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

Side by Side Diff: src/trusted/validator/x86/ncval_seg_sfi/ncdecode.c

Issue 7649021: Separate the (partial) decoder of the x86_32 validator into a separate library. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 9 years, 4 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 /* 7 /*
8 * ncdecode.c - table driven decoder for Native Client 8 * ncdecode.c - table driven decoder for Native Client
9 * 9 *
10 * Most x86 decoders I've looked at are big case statements. While 10 * Most x86 decoders I've looked at are big case statements. While
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 /* To turn on debugging of instruction decoding, change value of 43 /* To turn on debugging of instruction decoding, change value of
44 * DEBUGGING to 1. 44 * DEBUGGING to 1.
45 */ 45 */
46 #define DEBUGGING 0 46 #define DEBUGGING 0
47 47
48 #include "native_client/src/shared/utils/debugging.h" 48 #include "native_client/src/shared/utils/debugging.h"
49 49
50 /* Generates a print name for the given NCDecodeImmediateType. */ 50 /* Generates a print name for the given NCDecodeImmediateType. */
51 static const char* NCDecodeImmediateTypeName(NCDecodeImmediateType type) { 51 static const char* NCDecodeImmediateTypeName(NCDecodeImmediateType type) {
52 DEBUG( 52 DEBUG_OR_ERASE(
53 switch(type) { 53 switch(type) {
54 case IMM_UNKNOWN: return "IMM_UNKNOWN"; 54 case IMM_UNKNOWN: return "IMM_UNKNOWN";
55 case IMM_NONE: return "IMM_NONE"; 55 case IMM_NONE: return "IMM_NONE";
56 case IMM_FIXED1: return "IMM_FIXED1"; 56 case IMM_FIXED1: return "IMM_FIXED1";
57 case IMM_FIXED2: return "IMM_FIXED2"; 57 case IMM_FIXED2: return "IMM_FIXED2";
58 case IMM_FIXED3: return "IMM_FIXED3"; 58 case IMM_FIXED3: return "IMM_FIXED3";
59 case IMM_FIXED4: return "IMM_FIXED4"; 59 case IMM_FIXED4: return "IMM_FIXED4";
60 case IMM_DATAV: return "IMM_DATAV"; 60 case IMM_DATAV: return "IMM_DATAV";
61 case IMM_ADDRV: return "IMM_ADDRV"; 61 case IMM_ADDRV: return "IMM_ADDRV";
62 case IMM_GROUP3_F6: return "IMM_GROUP3_F6"; 62 case IMM_GROUP3_F6: return "IMM_GROUP3_F6";
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 if (! (tthis->action_fn)(tthis, old_dinst, new_dinst)) { 737 if (! (tthis->action_fn)(tthis, old_dinst, new_dinst)) {
738 return FALSE; 738 return FALSE;
739 } 739 }
740 740
741 /* Move to next instruction. */ 741 /* Move to next instruction. */
742 old_dinst = IncrementInst(old_dinst); 742 old_dinst = IncrementInst(old_dinst);
743 new_dinst = IncrementInst(new_dinst); 743 new_dinst = IncrementInst(new_dinst);
744 } 744 }
745 return TRUE; 745 return TRUE;
746 } 746 }
OLDNEW
« no previous file with comments | « src/trusted/validator/x86/ncval_seg_sfi/build.scons ('k') | src/trusted/validator_x86/build.scons » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698