mirror of
https://github.com/mpv-player/mpv
synced 2025-05-03 00:30:48 +00:00
apple and gnu style support at the same time (ok, choosen at compile time) -- now altivec works under osx too -- bug noted by Steven Schultz
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10299 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
a79e76be8c
commit
cd091b8ffd
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* cpu_state.c
|
* cpu_state.c
|
||||||
* Copyright (C) 2000-2002 Michel Lespinasse <walken@zoy.org>
|
* Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org>
|
||||||
* Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
|
* Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
|
||||||
*
|
*
|
||||||
* This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
|
* This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
|
||||||
@ -44,62 +44,72 @@ static void state_restore_mmx (cpu_state_t * state)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ARCH_PPC
|
#ifdef ARCH_PPC
|
||||||
|
#ifdef HAVE_ALTIVEC_H /* gnu */
|
||||||
|
#define LI(a,b) "li " #a "," #b "\n\t"
|
||||||
|
#define STVX0(a,b,c) "stvx " #a ",0," #c "\n\t"
|
||||||
|
#define STVX(a,b,c) "stvx " #a "," #b "," #c "\n\t"
|
||||||
|
#define LVX0(a,b,c) "lvx " #a ",0," #c "\n\t"
|
||||||
|
#define LVX(a,b,c) "lvx " #a "," #b "," #c "\n\t"
|
||||||
|
#else /* apple */
|
||||||
|
#define LI(a,b) "li r" #a "," #b "\n\t"
|
||||||
|
#define STVX0(a,b,c) "stvx v" #a ",0,r" #c "\n\t"
|
||||||
|
#define STVX(a,b,c) "stvx v" #a ",r" #b ",r" #c "\n\t"
|
||||||
|
#define LVX0(a,b,c) "lvx v" #a ",0,r" #c "\n\t"
|
||||||
|
#define LVX(a,b,c) "lvx v" #a ",r" #b ",r" #c "\n\t"
|
||||||
|
#endif
|
||||||
|
|
||||||
static void state_save_altivec (cpu_state_t * state)
|
static void state_save_altivec (cpu_state_t * state)
|
||||||
{
|
{
|
||||||
asm (" \n"
|
asm (LI (9, 16)
|
||||||
" li %r9, 16 \n"
|
STVX0 (20, 0, 3)
|
||||||
" stvx %v20, 0, %r3 \n"
|
LI (11, 32)
|
||||||
" li %r11, 32 \n"
|
STVX (21, 9, 3)
|
||||||
" stvx %v21, %r9, %r3 \n"
|
LI (9, 48)
|
||||||
" li %r9, 48 \n"
|
STVX (22, 11, 3)
|
||||||
" stvx %v22, %r11, %r3 \n"
|
LI (11, 64)
|
||||||
" li %r11, 64 \n"
|
STVX (23, 9, 3)
|
||||||
" stvx %v23, %r9, %r3 \n"
|
LI (9, 80)
|
||||||
" li %r9, 80 \n"
|
STVX (24, 11, 3)
|
||||||
" stvx %v24, %r11, %r3 \n"
|
LI (11, 96)
|
||||||
" li %r11, 96 \n"
|
STVX (25, 9, 3)
|
||||||
" stvx %v25, %r9, %r3 \n"
|
LI (9, 112)
|
||||||
" li %r9, 112 \n"
|
STVX (26, 11, 3)
|
||||||
" stvx %v26, %r11, %r3 \n"
|
LI (11, 128)
|
||||||
" li %r11, 128 \n"
|
STVX (27, 9, 3)
|
||||||
" stvx %v27, %r9, %r3 \n"
|
LI (9, 144)
|
||||||
" li %r9, 144 \n"
|
STVX (28, 11, 3)
|
||||||
" stvx %v28, %r11, %r3 \n"
|
LI (11, 160)
|
||||||
" li %r11, 160 \n"
|
STVX (29, 9, 3)
|
||||||
" stvx %v29, %r9, %r3 \n"
|
LI (9, 176)
|
||||||
" li %r9, 176 \n"
|
STVX (30, 11, 3)
|
||||||
" stvx %v30, %r11, %r3 \n"
|
STVX (31, 9, 3));
|
||||||
" stvx %v31, %r9, %r3 \n"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_restore_altivec (cpu_state_t * state)
|
static void state_restore_altivec (cpu_state_t * state)
|
||||||
{
|
{
|
||||||
asm (" \n"
|
asm (LI (9, 16)
|
||||||
" li %r9, 16 \n"
|
LVX0 (20, 0, 3)
|
||||||
" lvx %v20, 0, %r3 \n"
|
LI (11, 32)
|
||||||
" li %r11, 32 \n"
|
LVX (21, 9, 3)
|
||||||
" lvx %v21, %r9, %r3 \n"
|
LI (9, 48)
|
||||||
" li %r9, 48 \n"
|
LVX (22, 11, 3)
|
||||||
" lvx %v22, %r11, %r3 \n"
|
LI (11, 64)
|
||||||
" li %r11, 64 \n"
|
LVX (23, 9, 3)
|
||||||
" lvx %v23, %r9, %r3 \n"
|
LI (9, 80)
|
||||||
" li %r9, 80 \n"
|
LVX (24, 11, 3)
|
||||||
" lvx %v24, %r11, %r3 \n"
|
LI (11, 96)
|
||||||
" li %r11, 96 \n"
|
LVX (25, 9, 3)
|
||||||
" lvx %v25, %r9, %r3 \n"
|
LI (9, 112)
|
||||||
" li %r9, 112 \n"
|
LVX (26, 11, 3)
|
||||||
" lvx %v26, %r11, %r3 \n"
|
LI (11, 128)
|
||||||
" li %r11, 128 \n"
|
LVX (27, 9, 3)
|
||||||
" lvx %v27, %r9, %r3 \n"
|
LI (9, 144)
|
||||||
" li %r9, 144 \n"
|
LVX (28, 11, 3)
|
||||||
" lvx %v28, %r11, %r3 \n"
|
LI (11, 160)
|
||||||
" li %r11, 160 \n"
|
LVX (29, 9, 3)
|
||||||
" lvx %v29, %r9, %r3 \n"
|
LI (9, 176)
|
||||||
" li %r9, 176 \n"
|
LVX (30, 11, 3)
|
||||||
" lvx %v30, %r11, %r3 \n"
|
LVX (31, 9, 3));
|
||||||
" lvx %v31, %r9, %r3 \n"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user