Deleted Added
sdiff udiff text old ( 7316:bb190cb8ee69 ) new ( 7408:ee6949c5bb5b )
full compact
1// Copyright (c) 2010 ARM Limited
2// All rights reserved
3//
4// The license below extends only to copyright in the software and shall
5// not be construed as granting a license to any other intellectual
6// property including but not limited to intellectual property relating
7// to a hardware implementation of the functionality of the software
8// licensed hereunder. You may use the software subject to the license

--- 838 unchanged lines hidden (view full) ---

847 const uint32_t imm3 = bits(machInst, 8, 6);
848 const uint32_t imm8 = bits(machInst, 7, 0);
849 const IntRegIndex rd = (IntRegIndex)(uint32_t)bits(machInst, 2, 0);
850 const IntRegIndex rd8 = (IntRegIndex)(uint32_t)bits(machInst, 10, 8);
851 const IntRegIndex rn = (IntRegIndex)(uint32_t)bits(machInst, 5, 3);
852 const IntRegIndex rm = (IntRegIndex)(uint32_t)bits(machInst, 8, 6);
853 switch (bits(machInst, 13, 11)) {
854 case 0x0: // lsl
855 return new MovRegCc(machInst, rd, INTREG_ZERO, rn, imm5, LSL);
856 case 0x1: // lsr
857 return new MovRegCc(machInst, rd, INTREG_ZERO, rn, imm5, LSR);
858 case 0x2: // asr
859 return new MovRegCc(machInst, rd, INTREG_ZERO, rn, imm5, ASR);
860 case 0x3:
861 switch (bits(machInst, 10, 9)) {
862 case 0x0:
863 return new AddRegCc(machInst, rd, rn, rm, 0, LSL);
864 case 0x1:
865 return new SubRegCc(machInst, rd, rn, rm, 0, LSL);
866 case 0x2:
867 return new AddImmCc(machInst, rd, rn, imm3, true);
868 case 0x3:
869 return new SubImmCc(machInst, rd, rn, imm3, true);
870 }
871 case 0x4:
872 return new MovImmCc(machInst, rd8, INTREG_ZERO, imm8, false);
873 case 0x5:
874 return new CmpImmCc(machInst, INTREG_ZERO, rd8, imm8, true);
875 case 0x6:
876 return new AddImmCc(machInst, rd8, rd8, imm8, true);
877 case 0x7:
878 return new SubImmCc(machInst, rd8, rd8, imm8, true);
879 }
880 }
881 '''
882}};
883
884def format Thumb16DataProcessing() {{
885 decode_block = '''
886 {
887 const IntRegIndex rdn = (IntRegIndex)(uint32_t)bits(machInst, 2, 0);
888 const IntRegIndex rm = (IntRegIndex)(uint32_t)bits(machInst, 5, 3);
889 switch (bits(machInst, 9, 6)) {
890 case 0x0:
891 return new AndRegCc(machInst, rdn, rdn, rm, 0, LSL);
892 case 0x1:
893 return new EorRegCc(machInst, rdn, rdn, rm, 0, LSL);
894 case 0x2: //lsl
895 return new MovRegRegCc(machInst, rdn, INTREG_ZERO, rdn, rm, LSL);
896 case 0x3: //lsr
897 return new MovRegRegCc(machInst, rdn, INTREG_ZERO, rdn, rm, LSR);
898 case 0x4: //asr
899 return new MovRegRegCc(machInst, rdn, INTREG_ZERO, rdn, rm, ASR);
900 case 0x5:
901 return new AdcRegCc(machInst, rdn, rdn, rm, 0, LSL);
902 case 0x6:
903 return new SbcRegCc(machInst, rdn, rdn, rm, 0, LSL);
904 case 0x7: // ror
905 return new MovRegRegCc(machInst, rdn, INTREG_ZERO, rdn, rm, ROR);
906 case 0x8:
907 return new TstRegCc(machInst, INTREG_ZERO, rdn, rm, 0, LSL);
908 case 0x9:
909 return new RsbImmCc(machInst, rdn, rm, 0, true);
910 case 0xa:
911 return new CmpRegCc(machInst, INTREG_ZERO, rdn, rm, 0, LSL);
912 case 0xb:
913 return new CmnRegCc(machInst, INTREG_ZERO, rdn, rm, 0, LSL);
914 case 0xc:
915 return new OrrRegCc(machInst, rdn, rdn, rm, 0, LSL);
916 case 0xd:
917 return new MulCc(machInst, rdn, rm, rdn);
918 case 0xe:
919 return new BicRegCc(machInst, rdn, rdn, rm, 0, LSL);
920 case 0xf:
921 return new MvnRegCc(machInst, rdn, INTREG_ZERO, rm, 0, LSL);
922 }
923 }
924 '''
925}};
926
927def format Thumb16SpecDataAndBx() {{
928 decode_block = '''
929 {

--- 135 unchanged lines hidden (view full) ---

1065 const uint32_t regList = bits(machInst, 7, 0) | (p << 15);
1066 return new LdmStm(machInst, INTREG_SP, true, true, false,
1067 true, true, regList);
1068 }
1069 case 0xe:
1070 return new WarnUnimplemented("bkpt", machInst);
1071 case 0xf:
1072 if (bits(machInst, 3, 0) != 0)
1073 return new WarnUnimplemented("it", machInst);
1074 switch (bits(machInst, 7, 4)) {
1075 case 0x0:
1076 return new NopInst(machInst);
1077 case 0x1:
1078 return new WarnUnimplemented("yield", machInst);
1079 case 0x2:
1080 return new WarnUnimplemented("wfe", machInst);
1081 case 0x3:

--- 313 unchanged lines hidden ---