]>
Commit | Line | Data |
---|---|---|
33d68b5f TS |
1 | /* |
2 | * MIPS emulation for qemu: CPU initialisation routines. | |
3 | * | |
4 | * Copyright (c) 2004-2005 Jocelyn Mayer | |
5 | * Copyright (c) 2007 Herve Poussineau | |
6 | * | |
7 | * This library is free software; you can redistribute it and/or | |
8 | * modify it under the terms of the GNU Lesser General Public | |
9 | * License as published by the Free Software Foundation; either | |
10 | * version 2 of the License, or (at your option) any later version. | |
11 | * | |
12 | * This library is distributed in the hope that it will be useful, | |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | * Lesser General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU Lesser General Public | |
8167ee88 | 18 | * License along with this library; if not, see <http://www.gnu.org/licenses/>. |
33d68b5f TS |
19 | */ |
20 | ||
3953d786 TS |
21 | /* CPU / CPU family specific config register values. */ |
22 | ||
6d35524c | 23 | /* Have config1, uncached coherency */ |
3953d786 | 24 | #define MIPS_CONFIG0 \ |
f45cb2f4 | 25 | ((1U << CP0C0_M) | (0x2 << CP0C0_K0)) |
3953d786 | 26 | |
ae5d8053 | 27 | /* Have config2, no coprocessor2 attached, no MDMX support attached, |
3953d786 TS |
28 | no performance counters, watch registers present, |
29 | no code compression, EJTAG present, no FPU */ | |
30 | #define MIPS_CONFIG1 \ | |
f45cb2f4 | 31 | ((1U << CP0C1_M) | \ |
3953d786 TS |
32 | (0 << CP0C1_C2) | (0 << CP0C1_MD) | (0 << CP0C1_PC) | \ |
33 | (1 << CP0C1_WR) | (0 << CP0C1_CA) | (1 << CP0C1_EP) | \ | |
34 | (0 << CP0C1_FP)) | |
35 | ||
36 | /* Have config3, no tertiary/secondary caches implemented */ | |
37 | #define MIPS_CONFIG2 \ | |
f45cb2f4 | 38 | ((1U << CP0C2_M)) |
3953d786 | 39 | |
6d35524c | 40 | /* No config4, no DSP ASE, no large physaddr (PABITS), |
ff2712ba | 41 | no external interrupt controller, no vectored interrupts, |
ead9360e | 42 | no 1kb pages, no SmartMIPS ASE, no trace logic */ |
3953d786 TS |
43 | #define MIPS_CONFIG3 \ |
44 | ((0 << CP0C3_M) | (0 << CP0C3_DSPP) | (0 << CP0C3_LPA) | \ | |
45 | (0 << CP0C3_VEIC) | (0 << CP0C3_VInt) | (0 << CP0C3_SP) | \ | |
ead9360e | 46 | (0 << CP0C3_SM) | (0 << CP0C3_TL)) |
3953d786 | 47 | |
b4160af1 PJ |
48 | #define MIPS_CONFIG4 \ |
49 | ((0 << CP0C4_M)) | |
50 | ||
b4dd99a3 PJ |
51 | #define MIPS_CONFIG5 \ |
52 | ((0 << CP0C5_M)) | |
53 | ||
33d68b5f TS |
54 | /*****************************************************************************/ |
55 | /* MIPS CPU definitions */ | |
41da212c | 56 | const mips_def_t mips_defs[] = |
33d68b5f | 57 | { |
33d68b5f TS |
58 | { |
59 | .name = "4Kc", | |
60 | .CP0_PRid = 0x00018000, | |
6d35524c | 61 | .CP0_Config0 = MIPS_CONFIG0 | (MMU_TYPE_R4000 << CP0C0_MT), |
ae5d8053 | 62 | .CP0_Config1 = MIPS_CONFIG1 | (15 << CP0C1_MMU) | |
6958549d | 63 | (0 << CP0C1_IS) | (3 << CP0C1_IL) | (1 << CP0C1_IA) | |
d19954f4 | 64 | (0 << CP0C1_DS) | (3 << CP0C1_DL) | (1 << CP0C1_DA) | |
ab3aee26 | 65 | (0 << CP0C1_CA), |
3953d786 TS |
66 | .CP0_Config2 = MIPS_CONFIG2, |
67 | .CP0_Config3 = MIPS_CONFIG3, | |
2a6e32dd AJ |
68 | .CP0_LLAddr_rw_bitmask = 0, |
69 | .CP0_LLAddr_shift = 4, | |
2f644545 TS |
70 | .SYNCI_Step = 32, |
71 | .CCRes = 2, | |
ead9360e | 72 | .CP0_Status_rw_bitmask = 0x1278FF17, |
6d35524c TS |
73 | .SEGBITS = 32, |
74 | .PABITS = 32, | |
73642f5b | 75 | .insn_flags = CPU_MIPS32, |
6d35524c | 76 | .mmu_type = MMU_TYPE_R4000, |
33d68b5f | 77 | }, |
8d162c2b TS |
78 | { |
79 | .name = "4Km", | |
80 | .CP0_PRid = 0x00018300, | |
81 | /* Config1 implemented, fixed mapping MMU, | |
82 | no virtual icache, uncached coherency. */ | |
6d35524c | 83 | .CP0_Config0 = MIPS_CONFIG0 | (MMU_TYPE_FMT << CP0C0_MT), |
8d162c2b | 84 | .CP0_Config1 = MIPS_CONFIG1 | |
6958549d | 85 | (0 << CP0C1_IS) | (3 << CP0C1_IL) | (1 << CP0C1_IA) | |
d19954f4 NF |
86 | (0 << CP0C1_DS) | (3 << CP0C1_DL) | (1 << CP0C1_DA) | |
87 | (1 << CP0C1_CA), | |
8d162c2b TS |
88 | .CP0_Config2 = MIPS_CONFIG2, |
89 | .CP0_Config3 = MIPS_CONFIG3, | |
2a6e32dd AJ |
90 | .CP0_LLAddr_rw_bitmask = 0, |
91 | .CP0_LLAddr_shift = 4, | |
8d162c2b TS |
92 | .SYNCI_Step = 32, |
93 | .CCRes = 2, | |
94 | .CP0_Status_rw_bitmask = 0x1258FF17, | |
6d35524c TS |
95 | .SEGBITS = 32, |
96 | .PABITS = 32, | |
8d162c2b | 97 | .insn_flags = CPU_MIPS32 | ASE_MIPS16, |
6d35524c | 98 | .mmu_type = MMU_TYPE_FMT, |
8d162c2b | 99 | }, |
33d68b5f | 100 | { |
34ee2ede | 101 | .name = "4KEcR1", |
33d68b5f | 102 | .CP0_PRid = 0x00018400, |
6d35524c | 103 | .CP0_Config0 = MIPS_CONFIG0 | (MMU_TYPE_R4000 << CP0C0_MT), |
ae5d8053 | 104 | .CP0_Config1 = MIPS_CONFIG1 | (15 << CP0C1_MMU) | |
6958549d | 105 | (0 << CP0C1_IS) | (3 << CP0C1_IL) | (1 << CP0C1_IA) | |
d19954f4 | 106 | (0 << CP0C1_DS) | (3 << CP0C1_DL) | (1 << CP0C1_DA) | |
ab3aee26 | 107 | (0 << CP0C1_CA), |
34ee2ede TS |
108 | .CP0_Config2 = MIPS_CONFIG2, |
109 | .CP0_Config3 = MIPS_CONFIG3, | |
2a6e32dd AJ |
110 | .CP0_LLAddr_rw_bitmask = 0, |
111 | .CP0_LLAddr_shift = 4, | |
2f644545 TS |
112 | .SYNCI_Step = 32, |
113 | .CCRes = 2, | |
ead9360e | 114 | .CP0_Status_rw_bitmask = 0x1278FF17, |
6d35524c TS |
115 | .SEGBITS = 32, |
116 | .PABITS = 32, | |
73642f5b | 117 | .insn_flags = CPU_MIPS32, |
6d35524c | 118 | .mmu_type = MMU_TYPE_R4000, |
34ee2ede | 119 | }, |
8d162c2b TS |
120 | { |
121 | .name = "4KEmR1", | |
122 | .CP0_PRid = 0x00018500, | |
6d35524c | 123 | .CP0_Config0 = MIPS_CONFIG0 | (MMU_TYPE_FMT << CP0C0_MT), |
8d162c2b | 124 | .CP0_Config1 = MIPS_CONFIG1 | |
6958549d | 125 | (0 << CP0C1_IS) | (3 << CP0C1_IL) | (1 << CP0C1_IA) | |
d19954f4 NF |
126 | (0 << CP0C1_DS) | (3 << CP0C1_DL) | (1 << CP0C1_DA) | |
127 | (1 << CP0C1_CA), | |
8d162c2b TS |
128 | .CP0_Config2 = MIPS_CONFIG2, |
129 | .CP0_Config3 = MIPS_CONFIG3, | |
2a6e32dd AJ |
130 | .CP0_LLAddr_rw_bitmask = 0, |
131 | .CP0_LLAddr_shift = 4, | |
8d162c2b TS |
132 | .SYNCI_Step = 32, |
133 | .CCRes = 2, | |
134 | .CP0_Status_rw_bitmask = 0x1258FF17, | |
6d35524c TS |
135 | .SEGBITS = 32, |
136 | .PABITS = 32, | |
8d162c2b | 137 | .insn_flags = CPU_MIPS32 | ASE_MIPS16, |
6d35524c | 138 | .mmu_type = MMU_TYPE_FMT, |
8d162c2b | 139 | }, |
34ee2ede TS |
140 | { |
141 | .name = "4KEc", | |
142 | .CP0_PRid = 0x00019000, | |
6d35524c TS |
143 | .CP0_Config0 = MIPS_CONFIG0 | (0x1 << CP0C0_AR) | |
144 | (MMU_TYPE_R4000 << CP0C0_MT), | |
ae5d8053 | 145 | .CP0_Config1 = MIPS_CONFIG1 | (15 << CP0C1_MMU) | |
6958549d | 146 | (0 << CP0C1_IS) | (3 << CP0C1_IL) | (1 << CP0C1_IA) | |
d19954f4 | 147 | (0 << CP0C1_DS) | (3 << CP0C1_DL) | (1 << CP0C1_DA) | |
ab3aee26 | 148 | (0 << CP0C1_CA), |
34ee2ede | 149 | .CP0_Config2 = MIPS_CONFIG2, |
ead9360e | 150 | .CP0_Config3 = MIPS_CONFIG3 | (0 << CP0C3_VInt), |
2a6e32dd AJ |
151 | .CP0_LLAddr_rw_bitmask = 0, |
152 | .CP0_LLAddr_shift = 4, | |
2f644545 TS |
153 | .SYNCI_Step = 32, |
154 | .CCRes = 2, | |
ead9360e | 155 | .CP0_Status_rw_bitmask = 0x1278FF17, |
6d35524c TS |
156 | .SEGBITS = 32, |
157 | .PABITS = 32, | |
73642f5b | 158 | .insn_flags = CPU_MIPS32R2, |
6d35524c | 159 | .mmu_type = MMU_TYPE_R4000, |
34ee2ede | 160 | }, |
3e4587d5 TS |
161 | { |
162 | .name = "4KEm", | |
163 | .CP0_PRid = 0x00019100, | |
6d35524c | 164 | .CP0_Config0 = MIPS_CONFIG0 | (0x1 << CP0C0_AR) | |
6958549d | 165 | (MMU_TYPE_FMT << CP0C0_MT), |
3e4587d5 | 166 | .CP0_Config1 = MIPS_CONFIG1 | |
6958549d | 167 | (0 << CP0C1_IS) | (3 << CP0C1_IL) | (1 << CP0C1_IA) | |
d19954f4 NF |
168 | (0 << CP0C1_DS) | (3 << CP0C1_DL) | (1 << CP0C1_DA) | |
169 | (1 << CP0C1_CA), | |
3e4587d5 TS |
170 | .CP0_Config2 = MIPS_CONFIG2, |
171 | .CP0_Config3 = MIPS_CONFIG3, | |
2a6e32dd AJ |
172 | .CP0_LLAddr_rw_bitmask = 0, |
173 | .CP0_LLAddr_shift = 4, | |
3e4587d5 TS |
174 | .SYNCI_Step = 32, |
175 | .CCRes = 2, | |
176 | .CP0_Status_rw_bitmask = 0x1258FF17, | |
6d35524c TS |
177 | .SEGBITS = 32, |
178 | .PABITS = 32, | |
3e4587d5 | 179 | .insn_flags = CPU_MIPS32R2 | ASE_MIPS16, |
6d35524c | 180 | .mmu_type = MMU_TYPE_FMT, |
3e4587d5 | 181 | }, |
34ee2ede TS |
182 | { |
183 | .name = "24Kc", | |
184 | .CP0_PRid = 0x00019300, | |
6d35524c | 185 | .CP0_Config0 = MIPS_CONFIG0 | (0x1 << CP0C0_AR) | |
6958549d | 186 | (MMU_TYPE_R4000 << CP0C0_MT), |
ae5d8053 | 187 | .CP0_Config1 = MIPS_CONFIG1 | (15 << CP0C1_MMU) | |
6958549d | 188 | (0 << CP0C1_IS) | (3 << CP0C1_IL) | (1 << CP0C1_IA) | |
d19954f4 NF |
189 | (0 << CP0C1_DS) | (3 << CP0C1_DL) | (1 << CP0C1_DA) | |
190 | (1 << CP0C1_CA), | |
3953d786 | 191 | .CP0_Config2 = MIPS_CONFIG2, |
ead9360e | 192 | .CP0_Config3 = MIPS_CONFIG3 | (0 << CP0C3_VInt), |
2a6e32dd AJ |
193 | .CP0_LLAddr_rw_bitmask = 0, |
194 | .CP0_LLAddr_shift = 4, | |
2f644545 TS |
195 | .SYNCI_Step = 32, |
196 | .CCRes = 2, | |
ead9360e | 197 | /* No DSP implemented. */ |
671880e6 | 198 | .CP0_Status_rw_bitmask = 0x1278FF1F, |
6d35524c TS |
199 | .SEGBITS = 32, |
200 | .PABITS = 32, | |
3e4587d5 | 201 | .insn_flags = CPU_MIPS32R2 | ASE_MIPS16, |
6d35524c | 202 | .mmu_type = MMU_TYPE_R4000, |
33d68b5f | 203 | }, |
e9deaad8 AD |
204 | { |
205 | .name = "24KEc", | |
206 | .CP0_PRid = 0x00019600, | |
207 | .CP0_Config0 = MIPS_CONFIG0 | (0x1 << CP0C0_AR) | | |
208 | (MMU_TYPE_R4000 << CP0C0_MT), | |
209 | .CP0_Config1 = MIPS_CONFIG1 | (15 << CP0C1_MMU) | | |
210 | (0 << CP0C1_IS) | (3 << CP0C1_IL) | (1 << CP0C1_IA) | | |
211 | (0 << CP0C1_DS) | (3 << CP0C1_DL) | (1 << CP0C1_DA) | | |
212 | (1 << CP0C1_CA), | |
213 | .CP0_Config2 = MIPS_CONFIG2, | |
214 | .CP0_Config3 = MIPS_CONFIG3 | (1 << CP0C3_DSPP) | (0 << CP0C3_VInt), | |
215 | .CP0_LLAddr_rw_bitmask = 0, | |
216 | .CP0_LLAddr_shift = 4, | |
217 | .SYNCI_Step = 32, | |
218 | .CCRes = 2, | |
219 | /* we have a DSP, but no FPU */ | |
220 | .CP0_Status_rw_bitmask = 0x1378FF1F, | |
221 | .SEGBITS = 32, | |
222 | .PABITS = 32, | |
223 | .insn_flags = CPU_MIPS32R2 | ASE_MIPS16 | ASE_DSP, | |
224 | .mmu_type = MMU_TYPE_R4000, | |
225 | }, | |
33d68b5f TS |
226 | { |
227 | .name = "24Kf", | |
228 | .CP0_PRid = 0x00019300, | |
6d35524c TS |
229 | .CP0_Config0 = MIPS_CONFIG0 | (0x1 << CP0C0_AR) | |
230 | (MMU_TYPE_R4000 << CP0C0_MT), | |
ae5d8053 | 231 | .CP0_Config1 = MIPS_CONFIG1 | (1 << CP0C1_FP) | (15 << CP0C1_MMU) | |
6958549d | 232 | (0 << CP0C1_IS) | (3 << CP0C1_IL) | (1 << CP0C1_IA) | |
d19954f4 NF |
233 | (0 << CP0C1_DS) | (3 << CP0C1_DL) | (1 << CP0C1_DA) | |
234 | (1 << CP0C1_CA), | |
3953d786 | 235 | .CP0_Config2 = MIPS_CONFIG2, |
ead9360e | 236 | .CP0_Config3 = MIPS_CONFIG3 | (0 << CP0C3_VInt), |
2a6e32dd AJ |
237 | .CP0_LLAddr_rw_bitmask = 0, |
238 | .CP0_LLAddr_shift = 4, | |
2f644545 TS |
239 | .SYNCI_Step = 32, |
240 | .CCRes = 2, | |
ead9360e | 241 | /* No DSP implemented. */ |
671880e6 | 242 | .CP0_Status_rw_bitmask = 0x3678FF1F, |
5a5012ec TS |
243 | .CP1_fcr0 = (1 << FCR0_F64) | (1 << FCR0_L) | (1 << FCR0_W) | |
244 | (1 << FCR0_D) | (1 << FCR0_S) | (0x93 << FCR0_PRID), | |
599bc5e8 AM |
245 | .CP1_fcr31 = 0, |
246 | .CP1_fcr31_rw_bitmask = 0xFF83FFFF, | |
6d35524c TS |
247 | .SEGBITS = 32, |
248 | .PABITS = 32, | |
3e4587d5 | 249 | .insn_flags = CPU_MIPS32R2 | ASE_MIPS16, |
6d35524c | 250 | .mmu_type = MMU_TYPE_R4000, |
33d68b5f | 251 | }, |
ead9360e TS |
252 | { |
253 | .name = "34Kf", | |
254 | .CP0_PRid = 0x00019500, | |
6d35524c | 255 | .CP0_Config0 = MIPS_CONFIG0 | (0x1 << CP0C0_AR) | |
6958549d | 256 | (MMU_TYPE_R4000 << CP0C0_MT), |
ead9360e | 257 | .CP0_Config1 = MIPS_CONFIG1 | (1 << CP0C1_FP) | (15 << CP0C1_MMU) | |
6958549d | 258 | (0 << CP0C1_IS) | (3 << CP0C1_IL) | (1 << CP0C1_IA) | |
d19954f4 NF |
259 | (0 << CP0C1_DS) | (3 << CP0C1_DL) | (1 << CP0C1_DA) | |
260 | (1 << CP0C1_CA), | |
ead9360e | 261 | .CP0_Config2 = MIPS_CONFIG2, |
b9ac5d92 YK |
262 | .CP0_Config3 = MIPS_CONFIG3 | (1 << CP0C3_VInt) | (1 << CP0C3_MT) | |
263 | (1 << CP0C3_DSPP), | |
2a6e32dd AJ |
264 | .CP0_LLAddr_rw_bitmask = 0, |
265 | .CP0_LLAddr_shift = 0, | |
ead9360e TS |
266 | .SYNCI_Step = 32, |
267 | .CCRes = 2, | |
b9ac5d92 | 268 | .CP0_Status_rw_bitmask = 0x3778FF1F, |
ead9360e TS |
269 | .CP0_TCStatus_rw_bitmask = (0 << CP0TCSt_TCU3) | (0 << CP0TCSt_TCU2) | |
270 | (1 << CP0TCSt_TCU1) | (1 << CP0TCSt_TCU0) | | |
271 | (0 << CP0TCSt_TMX) | (1 << CP0TCSt_DT) | | |
272 | (1 << CP0TCSt_DA) | (1 << CP0TCSt_A) | | |
273 | (0x3 << CP0TCSt_TKSU) | (1 << CP0TCSt_IXMT) | | |
274 | (0xff << CP0TCSt_TASID), | |
275 | .CP1_fcr0 = (1 << FCR0_F64) | (1 << FCR0_L) | (1 << FCR0_W) | | |
276 | (1 << FCR0_D) | (1 << FCR0_S) | (0x95 << FCR0_PRID), | |
599bc5e8 AM |
277 | .CP1_fcr31 = 0, |
278 | .CP1_fcr31_rw_bitmask = 0xFF83FFFF, | |
ead9360e TS |
279 | .CP0_SRSCtl = (0xf << CP0SRSCtl_HSS), |
280 | .CP0_SRSConf0_rw_bitmask = 0x3fffffff, | |
f45cb2f4 | 281 | .CP0_SRSConf0 = (1U << CP0SRSC0_M) | (0x3fe << CP0SRSC0_SRS3) | |
ead9360e TS |
282 | (0x3fe << CP0SRSC0_SRS2) | (0x3fe << CP0SRSC0_SRS1), |
283 | .CP0_SRSConf1_rw_bitmask = 0x3fffffff, | |
f45cb2f4 | 284 | .CP0_SRSConf1 = (1U << CP0SRSC1_M) | (0x3fe << CP0SRSC1_SRS6) | |
ead9360e TS |
285 | (0x3fe << CP0SRSC1_SRS5) | (0x3fe << CP0SRSC1_SRS4), |
286 | .CP0_SRSConf2_rw_bitmask = 0x3fffffff, | |
f45cb2f4 | 287 | .CP0_SRSConf2 = (1U << CP0SRSC2_M) | (0x3fe << CP0SRSC2_SRS9) | |
ead9360e TS |
288 | (0x3fe << CP0SRSC2_SRS8) | (0x3fe << CP0SRSC2_SRS7), |
289 | .CP0_SRSConf3_rw_bitmask = 0x3fffffff, | |
f45cb2f4 | 290 | .CP0_SRSConf3 = (1U << CP0SRSC3_M) | (0x3fe << CP0SRSC3_SRS12) | |
ead9360e TS |
291 | (0x3fe << CP0SRSC3_SRS11) | (0x3fe << CP0SRSC3_SRS10), |
292 | .CP0_SRSConf4_rw_bitmask = 0x3fffffff, | |
293 | .CP0_SRSConf4 = (0x3fe << CP0SRSC4_SRS15) | | |
294 | (0x3fe << CP0SRSC4_SRS14) | (0x3fe << CP0SRSC4_SRS13), | |
6d35524c TS |
295 | .SEGBITS = 32, |
296 | .PABITS = 32, | |
7385ac0b | 297 | .insn_flags = CPU_MIPS32R2 | ASE_MIPS16 | ASE_DSP | ASE_MT, |
6d35524c | 298 | .mmu_type = MMU_TYPE_R4000, |
ead9360e | 299 | }, |
af13ae03 JL |
300 | { |
301 | .name = "74Kf", | |
302 | .CP0_PRid = 0x00019700, | |
303 | .CP0_Config0 = MIPS_CONFIG0 | (0x1 << CP0C0_AR) | | |
304 | (MMU_TYPE_R4000 << CP0C0_MT), | |
305 | .CP0_Config1 = MIPS_CONFIG1 | (1 << CP0C1_FP) | (15 << CP0C1_MMU) | | |
306 | (0 << CP0C1_IS) | (3 << CP0C1_IL) | (1 << CP0C1_IA) | | |
307 | (0 << CP0C1_DS) | (3 << CP0C1_DL) | (1 << CP0C1_DA) | | |
308 | (1 << CP0C1_CA), | |
309 | .CP0_Config2 = MIPS_CONFIG2, | |
e30614d5 | 310 | .CP0_Config3 = MIPS_CONFIG3 | (1 << CP0C3_DSP2P) | (1 << CP0C3_DSPP) | |
4386f087 | 311 | (1 << CP0C3_VInt), |
af13ae03 JL |
312 | .CP0_LLAddr_rw_bitmask = 0, |
313 | .CP0_LLAddr_shift = 4, | |
314 | .SYNCI_Step = 32, | |
315 | .CCRes = 2, | |
316 | .CP0_Status_rw_bitmask = 0x3778FF1F, | |
317 | .CP1_fcr0 = (1 << FCR0_F64) | (1 << FCR0_L) | (1 << FCR0_W) | | |
318 | (1 << FCR0_D) | (1 << FCR0_S) | (0x93 << FCR0_PRID), | |
599bc5e8 AM |
319 | .CP1_fcr31 = 0, |
320 | .CP1_fcr31_rw_bitmask = 0xFF83FFFF, | |
af13ae03 JL |
321 | .SEGBITS = 32, |
322 | .PABITS = 32, | |
908f6be1 | 323 | .insn_flags = CPU_MIPS32R2 | ASE_MIPS16 | ASE_DSP | ASE_DSP_R2, |
af13ae03 JL |
324 | .mmu_type = MMU_TYPE_R4000, |
325 | }, | |
11f5ea10 MR |
326 | { |
327 | .name = "M14K", | |
328 | .CP0_PRid = 0x00019b00, | |
329 | /* Config1 implemented, fixed mapping MMU, | |
330 | no virtual icache, uncached coherency. */ | |
331 | .CP0_Config0 = MIPS_CONFIG0 | (0x2 << CP0C0_KU) | (0x2 << CP0C0_K23) | | |
332 | (0x1 << CP0C0_AR) | (MMU_TYPE_FMT << CP0C0_MT), | |
333 | .CP0_Config1 = MIPS_CONFIG1, | |
334 | .CP0_Config2 = MIPS_CONFIG2, | |
335 | .CP0_Config3 = MIPS_CONFIG3 | (0x2 << CP0C3_ISA) | (1 << CP0C3_VInt), | |
336 | .CP0_LLAddr_rw_bitmask = 0, | |
337 | .CP0_LLAddr_shift = 4, | |
338 | .SYNCI_Step = 32, | |
339 | .CCRes = 2, | |
340 | .CP0_Status_rw_bitmask = 0x1258FF17, | |
341 | .SEGBITS = 32, | |
342 | .PABITS = 32, | |
343 | .insn_flags = CPU_MIPS32R2 | ASE_MICROMIPS, | |
344 | .mmu_type = MMU_TYPE_FMT, | |
345 | }, | |
346 | { | |
347 | .name = "M14Kc", | |
348 | /* This is the TLB-based MMU core. */ | |
349 | .CP0_PRid = 0x00019c00, | |
350 | .CP0_Config0 = MIPS_CONFIG0 | (0x1 << CP0C0_AR) | | |
351 | (MMU_TYPE_R4000 << CP0C0_MT), | |
352 | .CP0_Config1 = MIPS_CONFIG1 | (15 << CP0C1_MMU) | | |
353 | (0 << CP0C1_IS) | (3 << CP0C1_IL) | (1 << CP0C1_IA) | | |
354 | (0 << CP0C1_DS) | (3 << CP0C1_DL) | (1 << CP0C1_DA), | |
355 | .CP0_Config2 = MIPS_CONFIG2, | |
356 | .CP0_Config3 = MIPS_CONFIG3 | (0x2 << CP0C3_ISA) | (0 << CP0C3_VInt), | |
357 | .CP0_LLAddr_rw_bitmask = 0, | |
358 | .CP0_LLAddr_shift = 4, | |
359 | .SYNCI_Step = 32, | |
360 | .CCRes = 2, | |
361 | .CP0_Status_rw_bitmask = 0x1278FF17, | |
362 | .SEGBITS = 32, | |
363 | .PABITS = 32, | |
364 | .insn_flags = CPU_MIPS32R2 | ASE_MICROMIPS, | |
365 | .mmu_type = MMU_TYPE_R4000, | |
366 | }, | |
e527526d | 367 | { |
aff2bc6d | 368 | /* FIXME: |
574da58e | 369 | * Config3: CMGCR, PW, VZ, CTXTC, CDMM, TL |
aff2bc6d | 370 | * Config4: MMUExtDef |
574da58e | 371 | * Config5: MRP |
aff2bc6d YK |
372 | * FIR(FCR0): Has2008 |
373 | * */ | |
374 | .name = "P5600", | |
375 | .CP0_PRid = 0x0001A800, | |
376 | .CP0_Config0 = MIPS_CONFIG0 | (1 << CP0C0_MM) | (1 << CP0C0_AR) | | |
e527526d | 377 | (MMU_TYPE_R4000 << CP0C0_MT), |
aff2bc6d YK |
378 | .CP0_Config1 = MIPS_CONFIG1 | (0x3F << CP0C1_MMU) | |
379 | (2 << CP0C1_IS) | (4 << CP0C1_IL) | (3 << CP0C1_IA) | | |
380 | (2 << CP0C1_DS) | (4 << CP0C1_DL) | (3 << CP0C1_DA) | | |
381 | (1 << CP0C1_PC) | (1 << CP0C1_FP), | |
e527526d | 382 | .CP0_Config2 = MIPS_CONFIG2, |
6773f9b6 | 383 | .CP0_Config3 = MIPS_CONFIG3 | (1U << CP0C3_M) | (1 << CP0C3_MSAP) | |
574da58e JH |
384 | (1 << CP0C3_BP) | (1 << CP0C3_BI) | (1 << CP0C3_SC) | |
385 | (1 << CP0C3_ULRI) | (1 << CP0C3_RXI) | (1 << CP0C3_LPA) | | |
386 | (1 << CP0C3_VInt), | |
aff2bc6d YK |
387 | .CP0_Config4 = MIPS_CONFIG4 | (1U << CP0C4_M) | (2 << CP0C4_IE) | |
388 | (0x1c << CP0C4_KScrExist), | |
b4160af1 | 389 | .CP0_Config4_rw_bitmask = 0, |
574da58e JH |
390 | .CP0_Config5 = MIPS_CONFIG5 | (1 << CP0C5_EVA) | (1 << CP0C5_MVH) | |
391 | (1 << CP0C5_LLB) | (1 << CP0C5_MRP), | |
aff2bc6d YK |
392 | .CP0_Config5_rw_bitmask = (1 << CP0C5_K) | (1 << CP0C5_CV) | |
393 | (1 << CP0C5_MSAEn) | (1 << CP0C5_UFE) | | |
394 | (1 << CP0C5_FRE) | (1 << CP0C5_UFR), | |
e527526d | 395 | .CP0_LLAddr_rw_bitmask = 0, |
aff2bc6d | 396 | .CP0_LLAddr_shift = 0, |
e527526d PJ |
397 | .SYNCI_Step = 32, |
398 | .CCRes = 2, | |
aff2bc6d YK |
399 | .CP0_Status_rw_bitmask = 0x3C68FF1F, |
400 | .CP0_PageGrain_rw_bitmask = (1U << CP0PG_RIE) | (1 << CP0PG_XIE) | | |
401 | (1 << CP0PG_ELPA) | (1 << CP0PG_IEC), | |
574da58e | 402 | .CP0_EBaseWG_rw_bitmask = (1 << CP0EBase_WG), |
ba5c79f2 LA |
403 | .CP1_fcr0 = (1 << FCR0_FREP) | (1 << FCR0_UFRP) | (1 << FCR0_HAS2008) | |
404 | (1 << FCR0_F64) | (1 << FCR0_L) | (1 << FCR0_W) | | |
405 | (1 << FCR0_D) | (1 << FCR0_S) | (0x03 << FCR0_PRID), | |
406 | .CP1_fcr31 = (1 << FCR31_ABS2008) | (1 << FCR31_NAN2008), | |
599bc5e8 | 407 | .CP1_fcr31_rw_bitmask = 0xFF83FFFF, |
e527526d | 408 | .SEGBITS = 32, |
6773f9b6 | 409 | .PABITS = 40, |
aff2bc6d | 410 | .insn_flags = CPU_MIPS32R5 | ASE_MSA, |
e527526d PJ |
411 | .mmu_type = MMU_TYPE_R4000, |
412 | }, | |
4b3bcd01 YK |
413 | { |
414 | /* A generic CPU supporting MIPS32 Release 6 ISA. | |
415 | FIXME: Support IEEE 754-2008 FP. | |
416 | Eventually this should be replaced by a real CPU model. */ | |
417 | .name = "mips32r6-generic", | |
418 | .CP0_PRid = 0x00010000, | |
419 | .CP0_Config0 = MIPS_CONFIG0 | (0x2 << CP0C0_AR) | | |
420 | (MMU_TYPE_R4000 << CP0C0_MT), | |
421 | .CP0_Config1 = MIPS_CONFIG1 | (1 << CP0C1_FP) | (31 << CP0C1_MMU) | | |
422 | (2 << CP0C1_IS) | (4 << CP0C1_IL) | (3 << CP0C1_IA) | | |
423 | (2 << CP0C1_DS) | (4 << CP0C1_DL) | (3 << CP0C1_DA) | | |
424 | (0 << CP0C1_PC) | (1 << CP0C1_WR) | (1 << CP0C1_EP), | |
425 | .CP0_Config2 = MIPS_CONFIG2, | |
426 | .CP0_Config3 = MIPS_CONFIG3 | (1 << CP0C3_BP) | (1 << CP0C3_BI) | | |
427 | (2 << CP0C3_ISA) | (1 << CP0C3_ULRI) | | |
428 | (1 << CP0C3_RXI) | (1U << CP0C3_M), | |
429 | .CP0_Config4 = MIPS_CONFIG4 | (0xfc << CP0C4_KScrExist) | | |
430 | (3 << CP0C4_IE) | (1U << CP0C4_M), | |
35ac9e34 | 431 | .CP0_Config5 = MIPS_CONFIG5 | (1 << CP0C5_XNP) | (1 << CP0C5_LLB), |
4b3bcd01 YK |
432 | .CP0_Config5_rw_bitmask = (1 << CP0C5_SBRI) | (1 << CP0C5_FRE) | |
433 | (1 << CP0C5_UFE), | |
434 | .CP0_LLAddr_rw_bitmask = 0, | |
435 | .CP0_LLAddr_shift = 0, | |
436 | .SYNCI_Step = 32, | |
437 | .CCRes = 2, | |
438 | .CP0_Status_rw_bitmask = 0x3058FF1F, | |
439 | .CP0_PageGrain = (1 << CP0PG_IEC) | (1 << CP0PG_XIE) | | |
440 | (1U << CP0PG_RIE), | |
441 | .CP0_PageGrain_rw_bitmask = 0, | |
ba5c79f2 LA |
442 | .CP1_fcr0 = (1 << FCR0_FREP) | (1 << FCR0_HAS2008) | (1 << FCR0_F64) | |
443 | (1 << FCR0_L) | (1 << FCR0_W) | (1 << FCR0_D) | | |
444 | (1 << FCR0_S) | (0x00 << FCR0_PRID) | (0x0 << FCR0_REV), | |
445 | .CP1_fcr31 = (1 << FCR31_ABS2008) | (1 << FCR31_NAN2008), | |
599bc5e8 | 446 | .CP1_fcr31_rw_bitmask = 0x0103FFFF, |
4b3bcd01 YK |
447 | .SEGBITS = 32, |
448 | .PABITS = 32, | |
449 | .insn_flags = CPU_MIPS32R6 | ASE_MICROMIPS, | |
450 | .mmu_type = MMU_TYPE_R4000, | |
451 | }, | |
d45942d9 SM |
452 | { |
453 | .name = "I7200", | |
454 | .CP0_PRid = 0x00010000, | |
455 | .CP0_Config0 = MIPS_CONFIG0 | (1 << CP0C0_MM) | (0x2 << CP0C0_AR) | | |
456 | (MMU_TYPE_R4000 << CP0C0_MT), | |
457 | .CP0_Config1 = (1U << CP0C1_M) | (15 << CP0C1_MMU) | (2 << CP0C1_IS) | | |
458 | (4 << CP0C1_IL) | (3 << CP0C1_IA) | (2 << CP0C1_DS) | | |
459 | (4 << CP0C1_DL) | (3 << CP0C1_DA) | (1 << CP0C1_PC) | | |
460 | (1 << CP0C1_EP), | |
461 | .CP0_Config2 = MIPS_CONFIG2, | |
462 | .CP0_Config3 = MIPS_CONFIG3 | (1U << CP0C3_M) | (1 << CP0C3_CMGCR) | | |
463 | (1 << CP0C3_BI) | (1 << CP0C3_SC) | (3 << CP0C3_MMAR) | | |
464 | (1 << CP0C3_ISA_ON_EXC) | (1 << CP0C3_ISA) | | |
465 | (1 << CP0C3_ULRI) | (1 << CP0C3_RXI) | | |
466 | (1 << CP0C3_DSP2P) | (1 << CP0C3_DSPP) | | |
467 | (1 << CP0C3_CTXTC) | (1 << CP0C3_VInt) | | |
468 | (1 << CP0C3_CDMM) | (1 << CP0C3_MT) | (1 << CP0C3_TL), | |
469 | .CP0_Config4 = MIPS_CONFIG4 | (0xfc << CP0C4_KScrExist) | | |
470 | (2 << CP0C4_IE) | (1U << CP0C4_M), | |
471 | .CP0_Config5 = MIPS_CONFIG5 | (1 << CP0C5_MVH) | (1 << CP0C5_LLB), | |
472 | .CP0_Config5_rw_bitmask = (1 << CP0C5_SBRI) | (1 << CP0C5_FRE) | | |
473 | (1 << CP0C5_UFE), | |
474 | .CP0_LLAddr_rw_bitmask = 0, | |
475 | .CP0_LLAddr_shift = 0, | |
476 | .SYNCI_Step = 32, | |
477 | .CCRes = 2, | |
478 | .CP0_Status_rw_bitmask = 0x3158FF1F, | |
479 | .CP0_PageGrain = (1 << CP0PG_IEC) | (1 << CP0PG_XIE) | | |
480 | (1U << CP0PG_RIE), | |
481 | .CP0_PageGrain_rw_bitmask = 0, | |
482 | .CP1_fcr0 = (1 << FCR0_FREP) | (1 << FCR0_HAS2008) | (1 << FCR0_F64) | | |
483 | (1 << FCR0_L) | (1 << FCR0_W) | (1 << FCR0_D) | | |
484 | (1 << FCR0_S) | (0x02 << FCR0_PRID) | (0x0 << FCR0_REV), | |
485 | .CP1_fcr31 = (1 << FCR31_ABS2008) | (1 << FCR31_NAN2008), | |
486 | .SEGBITS = 32, | |
487 | .PABITS = 32, | |
908f6be1 | 488 | .insn_flags = CPU_NANOMIPS32 | ASE_DSP | ASE_DSP_R2 | ASE_DSP_R3 | |
59e781fb | 489 | ASE_MT, |
d45942d9 SM |
490 | .mmu_type = MMU_TYPE_R4000, |
491 | }, | |
d26bc211 | 492 | #if defined(TARGET_MIPS64) |
33d68b5f TS |
493 | { |
494 | .name = "R4000", | |
495 | .CP0_PRid = 0x00000400, | |
6d35524c TS |
496 | /* No L2 cache, icache size 8k, dcache size 8k, uncached coherency. */ |
497 | .CP0_Config0 = (1 << 17) | (0x1 << 9) | (0x1 << 6) | (0x2 << CP0C0_K0), | |
6958549d | 498 | /* Note: Config1 is only used internally, the R4000 has only Config0. */ |
6d35524c | 499 | .CP0_Config1 = (1 << CP0C1_FP) | (47 << CP0C1_MMU), |
2a6e32dd AJ |
500 | .CP0_LLAddr_rw_bitmask = 0xFFFFFFFF, |
501 | .CP0_LLAddr_shift = 4, | |
2f644545 TS |
502 | .SYNCI_Step = 16, |
503 | .CCRes = 2, | |
ead9360e | 504 | .CP0_Status_rw_bitmask = 0x3678FFFF, |
6958549d | 505 | /* The R4000 has a full 64bit FPU but doesn't use the fcr0 bits. */ |
c9c1a064 | 506 | .CP1_fcr0 = (0x5 << FCR0_PRID) | (0x0 << FCR0_REV), |
599bc5e8 AM |
507 | .CP1_fcr31 = 0, |
508 | .CP1_fcr31_rw_bitmask = 0x0183FFFF, | |
e034e2c3 | 509 | .SEGBITS = 40, |
6d35524c | 510 | .PABITS = 36, |
e189e748 | 511 | .insn_flags = CPU_MIPS3, |
6d35524c | 512 | .mmu_type = MMU_TYPE_R4000, |
c9c1a064 | 513 | }, |
e9c71dd1 TS |
514 | { |
515 | .name = "VR5432", | |
516 | .CP0_PRid = 0x00005400, | |
517 | /* No L2 cache, icache size 8k, dcache size 8k, uncached coherency. */ | |
518 | .CP0_Config0 = (1 << 17) | (0x1 << 9) | (0x1 << 6) | (0x2 << CP0C0_K0), | |
519 | .CP0_Config1 = (1 << CP0C1_FP) | (47 << CP0C1_MMU), | |
2a6e32dd AJ |
520 | .CP0_LLAddr_rw_bitmask = 0xFFFFFFFFL, |
521 | .CP0_LLAddr_shift = 4, | |
e9c71dd1 TS |
522 | .SYNCI_Step = 16, |
523 | .CCRes = 2, | |
524 | .CP0_Status_rw_bitmask = 0x3678FFFF, | |
525 | /* The VR5432 has a full 64bit FPU but doesn't use the fcr0 bits. */ | |
526 | .CP1_fcr0 = (0x54 << FCR0_PRID) | (0x0 << FCR0_REV), | |
599bc5e8 AM |
527 | .CP1_fcr31 = 0, |
528 | .CP1_fcr31_rw_bitmask = 0xFF83FFFF, | |
e9c71dd1 TS |
529 | .SEGBITS = 40, |
530 | .PABITS = 32, | |
531 | .insn_flags = CPU_VR54XX, | |
532 | .mmu_type = MMU_TYPE_R4000, | |
533 | }, | |
c9c1a064 TS |
534 | { |
535 | .name = "5Kc", | |
536 | .CP0_PRid = 0x00018100, | |
29fe0e34 | 537 | .CP0_Config0 = MIPS_CONFIG0 | (0x2 << CP0C0_AT) | |
6958549d | 538 | (MMU_TYPE_R4000 << CP0C0_MT), |
c9c1a064 | 539 | .CP0_Config1 = MIPS_CONFIG1 | (31 << CP0C1_MMU) | |
6958549d AJ |
540 | (1 << CP0C1_IS) | (4 << CP0C1_IL) | (1 << CP0C1_IA) | |
541 | (1 << CP0C1_DS) | (4 << CP0C1_DL) | (1 << CP0C1_DA) | | |
542 | (1 << CP0C1_PC) | (1 << CP0C1_WR) | (1 << CP0C1_EP), | |
c9c1a064 TS |
543 | .CP0_Config2 = MIPS_CONFIG2, |
544 | .CP0_Config3 = MIPS_CONFIG3, | |
2a6e32dd AJ |
545 | .CP0_LLAddr_rw_bitmask = 0, |
546 | .CP0_LLAddr_shift = 4, | |
c9c1a064 TS |
547 | .SYNCI_Step = 32, |
548 | .CCRes = 2, | |
196a7958 | 549 | .CP0_Status_rw_bitmask = 0x12F8FFFF, |
e034e2c3 | 550 | .SEGBITS = 42, |
6d35524c | 551 | .PABITS = 36, |
e189e748 | 552 | .insn_flags = CPU_MIPS64, |
6d35524c | 553 | .mmu_type = MMU_TYPE_R4000, |
c9c1a064 TS |
554 | }, |
555 | { | |
556 | .name = "5Kf", | |
557 | .CP0_PRid = 0x00018100, | |
29fe0e34 | 558 | .CP0_Config0 = MIPS_CONFIG0 | (0x2 << CP0C0_AT) | |
6958549d | 559 | (MMU_TYPE_R4000 << CP0C0_MT), |
c9c1a064 | 560 | .CP0_Config1 = MIPS_CONFIG1 | (1 << CP0C1_FP) | (31 << CP0C1_MMU) | |
6958549d AJ |
561 | (1 << CP0C1_IS) | (4 << CP0C1_IL) | (1 << CP0C1_IA) | |
562 | (1 << CP0C1_DS) | (4 << CP0C1_DL) | (1 << CP0C1_DA) | | |
563 | (1 << CP0C1_PC) | (1 << CP0C1_WR) | (1 << CP0C1_EP), | |
c9c1a064 TS |
564 | .CP0_Config2 = MIPS_CONFIG2, |
565 | .CP0_Config3 = MIPS_CONFIG3, | |
2a6e32dd AJ |
566 | .CP0_LLAddr_rw_bitmask = 0, |
567 | .CP0_LLAddr_shift = 4, | |
c9c1a064 TS |
568 | .SYNCI_Step = 32, |
569 | .CCRes = 2, | |
ead9360e | 570 | .CP0_Status_rw_bitmask = 0x36F8FFFF, |
6958549d | 571 | /* The 5Kf has F64 / L / W but doesn't use the fcr0 bits. */ |
c9c1a064 TS |
572 | .CP1_fcr0 = (1 << FCR0_D) | (1 << FCR0_S) | |
573 | (0x81 << FCR0_PRID) | (0x0 << FCR0_REV), | |
599bc5e8 AM |
574 | .CP1_fcr31 = 0, |
575 | .CP1_fcr31_rw_bitmask = 0xFF83FFFF, | |
e034e2c3 | 576 | .SEGBITS = 42, |
6d35524c | 577 | .PABITS = 36, |
e189e748 | 578 | .insn_flags = CPU_MIPS64, |
6d35524c | 579 | .mmu_type = MMU_TYPE_R4000, |
c9c1a064 TS |
580 | }, |
581 | { | |
582 | .name = "20Kc", | |
6958549d | 583 | /* We emulate a later version of the 20Kc, earlier ones had a broken |
bd04c6fe TS |
584 | WAIT instruction. */ |
585 | .CP0_PRid = 0x000182a0, | |
29fe0e34 | 586 | .CP0_Config0 = MIPS_CONFIG0 | (0x2 << CP0C0_AT) | |
6d35524c | 587 | (MMU_TYPE_R4000 << CP0C0_MT) | (1 << CP0C0_VI), |
c9c1a064 | 588 | .CP0_Config1 = MIPS_CONFIG1 | (1 << CP0C1_FP) | (47 << CP0C1_MMU) | |
6958549d AJ |
589 | (2 << CP0C1_IS) | (4 << CP0C1_IL) | (3 << CP0C1_IA) | |
590 | (2 << CP0C1_DS) | (4 << CP0C1_DL) | (3 << CP0C1_DA) | | |
591 | (1 << CP0C1_PC) | (1 << CP0C1_WR) | (1 << CP0C1_EP), | |
c9c1a064 TS |
592 | .CP0_Config2 = MIPS_CONFIG2, |
593 | .CP0_Config3 = MIPS_CONFIG3, | |
2a6e32dd AJ |
594 | .CP0_LLAddr_rw_bitmask = 0, |
595 | .CP0_LLAddr_shift = 0, | |
c9c1a064 | 596 | .SYNCI_Step = 32, |
a1daafd8 | 597 | .CCRes = 1, |
ead9360e | 598 | .CP0_Status_rw_bitmask = 0x36FBFFFF, |
6958549d | 599 | /* The 20Kc has F64 / L / W but doesn't use the fcr0 bits. */ |
c9c1a064 | 600 | .CP1_fcr0 = (1 << FCR0_3D) | (1 << FCR0_PS) | |
5a5012ec | 601 | (1 << FCR0_D) | (1 << FCR0_S) | |
c9c1a064 | 602 | (0x82 << FCR0_PRID) | (0x0 << FCR0_REV), |
599bc5e8 AM |
603 | .CP1_fcr31 = 0, |
604 | .CP1_fcr31_rw_bitmask = 0xFF83FFFF, | |
e034e2c3 | 605 | .SEGBITS = 40, |
6d35524c | 606 | .PABITS = 36, |
e189e748 | 607 | .insn_flags = CPU_MIPS64 | ASE_MIPS3D, |
6d35524c | 608 | .mmu_type = MMU_TYPE_R4000, |
33d68b5f | 609 | }, |
d2123ead | 610 | { |
6958549d | 611 | /* A generic CPU providing MIPS64 Release 2 features. |
d2123ead TS |
612 | FIXME: Eventually this should be replaced by a real CPU model. */ |
613 | .name = "MIPS64R2-generic", | |
8c89395e | 614 | .CP0_PRid = 0x00010000, |
6d35524c | 615 | .CP0_Config0 = MIPS_CONFIG0 | (0x1 << CP0C0_AR) | (0x2 << CP0C0_AT) | |
6958549d | 616 | (MMU_TYPE_R4000 << CP0C0_MT), |
d2123ead | 617 | .CP0_Config1 = MIPS_CONFIG1 | (1 << CP0C1_FP) | (63 << CP0C1_MMU) | |
6958549d AJ |
618 | (2 << CP0C1_IS) | (4 << CP0C1_IL) | (3 << CP0C1_IA) | |
619 | (2 << CP0C1_DS) | (4 << CP0C1_DL) | (3 << CP0C1_DA) | | |
620 | (1 << CP0C1_PC) | (1 << CP0C1_WR) | (1 << CP0C1_EP), | |
d2123ead | 621 | .CP0_Config2 = MIPS_CONFIG2, |
6d35524c | 622 | .CP0_Config3 = MIPS_CONFIG3 | (1 << CP0C3_LPA), |
2a6e32dd AJ |
623 | .CP0_LLAddr_rw_bitmask = 0, |
624 | .CP0_LLAddr_shift = 0, | |
d2123ead TS |
625 | .SYNCI_Step = 32, |
626 | .CCRes = 2, | |
627 | .CP0_Status_rw_bitmask = 0x36FBFFFF, | |
bad63a80 | 628 | .CP0_EBaseWG_rw_bitmask = (1 << CP0EBase_WG), |
ea4b07f7 TS |
629 | .CP1_fcr0 = (1 << FCR0_F64) | (1 << FCR0_3D) | (1 << FCR0_PS) | |
630 | (1 << FCR0_L) | (1 << FCR0_W) | (1 << FCR0_D) | | |
631 | (1 << FCR0_S) | (0x00 << FCR0_PRID) | (0x0 << FCR0_REV), | |
599bc5e8 AM |
632 | .CP1_fcr31 = 0, |
633 | .CP1_fcr31_rw_bitmask = 0xFF83FFFF, | |
6d35524c | 634 | .SEGBITS = 42, |
6d35524c | 635 | .PABITS = 36, |
d2123ead | 636 | .insn_flags = CPU_MIPS64R2 | ASE_MIPS3D, |
6d35524c | 637 | .mmu_type = MMU_TYPE_R4000, |
d2123ead | 638 | }, |
36b86e0d MR |
639 | { |
640 | .name = "5KEc", | |
641 | .CP0_PRid = 0x00018900, | |
642 | .CP0_Config0 = MIPS_CONFIG0 | (0x1 << CP0C0_AR) | (0x2 << CP0C0_AT) | | |
643 | (MMU_TYPE_R4000 << CP0C0_MT), | |
644 | .CP0_Config1 = MIPS_CONFIG1 | (31 << CP0C1_MMU) | | |
645 | (1 << CP0C1_IS) | (4 << CP0C1_IL) | (1 << CP0C1_IA) | | |
646 | (1 << CP0C1_DS) | (4 << CP0C1_DL) | (1 << CP0C1_DA) | | |
647 | (1 << CP0C1_PC) | (1 << CP0C1_WR) | (1 << CP0C1_EP), | |
648 | .CP0_Config2 = MIPS_CONFIG2, | |
649 | .CP0_Config3 = MIPS_CONFIG3, | |
650 | .CP0_LLAddr_rw_bitmask = 0, | |
651 | .CP0_LLAddr_shift = 4, | |
652 | .SYNCI_Step = 32, | |
653 | .CCRes = 2, | |
196a7958 | 654 | .CP0_Status_rw_bitmask = 0x12F8FFFF, |
36b86e0d MR |
655 | .SEGBITS = 42, |
656 | .PABITS = 36, | |
657 | .insn_flags = CPU_MIPS64R2, | |
658 | .mmu_type = MMU_TYPE_R4000, | |
659 | }, | |
660 | { | |
661 | .name = "5KEf", | |
662 | .CP0_PRid = 0x00018900, | |
663 | .CP0_Config0 = MIPS_CONFIG0 | (0x1 << CP0C0_AR) | (0x2 << CP0C0_AT) | | |
664 | (MMU_TYPE_R4000 << CP0C0_MT), | |
665 | .CP0_Config1 = MIPS_CONFIG1 | (1 << CP0C1_FP) | (31 << CP0C1_MMU) | | |
666 | (1 << CP0C1_IS) | (4 << CP0C1_IL) | (1 << CP0C1_IA) | | |
667 | (1 << CP0C1_DS) | (4 << CP0C1_DL) | (1 << CP0C1_DA) | | |
668 | (1 << CP0C1_PC) | (1 << CP0C1_WR) | (1 << CP0C1_EP), | |
669 | .CP0_Config2 = MIPS_CONFIG2, | |
670 | .CP0_Config3 = MIPS_CONFIG3, | |
671 | .CP0_LLAddr_rw_bitmask = 0, | |
672 | .CP0_LLAddr_shift = 4, | |
673 | .SYNCI_Step = 32, | |
674 | .CCRes = 2, | |
675 | .CP0_Status_rw_bitmask = 0x36F8FFFF, | |
676 | .CP1_fcr0 = (1 << FCR0_F64) | (1 << FCR0_L) | (1 << FCR0_W) | | |
677 | (1 << FCR0_D) | (1 << FCR0_S) | | |
678 | (0x89 << FCR0_PRID) | (0x0 << FCR0_REV), | |
679 | .SEGBITS = 42, | |
680 | .PABITS = 36, | |
681 | .insn_flags = CPU_MIPS64R2, | |
682 | .mmu_type = MMU_TYPE_R4000, | |
683 | }, | |
a773cc79 | 684 | { |
8f95ad1c LA |
685 | .name = "I6400", |
686 | .CP0_PRid = 0x1A900, | |
a773cc79 LA |
687 | .CP0_Config0 = MIPS_CONFIG0 | (0x2 << CP0C0_AR) | (0x2 << CP0C0_AT) | |
688 | (MMU_TYPE_R4000 << CP0C0_MT), | |
8f95ad1c LA |
689 | .CP0_Config1 = MIPS_CONFIG1 | (1 << CP0C1_FP) | (15 << CP0C1_MMU) | |
690 | (2 << CP0C1_IS) | (5 << CP0C1_IL) | (3 << CP0C1_IA) | | |
691 | (2 << CP0C1_DS) | (5 << CP0C1_DL) | (3 << CP0C1_DA) | | |
a773cc79 LA |
692 | (0 << CP0C1_PC) | (1 << CP0C1_WR) | (1 << CP0C1_EP), |
693 | .CP0_Config2 = MIPS_CONFIG2, | |
a9a95061 LA |
694 | .CP0_Config3 = MIPS_CONFIG3 | (1U << CP0C3_M) | |
695 | (1 << CP0C3_CMGCR) | (1 << CP0C3_MSAP) | | |
4dc89b78 | 696 | (1 << CP0C3_BP) | (1 << CP0C3_BI) | (1 << CP0C3_ULRI) | |
8f95ad1c | 697 | (1 << CP0C3_RXI) | (1 << CP0C3_LPA) | (1 << CP0C3_VInt), |
4dc89b78 | 698 | .CP0_Config4 = MIPS_CONFIG4 | (1U << CP0C4_M) | (3 << CP0C4_IE) | |
cdc46fab | 699 | (1 << CP0C4_AE) | (0xfc << CP0C4_KScrExist), |
01bc435b | 700 | .CP0_Config5 = MIPS_CONFIG5 | (1 << CP0C5_XNP) | (1 << CP0C5_VP) | |
8f95ad1c | 701 | (1 << CP0C5_LLB) | (1 << CP0C5_MRP), |
4dc89b78 YK |
702 | .CP0_Config5_rw_bitmask = (1 << CP0C5_MSAEn) | (1 << CP0C5_SBRI) | |
703 | (1 << CP0C5_FRE) | (1 << CP0C5_UFE), | |
a773cc79 LA |
704 | .CP0_LLAddr_rw_bitmask = 0, |
705 | .CP0_LLAddr_shift = 0, | |
706 | .SYNCI_Step = 32, | |
707 | .CCRes = 2, | |
708 | .CP0_Status_rw_bitmask = 0x30D8FFFF, | |
2d9e48bc LA |
709 | .CP0_PageGrain = (1 << CP0PG_IEC) | (1 << CP0PG_XIE) | |
710 | (1U << CP0PG_RIE), | |
6773f9b6 | 711 | .CP0_PageGrain_rw_bitmask = (1 << CP0PG_ELPA), |
bad63a80 | 712 | .CP0_EBaseWG_rw_bitmask = (1 << CP0EBase_WG), |
ba5c79f2 LA |
713 | .CP1_fcr0 = (1 << FCR0_FREP) | (1 << FCR0_HAS2008) | (1 << FCR0_F64) | |
714 | (1 << FCR0_L) | (1 << FCR0_W) | (1 << FCR0_D) | | |
8f95ad1c | 715 | (1 << FCR0_S) | (0x03 << FCR0_PRID) | (0x0 << FCR0_REV), |
ba5c79f2 | 716 | .CP1_fcr31 = (1 << FCR31_ABS2008) | (1 << FCR31_NAN2008), |
599bc5e8 | 717 | .CP1_fcr31_rw_bitmask = 0x0103FFFF, |
8f95ad1c | 718 | .MSAIR = 0x03 << MSAIR_ProcID, |
4dc89b78 | 719 | .SEGBITS = 48, |
6773f9b6 | 720 | .PABITS = 48, |
4dc89b78 | 721 | .insn_flags = CPU_MIPS64R6 | ASE_MSA, |
a773cc79 LA |
722 | .mmu_type = MMU_TYPE_R4000, |
723 | }, | |
ca1ffd14 YK |
724 | { |
725 | .name = "I6500", | |
726 | .CP0_PRid = 0x1B000, | |
727 | .CP0_Config0 = MIPS_CONFIG0 | (0x2 << CP0C0_AR) | (0x2 << CP0C0_AT) | | |
728 | (MMU_TYPE_R4000 << CP0C0_MT), | |
729 | .CP0_Config1 = MIPS_CONFIG1 | (1 << CP0C1_FP) | (15 << CP0C1_MMU) | | |
730 | (2 << CP0C1_IS) | (5 << CP0C1_IL) | (3 << CP0C1_IA) | | |
731 | (2 << CP0C1_DS) | (5 << CP0C1_DL) | (3 << CP0C1_DA) | | |
732 | (0 << CP0C1_PC) | (1 << CP0C1_WR) | (1 << CP0C1_EP), | |
733 | .CP0_Config2 = MIPS_CONFIG2, | |
734 | .CP0_Config3 = MIPS_CONFIG3 | (1U << CP0C3_M) | | |
735 | (1 << CP0C3_CMGCR) | (1 << CP0C3_MSAP) | | |
736 | (1 << CP0C3_BP) | (1 << CP0C3_BI) | (1 << CP0C3_ULRI) | | |
737 | (1 << CP0C3_RXI) | (1 << CP0C3_LPA) | (1 << CP0C3_VInt), | |
738 | .CP0_Config4 = MIPS_CONFIG4 | (1U << CP0C4_M) | (3 << CP0C4_IE) | | |
739 | (1 << CP0C4_AE) | (0xfc << CP0C4_KScrExist), | |
740 | .CP0_Config5 = MIPS_CONFIG5 | (1 << CP0C5_XNP) | (1 << CP0C5_VP) | | |
741 | (1 << CP0C5_LLB) | (1 << CP0C5_MRP), | |
742 | .CP0_Config5_rw_bitmask = (1 << CP0C5_MSAEn) | (1 << CP0C5_SBRI) | | |
743 | (1 << CP0C5_FRE) | (1 << CP0C5_UFE), | |
744 | .CP0_LLAddr_rw_bitmask = 0, | |
745 | .CP0_LLAddr_shift = 0, | |
746 | .SYNCI_Step = 64, | |
747 | .CCRes = 2, | |
748 | .CP0_Status_rw_bitmask = 0x30D8FFFF, | |
749 | .CP0_PageGrain = (1 << CP0PG_IEC) | (1 << CP0PG_XIE) | | |
750 | (1U << CP0PG_RIE), | |
751 | .CP0_PageGrain_rw_bitmask = (1 << CP0PG_ELPA), | |
752 | .CP0_EBaseWG_rw_bitmask = (1 << CP0EBase_WG), | |
753 | .CP1_fcr0 = (1 << FCR0_FREP) | (1 << FCR0_HAS2008) | (1 << FCR0_F64) | | |
754 | (1 << FCR0_L) | (1 << FCR0_W) | (1 << FCR0_D) | | |
755 | (1 << FCR0_S) | (0x03 << FCR0_PRID) | (0x0 << FCR0_REV), | |
756 | .CP1_fcr31 = (1 << FCR31_ABS2008) | (1 << FCR31_NAN2008), | |
757 | .CP1_fcr31_rw_bitmask = 0x0103FFFF, | |
758 | .MSAIR = 0x03 << MSAIR_ProcID, | |
759 | .SEGBITS = 48, | |
760 | .PABITS = 48, | |
761 | .insn_flags = CPU_MIPS64R6 | ASE_MSA, | |
762 | .mmu_type = MMU_TYPE_R4000, | |
763 | }, | |
5bc6fba8 HC |
764 | { |
765 | .name = "Loongson-2E", | |
766 | .CP0_PRid = 0x6302, | |
6225a4a0 MR |
767 | /* 64KB I-cache and d-cache. 4 way with 32 bit cache line size. */ |
768 | .CP0_Config0 = (0x1<<17) | (0x1<<16) | (0x1<<11) | (0x1<<8) | | |
769 | (0x1<<5) | (0x1<<4) | (0x1<<1), | |
770 | /* Note: Config1 is only used internally, | |
771 | Loongson-2E has only Config0. */ | |
5bc6fba8 HC |
772 | .CP0_Config1 = (1 << CP0C1_FP) | (47 << CP0C1_MMU), |
773 | .SYNCI_Step = 16, | |
774 | .CCRes = 2, | |
775 | .CP0_Status_rw_bitmask = 0x35D0FFFF, | |
776 | .CP1_fcr0 = (0x5 << FCR0_PRID) | (0x1 << FCR0_REV), | |
599bc5e8 AM |
777 | .CP1_fcr31 = 0, |
778 | .CP1_fcr31_rw_bitmask = 0xFF83FFFF, | |
5bc6fba8 HC |
779 | .SEGBITS = 40, |
780 | .PABITS = 40, | |
781 | .insn_flags = CPU_LOONGSON2E, | |
782 | .mmu_type = MMU_TYPE_R4000, | |
783 | }, | |
784 | { | |
6225a4a0 MR |
785 | .name = "Loongson-2F", |
786 | .CP0_PRid = 0x6303, | |
787 | /* 64KB I-cache and d-cache. 4 way with 32 bit cache line size. */ | |
788 | .CP0_Config0 = (0x1<<17) | (0x1<<16) | (0x1<<11) | (0x1<<8) | | |
789 | (0x1<<5) | (0x1<<4) | (0x1<<1), | |
790 | /* Note: Config1 is only used internally, | |
791 | Loongson-2F has only Config0. */ | |
792 | .CP0_Config1 = (1 << CP0C1_FP) | (47 << CP0C1_MMU), | |
793 | .SYNCI_Step = 16, | |
794 | .CCRes = 2, | |
795 | .CP0_Status_rw_bitmask = 0xF5D0FF1F, /* Bits 7:5 not writable. */ | |
796 | .CP1_fcr0 = (0x5 << FCR0_PRID) | (0x1 << FCR0_REV), | |
599bc5e8 AM |
797 | .CP1_fcr31 = 0, |
798 | .CP1_fcr31_rw_bitmask = 0xFF83FFFF, | |
6225a4a0 MR |
799 | .SEGBITS = 40, |
800 | .PABITS = 40, | |
801 | .insn_flags = CPU_LOONGSON2F, | |
802 | .mmu_type = MMU_TYPE_R4000, | |
5bc6fba8 | 803 | }, |
af13ae03 | 804 | { |
908f6be1 | 805 | /* A generic CPU providing MIPS64 DSP R2 ASE features. |
af13ae03 JL |
806 | FIXME: Eventually this should be replaced by a real CPU model. */ |
807 | .name = "mips64dspr2", | |
808 | .CP0_PRid = 0x00010000, | |
809 | .CP0_Config0 = MIPS_CONFIG0 | (0x1 << CP0C0_AR) | (0x2 << CP0C0_AT) | | |
810 | (MMU_TYPE_R4000 << CP0C0_MT), | |
811 | .CP0_Config1 = MIPS_CONFIG1 | (1 << CP0C1_FP) | (63 << CP0C1_MMU) | | |
812 | (2 << CP0C1_IS) | (4 << CP0C1_IL) | (3 << CP0C1_IA) | | |
813 | (2 << CP0C1_DS) | (4 << CP0C1_DL) | (3 << CP0C1_DA) | | |
814 | (1 << CP0C1_PC) | (1 << CP0C1_WR) | (1 << CP0C1_EP), | |
815 | .CP0_Config2 = MIPS_CONFIG2, | |
e30614d5 MR |
816 | .CP0_Config3 = MIPS_CONFIG3 | (1U << CP0C3_M) | (1 << CP0C3_DSP2P) | |
817 | (1 << CP0C3_DSPP) | (1 << CP0C3_LPA), | |
af13ae03 JL |
818 | .CP0_LLAddr_rw_bitmask = 0, |
819 | .CP0_LLAddr_shift = 0, | |
820 | .SYNCI_Step = 32, | |
821 | .CCRes = 2, | |
822 | .CP0_Status_rw_bitmask = 0x37FBFFFF, | |
823 | .CP1_fcr0 = (1 << FCR0_F64) | (1 << FCR0_3D) | (1 << FCR0_PS) | | |
824 | (1 << FCR0_L) | (1 << FCR0_W) | (1 << FCR0_D) | | |
825 | (1 << FCR0_S) | (0x00 << FCR0_PRID) | (0x0 << FCR0_REV), | |
599bc5e8 AM |
826 | .CP1_fcr31 = 0, |
827 | .CP1_fcr31_rw_bitmask = 0xFF83FFFF, | |
af13ae03 | 828 | .SEGBITS = 42, |
af13ae03 | 829 | .PABITS = 36, |
908f6be1 | 830 | .insn_flags = CPU_MIPS64R2 | ASE_DSP | ASE_DSP_R2, |
af13ae03 JL |
831 | .mmu_type = MMU_TYPE_R4000, |
832 | }, | |
5bc6fba8 | 833 | |
33d68b5f TS |
834 | #endif |
835 | }; | |
41da212c | 836 | const int mips_defs_number = ARRAY_SIZE(mips_defs); |
33d68b5f | 837 | |
0442428a | 838 | void mips_cpu_list(void) |
33d68b5f TS |
839 | { |
840 | int i; | |
841 | ||
b1503cda | 842 | for (i = 0; i < ARRAY_SIZE(mips_defs); i++) { |
0442428a | 843 | qemu_printf("MIPS '%s'\n", mips_defs[i].name); |
33d68b5f TS |
844 | } |
845 | } | |
846 | ||
f8a6ec58 | 847 | #ifndef CONFIG_USER_ONLY |
c227f099 | 848 | static void no_mmu_init (CPUMIPSState *env, const mips_def_t *def) |
29929e34 | 849 | { |
ead9360e TS |
850 | env->tlb->nb_tlb = 1; |
851 | env->tlb->map_address = &no_mmu_map_address; | |
29929e34 TS |
852 | } |
853 | ||
c227f099 | 854 | static void fixed_mmu_init (CPUMIPSState *env, const mips_def_t *def) |
29929e34 | 855 | { |
ead9360e TS |
856 | env->tlb->nb_tlb = 1; |
857 | env->tlb->map_address = &fixed_mmu_map_address; | |
29929e34 TS |
858 | } |
859 | ||
c227f099 | 860 | static void r4k_mmu_init (CPUMIPSState *env, const mips_def_t *def) |
29929e34 | 861 | { |
ead9360e TS |
862 | env->tlb->nb_tlb = 1 + ((def->CP0_Config1 >> CP0C1_MMU) & 63); |
863 | env->tlb->map_address = &r4k_map_address; | |
c01fccd2 AJ |
864 | env->tlb->helper_tlbwi = r4k_helper_tlbwi; |
865 | env->tlb->helper_tlbwr = r4k_helper_tlbwr; | |
866 | env->tlb->helper_tlbp = r4k_helper_tlbp; | |
867 | env->tlb->helper_tlbr = r4k_helper_tlbr; | |
9456c2fb LA |
868 | env->tlb->helper_tlbinv = r4k_helper_tlbinv; |
869 | env->tlb->helper_tlbinvf = r4k_helper_tlbinvf; | |
ead9360e TS |
870 | } |
871 | ||
c227f099 | 872 | static void mmu_init (CPUMIPSState *env, const mips_def_t *def) |
ead9360e | 873 | { |
a47dddd7 AF |
874 | MIPSCPU *cpu = mips_env_get_cpu(env); |
875 | ||
7267c094 | 876 | env->tlb = g_malloc0(sizeof(CPUMIPSTLBContext)); |
ead9360e | 877 | |
6d35524c TS |
878 | switch (def->mmu_type) { |
879 | case MMU_TYPE_NONE: | |
ead9360e TS |
880 | no_mmu_init(env, def); |
881 | break; | |
6d35524c | 882 | case MMU_TYPE_R4000: |
ead9360e TS |
883 | r4k_mmu_init(env, def); |
884 | break; | |
6d35524c | 885 | case MMU_TYPE_FMT: |
ead9360e TS |
886 | fixed_mmu_init(env, def); |
887 | break; | |
6d35524c TS |
888 | case MMU_TYPE_R3000: |
889 | case MMU_TYPE_R6000: | |
890 | case MMU_TYPE_R8000: | |
ead9360e | 891 | default: |
a47dddd7 | 892 | cpu_abort(CPU(cpu), "MMU type not supported\n"); |
ead9360e | 893 | } |
29929e34 | 894 | } |
f8a6ec58 | 895 | #endif /* CONFIG_USER_ONLY */ |
29929e34 | 896 | |
c227f099 | 897 | static void fpu_init (CPUMIPSState *env, const mips_def_t *def) |
ead9360e | 898 | { |
f01be154 TS |
899 | int i; |
900 | ||
901 | for (i = 0; i < MIPS_FPU_MAX; i++) | |
902 | env->fpus[i].fcr0 = def->CP1_fcr0; | |
ead9360e | 903 | |
f01be154 | 904 | memcpy(&env->active_fpu, &env->fpus[0], sizeof(env->active_fpu)); |
ead9360e TS |
905 | } |
906 | ||
c227f099 | 907 | static void mvp_init (CPUMIPSState *env, const mips_def_t *def) |
ead9360e | 908 | { |
7267c094 | 909 | env->mvp = g_malloc0(sizeof(CPUMIPSMVPContext)); |
ead9360e TS |
910 | |
911 | /* MVPConf1 implemented, TLB sharable, no gating storage support, | |
912 | programmable cache partitioning implemented, number of allocatable | |
913 | and sharable TLB entries, MVP has allocatable TCs, 2 VPEs | |
914 | implemented, 5 TCs implemented. */ | |
f45cb2f4 | 915 | env->mvp->CP0_MVPConf0 = (1U << CP0MVPC0_M) | (1 << CP0MVPC0_TLBS) | |
ead9360e | 916 | (0 << CP0MVPC0_GS) | (1 << CP0MVPC0_PCP) | |
ead9360e TS |
917 | // TODO: actually do 2 VPEs. |
918 | // (1 << CP0MVPC0_TCA) | (0x1 << CP0MVPC0_PVPE) | | |
919 | // (0x04 << CP0MVPC0_PTC); | |
920 | (1 << CP0MVPC0_TCA) | (0x0 << CP0MVPC0_PVPE) | | |
1dab005a | 921 | (0x00 << CP0MVPC0_PTC); |
932e71cd | 922 | #if !defined(CONFIG_USER_ONLY) |
0eaef5aa | 923 | /* Usermode has no TLB support */ |
932e71cd AJ |
924 | env->mvp->CP0_MVPConf0 |= (env->tlb->nb_tlb << CP0MVPC0_PTLBE); |
925 | #endif | |
0eaef5aa | 926 | |
ead9360e TS |
927 | /* Allocatable CP1 have media extensions, allocatable CP1 have FP support, |
928 | no UDI implemented, no CP2 implemented, 1 CP1 implemented. */ | |
f45cb2f4 | 929 | env->mvp->CP0_MVPConf1 = (1U << CP0MVPC1_CIM) | (1 << CP0MVPC1_CIF) | |
ead9360e TS |
930 | (0x0 << CP0MVPC1_PCX) | (0x0 << CP0MVPC1_PCP2) | |
931 | (0x1 << CP0MVPC1_PCP1); | |
932 | } | |
863f264d YK |
933 | |
934 | static void msa_reset(CPUMIPSState *env) | |
935 | { | |
936 | #ifdef CONFIG_USER_ONLY | |
937 | /* MSA access enabled */ | |
938 | env->CP0_Config5 |= 1 << CP0C5_MSAEn; | |
939 | env->CP0_Status |= (1 << CP0St_CU1) | (1 << CP0St_FR); | |
940 | #endif | |
941 | ||
942 | /* MSA CSR: | |
943 | - non-signaling floating point exception mode off (NX bit is 0) | |
944 | - Cause, Enables, and Flags are all 0 | |
945 | - round to nearest / ties to even (RM bits are 0) */ | |
946 | env->active_tc.msacsr = 0; | |
947 | ||
64451111 LA |
948 | restore_msa_fp_status(env); |
949 | ||
863f264d YK |
950 | /* tininess detected after rounding.*/ |
951 | set_float_detect_tininess(float_tininess_after_rounding, | |
952 | &env->active_tc.msa_fp_status); | |
953 | ||
954 | /* clear float_status exception flags */ | |
955 | set_float_exception_flags(0, &env->active_tc.msa_fp_status); | |
956 | ||
863f264d YK |
957 | /* clear float_status nan mode */ |
958 | set_default_nan_mode(0, &env->active_tc.msa_fp_status); | |
af39bc8c | 959 | |
40bd6dd4 AM |
960 | /* set proper signanling bit meaning ("1" means "quiet") */ |
961 | set_snan_bit_is_one(0, &env->active_tc.msa_fp_status); | |
863f264d | 962 | } |