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

Side by Side Diff: src/trusted/validator/x86/ncval_reg_sfi/nc_cpu_checks.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 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 * Checks that CPU ID features match instructions found in executable. 8 * Checks that CPU ID features match instructions found in executable.
9 */ 9 */
10 10
11 #include <stdlib.h> 11 #include <stdlib.h>
12 #include <string.h> 12 #include <string.h>
13 13
14 #include "native_client/src/trusted/validator/x86/ncval_reg_sfi/nc_cpu_checks.h" 14 #include "native_client/src/trusted/validator/x86/ncval_reg_sfi/nc_cpu_checks.h"
15 15
16 #include "native_client/src/shared/platform/nacl_log.h" 16 #include "native_client/src/shared/platform/nacl_log.h"
17 #include "native_client/src/trusted/validator/x86/nacl_cpuid.h" 17 #include "native_client/src/trusted/validator/x86/nacl_cpuid.h"
18 #include "native_client/src/trusted/validator/x86/decoder/nc_inst_iter.h"
19 #include "native_client/src/trusted/validator/x86/decoder/nc_inst_state.h" 18 #include "native_client/src/trusted/validator/x86/decoder/nc_inst_state.h"
20 #include "native_client/src/trusted/validator/x86/decoder/nc_inst_state_internal .h" 19 #include "native_client/src/trusted/validator/x86/decoder/nc_inst_state_internal .h"
21 #include "native_client/src/trusted/validator/x86/ncval_reg_sfi/ncvalidate_iter. h" 20 #include "native_client/src/trusted/validator/x86/ncval_reg_sfi/ncvalidate_iter. h"
22 #include "native_client/src/trusted/validator/x86/ncval_reg_sfi/ncvalidate_iter_ internal.h" 21 #include "native_client/src/trusted/validator/x86/ncval_reg_sfi/ncvalidate_iter_ internal.h"
23 #include "native_client/src/trusted/validator/x86/nc_segment.h" 22 #include "native_client/src/trusted/validator/x86/nc_segment.h"
24 23
24 #include "native_client/src/trusted/validator/x86/decoder/nc_inst_iter_inl.c"
25
25 typedef struct NaClCpuCheckState { 26 typedef struct NaClCpuCheckState {
26 /* The standard CPU features. */ 27 /* The standard CPU features. */
27 CPUFeatures cpu_features; 28 CPUFeatures cpu_features;
28 /* Check that both f_CMOV and f_x87 is defined. */ 29 /* Check that both f_CMOV and f_x87 is defined. */
29 Bool f_CMOV_and_x87; 30 Bool f_CMOV_and_x87;
30 /* Check that either f_MMX or f_SSE2 is defined. */ 31 /* Check that either f_MMX or f_SSE2 is defined. */
31 Bool f_MMX_or_SSE2; 32 Bool f_MMX_or_SSE2;
32 } NaClCpuCheckState; 33 } NaClCpuCheckState;
33 34
34 NaClCpuCheckState* NaClCpuCheckMemoryCreate(NaClValidatorState* state) { 35 NaClCpuCheckState* NaClCpuCheckMemoryCreate(NaClValidatorState* state) {
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 NACL_CHECK_FEATURE(f_SSE2, "SSE2"); 165 NACL_CHECK_FEATURE(f_SSE2, "SSE2");
165 break; 166 break;
166 default: 167 default:
167 break; 168 break;
168 } 169 }
169 if (state->cur_inst->flags & NACL_IFLAG(LongMode)) { 170 if (state->cur_inst->flags & NACL_IFLAG(LongMode)) {
170 NACL_CHECK_FEATURE(f_LM, "LM"); 171 NACL_CHECK_FEATURE(f_LM, "LM");
171 } 172 }
172 if (squash_me) { 173 if (squash_me) {
173 /* Replace all bytes with the stop instruction. */ 174 /* Replace all bytes with the stop instruction. */
174 memset(NaClInstIterGetInstMemory(iter), kNaClFullStop, 175 memset(NaClInstIterGetInstMemoryInline(iter), kNaClFullStop,
175 NaClInstStateLength(inst_state)); 176 NaClInstStateLength(inst_state));
176 } 177 }
177 } 178 }
OLDNEW
« no previous file with comments | « src/trusted/validator/x86/ncval_reg_sfi/address_sets_inl.c ('k') | src/trusted/validator/x86/ncval_reg_sfi/nc_jumps.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698