aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--graphics/scaler/scale2x.cpp38
-rw-r--r--graphics/scaler/scale2x.h2
-rw-r--r--graphics/scaler/scalebit.cpp8
3 files changed, 24 insertions, 24 deletions
diff --git a/graphics/scaler/scale2x.cpp b/graphics/scaler/scale2x.cpp
index 226d379c91..877bbb9509 100644
--- a/graphics/scaler/scale2x.cpp
+++ b/graphics/scaler/scale2x.cpp
@@ -158,7 +158,7 @@ void scale2x_32_def(scale2x_uint32* dst0, scale2x_uint32* dst1, const scale2x_ui
/***************************************************************************/
/* Scale2x MMX implementation */
-#if defined(__GNUC__) && defined(__i386__)
+#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
/*
* Apply the Scale2x effect at a single row.
@@ -205,7 +205,7 @@ static inline void scale2x_8_mmx_single(scale2x_uint8* dst, const scale2x_uint8*
__asm__ __volatile__(
/* central runs */
- "shrl $3, %4\n"
+ "shr $3, %4\n"
"jz 1f\n"
"0:\n"
@@ -261,12 +261,12 @@ static inline void scale2x_8_mmx_single(scale2x_uint8* dst, const scale2x_uint8*
"movq %%mm3, 8(%3)\n"
/* next */
- "addl $8, %0\n"
- "addl $8, %1\n"
- "addl $8, %2\n"
- "addl $16, %3\n"
+ "add $8, %0\n"
+ "add $8, %1\n"
+ "add $8, %2\n"
+ "add $16, %3\n"
- "decl %4\n"
+ "dec %4\n"
"jnz 0b\n"
"1:\n"
@@ -283,7 +283,7 @@ static inline void scale2x_16_mmx_single(scale2x_uint16* dst, const scale2x_uint
__asm__ __volatile__(
/* central runs */
- "shrl $2, %4\n"
+ "shr $2, %4\n"
"jz 1f\n"
"0:\n"
@@ -339,12 +339,12 @@ static inline void scale2x_16_mmx_single(scale2x_uint16* dst, const scale2x_uint
"movq %%mm3, 8(%3)\n"
/* next */
- "addl $8, %0\n"
- "addl $8, %1\n"
- "addl $8, %2\n"
- "addl $16, %3\n"
+ "add $8, %0\n"
+ "add $8, %1\n"
+ "add $8, %2\n"
+ "add $16, %3\n"
- "decl %4\n"
+ "dec %4\n"
"jnz 0b\n"
"1:\n"
@@ -361,7 +361,7 @@ static inline void scale2x_32_mmx_single(scale2x_uint32* dst, const scale2x_uint
__asm__ __volatile__(
/* central runs */
- "shrl $1, %4\n"
+ "shr $1, %4\n"
"jz 1f\n"
"0:\n"
@@ -417,12 +417,12 @@ static inline void scale2x_32_mmx_single(scale2x_uint32* dst, const scale2x_uint
"movq %%mm3, 8(%3)\n"
/* next */
- "addl $8, %0\n"
- "addl $8, %1\n"
- "addl $8, %2\n"
- "addl $16, %3\n"
+ "add $8, %0\n"
+ "add $8, %1\n"
+ "add $8, %2\n"
+ "add $16, %3\n"
- "decl %4\n"
+ "dec %4\n"
"jnz 0b\n"
"1:\n"
diff --git a/graphics/scaler/scale2x.h b/graphics/scaler/scale2x.h
index e38242a7ee..cefa14f22a 100644
--- a/graphics/scaler/scale2x.h
+++ b/graphics/scaler/scale2x.h
@@ -33,7 +33,7 @@ void scale2x_8_def(scale2x_uint8* dst0, scale2x_uint8* dst1, const scale2x_uint8
void scale2x_16_def(scale2x_uint16* dst0, scale2x_uint16* dst1, const scale2x_uint16* src0, const scale2x_uint16* src1, const scale2x_uint16* src2, unsigned count);
void scale2x_32_def(scale2x_uint32* dst0, scale2x_uint32* dst1, const scale2x_uint32* src0, const scale2x_uint32* src1, const scale2x_uint32* src2, unsigned count);
-#if defined(__GNUC__) && defined(__i386__)
+#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
void scale2x_8_mmx(scale2x_uint8* dst0, scale2x_uint8* dst1, const scale2x_uint8* src0, const scale2x_uint8* src1, const scale2x_uint8* src2, unsigned count);
void scale2x_16_mmx(scale2x_uint16* dst0, scale2x_uint16* dst1, const scale2x_uint16* src0, const scale2x_uint16* src1, const scale2x_uint16* src2, unsigned count);
diff --git a/graphics/scaler/scalebit.cpp b/graphics/scaler/scalebit.cpp
index 05888c6927..6a3b47b0f5 100644
--- a/graphics/scaler/scalebit.cpp
+++ b/graphics/scaler/scalebit.cpp
@@ -55,7 +55,7 @@
static inline void stage_scale2x(void* dst0, void* dst1, const void* src0, const void* src1, const void* src2, unsigned pixel, unsigned pixel_per_row)
{
switch (pixel) {
-#if defined(__GNUC__) && defined(__i386__)
+#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
case 1 : scale2x_8_mmx(DST(8,0), DST(8,1), SRC(8,0), SRC(8,1), SRC(8,2), pixel_per_row); break;
case 2 : scale2x_16_mmx(DST(16,0), DST(16,1), SRC(16,0), SRC(16,1), SRC(16,2), pixel_per_row); break;
case 4 : scale2x_32_mmx(DST(32,0), DST(32,1), SRC(32,0), SRC(32,1), SRC(32,2), pixel_per_row); break;
@@ -129,7 +129,7 @@ static void scale2x(void* void_dst, unsigned dst_slice, const void* void_src, un
--count;
}
-#if defined(__GNUC__) && defined(__i386__)
+#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
scale2x_mmx_emms();
#endif
}
@@ -229,7 +229,7 @@ static void scale4x_buf(void* void_dst, unsigned dst_slice, void* void_mid, unsi
--count;
}
-#if defined(__GNUC__) && defined(__i386__)
+#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
scale2x_mmx_emms();
#endif
}
@@ -307,7 +307,7 @@ int scale_precondition(unsigned scale, unsigned pixel, unsigned width, unsigned
break;
}
-#if defined(__GNUC__) && defined(__i386__)
+#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
switch (scale) {
case 2 :
case 4 :