News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

MovSx slower than MovZx

Started by jj2007, March 29, 2011, 07:41:55 AM

Previous topic - Next topic

clive

Intel(R) Atom(TM) CPU N270   @ 1.60GHz (SSE4)
148     cycles for cwde (mov word)
218     cycles for cwde (mov dword)
299     cycles for and 0FFFFh
257     cycles for movzx
126     cycles for movsx

147     cycles for cwde (mov word)
147     cycles for cwde (mov dword)
148     cycles for and 0FFFFh
152     cycles for movzx
154     cycles for movsx

210     cycles for cwde (mov word)
177     cycles for cwde (mov dword)
178     cycles for and 0FFFFh
152     cycles for movzx
191     cycles for movsx

230     cycles for cwde (mov word)
222     cycles for cwde (mov dword)
221     cycles for and 0FFFFh
193     cycles for movzx
191     cycles for movsx

225     cycles for cwde (mov word)
222     cycles for cwde (mov dword)
255     cycles for and 0FFFFh
193     cycles for movzx
197     cycles for movsx
It could be a random act of randomness. Those happen a lot as well.

dedndave

by increasing LOOP_COUNT from 1,000,000 to 10,000,000, i get considerably more repeatable results
this value makes each test ~0.5 seconds
the culprit seems to be the CPUID instructions used to serialize
i guess we already knew that   :P