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

Unified Diff: src/trusted/validator_ragel/unreviewed/decoder-test.c

Issue 9968039: Add ragel machine generators to SCONS (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: src/trusted/validator_ragel/unreviewed/decoder-test.c
===================================================================
--- src/trusted/validator_ragel/unreviewed/decoder-test.c (revision 8170)
+++ src/trusted/validator_ragel/unreviewed/decoder-test.c (working copy)
@@ -5,13 +5,14 @@
*/
#include <assert.h>
-#include <elf.h>
-#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "decoder.h"
+#include "native_client/src/include/elf32.h"
+#include "native_client/src/include/elf64.h"
+#include "native_client/src/trusted/validator_ragel/unreviewed/decoder.h"
+
#undef TRUE
#define TRUE 1
@@ -530,7 +531,7 @@
if ((instruction->rm.base >= REG_R8) &&
(instruction->rm.base <= REG_R15)) {
++rex_bits;
- } else if ((instruction->rm.base == REG_NONE) ||
+ } else if ((instruction->rm.base == NO_REG) ||
(instruction->rm.base == REG_RIP)) {
++maybe_rex_bits;
}
@@ -1152,8 +1153,8 @@
printf("0x%"PRIx64, instruction->rm.offset);
}
if (((struct DecodeState *)userdata)->ia32_mode) {
- if ((instruction->rm.base != REG_NONE) ||
- (instruction->rm.index != REG_NONE) ||
+ if ((instruction->rm.base != NO_REG) ||
+ (instruction->rm.index != NO_REG) ||
(instruction->rm.scale != 0)) {
printf("(");
}
@@ -1166,7 +1167,7 @@
case REG_RBP: printf("%%ebp"); break;
case REG_RSI: printf("%%esi"); break;
case REG_RDI: printf("%%edi"); break;
- case REG_NONE: break;
+ case NO_REG: break;
case REG_R8:
case REG_R9:
case REG_R10:
@@ -1201,7 +1202,7 @@
(instruction->rm.scale != 0))
printf(",%%eiz,%d",1<<instruction->rm.scale);
break;
- case REG_NONE: break;
+ case NO_REG: break;
case REG_R8:
case REG_R9:
case REG_R10:
@@ -1222,13 +1223,13 @@
case JMP_TO:
assert(FALSE);
}
- if ((instruction->rm.base != REG_NONE) ||
- (instruction->rm.index != REG_NONE) ||
+ if ((instruction->rm.base != NO_REG) ||
+ (instruction->rm.index != NO_REG) ||
(instruction->rm.scale != 0)) {
printf(")");
}
} else {
- if ((instruction->rm.base != REG_NONE) ||
+ if ((instruction->rm.base != NO_REG) ||
(instruction->rm.index != REG_RIZ) ||
(instruction->rm.scale != 0)) {
printf("(");
@@ -1251,7 +1252,7 @@
case REG_R14: printf("%%r14"); break;
case REG_R15: printf("%%r15"); break;
case REG_RIP: printf("%%rip"); print_rip = TRUE; break;
- case REG_NONE: break;
+ case NO_REG: break;
case REG_RM:
case REG_RIZ:
case REG_IMM:
@@ -1281,13 +1282,13 @@
case REG_R13: printf(",%%r13,%d",1<<instruction->rm.scale); break;
case REG_R14: printf(",%%r14,%d",1<<instruction->rm.scale); break;
case REG_R15: printf(",%%r15,%d",1<<instruction->rm.scale); break;
- case REG_RIZ: if (((instruction->rm.base != REG_NONE) &&
+ case REG_RIZ: if (((instruction->rm.base != NO_REG) &&
(instruction->rm.base != REG_RSP) &&
(instruction->rm.base != REG_R12)) ||
(instruction->rm.scale != 0))
printf(",%%riz,%d",1<<instruction->rm.scale);
break;
- case REG_NONE: break;
+ case NO_REG: break;
case REG_RM:
case REG_RIP:
case REG_IMM:
@@ -1300,7 +1301,7 @@
case JMP_TO:
assert(FALSE);
}
- if ((instruction->rm.base != REG_NONE) ||
+ if ((instruction->rm.base != NO_REG) ||
(instruction->rm.index != REG_RIZ) ||
(instruction->rm.scale != 0)) {
printf(")");
@@ -1344,7 +1345,7 @@
break;
case REG_RIP:
case REG_RIZ:
- case REG_NONE:
+ case NO_REG:
assert(FALSE);
}
delimeter = ',';

Powered by Google App Engine
This is Rietveld 408576698