Mercurial > sdl-ios-xcode
annotate src/hermes/mmx_main.asm @ 1982:3b4ce57c6215
First shot at new audio data types (int32 and float32).
Notable changes:
- Converters between types are autogenerated. Instead of making multiple
passes over the data with seperate filters for endianess, size, signedness,
etc, converting between data types is always one specialized filter. This
simplifies SDL_BuildAudioCVT(), which otherwise had a million edge cases
with the new types, and makes the actually conversions more CPU cache
friendly. Left a stub for adding specific optimized versions of these
routines (SSE/MMX/Altivec, assembler, etc)
- Autogenerated converters are built by SDL/src/audio/sdlgenaudiocvt.pl. This
does not need to be run unless tweaking the code, and thus doesn't need
integration into the build system.
- Went through all the drivers and tried to weed out all the "Uint16"
references that are better specified with the new SDL_AudioFormat typedef.
- Cleaned out a bunch of hardcoded bitwise magic numbers and replaced them
with new SDL_AUDIO_* macros.
- Added initial float32 and int32 support code. Theoretically, existing
drivers will push these through converters to get the data they want to
feed to the hardware.
Still TODO:
- Optimize and debug new converters.
- Update the CoreAudio backend to accept float32 data directly.
- Other backends, too?
- SDL_LoadWAV() needs to be updated to support int32 and float32 .wav files
(both of which exist and can be generated by 'sox' for testing purposes).
- Update the mixer to handle new datatypes.
- Optionally update SDL_sound and SDL_mixer, etc.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Thu, 24 Aug 2006 12:10:46 +0000 |
parents | eb4d9d99849b |
children | 180fa05e98e2 |
rev | line source |
---|---|
0 | 1 ; |
2 ; mmx format converter main loops for HERMES | |
3 ; Some routines Copyright (c) 1998 Christian Nentwich (c.nentwich@cs.ucl.ac.uk) | |
4 ; This source code is licensed under the GNU LGPL | |
5 ; | |
6 ; Please refer to the file COPYING.LIB contained in the distribution for | |
7 ; licensing conditions | |
8 ; | |
9 | |
10 BITS 32 | |
11 | |
1873
eb4d9d99849b
Renamed, per Mike's comment on bug #157
Sam Lantinga <slouken@libsdl.org>
parents:
1871
diff
changeset
|
12 %include "common.inc" |
1871 | 13 |
14 SDL_FUNC _ConvertMMX | |
15 SDL_FUNC _mmxreturn | |
0 | 16 |
17 SECTION .text | |
18 | |
19 ;; _ConvertMMX: | |
20 ;; [ESP+8] ConverterInfo* | |
21 ;; -------------------------------------------------------------------------- | |
22 ;; ConverterInfo (ebp+..) | |
23 ;; 0: void *s_pixels | |
24 ;; 4: int s_width | |
25 ;; 8: int s_height | |
26 ;; 12: int s_add | |
27 ;; 16: void *d_pixels | |
28 ;; 20: int d_width | |
29 ;; 24: int d_height | |
30 ;; 28: int d_add | |
31 ;; 32: void (*converter_function)() | |
32 ;; 36: int32 *lookup | |
33 | |
34 _ConvertMMX: | |
35 push ebp | |
36 mov ebp,esp | |
37 | |
38 ; Save the registers used by the blitters, necessary for optimized code | |
39 pusha | |
40 | |
41 mov eax,[ebp+8] | |
42 | |
43 cmp dword [eax+4],BYTE 0 | |
44 je endconvert | |
45 | |
46 mov ebp,eax | |
47 | |
48 mov esi,[ebp+0] | |
49 mov edi,[ebp+16] | |
50 | |
51 y_loop: | |
52 mov ecx,[ebp+4] | |
53 | |
54 jmp [ebp+32] | |
55 | |
56 _mmxreturn: | |
57 add esi,[ebp+12] | |
58 add edi,[ebp+28] | |
59 | |
60 dec dword [ebp+8] | |
61 jnz y_loop | |
62 | |
63 | |
64 ; Restore the registers used by the blitters, necessary for optimized code | |
65 popa | |
66 | |
67 pop ebp | |
68 | |
69 endconvert: | |
70 emms | |
71 | |
72 ret | |
73 | |
1199
2d6dc7de1145
From: Mike Frysinger <vapier@gentoo.org>
Ryan C. Gordon <icculus@icculus.org>
parents:
1166
diff
changeset
|
74 %ifidn __OUTPUT_FORMAT__,elf |
2d6dc7de1145
From: Mike Frysinger <vapier@gentoo.org>
Ryan C. Gordon <icculus@icculus.org>
parents:
1166
diff
changeset
|
75 section .note.GNU-stack noalloc noexec nowrite progbits |
2d6dc7de1145
From: Mike Frysinger <vapier@gentoo.org>
Ryan C. Gordon <icculus@icculus.org>
parents:
1166
diff
changeset
|
76 %endif |