+; vim:filetype=nasm ts=8
+
; libFLAC - Free Lossless Audio Codec library
-; Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson
+; Copyright (C) 2001-2009 Josh Coalson
+; Copyright (C) 2011-2013 Xiph.Org Foundation
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions
data_section
+cglobal FLAC__cpu_have_cpuid_asm_ia32
cglobal FLAC__cpu_info_asm_ia32
cglobal FLAC__cpu_info_extended_amd_asm_ia32
-cglobal FLAC__cpu_info_sse_test_asm_ia32
code_section
; **********************************************************************
;
+; FLAC__uint32 FLAC__cpu_have_cpuid_asm_ia32()
+;
-have_cpuid:
+cident FLAC__cpu_have_cpuid_asm_ia32
+ push ebx
pushfd
pop eax
mov edx, eax
.no_cpuid:
xor eax, eax
.end:
+ pop ebx
ret
+; **********************************************************************
+;
+; void FLAC__cpu_info_asm_ia32(FLAC__uint32 *flags_edx, FLAC__uint32 *flags_ecx)
+;
+
cident FLAC__cpu_info_asm_ia32
+ ;[esp + 8] == flags_edx
+ ;[esp + 12] == flags_ecx
+
push ebx
- call have_cpuid
+ call FLAC__cpu_have_cpuid_asm_ia32
test eax, eax
jz .no_cpuid
mov eax, 1
cpuid
- mov eax, edx
+ mov ebx, [esp + 8]
+ mov [ebx], edx
+ mov ebx, [esp + 12]
+ mov [ebx], ecx
jmp .end
.no_cpuid:
xor eax, eax
-.end
+ mov ebx, [esp + 8]
+ mov [ebx], eax
+ mov ebx, [esp + 12]
+ mov [ebx], eax
+.end:
pop ebx
ret
cident FLAC__cpu_info_extended_amd_asm_ia32
push ebx
- call have_cpuid
+ call FLAC__cpu_have_cpuid_asm_ia32
test eax, eax
jz .no_cpuid
mov eax, 0x80000000
cpuid
mov eax, edx
jmp .end
-.no_cpuid
+.no_cpuid:
xor eax, eax
-.end
+.end:
pop ebx
ret
-cident FLAC__cpu_info_sse_test_asm_ia32
- xorps xmm0, xmm0
- pop ebx
-
end
-
-%ifdef OBJ_FORMAT_elf
- section .note.GNU-stack noalloc
-%endif