summaryrefslogtreecommitdiff
path: root/src/xine-utils
diff options
context:
space:
mode:
authorMichael Roitzsch <mroi@users.sourceforge.net>2003-08-25 14:32:37 +0000
committerMichael Roitzsch <mroi@users.sourceforge.net>2003-08-25 14:32:37 +0000
commit92939d3b6df9165df0d7a25c4214c32401d9131d (patch)
tree278e8acebbe8f843693d5227906ac6d94dd635ba /src/xine-utils
parent8fdcd5444ac7ecd39f7b2323f8afb1440c3b6439 (diff)
downloadxine-lib-92939d3b6df9165df0d7a25c4214c32401d9131d.tar.gz
xine-lib-92939d3b6df9165df0d7a25c4214c32401d9131d.tar.bz2
AMD64 support patch by Adrian Schroeter
CVS patchset: 5308 CVS date: 2003/08/25 14:32:37
Diffstat (limited to 'src/xine-utils')
-rw-r--r--src/xine-utils/color.c12
-rw-r--r--src/xine-utils/cpu_accel.c16
-rw-r--r--src/xine-utils/memcpy.c2
-rw-r--r--src/xine-utils/monitor.c12
-rw-r--r--src/xine-utils/xine_check.c2
-rw-r--r--src/xine-utils/xineutils.h4
6 files changed, 30 insertions, 18 deletions
diff --git a/src/xine-utils/color.c b/src/xine-utils/color.c
index b44507091..65e375e88 100644
--- a/src/xine-utils/color.c
+++ b/src/xine-utils/color.c
@@ -61,7 +61,7 @@
* instructions), these macros will automatically map to those special
* instructions.
*
- * $Id: color.c,v 1.21 2003/07/27 12:47:23 hadess Exp $
+ * $Id: color.c,v 1.22 2003/08/25 14:32:37 mroi Exp $
*/
#include "xine_internal.h"
@@ -318,7 +318,7 @@ static void yuv444_to_yuy2_c(yuv_planes_t *yuv_planes, unsigned char *yuy2_map,
*/
static void yuv444_to_yuy2_mmx(yuv_planes_t *yuv_planes, unsigned char *yuy2_map,
int pitch) {
-#ifdef ARCH_X86
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
int h, i, j, k;
int width_div_8 = yuv_planes->row_width / 8;
int width_mod_8 = yuv_planes->row_width % 8;
@@ -796,7 +796,7 @@ static void yv12_to_yuy2_c
}
-#ifdef ARCH_X86
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
#define MMXEXT_YUV420_YUYV( ) \
do { \
@@ -840,7 +840,7 @@ static void yv12_to_yuy2_mmxext
unsigned char *v_src, int v_src_pitch,
unsigned char *yuy2_map, int yuy2_pitch,
int width, int height, int progressive ) {
-#ifdef ARCH_X86
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
uint8_t *p_line1, *p_line2 = yuy2_map;
uint8_t *p_y1, *p_y2 = y_src;
uint8_t *p_u = u_src;
@@ -1004,7 +1004,7 @@ static void yuy2_to_yv12_c
}
-#ifdef ARCH_X86
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
/* yuy2->yv12 with subsampling (some ideas from mplayer's yuy2toyv12) */
#define MMXEXT_YUYV_YUV420( ) \
@@ -1059,7 +1059,7 @@ static void yuy2_to_yv12_mmxext
unsigned char *u_dst, int u_dst_pitch,
unsigned char *v_dst, int v_dst_pitch,
int width, int height) {
-#ifdef ARCH_X86
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
uint8_t *p_line1, *p_line2 = yuy2_map;
uint8_t *p_y1, *p_y2 = y_dst;
uint8_t *p_u = u_dst;
diff --git a/src/xine-utils/cpu_accel.c b/src/xine-utils/cpu_accel.c
index bd207fd91..f4f083f70 100644
--- a/src/xine-utils/cpu_accel.c
+++ b/src/xine-utils/cpu_accel.c
@@ -34,7 +34,18 @@
#define LOG
*/
-#ifdef ARCH_X86
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if defined __x86_64__
+static uint32_t arch_accel (void)
+{
+ uint32_t caps;
+ /* No need to test for this on AMD64, we know what the
+ platform has. */
+ caps = MM_ACCEL_X86_MMX | MM_ACCEL_X86_SSE | MM_ACCEL_X86_MMXEXT | MM_ACCEL_X86_SSE2;
+
+ return caps;
+}
+#else
static uint32_t arch_accel (void)
{
#ifndef _MSC_VER
@@ -118,6 +129,7 @@ static uint32_t arch_accel (void)
return 0;
#endif
}
+#endif /* x86_64 */
static jmp_buf sigill_return;
@@ -170,7 +182,7 @@ uint32_t xine_mm_accel (void)
if (!initialized) {
accel = arch_accel ();
-#ifdef ARCH_X86
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
#ifndef _MSC_VER
/* test OS support for SSE */
diff --git a/src/xine-utils/memcpy.c b/src/xine-utils/memcpy.c
index b6326a696..945cd33f0 100644
--- a/src/xine-utils/memcpy.c
+++ b/src/xine-utils/memcpy.c
@@ -112,7 +112,7 @@ quote of the day:
*/
-#ifdef ARCH_X86
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
#ifndef _MSC_VER
/* for small memory blocks (<256 bytes) this version is faster */
diff --git a/src/xine-utils/monitor.c b/src/xine-utils/monitor.c
index 3d5aabec8..c9def23e1 100644
--- a/src/xine-utils/monitor.c
+++ b/src/xine-utils/monitor.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: monitor.c,v 1.5 2002/06/09 22:26:01 f1rmb Exp $
+ * $Id: monitor.c,v 1.6 2003/08/25 14:32:37 mroi Exp $
*
* debug print and profiling functions - implementation
*
@@ -64,7 +64,7 @@ int xine_profiler_allocate_slot (char *label) {
}
-#ifdef ARCH_X86
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
__inline__ unsigned long long int rdtsc()
{
unsigned long long int x;
@@ -77,7 +77,7 @@ void xine_profiler_start_count (int id) {
if ((unsigned)id >= MAX_ID) return;
-#ifdef ARCH_X86
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
profiler_start[id] = rdtsc();
#endif
}
@@ -86,7 +86,7 @@ void xine_profiler_stop_count (int id) {
if ((unsigned)id >= MAX_ID) return;
-#ifdef ARCH_X86
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
profiler_times[id] += rdtsc() - profiler_start[id];
#endif
profiler_calls[id]++;
@@ -95,7 +95,7 @@ void xine_profiler_stop_count (int id) {
void xine_profiler_print_results () {
int i;
-#ifdef ARCH_X86
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
static long long int cpu_speed; /* cpu cyles/usec */
if (!cpu_speed) {
long long int tsc_start, tsc_end;
@@ -125,7 +125,7 @@ void xine_profiler_print_results () {
i, profiler_label[i], profiler_times[i], profiler_calls[i]);
if (profiler_calls[i]) {
printf(" %12lld", profiler_times[i] / profiler_calls[i]);
-#ifdef ARCH_X86
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
printf(" %9lld", profiler_times[i] / (cpu_speed * profiler_calls[i]));
#endif
}
diff --git a/src/xine-utils/xine_check.c b/src/xine-utils/xine_check.c
index b87f2f0f0..a018138f6 100644
--- a/src/xine-utils/xine_check.c
+++ b/src/xine-utils/xine_check.c
@@ -166,7 +166,7 @@ xine_health_check_t* xine_health_check_kernel (xine_health_check_t* hc) {
return hc;
}
-#ifdef ARCH_X86
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
xine_health_check_t* xine_health_check_mtrr (xine_health_check_t* hc) {
char *file = "/proc/mtrr";
FILE *fd;
diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h
index 67daaba84..91ae9655b 100644
--- a/src/xine-utils/xineutils.h
+++ b/src/xine-utils/xineutils.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xineutils.h,v 1.58 2003/07/19 11:50:33 mroi Exp $
+ * $Id: xineutils.h,v 1.59 2003/08/25 14:32:37 mroi Exp $
*
*/
#ifndef XINEUTILS_H
@@ -103,7 +103,7 @@ extern "C" {
uint32_t xine_mm_accel (void);
/* uint32_t xine_mm_support (void) ; */
-#ifdef ARCH_X86
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
typedef union {
#ifdef _MSC_VER