;* Copyright (c) 2008 Loren Merritt
;* Copyright (c) 2012 Henrik Gramner
;*
-;* This file is part of Libav.
+;* This file is part of FFmpeg.
;*
-;* Libav is free software; you can redistribute it and/or modify
+;* FFmpeg is free software; you can redistribute it and/or modify
;* it under the terms of the GNU General Public License as published by
;* the Free Software Foundation; either version 2 of the License, or
;* (at your option) any later version.
;*
-;* Libav is distributed in the hope that it will be useful,
+;* FFmpeg is distributed in the hope that it will be useful,
;* but WITHOUT ANY WARRANTY; without even the implied warranty of
;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;* GNU General Public License for more details.
; 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
.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:
mov eax, r3
%endmacro
- %macro check_call 0-1
+ %macro CHECKED_CALL 0-1
;-----------------------------------------------------------------------------
; void checkasm_checked_call(void *func, ...)
;-----------------------------------------------------------------------------
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:
%endif ; ARCH_X86_64
- check_call
- check_call _emms
+ CHECKED_CALL
+ CHECKED_CALL _emms