Commit ab007fa6 authored by Tom Rini's avatar Tom Rini Committed by Paul Mackerras

PPC32: use the proper instruction mnemonics for altivec instructions.

Previously we used macros that constructed .longs since we couldn't
rely on having a recent enough binutils.  Now we check the binutils
version.
parent e435ba94
...@@ -892,9 +892,9 @@ load_up_altivec: ...@@ -892,9 +892,9 @@ load_up_altivec:
add r4,r4,r6 add r4,r4,r6
addi r4,r4,THREAD /* want THREAD of last_task_used_altivec */ addi r4,r4,THREAD /* want THREAD of last_task_used_altivec */
SAVE_32VR(0,r10,r4) SAVE_32VR(0,r10,r4)
MFVSCR(vr0) mfvscr vr0
li r10,THREAD_VSCR li r10,THREAD_VSCR
STVX(vr0,r10,r4) stvx vr0,r10,r4
lwz r5,PT_REGS(r4) lwz r5,PT_REGS(r4)
add r5,r5,r6 add r5,r5,r6
lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5) lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5)
...@@ -907,8 +907,8 @@ load_up_altivec: ...@@ -907,8 +907,8 @@ load_up_altivec:
oris r9,r9,MSR_VEC@h oris r9,r9,MSR_VEC@h
mfspr r5,SPRG3 /* current task's THREAD (phys) */ mfspr r5,SPRG3 /* current task's THREAD (phys) */
li r10,THREAD_VSCR li r10,THREAD_VSCR
LVX(vr0,r10,r5) lvx vr0,r10,r5
MTVSCR(vr0) mtvscr vr0
REST_32VR(0,r10,r5) REST_32VR(0,r10,r5)
#ifndef CONFIG_SMP #ifndef CONFIG_SMP
subi r4,r5,THREAD subi r4,r5,THREAD
...@@ -956,9 +956,9 @@ giveup_altivec: ...@@ -956,9 +956,9 @@ giveup_altivec:
lwz r5,PT_REGS(r3) lwz r5,PT_REGS(r3)
cmpi 0,r5,0 cmpi 0,r5,0
SAVE_32VR(0, r4, r3) SAVE_32VR(0, r4, r3)
MFVSCR(vr0) mfvscr vr0
li r4,THREAD_VSCR li r4,THREAD_VSCR
STVX(vr0, r4, r3) stvx vr0,r4,r3
beq 1f beq 1f
lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5) lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5)
lis r3,MSR_VEC@h lis r3,MSR_VEC@h
......
...@@ -49,21 +49,13 @@ ...@@ -49,21 +49,13 @@
#define REST_16FPRS(n, base) REST_8FPRS(n, base); REST_8FPRS(n+8, base) #define REST_16FPRS(n, base) REST_8FPRS(n, base); REST_8FPRS(n+8, base)
#define REST_32FPRS(n, base) REST_16FPRS(n, base); REST_16FPRS(n+16, base) #define REST_32FPRS(n, base) REST_16FPRS(n, base); REST_16FPRS(n+16, base)
/* #define SAVE_VR(n,b,base) li b,THREAD_VR0+(16*(n)); stvx n,b,base
* Once a version of gas that understands the AltiVec instructions
*/
#define LVX(r,a,b) .long (31<<26)+((r)<<21)+((a)<<16)+((b)<<11)+(103<<1)
#define STVX(r,a,b) .long (31<<26)+((r)<<21)+((a)<<16)+((b)<<11)+(231<<1)
#define MFVSCR(r) .long (4<<26)+((r)<<21)+(770<<1)
#define MTVSCR(r) .long (4<<26)+((r)<<11)+(802<<1)
#define SAVE_VR(n,b,base) li b,THREAD_VR0+(16*(n)); STVX(n,b,base)
#define SAVE_2VR(n,b,base) SAVE_VR(n,b,base); SAVE_VR(n+1,b,base) #define SAVE_2VR(n,b,base) SAVE_VR(n,b,base); SAVE_VR(n+1,b,base)
#define SAVE_4VR(n,b,base) SAVE_2VR(n,b,base); SAVE_2VR(n+2,b,base) #define SAVE_4VR(n,b,base) SAVE_2VR(n,b,base); SAVE_2VR(n+2,b,base)
#define SAVE_8VR(n,b,base) SAVE_4VR(n,b,base); SAVE_4VR(n+4,b,base) #define SAVE_8VR(n,b,base) SAVE_4VR(n,b,base); SAVE_4VR(n+4,b,base)
#define SAVE_16VR(n,b,base) SAVE_8VR(n,b,base); SAVE_8VR(n+8,b,base) #define SAVE_16VR(n,b,base) SAVE_8VR(n,b,base); SAVE_8VR(n+8,b,base)
#define SAVE_32VR(n,b,base) SAVE_16VR(n,b,base); SAVE_16VR(n+16,b,base) #define SAVE_32VR(n,b,base) SAVE_16VR(n,b,base); SAVE_16VR(n+16,b,base)
#define REST_VR(n,b,base) li b,THREAD_VR0+(16*(n)); LVX(n,b,base) #define REST_VR(n,b,base) li b,THREAD_VR0+(16*(n)); lvx n,b,base
#define REST_2VR(n,b,base) REST_VR(n,b,base); REST_VR(n+1,b,base) #define REST_2VR(n,b,base) REST_VR(n,b,base); REST_VR(n+1,b,base)
#define REST_4VR(n,b,base) REST_2VR(n,b,base); REST_2VR(n+2,b,base) #define REST_4VR(n,b,base) REST_2VR(n,b,base); REST_2VR(n+2,b,base)
#define REST_8VR(n,b,base) REST_4VR(n,b,base); REST_4VR(n+4,b,base) #define REST_8VR(n,b,base) REST_4VR(n,b,base); REST_4VR(n+4,b,base)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment