27
27
.endm
28
28
29
29
.macro sc_save_fp base
30
- EX fst.d $f0 , \base, (0 * FPU_REG_WIDTH)
31
- EX fst.d $f1 , \base, (1 * FPU_REG_WIDTH)
32
- EX fst.d $f2 , \base, (2 * FPU_REG_WIDTH)
33
- EX fst.d $f3 , \base, (3 * FPU_REG_WIDTH)
34
- EX fst.d $f4 , \base, (4 * FPU_REG_WIDTH)
35
- EX fst.d $f5 , \base, (5 * FPU_REG_WIDTH)
36
- EX fst.d $f6 , \base, (6 * FPU_REG_WIDTH)
37
- EX fst.d $f7 , \base, (7 * FPU_REG_WIDTH)
38
- EX fst.d $f8 , \base, (8 * FPU_REG_WIDTH)
39
- EX fst.d $f9 , \base, (9 * FPU_REG_WIDTH)
40
- EX fst.d $f10 , \base, (10 * FPU_REG_WIDTH)
41
- EX fst.d $f11 , \base, (11 * FPU_REG_WIDTH)
42
- EX fst.d $f12 , \base, (12 * FPU_REG_WIDTH)
43
- EX fst.d $f13 , \base, (13 * FPU_REG_WIDTH)
44
- EX fst.d $f14 , \base, (14 * FPU_REG_WIDTH)
45
- EX fst.d $f15 , \base, (15 * FPU_REG_WIDTH)
46
- EX fst.d $f16 , \base, (16 * FPU_REG_WIDTH)
47
- EX fst.d $f17 , \base, (17 * FPU_REG_WIDTH)
48
- EX fst.d $f18 , \base, (18 * FPU_REG_WIDTH)
49
- EX fst.d $f19 , \base, (19 * FPU_REG_WIDTH)
50
- EX fst.d $f20 , \base, (20 * FPU_REG_WIDTH)
51
- EX fst.d $f21 , \base, (21 * FPU_REG_WIDTH)
52
- EX fst.d $f22 , \base, (22 * FPU_REG_WIDTH)
53
- EX fst.d $f23 , \base, (23 * FPU_REG_WIDTH)
54
- EX fst.d $f24 , \base, (24 * FPU_REG_WIDTH)
55
- EX fst.d $f25 , \base, (25 * FPU_REG_WIDTH)
56
- EX fst.d $f26 , \base, (26 * FPU_REG_WIDTH)
57
- EX fst.d $f27 , \base, (27 * FPU_REG_WIDTH)
58
- EX fst.d $f28 , \base, (28 * FPU_REG_WIDTH)
59
- EX fst.d $f29 , \base, (29 * FPU_REG_WIDTH)
60
- EX fst.d $f30 , \base, (30 * FPU_REG_WIDTH)
61
- EX fst.d $f31 , \base, (31 * FPU_REG_WIDTH)
30
+ EX fst.d $f0 , \base, (0 * FPU_REG_WIDTH)
31
+ EX fst.d $f1 , \base, (1 * FPU_REG_WIDTH)
32
+ EX fst.d $f2 , \base, (2 * FPU_REG_WIDTH)
33
+ EX fst.d $f3 , \base, (3 * FPU_REG_WIDTH)
34
+ EX fst.d $f4 , \base, (4 * FPU_REG_WIDTH)
35
+ EX fst.d $f5 , \base, (5 * FPU_REG_WIDTH)
36
+ EX fst.d $f6 , \base, (6 * FPU_REG_WIDTH)
37
+ EX fst.d $f7 , \base, (7 * FPU_REG_WIDTH)
38
+ EX fst.d $f8 , \base, (8 * FPU_REG_WIDTH)
39
+ EX fst.d $f9 , \base, (9 * FPU_REG_WIDTH)
40
+ EX fst.d $f10 , \base, (10 * FPU_REG_WIDTH)
41
+ EX fst.d $f11 , \base, (11 * FPU_REG_WIDTH)
42
+ EX fst.d $f12 , \base, (12 * FPU_REG_WIDTH)
43
+ EX fst.d $f13 , \base, (13 * FPU_REG_WIDTH)
44
+ EX fst.d $f14 , \base, (14 * FPU_REG_WIDTH)
45
+ EX fst.d $f15 , \base, (15 * FPU_REG_WIDTH)
46
+ EX fst.d $f16 , \base, (16 * FPU_REG_WIDTH)
47
+ EX fst.d $f17 , \base, (17 * FPU_REG_WIDTH)
48
+ EX fst.d $f18 , \base, (18 * FPU_REG_WIDTH)
49
+ EX fst.d $f19 , \base, (19 * FPU_REG_WIDTH)
50
+ EX fst.d $f20 , \base, (20 * FPU_REG_WIDTH)
51
+ EX fst.d $f21 , \base, (21 * FPU_REG_WIDTH)
52
+ EX fst.d $f22 , \base, (22 * FPU_REG_WIDTH)
53
+ EX fst.d $f23 , \base, (23 * FPU_REG_WIDTH)
54
+ EX fst.d $f24 , \base, (24 * FPU_REG_WIDTH)
55
+ EX fst.d $f25 , \base, (25 * FPU_REG_WIDTH)
56
+ EX fst.d $f26 , \base, (26 * FPU_REG_WIDTH)
57
+ EX fst.d $f27 , \base, (27 * FPU_REG_WIDTH)
58
+ EX fst.d $f28 , \base, (28 * FPU_REG_WIDTH)
59
+ EX fst.d $f29 , \base, (29 * FPU_REG_WIDTH)
60
+ EX fst.d $f30 , \base, (30 * FPU_REG_WIDTH)
61
+ EX fst.d $f31 , \base, (31 * FPU_REG_WIDTH)
62
62
.endm
63
63
64
64
.macro sc_restore_fp base
65
- EX fld.d $f0 , \base, (0 * FPU_REG_WIDTH)
66
- EX fld.d $f1 , \base, (1 * FPU_REG_WIDTH)
67
- EX fld.d $f2 , \base, (2 * FPU_REG_WIDTH)
68
- EX fld.d $f3 , \base, (3 * FPU_REG_WIDTH)
69
- EX fld.d $f4 , \base, (4 * FPU_REG_WIDTH)
70
- EX fld.d $f5 , \base, (5 * FPU_REG_WIDTH)
71
- EX fld.d $f6 , \base, (6 * FPU_REG_WIDTH)
72
- EX fld.d $f7 , \base, (7 * FPU_REG_WIDTH)
73
- EX fld.d $f8 , \base, (8 * FPU_REG_WIDTH)
74
- EX fld.d $f9 , \base, (9 * FPU_REG_WIDTH)
75
- EX fld.d $f10 , \base, (10 * FPU_REG_WIDTH)
76
- EX fld.d $f11 , \base, (11 * FPU_REG_WIDTH)
77
- EX fld.d $f12 , \base, (12 * FPU_REG_WIDTH)
78
- EX fld.d $f13 , \base, (13 * FPU_REG_WIDTH)
79
- EX fld.d $f14 , \base, (14 * FPU_REG_WIDTH)
80
- EX fld.d $f15 , \base, (15 * FPU_REG_WIDTH)
81
- EX fld.d $f16 , \base, (16 * FPU_REG_WIDTH)
82
- EX fld.d $f17 , \base, (17 * FPU_REG_WIDTH)
83
- EX fld.d $f18 , \base, (18 * FPU_REG_WIDTH)
84
- EX fld.d $f19 , \base, (19 * FPU_REG_WIDTH)
85
- EX fld.d $f20 , \base, (20 * FPU_REG_WIDTH)
86
- EX fld.d $f21 , \base, (21 * FPU_REG_WIDTH)
87
- EX fld.d $f22 , \base, (22 * FPU_REG_WIDTH)
88
- EX fld.d $f23 , \base, (23 * FPU_REG_WIDTH)
89
- EX fld.d $f24 , \base, (24 * FPU_REG_WIDTH)
90
- EX fld.d $f25 , \base, (25 * FPU_REG_WIDTH)
91
- EX fld.d $f26 , \base, (26 * FPU_REG_WIDTH)
92
- EX fld.d $f27 , \base, (27 * FPU_REG_WIDTH)
93
- EX fld.d $f28 , \base, (28 * FPU_REG_WIDTH)
94
- EX fld.d $f29 , \base, (29 * FPU_REG_WIDTH)
95
- EX fld.d $f30 , \base, (30 * FPU_REG_WIDTH)
96
- EX fld.d $f31 , \base, (31 * FPU_REG_WIDTH)
65
+ EX fld.d $f0 , \base, (0 * FPU_REG_WIDTH)
66
+ EX fld.d $f1 , \base, (1 * FPU_REG_WIDTH)
67
+ EX fld.d $f2 , \base, (2 * FPU_REG_WIDTH)
68
+ EX fld.d $f3 , \base, (3 * FPU_REG_WIDTH)
69
+ EX fld.d $f4 , \base, (4 * FPU_REG_WIDTH)
70
+ EX fld.d $f5 , \base, (5 * FPU_REG_WIDTH)
71
+ EX fld.d $f6 , \base, (6 * FPU_REG_WIDTH)
72
+ EX fld.d $f7 , \base, (7 * FPU_REG_WIDTH)
73
+ EX fld.d $f8 , \base, (8 * FPU_REG_WIDTH)
74
+ EX fld.d $f9 , \base, (9 * FPU_REG_WIDTH)
75
+ EX fld.d $f10 , \base, (10 * FPU_REG_WIDTH)
76
+ EX fld.d $f11 , \base, (11 * FPU_REG_WIDTH)
77
+ EX fld.d $f12 , \base, (12 * FPU_REG_WIDTH)
78
+ EX fld.d $f13 , \base, (13 * FPU_REG_WIDTH)
79
+ EX fld.d $f14 , \base, (14 * FPU_REG_WIDTH)
80
+ EX fld.d $f15 , \base, (15 * FPU_REG_WIDTH)
81
+ EX fld.d $f16 , \base, (16 * FPU_REG_WIDTH)
82
+ EX fld.d $f17 , \base, (17 * FPU_REG_WIDTH)
83
+ EX fld.d $f18 , \base, (18 * FPU_REG_WIDTH)
84
+ EX fld.d $f19 , \base, (19 * FPU_REG_WIDTH)
85
+ EX fld.d $f20 , \base, (20 * FPU_REG_WIDTH)
86
+ EX fld.d $f21 , \base, (21 * FPU_REG_WIDTH)
87
+ EX fld.d $f22 , \base, (22 * FPU_REG_WIDTH)
88
+ EX fld.d $f23 , \base, (23 * FPU_REG_WIDTH)
89
+ EX fld.d $f24 , \base, (24 * FPU_REG_WIDTH)
90
+ EX fld.d $f25 , \base, (25 * FPU_REG_WIDTH)
91
+ EX fld.d $f26 , \base, (26 * FPU_REG_WIDTH)
92
+ EX fld.d $f27 , \base, (27 * FPU_REG_WIDTH)
93
+ EX fld.d $f28 , \base, (28 * FPU_REG_WIDTH)
94
+ EX fld.d $f29 , \base, (29 * FPU_REG_WIDTH)
95
+ EX fld.d $f30 , \base, (30 * FPU_REG_WIDTH)
96
+ EX fld.d $f31 , \base, (31 * FPU_REG_WIDTH)
97
97
.endm
98
98
99
99
.macro sc_save_fcc base, tmp0, tmp1
100
100
movcf2gr \tmp0, $fcc0
101
- move \tmp1, \tmp0
101
+ move \tmp1, \tmp0
102
102
movcf2gr \tmp0, $fcc1
103
103
bstrins.d \tmp1, \tmp0, 15 , 8
104
104
movcf2gr \tmp0, $fcc2
113
113
bstrins.d \tmp1, \tmp0, 55 , 48
114
114
movcf2gr \tmp0, $fcc7
115
115
bstrins.d \tmp1, \tmp0, 63 , 56
116
- EX st .d \tmp1, \base, 0
116
+ EX st .d \tmp1, \base, 0
117
117
.endm
118
118
119
119
.macro sc_restore_fcc base, tmp0, tmp1
120
- EX ld.d \tmp0, \base, 0
120
+ EX ld.d \tmp0, \base, 0
121
121
bstrpick.d \tmp1, \tmp0, 7 , 0
122
122
movgr2cf $fcc0 , \tmp1
123
123
bstrpick.d \tmp1, \tmp0, 15 , 8
138
138
139
139
.macro sc_save_fcsr base, tmp0
140
140
movfcsr2gr \tmp0, fcsr0
141
- EX st .w \tmp0, \base, 0
141
+ EX st .w \tmp0, \base, 0
142
142
.endm
143
143
144
144
.macro sc_restore_fcsr base, tmp0
145
- EX ld.w \tmp0, \base, 0
145
+ EX ld.w \tmp0, \base, 0
146
146
movgr2fcsr fcsr0, \tmp0
147
147
.endm
148
148
151
151
*/
152
152
SYM_FUNC_START (_save_fp)
153
153
fpu_save_csr a0 t1
154
- fpu_save_double a0 t1 # clobbers t1
154
+ fpu_save_double a0 t1 # clobbers t1
155
155
fpu_save_cc a0 t1 t2 # clobbers t1, t2
156
- jr ra
156
+ jr ra
157
157
SYM_FUNC_END (_save_fp)
158
158
EXPORT_SYMBOL (_save_fp)
159
159
160
160
/*
161
161
* Restore a thread's fp context.
162
162
*/
163
163
SYM_FUNC_START (_restore_fp)
164
- fpu_restore_double a0 t1 # clobbers t1
165
- fpu_restore_csr a0 t1
166
- fpu_restore_cc a0 t1 t2 # clobbers t1, t2
167
- jr ra
164
+ fpu_restore_double a0 t1 # clobbers t1
165
+ fpu_restore_csr a0 t1
166
+ fpu_restore_cc a0 t1 t2 # clobbers t1, t2
167
+ jr ra
168
168
SYM_FUNC_END (_restore_fp)
169
169
170
170
/*
@@ -225,11 +225,11 @@ SYM_FUNC_END(_init_fpu)
225
225
* a2: fcsr
226
226
*/
227
227
SYM_FUNC_START (_save_fp_context)
228
- sc_save_fcc a1 t1 t2
229
- sc_save_fcsr a2 t1
230
- sc_save_fp a0
231
- li.w a0 , 0 # success
232
- jr ra
228
+ sc_save_fcc a1 t1 t2
229
+ sc_save_fcsr a2 t1
230
+ sc_save_fp a0
231
+ li.w a0 , 0 # success
232
+ jr ra
233
233
SYM_FUNC_END (_save_fp_context)
234
234
235
235
/*
@@ -238,11 +238,11 @@ SYM_FUNC_END(_save_fp_context)
238
238
* a2: fcsr
239
239
*/
240
240
SYM_FUNC_START (_restore_fp_context)
241
- sc_restore_fp a0
242
- sc_restore_fcc a1 t1 t2
243
- sc_restore_fcsr a2 t1
244
- li.w a0 , 0 # success
245
- jr ra
241
+ sc_restore_fp a0
242
+ sc_restore_fcc a1 t1 t2
243
+ sc_restore_fcsr a2 t1
244
+ li.w a0 , 0 # success
245
+ jr ra
246
246
SYM_FUNC_END (_restore_fp_context)
247
247
248
248
SYM_FUNC_START (fault)
0 commit comments