Skip to content

Commit

Permalink
asm test: Ensure predicate cache is reset when control flow leaves block
Browse files Browse the repository at this point in the history
  • Loading branch information
pmatos committed Jan 17, 2025
1 parent 006a2ce commit fa9ff97
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions unittests/ASM/X87/MemcopyWithCPUID.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
%ifdef CONFIG
{
"RegData": {
"RBX": "0x8000000000000000",
"RCX": "0x3fff"
}
}
%endif

; Related to #4274 - ensures that if cpuid clobbers the predicate register,
; we reset the predicate cache.

section .data
align 8

data:
dt 1.0

section .bss
align 8

data2:
resb 10

section .text
lea r8, [rel data]
fld tword [r8]

mov rax, 0x0
cpuid ; Will this instruction clobber the predicate register?

fstp tword [rel data2]

mov rbx, [rel data2]
mov rcx, [rel data2+8]
hlt

0 comments on commit fa9ff97

Please sign in to comment.