Author Topic: Comparing the contents of YMM/XMM registers  (Read 11644 times)

Offline Kryptos

  • Jr. Member
  • *
  • Posts: 5
Comparing the contents of YMM/XMM registers
« on: April 19, 2012, 01:30:04 AM »
I am looking for a method to compare the contents of YMM/XMM registers to each other. Anyone have any ideas? I am looking for something quick and easy if it exists. I was poking around with PCMPEQB to set all the bits to 0/1 (creating a 127 bit mask), then using a PMOVMSKB instruction. I can't seem to make this work, so any suggestions?



Offline Kryptos

  • Jr. Member
  • *
  • Posts: 5
Re: Comparing the contents of YMM/XMM registers
« Reply #1 on: April 20, 2012, 02:54:13 PM »
Well, I figured it out...

pcmpeqb xmm0, xmm1
pmovmskb r15, xmm0
cmp r15, 0xffff
jne failed

this also seems to work for just [bits 63..0]
vcomisd xmm0, xmm1
jbe failed