Author Topic: What is best alternative?  (Read 711 times)

felipe

  • Member
  • *****
  • Posts: 1365
  • At least we are not alone...
Re: What is best alternative?
« Reply #15 on: January 20, 2021, 09:47:02 AM »
why do my compiler choose R9D(32bit) to use in a loop?

Probably because the r9 register is one of the volatile on function call registers (as ecx in 32 bit abi), so the compiler won't use a non-volatile register in loops... :icon_idea:
No remarkable words at all...

felipe

  • Member
  • *****
  • Posts: 1365
  • At least we are not alone...
Re: What is best alternative?
« Reply #16 on: January 20, 2021, 09:50:37 AM »
of course this in the context of the windows 64 bit abi, as mentioned by hutch...
No remarkable words at all...

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 8116
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: What is best alternative?
« Reply #17 on: January 20, 2021, 10:55:09 AM »
felipe is correct here, if you get the register list in the masm 64 bit reference section, transient registers are used differently from system or fixed registers and it works in much the same way as the Intel 32 bit ABI, some registers are reserved by the OS and the others are transient.

Win64 is a lot easier to use as you have a lot more registers and rarely need locals to make up for registers so the OS has enough to make the OS faster while leaving more transient registers available.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

daydreamer

  • Member
  • *****
  • Posts: 1502
  • building nextdoor
Re: What is best alternative?
« Reply #18 on: January 21, 2021, 03:08:32 AM »
felipe is correct here, if you get the register list in the masm 64 bit reference section, transient registers are used differently from system or fixed registers and it works in much the same way as the Intel 32 bit ABI, some registers are reserved by the OS and the others are transient.
thanks Hutch
so 32bit use free registers used to change X and Y first avoids 3push/3pops,its push,push,push,push,call bitblt or other imagedrawing call,question if fixed point 16:16 shift to get only integer part

64bit use the right 4 registers to change X,xlow and Y,ylow and shift and call bitblt,few cycles faster!!!
SIMD fan and macro fan
Happy new year 2021 that can only turn out to become better than worse 2020 :)