comparison src/audio/SDL_mixer_MMX_VC.c @ 1190:173c063d4f55

OS/2 port! This was mostly, if not entirely, written by "Doodle" and "Caetano": doodle@scenergy.dfmk.hu daniel@caetano.eng.br --ryan.
author Ryan C. Gordon <icculus@icculus.org>
date Wed, 23 Nov 2005 07:29:56 +0000
parents ef03e8789d59
children 450721ad5436
comparison
equal deleted inserted replaced
1189:c96b326b90ba 1190:173c063d4f55
10 10
11 //////////////////////////////////////////////// 11 ////////////////////////////////////////////////
12 // Mixing for 16 bit signed buffers 12 // Mixing for 16 bit signed buffers
13 //////////////////////////////////////////////// 13 ////////////////////////////////////////////////
14 14
15 #ifndef __WATCOMC__
15 #include <windows.h> 16 #include <windows.h>
16 #include <stdio.h> 17 #include <stdio.h>
18 #endif
17 19
18 void SDL_MixAudio_MMX_S16_VC(char* dst,char* src,unsigned int nSize,int volume) 20 void SDL_MixAudio_MMX_S16_VC(char* dst,char* src,unsigned int nSize,int volume)
19 { 21 {
20 __asm 22 __asm
21 { 23 {
39 psllq mm0, 16 //$16,%%mm0 41 psllq mm0, 16 //$16,%%mm0
40 por mm0, mm1 //%%mm1,%%mm0 42 por mm0, mm1 //%%mm1,%%mm0
41 psllq mm0, 16 //$16,%%mm0 43 psllq mm0, 16 //$16,%%mm0
42 por mm0, mm1 //%%mm1,%%mm0 // mm0 = vol|vol|vol|vol 44 por mm0, mm1 //%%mm1,%%mm0 // mm0 = vol|vol|vol|vol
43 45
46 #ifndef __WATCOMC__
44 align 16 47 align 16
48 #endif
45 mixloopS16: 49 mixloopS16:
46 movq mm1, [esi] //(%%esi),%%mm1\n" // mm1 = a|b|c|d 50 movq mm1, [esi] //(%%esi),%%mm1\n" // mm1 = a|b|c|d
47 movq mm2, mm1 //%%mm1,%%mm2\n" // mm2 = a|b|c|d 51 movq mm2, mm1 //%%mm1,%%mm2\n" // mm2 = a|b|c|d
48 movq mm4, [esi + 8] //8(%%esi),%%mm4\n" // mm4 = e|f|g|h 52 movq mm4, [esi + 8] //8(%%esi),%%mm4\n" // mm4 = e|f|g|h
49 // pre charger le buffer dst dans mm7 53 // pre charger le buffer dst dans mm7
119 mov ebx, nSize //%2,%%ebx // ebx = size 123 mov ebx, nSize //%2,%%ebx // ebx = size
120 shr ebx, 3 //$3,%%ebx // process 8 bytes per iteration = 8 samples 124 shr ebx, 3 //$3,%%ebx // process 8 bytes per iteration = 8 samples
121 cmp ebx, 0 //$0,%%ebx 125 cmp ebx, 0 //$0,%%ebx
122 je endS8 126 je endS8
123 127
128 #ifndef __WATCOMC__
124 align 16 129 align 16
130 #endif
125 mixloopS8: 131 mixloopS8:
126 pxor mm2, mm2 //%%mm2,%%mm2 // mm2 = 0 132 pxor mm2, mm2 //%%mm2,%%mm2 // mm2 = 0
127 movq mm1, [esi] //(%%esi),%%mm1 // mm1 = a|b|c|d|e|f|g|h 133 movq mm1, [esi] //(%%esi),%%mm1 // mm1 = a|b|c|d|e|f|g|h
128 movq mm3, mm1 //%%mm1,%%mm3 // mm3 = a|b|c|d|e|f|g|h 134 movq mm3, mm1 //%%mm1,%%mm3 // mm3 = a|b|c|d|e|f|g|h
129 // on va faire le "sign extension" en faisant un cmp avec 0 qui retourne 1 si <0, 0 si >0 135 // on va faire le "sign extension" en faisant un cmp avec 0 qui retourne 1 si <0, 0 si >0