Welcome to the VirtuQ Forums.
Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Oct 2011
    Location
    Allahabad, India
    Posts
    245

    Register Allocation

    Hello Sir,

    As per 8.5"Variables" register allocation is done by compiler,
    means which value will give to which register is decided by compiler.

    So in the same slide

    int var3 = var1 + var2;

    said that var1 and var2 are used at same time so they will be in different registers at execution time.

    So if RHS is extended to variable addition upto var'n' , then this n depends on number of registers and hence processor architecture.

    So what is the value of n for x86 architecture and how it can be find out?

    Regards,
    Anon10020

  2. #2
    VirtuQ™ Moderator
    Join Date
    Jul 2011
    Location
    Bangalore, India
    Posts
    1,044
    Blog Entries
    2
    Anon10020,

    The number of register varies across exact processor versions. You will need to find out the exact processor which you have (Windows from System properties and cat /proc/cpuinfo on Linux). The architecture manual of the processor will give you the information on number of registers. These architecture manuals are available free-of-cost from the vendor website. In this case, it is the website of Intel. Do note that the AMD processors, though x86, may have a different number of registers.

    Thanks,

    Anup


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •