[xiph-commits] r11400 - in branches/theora-mmx/lib: . x86_64
dlenski at svn.xiph.org
dlenski at svn.xiph.org
Wed May 10 13:01:45 PDT 2006
Author: dlenski
Date: 2006-05-10 13:01:42 -0700 (Wed, 10 May 2006)
New Revision: 11400
Modified:
branches/theora-mmx/lib/cpu.c
branches/theora-mmx/lib/x86_64/dsp_mmx.c
branches/theora-mmx/lib/x86_64/dsp_mmxext.c
branches/theora-mmx/lib/x86_64/recon_mmx.c
Log:
Removed ogg_uint64_t function parameters in lib/x86_64, replaced w/ogg_uint32_t. Now all 32b/64b casting is
done inside the DSP functions. Should get rid of "incompatible function pointer type" errors.
Modified: branches/theora-mmx/lib/cpu.c
===================================================================
--- branches/theora-mmx/lib/cpu.c 2006-05-10 16:49:41 UTC (rev 11399)
+++ branches/theora-mmx/lib/cpu.c 2006-05-10 20:01:42 UTC (rev 11400)
@@ -101,17 +101,6 @@
}
}
- if (flags) {
- fprintf(stderr, "vectorized instruction sets supported: ");
- if (flags & CPU_X86_MMX) fprintf(stderr, "mmx ");
- if (flags & CPU_X86_MMXEXT) fprintf(stderr, "mmxext ");
- if (flags & CPU_X86_SSE) fprintf(stderr, "sse ");
- if (flags & CPU_X86_SSE2) fprintf(stderr, "sse2 ");
- if (flags & CPU_X86_3DNOW) fprintf(stderr, "3dnow ");
- if (flags & CPU_X86_3DNOWEXT) fprintf(stderr, "3dnowext ");
- fprintf(stderr, "\n");
- }
-
return flags;
}
@@ -126,4 +115,15 @@
void cpu_init ()
{
cpu_flags = cpu_get_flags();
+
+ if (cpu_flags) {
+ fprintf(stderr, "vectorized instruction sets supported:");
+ if (cpu_flags & CPU_X86_MMX) fprintf(stderr, " mmx");
+ if (cpu_flags & CPU_X86_MMXEXT) fprintf(stderr, " mmxext");
+ if (cpu_flags & CPU_X86_SSE) fprintf(stderr, " sse");
+ if (cpu_flags & CPU_X86_SSE2) fprintf(stderr, " sse2");
+ if (cpu_flags & CPU_X86_3DNOW) fprintf(stderr, " 3dnow");
+ if (cpu_flags & CPU_X86_3DNOWEXT) fprintf(stderr, " 3dnowext");
+ fprintf(stderr, "\n");
+ }
}
Modified: branches/theora-mmx/lib/x86_64/dsp_mmx.c
===================================================================
--- branches/theora-mmx/lib/x86_64/dsp_mmx.c 2006-05-10 16:49:41 UTC (rev 11399)
+++ branches/theora-mmx/lib/x86_64/dsp_mmx.c 2006-05-10 20:01:42 UTC (rev 11400)
@@ -26,8 +26,8 @@
#define DSP_OP_ABS_DIFF(a,b) abs((((int)(a)) - ((int)(b))))
static void sub8x8__mmx (unsigned char *FiltPtr, unsigned char *ReconPtr,
- ogg_int16_t *DctInputPtr, ogg_uint64_t PixelsPerLine,
- ogg_uint64_t ReconPixelsPerLine)
+ ogg_int16_t *DctInputPtr, ogg_uint32_t PixelsPerLine,
+ ogg_uint32_t ReconPixelsPerLine)
{
__asm__ __volatile__ (
" .balign 16 \n\t"
@@ -58,15 +58,17 @@
: "+r" (FiltPtr),
"+r" (ReconPtr),
"+r" (DctInputPtr)
- : "m" (PixelsPerLine),
- "m" (ReconPixelsPerLine)
+ : "r" ((ogg_uint64_t)PixelsPerLine),
+ "r" ((ogg_uint64_t)ReconPixelsPerLine)
: "memory"
);
}
static void sub8x8_128__mmx (unsigned char *FiltPtr, ogg_int16_t *DctInputPtr,
- ogg_uint64_t PixelsPerLine)
+ ogg_uint32_t PixelsPerLine)
{
+ ogg_uint64_t ppl = PixelsPerLine;
+
__asm__ __volatile__ (
" .balign 16 \n\t"
@@ -91,7 +93,7 @@
: "+r" (FiltPtr),
"+r" (DctInputPtr)
- : "m" (PixelsPerLine),
+ : "r" (ppl), /* gcc bug? a cast won't work here, e.g. (ogg_uint64_t)PixelsPerLine */
[V128] "m" (V128)
: "memory"
);
@@ -99,8 +101,8 @@
static void sub8x8avg2__mmx (unsigned char *FiltPtr, unsigned char *ReconPtr1,
unsigned char *ReconPtr2, ogg_int16_t *DctInputPtr,
- ogg_uint64_t PixelsPerLine,
- ogg_uint64_t ReconPixelsPerLine)
+ ogg_uint32_t PixelsPerLine,
+ ogg_uint32_t ReconPixelsPerLine)
{
__asm__ __volatile__ (
" .balign 16 \n\t"
@@ -141,13 +143,13 @@
"+r" (ReconPtr1),
"+r" (ReconPtr2),
"+r" (DctInputPtr)
- : "m" (PixelsPerLine),
- "m" (ReconPixelsPerLine)
+ : "r" ((ogg_uint64_t)PixelsPerLine),
+ "r" ((ogg_uint64_t)ReconPixelsPerLine)
: "memory"
);
}
-static ogg_uint32_t intra8x8_err__mmx (unsigned char *DataPtr, ogg_uint64_t Stride)
+static ogg_uint32_t intra8x8_err__mmx (unsigned char *DataPtr, ogg_uint32_t Stride)
{
ogg_uint64_t XSum;
ogg_uint64_t XXSum;
@@ -198,7 +200,7 @@
: "=r" (XSum),
"=r" (XXSum),
"+r" (DataPtr)
- : "r" (Stride)
+ : "r" ((ogg_uint64_t)Stride)
: "rdi", "memory"
);
@@ -206,8 +208,8 @@
return (( (XXSum<<6) - XSum*XSum ) );
}
-static ogg_uint32_t inter8x8_err__mmx (unsigned char *SrcData, ogg_uint64_t SrcStride,
- unsigned char *RefDataPtr, ogg_uint64_t RefStride)
+static ogg_uint32_t inter8x8_err__mmx (unsigned char *SrcData, ogg_uint32_t SrcStride,
+ unsigned char *RefDataPtr, ogg_uint32_t RefStride)
{
ogg_uint64_t XSum;
ogg_uint64_t XXSum;
@@ -267,8 +269,8 @@
"=m" (XXSum),
"+r" (SrcData),
"+r" (RefDataPtr)
- : "m" (SrcStride),
- "m" (RefStride)
+ : "r" ((ogg_uint64_t)SrcStride),
+ "r" ((ogg_uint64_t)RefStride)
: "rdi", "memory"
);
Modified: branches/theora-mmx/lib/x86_64/dsp_mmxext.c
===================================================================
--- branches/theora-mmx/lib/x86_64/dsp_mmxext.c 2006-05-10 16:49:41 UTC (rev 11399)
+++ branches/theora-mmx/lib/x86_64/dsp_mmxext.c 2006-05-10 20:01:42 UTC (rev 11400)
@@ -19,8 +19,8 @@
#include <stdlib.h>
#include "dsp.h"
-static ogg_uint32_t sad8x8__mmxext (unsigned char *ptr1, ogg_uint64_t stride1,
- unsigned char *ptr2, ogg_uint64_t stride2)
+static ogg_uint32_t sad8x8__mmxext (unsigned char *ptr1, ogg_uint32_t stride1,
+ unsigned char *ptr2, ogg_uint32_t stride2)
{
ogg_uint32_t DiffVal;
@@ -46,17 +46,17 @@
: "=r" (DiffVal),
"+r" (ptr1),
"+r" (ptr2)
- : "r" (stride1),
- "r" (stride2)
+ : "r" ((ogg_uint64_t)stride1),
+ "r" ((ogg_uint64_t)stride2)
: "memory"
);
return DiffVal;
}
-static ogg_uint32_t sad8x8_thres__mmxext (unsigned char *ptr1, ogg_uint64_t stride1,
- unsigned char *ptr2, ogg_uint64_t stride2,
- ogg_uint64_t thres)
+static ogg_uint32_t sad8x8_thres__mmxext (unsigned char *ptr1, ogg_uint32_t stride1,
+ unsigned char *ptr2, ogg_uint32_t stride2,
+ ogg_uint32_t thres)
{
ogg_uint32_t DiffVal;
@@ -78,18 +78,18 @@
: "=r" (DiffVal),
"+r" (ptr1),
"+r" (ptr2)
- : "r" (stride1),
- "r" (stride2)
+ : "r" ((ogg_uint64_t)stride1),
+ "r" ((ogg_uint64_t)stride2)
: "memory"
);
return DiffVal;
}
-static ogg_uint32_t sad8x8_xy2_thres__mmxext (unsigned char *SrcData, ogg_uint64_t SrcStride,
+static ogg_uint32_t sad8x8_xy2_thres__mmxext (unsigned char *SrcData, ogg_uint32_t SrcStride,
unsigned char *RefDataPtr1,
- unsigned char *RefDataPtr2, ogg_uint64_t RefStride,
- ogg_uint64_t thres)
+ unsigned char *RefDataPtr2, ogg_uint32_t RefStride,
+ ogg_uint32_t thres)
{
ogg_uint32_t DiffVal;
@@ -114,8 +114,8 @@
"+r" (SrcData),
"+r" (RefDataPtr1),
"+r" (RefDataPtr2)
- : "m" (SrcStride),
- "m" (RefStride)
+ : "r" ((ogg_uint64_t)SrcStride),
+ "r" ((ogg_uint64_t)RefStride)
: "memory"
);
@@ -151,7 +151,7 @@
}
static ogg_uint32_t col_sad8x8__mmxext (unsigned char *Src1, unsigned char *Src2,
- ogg_uint64_t stride)
+ ogg_uint32_t stride)
{
ogg_uint32_t MaxSad;
@@ -220,16 +220,16 @@
: "=r" (MaxSad),
"+r" (Src1),
"+r" (Src2)
- : "r" (stride)
+ : "r" ((ogg_uint64_t)stride)
: "memory", "rdi"
);
return MaxSad;
}
-static ogg_uint32_t inter8x8_err_xy2__mmxext (unsigned char *SrcData, ogg_uint64_t SrcStride,
+static ogg_uint32_t inter8x8_err_xy2__mmxext (unsigned char *SrcData, ogg_uint32_t SrcStride,
unsigned char *RefDataPtr1,
- unsigned char *RefDataPtr2, ogg_uint64_t RefStride)
+ unsigned char *RefDataPtr2, ogg_uint32_t RefStride)
{
ogg_uint64_t XSum;
ogg_uint64_t XXSum;
@@ -296,8 +296,8 @@
"+r" (SrcData),
"+r" (RefDataPtr1),
"+r" (RefDataPtr2)
- : "m" (SrcStride),
- "m" (RefStride)
+ : "r" ((ogg_uint64_t)SrcStride),
+ "r" ((ogg_uint64_t)RefStride)
: "rdi", "memory"
);
Modified: branches/theora-mmx/lib/x86_64/recon_mmx.c
===================================================================
--- branches/theora-mmx/lib/x86_64/recon_mmx.c 2006-05-10 16:49:41 UTC (rev 11399)
+++ branches/theora-mmx/lib/x86_64/recon_mmx.c 2006-05-10 20:01:42 UTC (rev 11400)
@@ -22,7 +22,7 @@
static void copy8x8__mmx (unsigned char *src,
unsigned char *dest,
- ogg_uint64_t stride)
+ ogg_uint32_t stride)
{
__asm__ __volatile__ (
" .balign 16 \n\t"
@@ -54,13 +54,13 @@
" movq %%mm3, (%0, %%rdi) \n\t"
: "+a" (dest)
: "c" (src),
- "d" (stride)
+ "d" ((ogg_uint64_t)stride)
: "memory", "rdi"
);
}
static void recon_intra8x8__mmx (unsigned char *ReconPtr, ogg_int16_t *ChangePtr,
- ogg_uint64_t LineStep)
+ ogg_uint32_t LineStep)
{
__asm__ __volatile__ (
" .balign 16 \n\t"
@@ -83,14 +83,14 @@
" jc 1b \n\t" /* Loop back if we are not done */
: "+r" (ReconPtr)
: "r" (ChangePtr),
- "r" (LineStep),
+ "r" ((ogg_uint64_t)LineStep),
[V128] "m" (V128)
: "memory", "rdi"
);
}
static void recon_inter8x8__mmx (unsigned char *ReconPtr, unsigned char *RefPtr,
- ogg_int16_t *ChangePtr, ogg_uint64_t LineStep)
+ ogg_int16_t *ChangePtr, ogg_uint32_t LineStep)
{
__asm__ __volatile__ (
" .balign 16 \n\t"
@@ -120,14 +120,14 @@
: "+r" (ReconPtr)
: "r" (ChangePtr),
"r" (RefPtr),
- "r" (LineStep)
+ "r" ((ogg_uint64_t)LineStep)
: "memory", "rdi"
);
}
static void recon_inter8x8_half__mmx (unsigned char *ReconPtr, unsigned char *RefPtr1,
unsigned char *RefPtr2, ogg_int16_t *ChangePtr,
- ogg_uint64_t LineStep)
+ ogg_uint32_t LineStep)
{
__asm__ __volatile__ (
" .balign 16 \n\t"
@@ -165,7 +165,7 @@
: "r" (ChangePtr),
"r" (RefPtr1),
"r" (RefPtr2),
- "m" (LineStep)
+ "r" ((ogg_uint64_t)LineStep)
: "memory", "rdi"
);
}
More information about the commits
mailing list