0

Assembly Code

source/asm on Godbolt

In the above code, I can't figure out why pxor xmm0, xmm0 takes place.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
  • 2
    Please do not post images of code, just share the link that godbolt example. – Quimby Apr 26 '22 at 08:50
  • 1
    Okay.. I'll keep that in mind. I'm updating it now – InexactRex69 Apr 26 '22 at 08:54
  • 1
    That's there to clear the bits of `xmm0`, but it is a good question as to why that's needed. From what I can tell neither `cvtsi2sd`, `divsd` nor `movsd` cares about the most significant 64 bits, everything else is set by `cvtsi2sd` or `divsd`. – Lala5th Apr 26 '22 at 09:03
  • @Lala5th: It's there to break the false dependency from the short-signed design of `cvtsi2sd` merging into the destination, instead of zero-extending to the full XMM reg. – Peter Cordes Apr 26 '22 at 09:53

0 Answers0