OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 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 * Hand-written Ragel machines and actions used in validator and decoding. | 8 * Hand-written Ragel machines and actions used in validator and decoding. |
9 * | 9 * |
10 * Note: this file includes many different machines which are supposed to be | 10 * Note: this file includes many different machines which are supposed to be |
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
893 action att_show_name_suffix_b { SET_ATT_INSTRUCTION_SUFFIX("b"); } | 893 action att_show_name_suffix_b { SET_ATT_INSTRUCTION_SUFFIX("b"); } |
894 action att_show_name_suffix_l { SET_ATT_INSTRUCTION_SUFFIX("l"); } | 894 action att_show_name_suffix_l { SET_ATT_INSTRUCTION_SUFFIX("l"); } |
895 action att_show_name_suffix_ll { SET_ATT_INSTRUCTION_SUFFIX("ll"); } | 895 action att_show_name_suffix_ll { SET_ATT_INSTRUCTION_SUFFIX("ll"); } |
896 action att_show_name_suffix_t { SET_ATT_INSTRUCTION_SUFFIX("t"); } | 896 action att_show_name_suffix_t { SET_ATT_INSTRUCTION_SUFFIX("t"); } |
897 action att_show_name_suffix_s { SET_ATT_INSTRUCTION_SUFFIX("s"); } | 897 action att_show_name_suffix_s { SET_ATT_INSTRUCTION_SUFFIX("s"); } |
898 action att_show_name_suffix_q { SET_ATT_INSTRUCTION_SUFFIX("q"); } | 898 action att_show_name_suffix_q { SET_ATT_INSTRUCTION_SUFFIX("q"); } |
899 action att_show_name_suffix_w { SET_ATT_INSTRUCTION_SUFFIX("w"); } | 899 action att_show_name_suffix_w { SET_ATT_INSTRUCTION_SUFFIX("w"); } |
900 action att_show_name_suffix_x { SET_ATT_INSTRUCTION_SUFFIX("x"); } | 900 action att_show_name_suffix_x { SET_ATT_INSTRUCTION_SUFFIX("x"); } |
901 action att_show_name_suffix_y { SET_ATT_INSTRUCTION_SUFFIX("y"); } | 901 action att_show_name_suffix_y { SET_ATT_INSTRUCTION_SUFFIX("y"); } |
902 }%% | 902 }%% |
903 | |
904 %%{ | |
905 machine decoder; | |
906 | |
907 action end_of_instruction_cleanup { | |
908 process_instruction(instruction_begin, current_position + 1, &instruction, | |
909 userdata); | |
910 instruction_begin = current_position + 1; | |
911 SET_DISP_TYPE(DISPNONE); | |
912 SET_IMM_TYPE(IMMNONE); | |
913 SET_IMM2_TYPE(IMMNONE); | |
914 SET_REX_PREFIX(FALSE); | |
915 SET_DATA16_PREFIX(FALSE); | |
916 SET_LOCK_PREFIX(FALSE); | |
917 SET_REPNZ_PREFIX(FALSE); | |
918 SET_REPZ_PREFIX(FALSE); | |
919 SET_BRANCH_NOT_TAKEN(FALSE); | |
920 SET_BRANCH_TAKEN(FALSE); | |
921 /* Top three bis of VEX2 are inverted: see AMD/Intel manual. */ | |
922 SET_VEX_PREFIX2(VEX_R | VEX_X | VEX_B); | |
923 SET_VEX_PREFIX3(0x00); | |
924 SET_ATT_INSTRUCTION_SUFFIX(NULL); | |
925 CLEAR_SPURIOUS_REX_B(); | |
926 CLEAR_SPURIOUS_REX_X(); | |
927 CLEAR_SPURIOUS_REX_R(); | |
928 CLEAR_SPURIOUS_REX_W(); | |
929 } | |
930 | |
931 action report_fatal_error { | |
932 process_error(current_position, userdata); | |
933 result = FALSE; | |
934 goto error_detected; | |
935 } | |
936 | |
937 decoder = (one_instruction @end_of_instruction_cleanup)* | |
938 $!report_fatal_error; | |
939 }%% | |
OLD | NEW |