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

Side by Side Diff: src/trusted/validator_ragel/decoder_x86_64.rl

Issue 11000033: Move validator_x86_XX.rl out of unreviewed. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 8 years, 2 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 #include <assert.h> 7 #include <assert.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdio.h> 9 #include <stdio.h>
10 #include <stdlib.h> 10 #include <stdlib.h>
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 "native_client/src/trusted/validator_ragel/unreviewed/parse_instruction.rl"; 60 "native_client/src/trusted/validator_ragel/unreviewed/parse_instruction.rl";
61 61
62 include decode_x86_64 "decoder_x86_64_instruction.rl"; 62 include decode_x86_64 "decoder_x86_64_instruction.rl";
63 63
64 main := (one_instruction 64 main := (one_instruction
65 @{ 65 @{
66 switch (instruction.rm.disp_type) { 66 switch (instruction.rm.disp_type) {
67 case DISPNONE: instruction.rm.offset = 0; break; 67 case DISPNONE: instruction.rm.offset = 0; break;
68 case DISP8: instruction.rm.offset = (int8_t) *disp; break; 68 case DISP8: instruction.rm.offset = (int8_t) *disp; break;
69 case DISP16: instruction.rm.offset = 69 case DISP16: instruction.rm.offset =
70 (uint16_t) (disp[0] + 256U * disp[1]); 70 (uint16_t) (disp[0] + 256U * disp[1]);
Brad Chen 2012/09/28 20:41:01 Is it deliberate or accidental that you use uint16
khim 2012/09/28 23:22:06 It's just a typo - and an unimportant one at that
71 break; 71 break;
72 case DISP32: instruction.rm.offset = (int32_t) 72 case DISP32: instruction.rm.offset = (int32_t)
73 (disp[0] + 256U * (disp[1] + 256U * (disp[2] + 256U * (disp[3])))); 73 (disp[0] + 256U * (disp[1] + 256U * (disp[2] + 256U * (disp[3]))));
74 break; 74 break;
75 case DISP64: instruction.rm.offset = (int64_t) 75 case DISP64: instruction.rm.offset = (int64_t)
76 (*disp + 256ULL * (disp[1] + 256ULL * (disp[2] + 256ULL * (disp[3] + 76 (*disp + 256ULL * (disp[1] + 256ULL * (disp[2] + 256ULL * (disp[3] +
77 256ULL * (disp[4] + 256ULL * (disp[5] + 256ULL * (disp[6] + 256ULL * 77 256ULL * (disp[4] + 256ULL * (disp[5] + 256ULL * (disp[6] + 256ULL *
78 disp[7]))))))); 78 disp[7])))))));
79 break; 79 break;
80 } 80 }
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 SET_REPZ_PREFIX(FALSE); 207 SET_REPZ_PREFIX(FALSE);
208 SET_BRANCH_NOT_TAKEN(FALSE); 208 SET_BRANCH_NOT_TAKEN(FALSE);
209 SET_BRANCH_TAKEN(FALSE); 209 SET_BRANCH_TAKEN(FALSE);
210 210
211 %% write init; 211 %% write init;
212 %% write exec; 212 %% write exec;
213 213
214 error_detected: 214 error_detected:
215 return result; 215 return result;
216 } 216 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698