[x265] [PATCH] checkasm: Properly save rdx/edx in checkasm_call() on x86

Min Chen chenm003 at 163.com
Fri Aug 21 06:33:21 CEST 2015


# HG changeset patch
# User Henrik Gramner <henrik at gramner.com>
# Date 1440131593 25200
# Node ID 1932b44f5748d03b9f2720219af99e21c76473c1
# Parent  f63273fa3137fef2f6898c686b68ee12608acd31
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.
---
 tools/checkasm-a.asm |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff -r f63273fa3137 -r 1932b44f5748 source/test/checkasm-a.asm
--- a/source/test/checkasm-a.asm	Thu Aug 20 11:13:25 2015 +0530
+++ b/source/test/checkasm-a.asm	Thu Aug 20 21:33:13 2015 -0700
@@ -152,10 +152,12 @@
 
     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
@@ -191,12 +193,14 @@
     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 x265-devel mailing list