Guest User

JCC at 64 byte boundary

a guest
Jan 20th, 2022
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. global _start
  2.  
  3. section .text
  4.  
  5. ; JCC erratum mitigation should in theory disable the DSB when N is in {0, 1, 2, 30, 31} mod 32 (cmp and jg are macrofused and take 5 bytes).
  6. ; ...except when N == 0 mod 64 - DSB+LSD are much more active (running on core i7-10710U, microcode 0xca)
  7.  
  8. ; NASM snippet:
  9. ;   nasm -f elf64 -o test.o test.S
  10. ;   ld -o test test.o
  11. _start:
  12.   ; Replace N with 64 and see DSB+LSD unexpectedly (?) kick in
  13.   db N-(loopend-loopstart) dup(0x90)
  14. loopstart:
  15.   mov ebp, 1
  16.   mov r15d, 2
  17.   cmp r15d, ebp
  18. loopend:
  19.   jg loopstart
Advertisement
Add Comment
Please, Sign In to add comment