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

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

Issue 11016003: [MIPS] Use break instruction as NACL_HALT for MIPS. (Closed) Base URL: http://src.chromium.org/native_client/trunk/src/native_client/
Patch Set: Remove extra lines. 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
« no previous file with comments | « src/trusted/service_runtime/nacl_config.h ('k') | src/trusted/validator_mips/inst_classes.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
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->_NaClHalt_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 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 // Catch any attempt to fall through... 1061 // Catch any attempt to fall through...
1046 fprintf(stderr, "TABLE IS INCOMPLETE: arithm3_2 could not parse %08X",insn.Bit s(31,0)); 1062 fprintf(stderr, "TABLE IS INCOMPLETE: arithm3_2 could not parse %08X",insn.Bit s(31,0));
1047 return state->_Forbidden_instance; 1063 return state->_Forbidden_instance;
1048 } 1064 }
1049 1065
1050 /* 1066 /*
1051 * Implementation of table jr. 1067 * Implementation of table jr.
1052 * Specified by: jr. 1068 * Specified by: jr.
1053 */ 1069 */
1054 static inline const ClassDecoder &decode_jr(const Instruction insn, const Decode rState *state) { 1070 static inline const ClassDecoder &decode_jr(const Instruction insn, const Decode rState *state) {
1055 if (((insn & 0x03E00000) != 0x00000000) && ((insn & 0x001FFFC0) == 0x00000000) ) { 1071 if (((insn & 0x001FFFC0) != 0x00000000)) {
1072 return state->_Forbidden_instance;
1073 }
1074
1075 if (((insn & 0x001FFFC0) == 0x00000000)) {
1056 return state->_JmpReg_instance; 1076 return state->_JmpReg_instance;
1057 } 1077 }
1058 1078
1059 if (((insn & 0x03E00000) == 0x00000000) && ((insn & 0x001FFFC0) == 0x00000000) ) {
1060 return state->_NaClHalt_instance;
1061 }
1062
1063 if ((true) && ((insn & 0x001FFFC0) != 0x00000000)) {
1064 return state->_Forbidden_instance;
1065 }
1066
1067 // Catch any attempt to fall through... 1079 // Catch any attempt to fall through...
1068 fprintf(stderr, "TABLE IS INCOMPLETE: jr could not parse %08X",insn.Bits(31,0) ); 1080 fprintf(stderr, "TABLE IS INCOMPLETE: jr could not parse %08X",insn.Bits(31,0) );
1069 return state->_Forbidden_instance; 1081 return state->_Forbidden_instance;
1070 } 1082 }
1071 1083
1072 /* 1084 /*
1073 * Implementation of table jalr. 1085 * Implementation of table jalr.
1074 * Specified by: jalr. 1086 * Specified by: jalr.
1075 */ 1087 */
1076 static inline const ClassDecoder &decode_jalr(const Instruction insn, const Deco derState *state) { 1088 static inline const ClassDecoder &decode_jalr(const Instruction insn, const Deco derState *state) {
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 } 1308 }
1297 void delete_state(const DecoderState *state) { 1309 void delete_state(const DecoderState *state) {
1298 delete (DecoderState *)state; 1310 delete (DecoderState *)state;
1299 } 1311 }
1300 1312
1301 const ClassDecoder &decode(const Instruction insn, const DecoderState *state) { 1313 const ClassDecoder &decode(const Instruction insn, const DecoderState *state) {
1302 return decode_MIPS32(insn, (DecoderState *)state); 1314 return decode_MIPS32(insn, (DecoderState *)state);
1303 } 1315 }
1304 1316
1305 } // namespace 1317 } // namespace
OLDNEW
« no previous file with comments | « src/trusted/service_runtime/nacl_config.h ('k') | src/trusted/validator_mips/inst_classes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698