Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: src/trusted/validator_mips/gen/decode.cc

Issue 10978045: [MIPS] Use break instruction as NACL_HALT for MIPS. (Closed)
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * DO NOT EDIT: GENERATED CODE 2 * DO NOT EDIT: GENERATED CODE
3 */ 3 */
4 #include <stdio.h> 4 #include <stdio.h>
5 #include "native_client/src/trusted/validator_mips/decode.h" 5 #include "native_client/src/trusted/validator_mips/decode.h"
6 6
7 namespace nacl_mips_dec { 7 namespace nacl_mips_dec {
8 8
9 /* 9 /*
10 * This beast holds a bunch of pre-created ClassDecoder instances, which 10 * This beast holds a bunch of pre-created ClassDecoder instances, which
11 * we create in init_decode(). Because ClassDecoders are stateless, we 11 * we create in init_decode(). Because ClassDecoders are stateless, we
12 * can freely reuse them -- even across threads -- and avoid allocating 12 * can freely reuse them -- even across threads -- and avoid allocating
13 * in the inner decoder loop. 13 * in the inner decoder loop.
14 */ 14 */
15 struct DecoderState { 15 struct DecoderState {
16 const Load _Load_instance; 16 const Load _Load_instance;
17 const JalImm _JalImm_instance; 17 const JalImm _JalImm_instance;
18 const FPLoadStore _FPLoadStore_instance; 18 const Branch _Branch_instance;
Mark Seaborn 2012/09/26 16:59:24 Why do Branch and FPLoadStore get swapped? Does t
petarj 2012/09/28 17:55:02 Validator's generator will produce deterministic o
19 const Arithm2 _Arithm2_instance; 19 const Arithm2 _Arithm2_instance;
20 const Arithm3 _Arithm3_instance; 20 const Arithm3 _Arithm3_instance;
21 const Forbidden _Forbidden_instance; 21 const Forbidden _Forbidden_instance;
22 const Safe _Safe_instance; 22 const Safe _Safe_instance;
23 const BranchAndLink _BranchAndLink_instance; 23 const BranchAndLink _BranchAndLink_instance;
24 const JalReg _JalReg_instance; 24 const JalReg _JalReg_instance;
25 const NaClHalt _NaClHalt_instance; 25 const NaClHalt _NaClHalt_instance;
26 const StoreConditional _StoreConditional_instance; 26 const StoreConditional _StoreConditional_instance;
27 const Branch _Branch_instance; 27 const FPLoadStore _FPLoadStore_instance;
28 const JmpImm _JmpImm_instance; 28 const JmpImm _JmpImm_instance;
29 const JmpReg _JmpReg_instance; 29 const JmpReg _JmpReg_instance;
30 const Store _Store_instance; 30 const Store _Store_instance;
31 const ExtIns _ExtIns_instance; 31 const ExtIns _ExtIns_instance;
32 DecoderState() : 32 DecoderState() :
33 _Load_instance() 33 _Load_instance()
34 ,_JalImm_instance() 34 ,_JalImm_instance()
35 ,_FPLoadStore_instance() 35 ,_Branch_instance()
36 ,_Arithm2_instance() 36 ,_Arithm2_instance()
37 ,_Arithm3_instance() 37 ,_Arithm3_instance()
38 ,_Forbidden_instance() 38 ,_Forbidden_instance()
39 ,_Safe_instance() 39 ,_Safe_instance()
40 ,_BranchAndLink_instance() 40 ,_BranchAndLink_instance()
41 ,_JalReg_instance() 41 ,_JalReg_instance()
42 ,_NaClHalt_instance() 42 ,_NaClHalt_instance()
43 ,_StoreConditional_instance() 43 ,_StoreConditional_instance()
44 ,_Branch_instance() 44 ,_FPLoadStore_instance()
45 ,_JmpImm_instance() 45 ,_JmpImm_instance()
46 ,_JmpReg_instance() 46 ,_JmpReg_instance()
47 ,_Store_instance() 47 ,_Store_instance()
48 ,_ExtIns_instance() 48 ,_ExtIns_instance()
49 {} 49 {}
50 }; 50 };
51 51
52 /* 52 /*
53 * Prototypes for static table-matching functions. 53 * Prototypes for static table-matching functions.
54 */ 54 */
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 } 263 }
264 264
265 if (((insn & 0x0000003F) == 0x00000008)) { 265 if (((insn & 0x0000003F) == 0x00000008)) {
266 return decode_jr(insn, state); 266 return decode_jr(insn, state);
267 } 267 }
268 268
269 if (((insn & 0x0000003F) == 0x00000009)) { 269 if (((insn & 0x0000003F) == 0x00000009)) {
270 return decode_jalr(insn, state); 270 return decode_jalr(insn, state);
271 } 271 }
272 272
273 if (((insn & 0x0000003F) == 0x0000000D)) {
274 return state->_Safe_instance;
275 }
276
273 if (((insn & 0x0000003F) == 0x0000000F)) { 277 if (((insn & 0x0000003F) == 0x0000000F)) {
274 return decode_sync(insn, state); 278 return decode_sync(insn, state);
275 } 279 }
276 280
277 if (((insn & 0x00000037) == 0x00000005)) { 281 if (((insn & 0x0000003F) == 0x0000003F)) {
278 return state->_Forbidden_instance; 282 return state->_Forbidden_instance;
279 } 283 }
280 284
285 if (((insn & 0x0000001F) == 0x0000001E)) {
286 return state->_Forbidden_instance;
287 }
288
289 if (((insn & 0x0000002F) == 0x00000005)) {
290 return state->_Forbidden_instance;
291 }
292
293 if (((insn & 0x00000037) == 0x00000017)) {
294 return state->_Forbidden_instance;
295 }
296
281 if (((insn & 0x0000003D) == 0x0000000C)) { 297 if (((insn & 0x0000003D) == 0x0000000C)) {
282 return state->_Forbidden_instance; 298 return state->_Forbidden_instance;
283 } 299 }
284 300
285 if (((insn & 0x0000003D) == 0x00000010)) { 301 if (((insn & 0x0000003D) == 0x00000010)) {
286 return decode_mfhi(insn, state); 302 return decode_mfhi(insn, state);
287 } 303 }
288 304
289 if (((insn & 0x0000003D) == 0x00000011)) { 305 if (((insn & 0x0000003D) == 0x00000011)) {
290 return decode_mthi(insn, state); 306 return decode_mthi(insn, state);
291 } 307 }
292 308
309 if (((insn & 0x0000003D) == 0x00000014)) {
310 return state->_Forbidden_instance;
311 }
312
293 if (((insn & 0x0000003E) == 0x0000000A)) { 313 if (((insn & 0x0000003E) == 0x0000000A)) {
294 return decode_arithm3_2(insn, state); 314 return decode_arithm3_2(insn, state);
295 } 315 }
296 316
297 if (((insn & 0x0000003E) == 0x0000002A)) { 317 if (((insn & 0x0000003E) == 0x0000002A)) {
298 return decode_arithm3_3(insn, state); 318 return decode_arithm3_3(insn, state);
299 } 319 }
300 320
301 if (((insn & 0x0000003E) == 0x0000003C)) { 321 if (((insn & 0x0000003E) == 0x0000002E)) {
302 return state->_Forbidden_instance; 322 return state->_Forbidden_instance;
303 } 323 }
304 324
305 if (((insn & 0x0000002E) == 0x0000002E)) { 325 if (((insn & 0x0000001E) == 0x0000001C)) {
306 return state->_Forbidden_instance; 326 return state->_Forbidden_instance;
307 } 327 }
308 328
309 if (((insn & 0x0000003A) == 0x00000028)) { 329 if (((insn & 0x0000003A) == 0x00000028)) {
310 return state->_Forbidden_instance; 330 return state->_Forbidden_instance;
311 } 331 }
312 332
313 if (((insn & 0x0000003C) == 0x00000018)) { 333 if (((insn & 0x0000003C) == 0x00000018)) {
314 return decode_mult(insn, state); 334 return decode_mult(insn, state);
315 } 335 }
316 336
317 if (((insn & 0x0000003C) == 0x00000038)) { 337 if (((insn & 0x0000003C) == 0x00000038)) {
318 return state->_Forbidden_instance; 338 return state->_Forbidden_instance;
319 } 339 }
320 340
321 if (((insn & 0x00000034) == 0x00000014)) {
322 return state->_Forbidden_instance;
323 }
324
325 if (((insn & 0x00000038) == 0x00000020)) { 341 if (((insn & 0x00000038) == 0x00000020)) {
326 return decode_arithm3_3(insn, state); 342 return decode_arithm3_3(insn, state);
327 } 343 }
328 344
329 if (((insn & 0x00000038) == 0x00000030)) { 345 if (((insn & 0x00000038) == 0x00000030)) {
330 return state->_Forbidden_instance; 346 return state->_Forbidden_instance;
331 } 347 }
332 348
333 // Catch any attempt to fall through... 349 // Catch any attempt to fall through...
334 fprintf(stderr, "TABLE IS INCOMPLETE: special could not parse %08X",insn.Bits( 31,0)); 350 fprintf(stderr, "TABLE IS INCOMPLETE: special could not parse %08X",insn.Bits( 31,0));
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 } 1312 }
1297 void delete_state(const DecoderState *state) { 1313 void delete_state(const DecoderState *state) {
1298 delete (DecoderState *)state; 1314 delete (DecoderState *)state;
1299 } 1315 }
1300 1316
1301 const ClassDecoder &decode(const Instruction insn, const DecoderState *state) { 1317 const ClassDecoder &decode(const Instruction insn, const DecoderState *state) {
1302 return decode_MIPS32(insn, (DecoderState *)state); 1318 return decode_MIPS32(insn, (DecoderState *)state);
1303 } 1319 }
1304 1320
1305 } // namespace 1321 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698