summaryrefslogtreecommitdiff
path: root/draw/archx86.c
diff options
context:
space:
mode:
Diffstat (limited to 'draw/archx86.c')
-rw-r--r--draw/archx86.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/draw/archx86.c b/draw/archx86.c
index 0c313f33..5418e9f7 100644
--- a/draw/archx86.c
+++ b/draw/archx86.c
@@ -40,7 +40,7 @@ static void duff_4i1o4mmx(byte *sp0, int sw, byte *mp0, int mw, byte *dp0, int d
{
int ts = *s++;
int ma = *mp++ + 1;
- int sa = ((ts & 0xff) * ma) >> 8;
+ int sa = (((ts>>24) & 0xff) * ma) >> 8;
int ssa = 255 - sa;
__m64 d0 = _mm_cvtsi32_si64(*d);
@@ -50,11 +50,11 @@ static void duff_4i1o4mmx(byte *sp0, int sw, byte *mp0, int mw, byte *dp0, int d
__m64 mma = _mm_set1_pi16(ma);
__m64 mssa = _mm_set1_pi16(ssa);
- /* unpack 0000argb => a0r0g0b0 */
+ /* unpack 0000rgba => r0g0b0a0 */
__m64 d1 = _mm_unpacklo_pi8(d0, mzero);
__m64 s1 = _mm_unpacklo_pi8(s0, mzero);
- /* s1 * ma => a0r0g0b0 */
+ /* s1 * ma => r0g0b0a0 */
__m64 msma = _mm_mullo_pi16(s1, mma);
/* d1 * mssa */
__m64 mdssa = _mm_mullo_pi16(d1, mssa);
@@ -79,6 +79,8 @@ static void duff_4i1o4mmx(byte *sp0, int sw, byte *mp0, int mw, byte *dp0, int d
#if 0 /* TODO */
+/* Needs to be rgba, not bgra, as well as needing finishing */
+
static inline unsigned
getargb(unsigned *s, int w, int h, int u, int v)
{