[x264-devel] checkasm: Properly save rdx/edx in checkasm_call() on x86

Henrik Gramner git at videolan.org
Wed Aug 19 21:16:15 CEST 2015


x264 | branch: master | Henrik Gramner <henrik at gramner.com> | Sun Aug 16 21:59:26 2015 +0200| [401941cc7099b322864600b62104940542497e7a] | committer: Anton Mitrofanov

checkasm: Properly save rdx/edx in checkasm_call() on x86

If the return value doesn't fit in a single register rdx/edx can in some
cases be used in addition to rax/eax.

Doesn't affect any of the existing checkasm tests but it's more correct
behavior and it might be useful in the future.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=401941cc7099b322864600b62104940542497e7a
---

 tools/checkasm-a.asm |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/checkasm-a.asm b/tools/checkasm-a.asm
index 51f7ab5..fb9d141 100644
--- a/tools/checkasm-a.asm
+++ b/tools/checkasm-a.asm
@@ -151,10 +151,12 @@ cglobal checkasm_call, 2,15,16,max_args*8+8
 
     jz .ok
     mov  r9, rax
+    mov r10, rdx
     lea  r0, [error_message]
     call puts
     mov  r1, [rsp+max_args*8]
     mov  dword [r1], 0
+    mov  rdx, r10
     mov  rax, r9
 .ok:
     RET
@@ -189,12 +191,14 @@ cglobal checkasm_call, 1,7
     or   r3, r5
     jz .ok
     mov  r3, eax
+    mov  r4, edx
     lea  r1, [error_message]
     push r1
     call puts
     add  esp, 4
     mov  r1, r1m
     mov  dword [r1], 0
+    mov  edx, r4
     mov  eax, r3
 .ok:
     REP_RET



More information about the x264-devel mailing list