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

Side by Side Diff: src/trusted/validator_arm/gen/arm32_decode_actuals_1.cc

Issue 12223046: Use generated actual decoders for ARM table: (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 7 years, 10 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 2013 The Native Client Authors. All rights reserved. 2 * Copyright 2013 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can 3 * Use of this source code is governed by a BSD-style license that can
4 * be found in the LICENSE file. 4 * be found in the LICENSE file.
5 */ 5 */
6 6
7 // DO NOT EDIT: GENERATED CODE 7 // DO NOT EDIT: GENERATED CODE
8 8
9 #include "native_client/src/trusted/validator_arm/inst_classes.h" 9 #include "native_client/src/trusted/validator_arm/inst_classes.h"
10 #include "native_client/src/trusted/validator_arm/gen/arm32_decode_actuals.h" 10 #include "native_client/src/trusted/validator_arm/gen/arm32_decode_actuals.h"
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 // uses: '{inst(3:0)}' 677 // uses: '{inst(3:0)}'
678 return RegisterList(). 678 return RegisterList().
679 Add(Register((inst.Bits() & 0x0000000F))); 679 Add(Register((inst.Bits() & 0x0000000F)));
680 } 680 }
681 681
682 // Actual_BL_BLX_immediate_cccc1011iiiiiiiiiiiiiiiiiiiiiiii_case_1 682 // Actual_BL_BLX_immediate_cccc1011iiiiiiiiiiiiiiiiiiiiiiii_case_1
683 // 683 //
684 // Actual: 684 // Actual:
685 // {defs: {15, 14}, 685 // {defs: {15, 14},
686 // relative: true, 686 // relative: true,
687 // relative_offset: SignExtend(inst(23:0):'00'(1:0), 32), 687 // relative_offset: SignExtend(inst(23:0):'00'(1:0), 32) + 8,
688 // safety: [true => MAY_BE_SAFE], 688 // safety: [true => MAY_BE_SAFE],
689 // uses: {15}} 689 // uses: {15}}
690 690
691 RegisterList Actual_BL_BLX_immediate_cccc1011iiiiiiiiiiiiiiiiiiiiiiii_case_1:: 691 RegisterList Actual_BL_BLX_immediate_cccc1011iiiiiiiiiiiiiiiiiiiiiiii_case_1::
692 defs(Instruction inst) const { 692 defs(Instruction inst) const {
693 UNREFERENCED_PARAMETER(inst); // To silence compiler. 693 UNREFERENCED_PARAMETER(inst); // To silence compiler.
694 // defs: '{15, 14}' 694 // defs: '{15, 14}'
695 return RegisterList(). 695 return RegisterList().
696 Add(Register(15)). 696 Add(Register(15)).
697 Add(Register(14)); 697 Add(Register(14));
698 } 698 }
699 699
700 bool Actual_BL_BLX_immediate_cccc1011iiiiiiiiiiiiiiiiiiiiiiii_case_1:: 700 bool Actual_BL_BLX_immediate_cccc1011iiiiiiiiiiiiiiiiiiiiiiii_case_1::
701 is_relative_branch(Instruction inst) const { 701 is_relative_branch(Instruction inst) const {
702 UNREFERENCED_PARAMETER(inst); // To silence compiler. 702 UNREFERENCED_PARAMETER(inst); // To silence compiler.
703 // relative: 'true' 703 // relative: 'true'
704 return true; 704 return true;
705 } 705 }
706 706
707 int32_t Actual_BL_BLX_immediate_cccc1011iiiiiiiiiiiiiiiiiiiiiiii_case_1:: 707 int32_t Actual_BL_BLX_immediate_cccc1011iiiiiiiiiiiiiiiiiiiiiiii_case_1::
708 branch_target_offset(Instruction inst) const { 708 branch_target_offset(Instruction inst) const {
709 UNREFERENCED_PARAMETER(inst); // To silence compiler. 709 UNREFERENCED_PARAMETER(inst); // To silence compiler.
710 // relative_offset: "SignExtend(inst(23:0):'00'(1:0), 32)" 710 // relative_offset: "SignExtend(inst(23:0):'00'(1:0), 32) + 8"
711 return (((((((inst.Bits() & 0x00FFFFFF)) << 2) | (0 & 0x00000003))) & 0x020000 00) 711 return (((((((inst.Bits() & 0x00FFFFFF)) << 2) | (0 & 0x00000003))) & 0x020000 00)
712 ? ((((((inst.Bits() & 0x00FFFFFF)) << 2) | (0 & 0x00000003))) | 0xFC00000 0) 712 ? ((((((inst.Bits() & 0x00FFFFFF)) << 2) | (0 & 0x00000003))) | 0xFC00000 0)
713 : ((((inst.Bits() & 0x00FFFFFF)) << 2) | (0 & 0x00000003))); 713 : ((((inst.Bits() & 0x00FFFFFF)) << 2) | (0 & 0x00000003))) + 8;
714 } 714 }
715 715
716 SafetyLevel Actual_BL_BLX_immediate_cccc1011iiiiiiiiiiiiiiiiiiiiiiii_case_1:: 716 SafetyLevel Actual_BL_BLX_immediate_cccc1011iiiiiiiiiiiiiiiiiiiiiiii_case_1::
717 safety(Instruction inst) const { 717 safety(Instruction inst) const {
718 UNREFERENCED_PARAMETER(inst); // To silence compiler. 718 UNREFERENCED_PARAMETER(inst); // To silence compiler.
719 719
720 // true => MAY_BE_SAFE 720 // true => MAY_BE_SAFE
721 if (true) 721 if (true)
722 return MAY_BE_SAFE; 722 return MAY_BE_SAFE;
723 723
724 return MAY_BE_SAFE; 724 return MAY_BE_SAFE;
725 } 725 }
726 726
727 727
728 RegisterList Actual_BL_BLX_immediate_cccc1011iiiiiiiiiiiiiiiiiiiiiiii_case_1:: 728 RegisterList Actual_BL_BLX_immediate_cccc1011iiiiiiiiiiiiiiiiiiiiiiii_case_1::
729 uses(Instruction inst) const { 729 uses(Instruction inst) const {
730 UNREFERENCED_PARAMETER(inst); // To silence compiler. 730 UNREFERENCED_PARAMETER(inst); // To silence compiler.
731 // uses: '{15}' 731 // uses: '{15}'
732 return RegisterList(). 732 return RegisterList().
733 Add(Register(15)); 733 Add(Register(15));
734 } 734 }
735 735
736 // Actual_B_cccc1010iiiiiiiiiiiiiiiiiiiiiiii_case_1 736 // Actual_B_cccc1010iiiiiiiiiiiiiiiiiiiiiiii_case_1
737 // 737 //
738 // Actual: 738 // Actual:
739 // {defs: {15}, 739 // {defs: {15},
740 // relative: true, 740 // relative: true,
741 // relative_offset: SignExtend(inst(23:0):'00'(1:0), 32), 741 // relative_offset: SignExtend(inst(23:0):'00'(1:0), 32) + 8,
742 // safety: [true => MAY_BE_SAFE], 742 // safety: [true => MAY_BE_SAFE],
743 // uses: {15}} 743 // uses: {15}}
744 744
745 RegisterList Actual_B_cccc1010iiiiiiiiiiiiiiiiiiiiiiii_case_1:: 745 RegisterList Actual_B_cccc1010iiiiiiiiiiiiiiiiiiiiiiii_case_1::
746 defs(Instruction inst) const { 746 defs(Instruction inst) const {
747 UNREFERENCED_PARAMETER(inst); // To silence compiler. 747 UNREFERENCED_PARAMETER(inst); // To silence compiler.
748 // defs: '{15}' 748 // defs: '{15}'
749 return RegisterList(). 749 return RegisterList().
750 Add(Register(15)); 750 Add(Register(15));
751 } 751 }
752 752
753 bool Actual_B_cccc1010iiiiiiiiiiiiiiiiiiiiiiii_case_1:: 753 bool Actual_B_cccc1010iiiiiiiiiiiiiiiiiiiiiiii_case_1::
754 is_relative_branch(Instruction inst) const { 754 is_relative_branch(Instruction inst) const {
755 UNREFERENCED_PARAMETER(inst); // To silence compiler. 755 UNREFERENCED_PARAMETER(inst); // To silence compiler.
756 // relative: 'true' 756 // relative: 'true'
757 return true; 757 return true;
758 } 758 }
759 759
760 int32_t Actual_B_cccc1010iiiiiiiiiiiiiiiiiiiiiiii_case_1:: 760 int32_t Actual_B_cccc1010iiiiiiiiiiiiiiiiiiiiiiii_case_1::
761 branch_target_offset(Instruction inst) const { 761 branch_target_offset(Instruction inst) const {
762 UNREFERENCED_PARAMETER(inst); // To silence compiler. 762 UNREFERENCED_PARAMETER(inst); // To silence compiler.
763 // relative_offset: "SignExtend(inst(23:0):'00'(1:0), 32)" 763 // relative_offset: "SignExtend(inst(23:0):'00'(1:0), 32) + 8"
764 return (((((((inst.Bits() & 0x00FFFFFF)) << 2) | (0 & 0x00000003))) & 0x020000 00) 764 return (((((((inst.Bits() & 0x00FFFFFF)) << 2) | (0 & 0x00000003))) & 0x020000 00)
765 ? ((((((inst.Bits() & 0x00FFFFFF)) << 2) | (0 & 0x00000003))) | 0xFC00000 0) 765 ? ((((((inst.Bits() & 0x00FFFFFF)) << 2) | (0 & 0x00000003))) | 0xFC00000 0)
766 : ((((inst.Bits() & 0x00FFFFFF)) << 2) | (0 & 0x00000003))); 766 : ((((inst.Bits() & 0x00FFFFFF)) << 2) | (0 & 0x00000003))) + 8;
767 } 767 }
768 768
769 SafetyLevel Actual_B_cccc1010iiiiiiiiiiiiiiiiiiiiiiii_case_1:: 769 SafetyLevel Actual_B_cccc1010iiiiiiiiiiiiiiiiiiiiiiii_case_1::
770 safety(Instruction inst) const { 770 safety(Instruction inst) const {
771 UNREFERENCED_PARAMETER(inst); // To silence compiler. 771 UNREFERENCED_PARAMETER(inst); // To silence compiler.
772 772
773 // true => MAY_BE_SAFE 773 // true => MAY_BE_SAFE
774 if (true) 774 if (true)
775 return MAY_BE_SAFE; 775 return MAY_BE_SAFE;
776 776
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 // defs: Union({inst(19:16) 1105 // defs: Union({inst(19:16)
1106 // if inst(21)=1 1106 // if inst(21)=1
1107 // else 32}, RegisterList(inst(15:0))), 1107 // else 32}, RegisterList(inst(15:0))),
1108 // safety: [15 == 1108 // safety: [15 ==
1109 // inst(19:16) || 1109 // inst(19:16) ||
1110 // NumGPRs(RegisterList(inst(15:0))) < 1110 // NumGPRs(RegisterList(inst(15:0))) <
1111 // 1 => UNPREDICTABLE, 1111 // 1 => UNPREDICTABLE,
1112 // Contains(RegisterList(inst(15:0)), 15) => FORBIDDEN_OPERANDS, 1112 // Contains(RegisterList(inst(15:0)), 15) => FORBIDDEN_OPERANDS,
1113 // inst(21)=1 && 1113 // inst(21)=1 &&
1114 // Contains(RegisterList(inst(15:0)), inst(19:16)) => UNKNOWN], 1114 // Contains(RegisterList(inst(15:0)), inst(19:16)) => UNKNOWN],
1115 // small_imm_base_wb: true, 1115 // small_imm_base_wb: inst(21)=1,
1116 // uses: {inst(19:16)}} 1116 // uses: {inst(19:16)}}
1117 1117
1118 Register Actual_LDMDA_LDMFA_cccc100000w1nnnnrrrrrrrrrrrrrrrr_case_1:: 1118 Register Actual_LDMDA_LDMFA_cccc100000w1nnnnrrrrrrrrrrrrrrrr_case_1::
1119 base_address_register(Instruction inst) const { 1119 base_address_register(Instruction inst) const {
1120 UNREFERENCED_PARAMETER(inst); // To silence compiler. 1120 UNREFERENCED_PARAMETER(inst); // To silence compiler.
1121 // base: 'inst(19:16)' 1121 // base: 'inst(19:16)'
1122 return Register(((inst.Bits() & 0x000F0000) >> 16)); 1122 return Register(((inst.Bits() & 0x000F0000) >> 16));
1123 } 1123 }
1124 1124
1125 RegisterList Actual_LDMDA_LDMFA_cccc100000w1nnnnrrrrrrrrrrrrrrrr_case_1:: 1125 RegisterList Actual_LDMDA_LDMFA_cccc100000w1nnnnrrrrrrrrrrrrrrrr_case_1::
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 return FORBIDDEN_OPERANDS; 1159 return FORBIDDEN_OPERANDS;
1160 1160
1161 return MAY_BE_SAFE; 1161 return MAY_BE_SAFE;
1162 } 1162 }
1163 1163
1164 1164
1165 bool Actual_LDMDA_LDMFA_cccc100000w1nnnnrrrrrrrrrrrrrrrr_case_1:: 1165 bool Actual_LDMDA_LDMFA_cccc100000w1nnnnrrrrrrrrrrrrrrrr_case_1::
1166 base_address_register_writeback_small_immediate( 1166 base_address_register_writeback_small_immediate(
1167 Instruction inst) const { 1167 Instruction inst) const {
1168 UNREFERENCED_PARAMETER(inst); // To silence compiler. 1168 UNREFERENCED_PARAMETER(inst); // To silence compiler.
1169 // small_imm_base_wb: 'true' 1169 // small_imm_base_wb: 'inst(21)=1'
1170 return true; 1170 return (inst.Bits() & 0x00200000) ==
1171 0x00200000;
1171 } 1172 }
1172 1173
1173 RegisterList Actual_LDMDA_LDMFA_cccc100000w1nnnnrrrrrrrrrrrrrrrr_case_1:: 1174 RegisterList Actual_LDMDA_LDMFA_cccc100000w1nnnnrrrrrrrrrrrrrrrr_case_1::
1174 uses(Instruction inst) const { 1175 uses(Instruction inst) const {
1175 UNREFERENCED_PARAMETER(inst); // To silence compiler. 1176 UNREFERENCED_PARAMETER(inst); // To silence compiler.
1176 // uses: '{inst(19:16)}' 1177 // uses: '{inst(19:16)}'
1177 return RegisterList(). 1178 return RegisterList().
1178 Add(Register(((inst.Bits() & 0x000F0000) >> 16))); 1179 Add(Register(((inst.Bits() & 0x000F0000) >> 16)));
1179 } 1180 }
1180 1181
(...skipping 2735 matching lines...) Expand 10 before | Expand all | Expand 10 after
3916 // if inst(21)=1 3917 // if inst(21)=1
3917 // else 32}, 3918 // else 32},
3918 // safety: [15 == 3919 // safety: [15 ==
3919 // inst(19:16) || 3920 // inst(19:16) ||
3920 // NumGPRs(RegisterList(inst(15:0))) < 3921 // NumGPRs(RegisterList(inst(15:0))) <
3921 // 1 => UNPREDICTABLE, 3922 // 1 => UNPREDICTABLE,
3922 // inst(21)=1 && 3923 // inst(21)=1 &&
3923 // Contains(RegisterList(inst(15:0)), inst(19:16)) && 3924 // Contains(RegisterList(inst(15:0)), inst(19:16)) &&
3924 // SmallestGPR(RegisterList(inst(15:0))) != 3925 // SmallestGPR(RegisterList(inst(15:0))) !=
3925 // inst(19:16) => UNKNOWN], 3926 // inst(19:16) => UNKNOWN],
3926 // small_imm_base_wb: true, 3927 // small_imm_base_wb: inst(21)=1,
3927 // uses: Union({inst(19:16)}, RegisterList(inst(15:0)))} 3928 // uses: Union({inst(19:16)}, RegisterList(inst(15:0)))}
3928 3929
3929 Register Actual_STMDA_STMED_cccc100000w0nnnnrrrrrrrrrrrrrrrr_case_1:: 3930 Register Actual_STMDA_STMED_cccc100000w0nnnnrrrrrrrrrrrrrrrr_case_1::
3930 base_address_register(Instruction inst) const { 3931 base_address_register(Instruction inst) const {
3931 UNREFERENCED_PARAMETER(inst); // To silence compiler. 3932 UNREFERENCED_PARAMETER(inst); // To silence compiler.
3932 // base: 'inst(19:16)' 3933 // base: 'inst(19:16)'
3933 return Register(((inst.Bits() & 0x000F0000) >> 16)); 3934 return Register(((inst.Bits() & 0x000F0000) >> 16));
3934 } 3935 }
3935 3936
3936 RegisterList Actual_STMDA_STMED_cccc100000w0nnnnrrrrrrrrrrrrrrrr_case_1:: 3937 RegisterList Actual_STMDA_STMED_cccc100000w0nnnnrrrrrrrrrrrrrrrr_case_1::
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
3969 return UNKNOWN; 3970 return UNKNOWN;
3970 3971
3971 return MAY_BE_SAFE; 3972 return MAY_BE_SAFE;
3972 } 3973 }
3973 3974
3974 3975
3975 bool Actual_STMDA_STMED_cccc100000w0nnnnrrrrrrrrrrrrrrrr_case_1:: 3976 bool Actual_STMDA_STMED_cccc100000w0nnnnrrrrrrrrrrrrrrrr_case_1::
3976 base_address_register_writeback_small_immediate( 3977 base_address_register_writeback_small_immediate(
3977 Instruction inst) const { 3978 Instruction inst) const {
3978 UNREFERENCED_PARAMETER(inst); // To silence compiler. 3979 UNREFERENCED_PARAMETER(inst); // To silence compiler.
3979 // small_imm_base_wb: 'true' 3980 // small_imm_base_wb: 'inst(21)=1'
3980 return true; 3981 return (inst.Bits() & 0x00200000) ==
3982 0x00200000;
3981 } 3983 }
3982 3984
3983 RegisterList Actual_STMDA_STMED_cccc100000w0nnnnrrrrrrrrrrrrrrrr_case_1:: 3985 RegisterList Actual_STMDA_STMED_cccc100000w0nnnnrrrrrrrrrrrrrrrr_case_1::
3984 uses(Instruction inst) const { 3986 uses(Instruction inst) const {
3985 UNREFERENCED_PARAMETER(inst); // To silence compiler. 3987 UNREFERENCED_PARAMETER(inst); // To silence compiler.
3986 // uses: 'Union({inst(19:16)}, RegisterList(inst(15:0)))' 3988 // uses: 'Union({inst(19:16)}, RegisterList(inst(15:0)))'
3987 return nacl_arm_dec::Union(RegisterList(). 3989 return nacl_arm_dec::Union(RegisterList().
3988 Add(Register(((inst.Bits() & 0x000F0000) >> 16))), nacl_arm_dec::RegisterList ((inst.Bits() & 0x0000FFFF))); 3990 Add(Register(((inst.Bits() & 0x000F0000) >> 16))), nacl_arm_dec::RegisterList ((inst.Bits() & 0x0000FFFF)));
3989 } 3991 }
3990 3992
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
5157 5159
5158 5160
5159 RegisterList Actual_VABA_1111001u0dssnnnndddd0111nqm1mmmm_case_1:: 5161 RegisterList Actual_VABA_1111001u0dssnnnndddd0111nqm1mmmm_case_1::
5160 uses(Instruction inst) const { 5162 uses(Instruction inst) const {
5161 UNREFERENCED_PARAMETER(inst); // To silence compiler. 5163 UNREFERENCED_PARAMETER(inst); // To silence compiler.
5162 // uses: '{}' 5164 // uses: '{}'
5163 return RegisterList(); 5165 return RegisterList();
5164 } 5166 }
5165 5167
5166 } // namespace nacl_arm_dec 5168 } // namespace nacl_arm_dec
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698