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

Unified Diff: src/trusted/validator/x86/x86_insts_inl.c

Issue 7980021: Speed up x86-64 validator by inlining heavily called routines. Speeds up (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 9 years, 3 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
« no previous file with comments | « src/trusted/validator/x86/x86_insts.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/validator/x86/x86_insts_inl.c
===================================================================
--- src/trusted/validator/x86/x86_insts_inl.c (revision 0)
+++ src/trusted/validator/x86/x86_insts_inl.c (revision 0)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2011 The Native Client Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/*
+ * x86_insts.h - Holds inline routines for commonly used (simple)
+ * functions in x86_insts.h. Used to speed up code. Inlined routines
+ * correspond to the following functions in x86_insts.h, but with an
+ * 'Inline' suffix:
+ *
+ * modrm_mod
+ * modrm_rm
+ * modrm_reg
+ * modrm_opcode
+ */
+
+#ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_X86_INSTS_INL_H__
+#define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_X86_INSTS_INL_H__
+
+#include "native_client/src/trusted/validator/x86/x86_insts.h"
+
+/* Accessors for the ModRm byte. */
+static INLINE uint8_t modrm_modInline(uint8_t modrm) {
+ return ((modrm >> 6) & 0x03);
+}
+
+static INLINE uint8_t modrm_rmInline(uint8_t modrm) {
+ return (modrm & 0x07);
+}
+
+static INLINE uint8_t modrm_regInline(uint8_t modrm) {
+ return ((modrm >> 3) & 0x07);
+}
+
+static INLINE uint8_t modrm_opcodeInline(uint8_t modrm) {
+ return modrm_regInline(modrm);
+}
+
+#endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_X86_INSTS_INL_H__ */
Property changes on: src/trusted/validator/x86/x86_insts_inl.c
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « src/trusted/validator/x86/x86_insts.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698