aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2015-04-03 18:26:44 -0400
committerRalf Baechle <ralf@linux-mips.org>2015-04-07 19:10:03 -0400
commit80cbfad790962125b542cb0cb637954c04386b30 (patch)
tree26e4eb2396e6e2a34824bd23a27be255e256ab07 /arch/mips/include
parent7737b20b9e071f3595582686e894bf56377c43e4 (diff)
MIPS: Correct MIPS I FP context layout
Implement the correct ordering of individual floating-point registers within double-precision register pairs for the MIPS I FP context, as required by our FP emulation code and expected by userland talking via ptrace(2). Use L.D and S.D assembly macros that do the right thing like LDC1 and SDC1 from MIPS II up, avoiding the need to mess up with endianness conditionals. This in particular fixes the handling of denormals and NaN generation in Unimplemented Operation emulation traps. Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/9699/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include')
-rw-r--r--arch/mips/include/asm/asmmacro-32.h96
1 files changed, 32 insertions, 64 deletions
diff --git a/arch/mips/include/asm/asmmacro-32.h b/arch/mips/include/asm/asmmacro-32.h
index cdac7b3eeaf7..8deb906df724 100644
--- a/arch/mips/include/asm/asmmacro-32.h
+++ b/arch/mips/include/asm/asmmacro-32.h
@@ -16,38 +16,22 @@
16 .set push 16 .set push
17 SET_HARDFLOAT 17 SET_HARDFLOAT
18 cfc1 \tmp, fcr31 18 cfc1 \tmp, fcr31
19 swc1 $f0, THREAD_FPR0_LS64(\thread) 19 s.d $f0, THREAD_FPR0_LS64(\thread)
20 swc1 $f1, THREAD_FPR1_LS64(\thread) 20 s.d $f2, THREAD_FPR2_LS64(\thread)
21 swc1 $f2, THREAD_FPR2_LS64(\thread) 21 s.d $f4, THREAD_FPR4_LS64(\thread)
22 swc1 $f3, THREAD_FPR3_LS64(\thread) 22 s.d $f6, THREAD_FPR6_LS64(\thread)
23 swc1 $f4, THREAD_FPR4_LS64(\thread) 23 s.d $f8, THREAD_FPR8_LS64(\thread)
24 swc1 $f5, THREAD_FPR5_LS64(\thread) 24 s.d $f10, THREAD_FPR10_LS64(\thread)
25 swc1 $f6, THREAD_FPR6_LS64(\thread) 25 s.d $f12, THREAD_FPR12_LS64(\thread)
26 swc1 $f7, THREAD_FPR7_LS64(\thread) 26 s.d $f14, THREAD_FPR14_LS64(\thread)
27 swc1 $f8, THREAD_FPR8_LS64(\thread) 27 s.d $f16, THREAD_FPR16_LS64(\thread)
28 swc1 $f9, THREAD_FPR9_LS64(\thread) 28 s.d $f18, THREAD_FPR18_LS64(\thread)
29 swc1 $f10, THREAD_FPR10_LS64(\thread) 29 s.d $f20, THREAD_FPR20_LS64(\thread)
30 swc1 $f11, THREAD_FPR11_LS64(\thread) 30 s.d $f22, THREAD_FPR22_LS64(\thread)
31 swc1 $f12, THREAD_FPR12_LS64(\thread) 31 s.d $f24, THREAD_FPR24_LS64(\thread)
32 swc1 $f13, THREAD_FPR13_LS64(\thread) 32 s.d $f26, THREAD_FPR26_LS64(\thread)
33 swc1 $f14, THREAD_FPR14_LS64(\thread) 33 s.d $f28, THREAD_FPR28_LS64(\thread)
34 swc1 $f15, THREAD_FPR15_LS64(\thread) 34 s.d $f30, THREAD_FPR30_LS64(\thread)
35 swc1 $f16, THREAD_FPR16_LS64(\thread)
36 swc1 $f17, THREAD_FPR17_LS64(\thread)
37 swc1 $f18, THREAD_FPR18_LS64(\thread)
38 swc1 $f19, THREAD_FPR19_LS64(\thread)
39 swc1 $f20, THREAD_FPR20_LS64(\thread)
40 swc1 $f21, THREAD_FPR21_LS64(\thread)
41 swc1 $f22, THREAD_FPR22_LS64(\thread)
42 swc1 $f23, THREAD_FPR23_LS64(\thread)
43 swc1 $f24, THREAD_FPR24_LS64(\thread)
44 swc1 $f25, THREAD_FPR25_LS64(\thread)
45 swc1 $f26, THREAD_FPR26_LS64(\thread)
46 swc1 $f27, THREAD_FPR27_LS64(\thread)
47 swc1 $f28, THREAD_FPR28_LS64(\thread)
48 swc1 $f29, THREAD_FPR29_LS64(\thread)
49 swc1 $f30, THREAD_FPR30_LS64(\thread)
50 swc1 $f31, THREAD_FPR31_LS64(\thread)
51 sw \tmp, THREAD_FCR31(\thread) 35 sw \tmp, THREAD_FCR31(\thread)
52 .set pop 36 .set pop
53 .endm 37 .endm
@@ -56,38 +40,22 @@
56 .set push 40 .set push
57 SET_HARDFLOAT 41 SET_HARDFLOAT
58 lw \tmp, THREAD_FCR31(\thread) 42 lw \tmp, THREAD_FCR31(\thread)
59 lwc1 $f0, THREAD_FPR0_LS64(\thread) 43 l.d $f0, THREAD_FPR0_LS64(\thread)
60 lwc1 $f1, THREAD_FPR1_LS64(\thread) 44 l.d $f2, THREAD_FPR2_LS64(\thread)
61 lwc1 $f2, THREAD_FPR2_LS64(\thread) 45 l.d $f4, THREAD_FPR4_LS64(\thread)
62 lwc1 $f3, THREAD_FPR3_LS64(\thread) 46 l.d $f6, THREAD_FPR6_LS64(\thread)
63 lwc1 $f4, THREAD_FPR4_LS64(\thread) 47 l.d $f8, THREAD_FPR8_LS64(\thread)
64 lwc1 $f5, THREAD_FPR5_LS64(\thread) 48 l.d $f10, THREAD_FPR10_LS64(\thread)
65 lwc1 $f6, THREAD_FPR6_LS64(\thread) 49 l.d $f12, THREAD_FPR12_LS64(\thread)
66 lwc1 $f7, THREAD_FPR7_LS64(\thread) 50 l.d $f14, THREAD_FPR14_LS64(\thread)
67 lwc1 $f8, THREAD_FPR8_LS64(\thread) 51 l.d $f16, THREAD_FPR16_LS64(\thread)
68 lwc1 $f9, THREAD_FPR9_LS64(\thread) 52 l.d $f18, THREAD_FPR18_LS64(\thread)
69 lwc1 $f10, THREAD_FPR10_LS64(\thread) 53 l.d $f20, THREAD_FPR20_LS64(\thread)
70 lwc1 $f11, THREAD_FPR11_LS64(\thread) 54 l.d $f22, THREAD_FPR22_LS64(\thread)
71 lwc1 $f12, THREAD_FPR12_LS64(\thread) 55 l.d $f24, THREAD_FPR24_LS64(\thread)
72 lwc1 $f13, THREAD_FPR13_LS64(\thread) 56 l.d $f26, THREAD_FPR26_LS64(\thread)
73 lwc1 $f14, THREAD_FPR14_LS64(\thread) 57 l.d $f28, THREAD_FPR28_LS64(\thread)
74 lwc1 $f15, THREAD_FPR15_LS64(\thread) 58 l.d $f30, THREAD_FPR30_LS64(\thread)
75 lwc1 $f16, THREAD_FPR16_LS64(\thread)
76 lwc1 $f17, THREAD_FPR17_LS64(\thread)
77 lwc1 $f18, THREAD_FPR18_LS64(\thread)
78 lwc1 $f19, THREAD_FPR19_LS64(\thread)
79 lwc1 $f20, THREAD_FPR20_LS64(\thread)
80 lwc1 $f21, THREAD_FPR21_LS64(\thread)
81 lwc1 $f22, THREAD_FPR22_LS64(\thread)
82 lwc1 $f23, THREAD_FPR23_LS64(\thread)
83 lwc1 $f24, THREAD_FPR24_LS64(\thread)
84 lwc1 $f25, THREAD_FPR25_LS64(\thread)
85 lwc1 $f26, THREAD_FPR26_LS64(\thread)
86 lwc1 $f27, THREAD_FPR27_LS64(\thread)
87 lwc1 $f28, THREAD_FPR28_LS64(\thread)
88 lwc1 $f29, THREAD_FPR29_LS64(\thread)
89 lwc1 $f30, THREAD_FPR30_LS64(\thread)
90 lwc1 $f31, THREAD_FPR31_LS64(\thread)
91 ctc1 \tmp, fcr31 59 ctc1 \tmp, fcr31
92 .set pop 60 .set pop
93 .endm 61 .endm