Debian Codegraph @

libmmxnow/src/i386/rgb15to16mmx.c

raw symbols SCIP
1 // Original by Strepto/Astral
2 // ported to gcc & bugfixed : A'rpi
3
4 #include <inttypes.h>
5 //#include "attributes.h"
6 #include "mmx.h"
7
8 void rgb15to16_mmx(char* dst, const char* src, int count)
9 {
10 static uint64_t mask_b = 0x001F001F001F001FLL; // 00000000 00011111 xxB
11 static uint64_t mask_rg = 0x7FE07FE07FE07FE0LL; // 01111111 11100000 RGx
12 char* s=s0+count;
13 char* d=d0+count;
14 int offs=-count;
15 movq_m2r (mask_b, mm4);
16 movq_m2r (mask_rg, mm5);
17 while(offs<0){
18 movq_m2r (*(s+offs), mm0);
19 movq_r2r (mm0, mm1);
20
21 movq_m2r (*(s+8+offs), mm2);
22 movq_r2r (mm2, mm3);
23
24 pand_r2r (mm4, mm0);
25 pand_r2r (mm5, mm1);
26
27 psllq_i2r(1, mm1);
28 pand_r2r (mm4, mm2);
29
30 pand_r2r (mm5, mm3);
31 por_r2r (mm1, mm0);
32
33 psllq_i2r(1,mm3);
34 movq_r2m (mm0,*(d+offs));
35
36 por_r2r (mm3,mm2);
37 movq_r2m (mm2,*(d+8+offs));
38
39 offs+=16;
40 }
41 }
42