]> git.sesse.net Git - ffmpeg/blobdiff - tests/checkasm/x86/checkasm.asm
Split global .gitignore file into per-directory files
[ffmpeg] / tests / checkasm / x86 / checkasm.asm
index 147d7a7497b7a1e5cb97f8194bf8aa484a287bea..55212fc24b3be71f25eb3e9f8066bd2cee1c5eef 100644 (file)
@@ -66,14 +66,14 @@ cextern fail_func
 ;-----------------------------------------------------------------------------
 cglobal stack_clobber, 1,2
     ; Clobber the stack with junk below the stack pointer
-    %define size (max_args+6)*8
-    SUB  rsp, size
-    mov   r1, size-8
+    %define argsize (max_args+6)*8
+    SUB  rsp, argsize
+    mov   r1, argsize-8
 .loop:
     mov [rsp+r1], r0
     sub   r1, 8
     jge .loop
-    ADD  rsp, size
+    ADD  rsp, argsize
     RET
 
 %if WIN64
@@ -98,7 +98,7 @@ cglobal stack_clobber, 1,2
 ; void checkasm_checked_call(void *func, ...)
 ;-----------------------------------------------------------------------------
 INIT_XMM
-%macro check_call 0-1
+%macro CHECKED_CALL 0-1
 cglobal checked_call%1, 2,15,16,max_args*8+8
     mov  t0, r0
 
@@ -171,9 +171,8 @@ cglobal checked_call%1, 2,15,16,max_args*8+8
 .clobber_ok:
 %ifnid %1, _emms
     fstenv [rsp]
-    mov  r9h, [rsp + 8]
-    add  r9h, 1
-    jz   .emms_ok
+    cmp  word [rsp + 8], 0xffff
+    je   .emms_ok
     report_fail error_message_emms
     emms
 .emms_ok:
@@ -201,7 +200,7 @@ cglobal checked_call%1, 2,15,16,max_args*8+8
     mov  eax, r3
 %endmacro
 
-%macro check_call 0-1
+%macro CHECKED_CALL 0-1
 ;-----------------------------------------------------------------------------
 ; void checkasm_checked_call(void *func, ...)
 ;-----------------------------------------------------------------------------
@@ -225,10 +224,9 @@ cglobal checked_call%1, 1,7
     report_fail error_message
 .clobber_ok:
 %ifnid %1, _emms
-    fstenv [rsp]
-    mov  r3h, [rsp + 8]
-    add  r3h, 1
-    jz   .emms_ok
+    fstenv [esp]
+    cmp  word [esp + 8], 0xffff
+    je   .emms_ok
     report_fail error_message_emms
     emms
 .emms_ok:
@@ -241,5 +239,5 @@ cglobal checked_call%1, 1,7
 
 %endif ; ARCH_X86_64
 
-check_call
-check_call _emms
+CHECKED_CALL
+CHECKED_CALL _emms