mirror of https://git.ffmpeg.org/ffmpeg.git
checkasm: x86: properly save rdx/edx in checked_call()
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 might be useful later. Also comment the relevant code a bit better.
This commit is contained in:
parent
18b101ff59
commit
e6b8797b82
|
@ -145,10 +145,15 @@ cglobal checked_call, 2,15,16,max_args*8+8
|
||||||
or r14, r5
|
or r14, r5
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
; Call fail_func() with a descriptive message to mark it as a failure
|
||||||
|
; if the called function didn't preserve all callee-saved registers.
|
||||||
|
; Save the return value located in rdx:rax first to prevent clobbering.
|
||||||
jz .ok
|
jz .ok
|
||||||
mov r9, rax
|
mov r9, rax
|
||||||
|
mov r10, rdx
|
||||||
lea r0, [error_message]
|
lea r0, [error_message]
|
||||||
call fail_func
|
call fail_func
|
||||||
|
mov rdx, r10
|
||||||
mov rax, r9
|
mov rax, r9
|
||||||
.ok:
|
.ok:
|
||||||
RET
|
RET
|
||||||
|
@ -182,9 +187,11 @@ cglobal checked_call, 1,7
|
||||||
or r3, r5
|
or r3, r5
|
||||||
jz .ok
|
jz .ok
|
||||||
mov r3, eax
|
mov r3, eax
|
||||||
|
mov r4, edx
|
||||||
lea r0, [error_message]
|
lea r0, [error_message]
|
||||||
mov [esp], r0
|
mov [esp], r0
|
||||||
call fail_func
|
call fail_func
|
||||||
|
mov edx, r4
|
||||||
mov eax, r3
|
mov eax, r3
|
||||||
.ok:
|
.ok:
|
||||||
add esp, max_args*4
|
add esp, max_args*4
|
||||||
|
|
Loading…
Reference in New Issue