1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-18 16:41:14 +02:00

Start on built-in LAME

Using LAME 3.10
Windows project files substantially changed from original, and included into audacity solution.
This commit is contained in:
James Crook
2019-03-23 20:08:52 +00:00
parent 75e44df43d
commit 5e0efd1a25
108 changed files with 42291 additions and 4 deletions

View File

@@ -0,0 +1,107 @@
;
;
; assembler routines to detect CPU-features
;
; MMX / 3DNow! / SSE / SSE2
;
; for the LAME project
; Frank Klemm, Robert Hegemann 2000-10-12
;
%include "nasm.h"
globaldef has_MMX_nasm
globaldef has_3DNow_nasm
globaldef has_SSE_nasm
globaldef has_SSE2_nasm
segment_code
testCPUID:
pushfd
pop eax
mov ecx,eax
xor eax,0x200000
push eax
popfd
pushfd
pop eax
cmp eax,ecx
ret
;---------------------------------------
; int has_MMX_nasm (void)
;---------------------------------------
has_MMX_nasm:
pushad
call testCPUID
jz return0 ; no CPUID command, so no MMX
mov eax,0x1
CPUID
test edx,0x800000
jz return0 ; no MMX support
jmp return1 ; MMX support
;---------------------------------------
; int has_SSE_nasm (void)
;---------------------------------------
has_SSE_nasm:
pushad
call testCPUID
jz return0 ; no CPUID command, so no SSE
mov eax,0x1
CPUID
test edx,0x02000000
jz return0 ; no SSE support
jmp return1 ; SSE support
;---------------------------------------
; int has_SSE2_nasm (void)
;---------------------------------------
has_SSE2_nasm:
pushad
call testCPUID
jz return0 ; no CPUID command, so no SSE2
mov eax,0x1
CPUID
test edx,0x04000000
jz return0 ; no SSE2 support
jmp return1 ; SSE2 support
;---------------------------------------
; int has_3DNow_nasm (void)
;---------------------------------------
has_3DNow_nasm:
pushad
call testCPUID
jz return0 ; no CPUID command, so no 3DNow!
mov eax,0x80000000
CPUID
cmp eax,0x80000000
jbe return0 ; no extended MSR(1), so no 3DNow!
mov eax,0x80000001
CPUID
test edx,0x80000000
jz return0 ; no 3DNow! support
; 3DNow! support
return1:
popad
xor eax,eax
inc eax
ret
return0:
popad
xor eax,eax
ret
end