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

Unified Diff: src/trusted/validator_x86/ncdis_util.c

Issue 6883091: Start unit testing for functions in nc_inst_state.c (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 9 years, 8 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_x86/ncdis_util.c
===================================================================
--- src/trusted/validator_x86/ncdis_util.c (revision 4944)
+++ src/trusted/validator_x86/ncdis_util.c (working copy)
@@ -20,8 +20,8 @@
#include "native_client/src/trusted/validator_x86/ncdecode.h"
#include "gen/native_client/src/trusted/validator_x86/ncdisasmtab.h"
+#include "native_client/src/trusted/validator_x86/RexPrefixes.h"
-
/* To turn on debugging of instruction decoding, change value of
* DEBUGGING to 1.
*/
@@ -47,26 +47,27 @@
/* Returns true if REX.W is defined in the REX prefix byte. */
static INLINE uint8_t GetRexPrefixW(const NCDecoderInst* dinst) {
/* Note: the field rexprefix is non-zero only if a rexprefix was found. */
- return 0 != (dinst->inst.rexprefix & 0x8);
+ return 0 != NaClRexW(dinst->inst.rexprefix);
}
/* Returns true if REX.R is defined in the REX prefix byte. */
static INLINE uint8_t GetRexPrefixR(const NCDecoderInst* dinst) {
/* Note: the field rexprefix is non-zero only if a rexprefix was found. */
- return 0 != (dinst->inst.rexprefix & 0x4);
+ return 0 != NaClRexR(dinst->inst.rexprefix);
}
/* Returns true if REX.X is defined in the REX prefix byte. */
static INLINE uint8_t GetRexPrefixX(const NCDecoderInst* dinst) {
/* Note: the field rexprefix is non-zero only if a rexprefix was found. */
- return 0 != (dinst->inst.rexprefix & 0x2);
+ return 0 != NaClRexX(dinst->inst.rexprefix);
}
/* Returns true if REX.B is defined in the REX prefix byte. */
static INLINE uint8_t GetRexPrefixB(const NCDecoderInst* dinst) {
/* Note: the field rexprefix is non-zero only if a rexprefix was found. */
- return 0 != (dinst->inst.rexprefix & 0x1);
+ return 0 != NaClRexB(dinst ->inst.rexprefix);
}
+
#endif
/* Returns the index into the general purpose registers based on the

Powered by Google App Engine
This is Rietveld 408576698