Răsfoiți Sursa

Added full 16-bit Thumb support to the ARM internal writer.

git-svn-id: branches/laksen/armiw@29326 -
Jeppe Johansen 10 ani în urmă
părinte
comite
3cb9b30165
4 a modificat fișierele cu 1157 adăugiri și 30 ștergeri
  1. 388 8
      compiler/arm/aasmcpu.pas
  2. 151 20
      compiler/arm/armins.dat
  3. 1 1
      compiler/arm/armnop.inc
  4. 617 1
      compiler/arm/armtab.inc

+ 388 - 8
compiler/arm/aasmcpu.pas

@@ -54,7 +54,8 @@ uses
                      $00000200;
 
       OT_SIZE_MASK = $000003FF;  { all the size attributes  }
-      OT_NON_SIZE  = longint(not OT_SIZE_MASK);
+      OT_NON_SIZE  = $0FFFF800;
+      OT_OPT_SIZE  = $F0000000;
 
       OT_SIGNED    = $00000100;  { the operand need to be signed -128-127 }
 
@@ -85,6 +86,8 @@ uses
       OT_REG8      = $00201001;
       OT_REG16     = $00201002;
       OT_REG32     = $00201004;
+      OT_REGLO     = $10201004;  { lower reg (r0-r7) }
+      OT_REGSP     = $20201004;
       OT_REG64     = $00201008;
       OT_VREG      = $00201010;  { vector register }
       OT_REGF      = $00201020;  { coproc register }
@@ -96,13 +99,13 @@ uses
       OT_MEM80     = $00204010;
       { word/byte load/store }
       OT_AM2       = $00010000;
-      { misc ld/st operations }
+      { misc ld/st operations, thumb reg indexed }
       OT_AM3       = $00020000;
-      { multiple ld/st operations }
+      { multiple ld/st operations or thumb imm indexed }
       OT_AM4       = $00040000;
-      { co proc. ld/st operations }
+      { co proc. ld/st operations or thumb sp+imm indexed }
       OT_AM5       = $00080000;
-      { exclusive ld/st operations }
+      { exclusive ld/st operations or thumb pc+imm indexed }
       OT_AM6       = $00100000;
       OT_AMMASK    = $001f0000;
       { IT instruction }
@@ -254,11 +257,14 @@ uses
          procedure ppubuildderefimploper(var o:toper);override;
          procedure ppuderefoper(var o:toper);override;
       private
+         fArmVMask,
+         fArmMask  : longint;
          { next fields are filled in pass1, so pass2 is faster }
          inssize   : shortint;
          insoffset : longint;
          LastInsOffset : longint; { need to be public to be reset }
          insentry  : PInsEntry;
+         procedure BuildArmMasks;
          function  InsEnd:longint;
          procedure create_ot(objdata:TObjData);
          function  Matches(p:PInsEntry):longint;
@@ -1277,6 +1283,41 @@ implementation
                 end;
             end;
 
+            curtai:=tai(curtai.Next);
+          end;
+      end;
+
+
+    procedure ensurethumbencodings(list: TAsmList);
+      var
+        curtai: tai;
+        op2reg: TRegister;
+      begin
+        { Do Thumb 16bit transformations to form valid instruction forms }
+        curtai:=tai(list.first);
+        while assigned(curtai) do
+          begin
+            case curtai.typ of
+              ait_instruction:
+                begin
+                  case taicpu(curtai).opcode of
+                    A_ADD,
+                    A_AND,A_EOR,A_ORR,A_BIC,
+                    A_LSL,A_LSR,A_ASR,A_ROR,
+                    A_ADC,A_SBC:
+                      begin
+                        if (taicpu(curtai).ops = 3) and
+                           (taicpu(curtai).oper[2]^.typ=top_reg) and
+                           (taicpu(curtai).oper[0]^.reg=taicpu(curtai).oper[1]^.reg) and
+                           (taicpu(curtai).oper[0]^.reg<>NR_STACK_POINTER_REG) then
+                          begin
+                            taicpu(curtai).oper[1]^.reg:=taicpu(curtai).oper[2]^.reg;
+                            taicpu(curtai).ops:=2;
+                          end;
+                      end;
+                  end;
+                end;
+            end;
 
             curtai:=tai(curtai.Next);
           end;
@@ -1423,9 +1464,12 @@ implementation
         { Do Thumb-2 16bit -> 32bit transformations }
         if GenerateThumb2Code then
           begin
+            ensurethumbencodings(list);
             ensurethumb2encodings(list);
             foldITInstructions(list);
-          end;
+          end
+        else if GenerateThumbCode then
+          ensurethumbencodings(list);
 
         fix_invalid_imms(list);
 
@@ -1811,6 +1855,43 @@ implementation
       end;
 
 
+    procedure taicpu.BuildArmMasks;
+      const
+        Masks: array[tcputype] of longint =
+          (
+            IF_NONE,
+            IF_ARMv4,
+            IF_ARMv4,
+            IF_ARMv4T or IF_ARMv4,
+            IF_ARMv4T or IF_ARMv4 or IF_ARMv5,
+            IF_ARMv4T or IF_ARMv4 or IF_ARMv5 or IF_ARMv5T,
+            IF_ARMv4T or IF_ARMv4 or IF_ARMv5 or IF_ARMv5T or IF_ARMv5TE,
+            IF_ARMv4T or IF_ARMv4 or IF_ARMv5 or IF_ARMv5T or IF_ARMv5TE or IF_ARMv5TEJ,
+            IF_ARMv4T or IF_ARMv4 or IF_ARMv5 or IF_ARMv5T or IF_ARMv5TE or IF_ARMv5TEJ or IF_armv6,
+            IF_ARMv4T or IF_ARMv4 or IF_ARMv5 or IF_ARMv5T or IF_ARMv5TE or IF_ARMv5TEJ or IF_armv6 or IF_ARMv6K,
+            IF_ARMv4T or IF_ARMv4 or IF_ARMv5 or IF_ARMv5T or IF_ARMv5TE or IF_ARMv5TEJ or IF_armv6 or IF_ARMv6K or IF_ARMv6T2,
+            IF_ARMv4T or IF_ARMv4 or IF_ARMv5 or IF_ARMv5T or IF_ARMv5TE or IF_ARMv5TEJ or IF_armv6 or IF_ARMv6K or IF_ARMv6T2 or IF_ARMv6Z,
+            IF_ARMv4T or IF_ARMv5T or IF_ARMv6M,
+            IF_ARMv4T or IF_ARMv4 or IF_ARMv5 or IF_ARMv5T or IF_ARMv5TE or IF_ARMv5TEJ or IF_armv6 or IF_ARMv6K or IF_ARMv6T2 or IF_ARMv6Z or IF_ARMv7,
+            IF_ARMv4T or IF_ARMv4 or IF_ARMv5 or IF_ARMv5T or IF_ARMv5TE or IF_ARMv5TEJ or IF_armv6 or IF_ARMv6K or IF_ARMv6T2 or IF_ARMv6Z or IF_ARMv7 or IF_ARMv7A,
+            IF_ARMv4T or IF_ARMv4 or IF_ARMv5 or IF_ARMv5T or IF_ARMv5TE or IF_ARMv5TEJ or IF_armv6 or IF_ARMv6K or IF_ARMv6T2 or IF_ARMv6Z or IF_ARMv7 or IF_ARMv7A or IF_ARMv7R,
+            IF_ARMv4T or IF_ARMv5T or IF_ARMv6T2 or IF_ARMv7M,
+            IF_ARMv4T or IF_ARMv5T or IF_ARMv6T2 or IF_ARMv7M or IF_ARMv7EM
+          );
+      begin
+        fArmVMask:=Masks[current_settings.cputype];
+
+        if current_settings.instructionset=is_thumb then
+          begin
+            fArmMask:=IF_THUMB;
+            if CPUARM_HAS_THUMB2 in cpu_capabilities[current_settings.cputype] then
+             fArmMask:=fArmMask or IF_THUMB32;
+          end
+        else
+          fArmMask:=IF_ARM32;
+      end;
+
+
     function  taicpu.InsEnd:longint;
       begin
         Result:=0; { unimplemented }
@@ -1838,7 +1919,13 @@ implementation
                 begin
                   case getregtype(reg) of
                     R_INTREGISTER:
-                      ot:=OT_REG32 or OT_SHIFTEROP;
+                      begin
+                        ot:=OT_REG32 or OT_SHIFTEROP;
+                        if getsupreg(reg)<8 then
+                          ot:=ot or OT_REGLO
+                        else if reg=NR_STACK_POINTER_REG then
+                          ot:=ot or OT_REGSP;
+                      end;
                     R_FPUREGISTER:
                       ot:=OT_FPUREG;
                     R_MMREGISTER:
@@ -1875,7 +1962,19 @@ implementation
                         ref^.base:=NR_PC;
 
                       { determine possible address modes }
-                      if (ref^.base<>NR_NO) and
+                      if GenerateThumbCode or
+                         GenerateThumb2Code then
+                        begin
+                          if (ref^.base=NR_PC) then
+                            ot:=ot or OT_AM6
+                          else if (ref^.base=NR_STACK_POINTER_REG) then
+                            ot:=ot or OT_AM5
+                          else if ref^.index=NR_NO then
+                            ot:=ot or OT_AM4
+                          else
+                            ot:=ot or OT_AM3;
+                        end
+                      else if (ref^.base<>NR_NO) and
                         (opcode in [A_LDREX,A_LDREXB,A_LDREXH,A_LDREXD,
                                     A_STREX,A_STREXB,A_STREXH,A_STREXD]) and
                         (
@@ -2002,6 +2101,20 @@ implementation
            exit;
          end;
 
+        { check ARM instruction version }
+        if (p^.flags and fArmVMask)=0 then
+          begin
+            Matches:=0;
+            exit;
+          end;
+
+        { check ARM instruction type }
+        if (p^.flags and fArmMask)=0 then
+          begin
+            Matches:=0;
+            exit;
+          end;
+
         { Check that no spurious colons or TOs are present }
         for i:=0 to p^.ops-1 do
          if (oper[i]^.ot and (not p^.optypes[i]) and (OT_COLON or OT_TO))<>0 then
@@ -2023,6 +2136,12 @@ implementation
                  Matches:=0;
                  exit;
                end
+              else if ((p^.optypes[i] and OT_OPT_SIZE)<>0) and
+                       ((p^.optypes[i] and OT_OPT_SIZE)<>(oper[i]^.ot and OT_OPT_SIZE)) then
+               begin
+                 Matches:=0;
+                 exit;
+               end
               else
                Matches:=1;
             end;
@@ -2077,6 +2196,45 @@ implementation
           exit;
         end;
 
+      { Check thumb flags }
+      if p^.code[0] in [#$60..#$61] then
+        begin
+          if (p^.code[0]=#$60) and
+             ((oppostfix<>PF_S) and
+              (condition<>C_None)) then
+            begin
+              Matches:=0;
+              exit;
+            end
+          else if (p^.code[0]=#$61) and
+             (oppostfix=PF_S) then
+            begin
+              Matches:=0;
+              exit;
+            end;
+        end
+      else if p^.code[0]=#$62 then
+        begin
+          if (condition<>C_None) then
+            begin
+              Matches:=0;
+              exit;
+            end;
+        end
+      else if p^.code[0]=#$64 then
+        begin
+          if (opcode=A_MUL) then
+            begin
+              if (ops<>3) or
+                 (oper[2]^.typ<>top_reg) or
+                 (oper[0]^.reg<>oper[2]^.reg) then
+                begin
+                  matches:=0;
+                  exit;
+                end;
+            end;
+        end;
+
       { Check operand sizes }
         { as default an untyped size can get all the sizes, this is different
           from nasm, but else we need to do a lot checking which opcodes want
@@ -2172,6 +2330,8 @@ implementation
          begin
            { create the .ot fields }
            create_ot(objdata);
+
+           BuildArmMasks;
            { set the file postion }
            current_filepos:=fileinfo;
          end
@@ -3742,6 +3902,226 @@ implementation
               else
                 message(asmw_e_invalid_opcode_and_operands);
             end;
+          #$60..#$61: { Thumb }
+            begin
+              bytelen:=2;
+              bytes:=0;
+
+              { set opcode }
+              bytes:=bytes or (ord(insentry^.code[1]) shl 8);
+              bytes:=bytes or ord(insentry^.code[2]);
+              { set regs }
+              if ops>=2 then
+                begin
+                  if oper[1]^.typ=top_reg then
+                    begin
+                      bytes:=bytes or (getsupreg(oper[0]^.reg) and $7) or ((getsupreg(oper[0]^.reg) shr 3) shl 7);
+                      bytes:=bytes or (getsupreg(oper[1]^.reg) shl 3);
+
+                      if ops=3 then
+                        begin
+                          case oper[2]^.typ of
+                            top_const:
+                              bytes:=bytes or ((oper[2]^.val and $1F) shl 6);
+                            top_reg:
+                              bytes:=bytes or ((getsupreg(oper[2]^.reg) and $7) shl 6);
+                          end;
+                        end;
+                    end
+                  else if oper[1]^.typ=top_const then
+                    begin
+                      bytes:=bytes or ((getsupreg(oper[0]^.reg) and $7) shl 8);
+                      bytes:=bytes or (oper[1]^.val and $FF);
+                    end;
+                end
+              else if ops=1 then
+                begin
+                  if oper[0]^.typ=top_const then
+                    bytes:=bytes or (oper[0]^.val and $FF);
+                end;
+            end;
+          #$62..#$63: { Thumb branches }
+            begin
+              bytelen:=2;
+              bytes:=0;
+
+              { set opcode }
+              bytes:=bytes or (ord(insentry^.code[1]) shl 8);
+              bytes:=bytes or ord(insentry^.code[2]);
+
+              if insentry^.code[0]=#$63 then
+                bytes:=bytes or (CondVal[condition] shl 8);
+
+              if oper[0]^.typ=top_const then
+                begin
+                  if insentry^.code[0]=#$63 then
+                    bytes:=bytes or ((oper[0]^.val shr 1) and $FF)
+                  else
+                    bytes:=bytes or ((oper[0]^.val shr 1) and $3FF);
+                end
+              else if oper[0]^.typ=top_reg then
+                begin
+                  bytes:=bytes or (getsupreg(oper[0]^.reg) shl 3);
+                end;
+            end;
+          #$64: { Thumb: Special encodings }
+            begin
+              bytelen:=2;
+              bytes:=0;
+
+              { set opcode }
+              bytes:=bytes or (ord(insentry^.code[1]) shl 8);
+              bytes:=bytes or ord(insentry^.code[2]);
+
+              case opcode of
+                A_SUB:
+                  if(ops=3) then
+                    bytes:=bytes or ((oper[2]^.val shr 2) and $7F);
+                A_MUL:
+                  if (ops=3) then
+                    begin
+                      bytes:=bytes or (getsupreg(oper[0]^.reg) and $7);
+                      bytes:=bytes or (getsupreg(oper[1]^.reg) shl 3);
+                    end;
+                A_ADD:
+                  begin
+                    if ops=2 then
+                      begin
+                        bytes:=bytes or (getsupreg(oper[1]^.reg) shl $3);
+                      end
+                    else if (oper[0]^.reg<>NR_STACK_POINTER_REG) and
+                       (oper[2]^.typ=top_const) then
+                      begin
+                        bytes:=bytes or (getsupreg(oper[0]^.reg) and $7) shl 8;
+                        bytes:=bytes or ((oper[2]^.val shr 2) and $7F);
+                      end
+                    else if (oper[0]^.reg<>NR_STACK_POINTER_REG) and
+                       (oper[2]^.typ=top_reg) then
+                      begin
+                        bytes:=bytes or (getsupreg(oper[0]^.reg) and $7);
+                        bytes:=bytes or ((getsupreg(oper[0]^.reg) and $8) shr 3) shl 7;
+                      end
+                    else
+                      bytes:=bytes or ((oper[2]^.val shr 2) and $7F);
+                  end;
+              end;
+            end;
+          #$65: { Thumb load/store }
+            begin
+              bytelen:=2;
+              bytes:=0;
+
+              { set opcode }
+              bytes:=bytes or (ord(insentry^.code[1]) shl 8);
+              bytes:=bytes or ord(insentry^.code[2]);
+              { set regs }
+              bytes:=bytes or (getsupreg(oper[0]^.reg) and $7);
+              bytes:=bytes or (getsupreg(oper[1]^.ref^.base) shl 3);
+              bytes:=bytes or (getsupreg(oper[1]^.ref^.index) shl 6);
+            end;
+          #$66: { Thumb load/store }
+            begin
+              bytelen:=2;
+              bytes:=0;
+
+              { set opcode }
+              bytes:=bytes or (ord(insentry^.code[1]) shl 8);
+              bytes:=bytes or ord(insentry^.code[2]);
+              { set regs }
+              bytes:=bytes or (getsupreg(oper[0]^.reg) and $7);
+              bytes:=bytes or (getsupreg(oper[1]^.ref^.base) shl 3);
+              bytes:=bytes or (((oper[1]^.ref^.offset shr ord(insentry^.code[3])) and $1F) shl 6);
+            end;
+          #$67: { Thumb load/store }
+            begin
+              bytelen:=2;
+              bytes:=0;
+
+              { set opcode }
+              bytes:=bytes or (ord(insentry^.code[1]) shl 8);
+              bytes:=bytes or ord(insentry^.code[2]);
+              { set regs }
+              bytes:=bytes or (getsupreg(oper[0]^.reg) shl 8);
+              if oper[1]^.typ=top_ref then
+                bytes:=bytes or ((oper[1]^.ref^.offset shr ord(insentry^.code[3])) and $FF)
+              else
+                bytes:=bytes or ((oper[1]^.val shr ord(insentry^.code[3])) and $FF);
+            end;
+          #$68: { Thumb CB{N}Z }
+            begin
+              bytelen:=2;
+              bytes:=0;
+
+              { set opcode }
+              bytes:=bytes or (ord(insentry^.code[1]) shl 8);
+              { set opers }
+              bytes:=bytes or (getsupreg(oper[0]^.reg) and $7);
+
+              if oper[1]^.typ=top_ref then
+                begin
+                  offset:=0;
+                  currsym:=objdata.symbolref(oper[1]^.ref^.symbol);
+                  if assigned(currsym) then
+                    offset:=currsym.offset-insoffset-8;
+                  offset:=offset+oper[1]^.ref^.offset;
+
+                  offset:=offset div 2;
+                end
+              else
+                offset:=oper[1]^.val div 2;
+
+              bytes:=bytes or ((offset) and $1F) shl 3;
+              bytes:=bytes or ((offset shr 5) and 1) shl 9;
+            end;
+          #$69: { Thumb: Push/Pop/Stm/Ldm }
+            begin
+              bytelen:=2;
+              bytes:=0;
+
+              { set opcode }
+              bytes:=bytes or (ord(insentry^.code[1]) shl 8);
+
+              case opcode of
+                A_PUSH:
+                  begin
+                    for r:=0 to 7 do
+                      if r in oper[0]^.regset^ then
+                        bytes:=bytes or (1 shl r);
+                    if RS_R14 in oper[0]^.regset^ then
+                      bytes:=bytes or (1 shl 8);
+                  end;
+                A_POP:
+                  begin
+                    for r:=0 to 7 do
+                      if r in oper[0]^.regset^ then
+                        bytes:=bytes or (1 shl r);
+                    if RS_R15 in oper[0]^.regset^ then
+                      bytes:=bytes or (1 shl 8);
+                  end;
+                A_STM:
+                  begin
+                    for r:=0 to 7 do
+                      if r in oper[1]^.regset^ then
+                        bytes:=bytes or (1 shl r);
+
+                    if oper[0]^.typ=top_ref then
+                      bytes:=bytes or (getsupreg(oper[0]^.ref^.base) shl 8)
+                    else
+                      bytes:=bytes or (getsupreg(oper[0]^.reg) shl 8);
+                  end;
+                A_LDM:
+                  begin
+                    for r:=0 to 7 do
+                      if r in oper[1]^.regset^ then
+                        bytes:=bytes or (1 shl r);
+
+                    if oper[0]^.typ=top_ref then
+                      bytes:=bytes or (getsupreg(oper[0]^.ref^.base) shl 8)
+                    else
+                      bytes:=bytes or (getsupreg(oper[0]^.reg) shl 8);
+                  end;
+              end;
+            end;
           #$fe: // No written data
             begin
               exit;

+ 151 - 20
compiler/arm/armins.dat

@@ -86,11 +86,24 @@
 void                  void                            none
 
 [ADCcc]
+reglo,reglo                 \x60\x41\x40                  THUMB,ARMv4T
+
 reg32,reg32,reg32           \4\x0\xA0                     ARM32,ARMv4
 reg32,reg32,reg32,shifterop \6\x0\xA0                     ARM32,ARMv4
 reg32,reg32,immshifter      \7\x2\xA0                     ARM32,ARMv4
 
 [ADDcc]
+reg32,reg32                 \x61\x44\x0                   THUMB,ARMv4T
+reglo,reglo,reglo           \x60\x18\x0                   THUMB,ARMv4T
+
+reglo,reglo,immshifter      \x60\x1C\x0                   THUMB,ARMv4T
+reglo,immshifter            \x60\x30\x0                   THUMB,ARMv4T
+
+reglo,regsp,immshifter      \x64\xA8\x00                  THUMB,ARMv4T
+regsp,regsp,immshifter      \x64\xB0\x00                  THUMB,ARMv4T
+reg32,regsp,reg32           \x64\x44\x68                  THUMB,ARMv4T
+regsp,reg32                 \x64\x44\x85                  THUMB,ARMv4T
+
 reg32,reg32,reg32           \4\x0\x80                     ARM32,ARMv4
 reg32,reg32,reg32,shifterop \6\x0\x80                     ARM32,ARMv4
 reg32,reg32,immshifter      \7\x2\x80                     ARM32,ARMv4
@@ -98,20 +111,34 @@ reg32,reg32,immshifter      \7\x2\x80                     ARM32,ARMv4
 [ADFcc]
 
 [ADRcc]
-;reg32,immshifter            \x33\x2\x0F                   ARM32,ARMv4
-;reg32,imm32                 \x33\x2\x0F                   ARM32,ARMv4
+;reg32,immshifter           \x33\x2\x0F                   ARM32,ARMv4
+;reg32,imm32                \x33\x2\x0F                   ARM32,ARMv4
+reglo,immshifter            \x67\xA0\x0\2                 THUMB,ARMv4T
+reglo,memam6                \x67\xA0\x0\2                 THUMB,ARMv4T
 reg32,memam2                \x33\x2\x0F                   ARM32,ARMv4
 
 [ANDcc]
+reglo,reglo                 \x60\x40\x00                  THUMB,ARMv4T
+
 reg32,reg32,reg32           \x4\x0\x00                    ARM32,ARMv4
 reg32,reg32,reg32,shifterop \x6\x0\x00                    ARM32,ARMv4
 reg32,reg32,immshifter      \x7\x2\x00                    ARM32,ARMv4
 
 [Bcc]
+imm32                       \x62\xE0\x0                   THUMB,ARMv4T
+immshifter                  \x62\xE0\x0                   THUMB,ARMv4T
+mem32                       \x62\xE0\x0                   THUMB,ARMv4T
+
+imm32                       \x63\xD0\x0                   THUMB,ARMv4T
+immshifter                  \x63\xD0\x0                   THUMB,ARMv4T
+mem32                       \x63\xD0\x0                   THUMB,ARMv4T
+
 imm24                       \x1\x0A                       ARM32,ARMv4
 mem32                       \x1\x0A                       ARM32,ARMv4
 
 [BICcc]
+reglo,reglo                 \x60\x43\x80                  THUMB,ARMv4T
+
 reg32,reg32,reg32           \x6\x1\xC0                    ARM32,ARMv4
 reg32,reg32,reg32,shifterop \x6\x1\xC0                    ARM32,ARMv4
 reg32,reg32,immshifter      \x7\x3\xC0                    ARM32,ARMv4
@@ -121,26 +148,38 @@ imm24                    \x1\x0B                        ARM32,ARMv4
 mem32                    \x1\x0B                        ARM32,ARMv4
 
 [BLX]
+reg32                    \x62\x47\x80                   THUMB,ARMv4T
+
 imm24                    \x28\xFA                       ARM32,ARMv5T
 mem32                    \x28\xFA                       ARM32,ARMv5T
-reg32                    \3\x01\x2F\xFF\x30            ARM32,ARMv5T
+reg32                    \3\x01\x2F\xFF\x30             ARM32,ARMv5T
 
 [BKPTcc]
+immshifter               \x60\xBE\x0                   THUMB,ARMv5T
 imm                      \x31\x1\x20\x70               ARM32,ARMv5T
 immshifter               \x31\x1\x20\x70               ARM32,ARMv5T
 
 [BXcc]
+reg32                    \x62\x47\x0                   THUMB,ARMv4T
+
 reg32                    \3\x01\x2F\xFF\x10            ARM32,ARMv4T
 
 [CDP]
 reg8,reg8                \300\1\x10\101                ARM32,ARMv4
 
 [CMNcc]
-reg32,reg32              \xC\x1\x60                     ARM32,ARMv4
-reg32,reg32,shifterop    \xE\x1\x60                     ARM32,ARMv4
-reg32,immshifter         \xF\x1\x60                     ARM32,ARMv4
+reglo,reglo             \x60\x42\xC0                     THUMB,ARMv4T
+
+reg32,reg32             \xC\x1\x60                       ARM32,ARMv4
+reg32,reg32,shifterop   \xE\x1\x60                       ARM32,ARMv4
+reg32,immshifter        \xF\x1\x60                       ARM32,ARMv4
 
 [CMPcc]
+reglo,reglo             \x60\x42\x80                     THUMB,ARMv4T
+reg32,reg32             \x61\x45\x0                      THUMB,ARMv4T
+
+reglo,immshifter        \x60\x28\x0                      THUMB,ARMv4T
+
 reg32,reg32              \xC\x1\x40                     ARM32,ARMv4
 reg32,reg32,shifterop    \xE\x1\x40                     ARM32,ARMv4
 reg32,immshifter         \xF\x3\x40                     ARM32,ARMv4
@@ -164,6 +203,8 @@ reg32,reg32              \x32\x01\x6F\xF\x10            ARM32,ARMv4
 [CPSIE]
 
 [EORcc]
+reglo,reglo                 \x60\x40\x40                  THUMB,ARMv4T
+
 reg32,reg32,reg32           \4\x0\x20                     ARM32,ARMv4
 reg32,reg32,reg32,shifterop \6\x0\x20                     ARM32,ARMv4
 reg32,reg32,immshifter      \7\x2\x20                     ARM32,ARMv4
@@ -172,30 +213,47 @@ reg32,reg32,immshifter      \7\x2\x20                     ARM32,ARMv4
 reg32,reg32         \321\300\1\x11\101            ARM32,ARMv4
 
 [LDMcc]
-memam4,reglist		   \x26\x81			ARM32,ARMv4
-reg32,reglist		   \x26\x81			ARM32,ARMv4
+memam4,reglist              \x69\xC8            THUMB,ARMv4T
+reglo,reglist               \x69\xC8            THUMB,ARMv4T
+
+memam4,reglist		          \x26\x81			   ARM32,ARMv4
+reg32,reglist		          \x26\x81			   ARM32,ARMv4
 
 [LDRBTcc]
 reg32,memam2              \x17\x04\x70                           ARM32,ARMv4
 reg32,immshifter          \x17\x04\x70                           ARM32,ARMv4
 
 [LDRBcc]
-reg32,memam2              \x17\x04\x50                            ARM32,ARMv4
+reglo,memam3              \x65\x5C\x0\0                  THUMB,ARMv4T
+reglo,memam4              \x66\x78\x0\0                  THUMB,ARMv4T
+reg32,memam2              \x17\x04\x50                   ARM32,ARMv4
 
 [LDRcc]
+reglo,memam3              \x65\x58\x0\2                  THUMB,ARMv4T
+reglo,memam4              \x66\x68\x0\2                  THUMB,ARMv4T
+reglo,memam5              \x67\x98\x0\2                  THUMB,ARMv4T
+reglo,memam6              \x67\x48\x0\2                  THUMB,ARMv4T
+
 reg32,memam2              \x17\x04\x10                   ARM32,ARMv4
 
 [LDRHcc]
-reg32,memam2              \x22\x10\xB0               ARM32,ARMv4
+reglo,memam3              \x65\x5A\x0\1                  THUMB,ARMv4T
+reglo,memam4              \x66\x88\x0\1                  THUMB,ARMv4T
+
+reg32,memam2              \x22\x10\xB0                   ARM32,ARMv4
 
 [LDRSBcc]
-reg32,memam2             \x22\x10\xD0               ARM32,ARMv4
-reg32,reg32              \x23\x50\xD0               ARM32,ARMv4
-reg32,reg32,imm32        \x24\x50\xD0                   ARM32,ARMv4
-reg32,reg32,reg32        \x25\x10\xD0                   ARM32,ARMv4
+reglo,memam3              \x65\x56\x0\0                  THUMB,ARMv4T
+
+reg32,memam2             \x22\x10\xD0                    ARM32,ARMv4
+reg32,reg32              \x23\x50\xD0                    ARM32,ARMv4
+reg32,reg32,imm32        \x24\x50\xD0                    ARM32,ARMv4
+reg32,reg32,reg32        \x25\x10\xD0                    ARM32,ARMv4
 
 [LDRSHcc]
-reg32,memam2              \x22\x10\xF0               ARM32,ARMv4
+reglo,memam3              \x65\x5E\x0\1                  THUMB,ARMv4T
+
+reg32,memam2              \x22\x10\xF0                   ARM32,ARMv4
 
 [LDRTcc]
 reg32,memam2              \x17\x04\x30                   ARM32,ARMv4
@@ -232,9 +290,14 @@ regf,immshifter,reg32,reg32,regf             \x1D\xFC\x50\x0   ARM32,ARMv6
 reg32,reg32,reg32,reg32  \x15\x00\x20\x9                ARM32,ARMv4
 
 [MOVcc]
-reg32,shifterop        \x8\x1\xA0                       ARM32,ARMv4
-reg32,reg32,shifterop  \xA\x1\xA0                       ARM32,ARMv4
-reg32,immshifter       \xB\x1\xA0                       ARM32,ARMv4
+reglo,reglo             \x60\x0\x0                       THUMB,ARMv4T
+reg32,reg32             \x61\x46\xC0                     THUMB,ARMv4T
+
+reglo,immshifter        \x60\x20\x0                      THUMB,ARMv4T
+
+reg32,shifterop         \x8\x1\xA0                       ARM32,ARMv4
+reg32,reg32,shifterop   \xA\x1\xA0                       ARM32,ARMv4
+reg32,immshifter        \xB\x1\xA0                       ARM32,ARMv4
 
 [MRScc]
 reg32,regf          \x10\x01\x0F                        ARM32,ARMv4
@@ -244,6 +307,8 @@ regf,reg32          \x12\x01\x28\xF0                    ARM32,ARMv4
 regf,immshifter     \x13\x03\x28\xF0                    ARM32,ARMv4
 
 [MULcc]
+reglo,reglo,reglo      \x64\x43\x40              THUMB,ARMv4T
+
 reg32,reg32,reg32      \x14\x00\x00\x90          ARM32,ARMv4
 
 [MVFcc]
@@ -251,6 +316,8 @@ fpureg,fpureg              \xF2                      FPA
 fpureg,immfpu              \xF2                      FPA
 
 [MVNcc]
+reglo,reglo             \x60\x43\xc0                    THUMB,ARMv4T
+
 reg32,reg32            \x8\x1\xE0                       ARM32,ARMv4
 reg32,reg32,shifterop  \xA\x1\xE0                       ARM32,ARMv4
 reg32,immshifter       \xB\x1\xE0                       ARM32,ARMv4
@@ -268,15 +335,20 @@ reg32,reg32,vreg      \x40\xC\x50\xB\x10        ARM32,VFPv2
 vreg,reg32,reg32      \x40\xC\x40\xB\x10        ARM32,VFPv2
 
 [NOP]
-void                    \x2F\x03\x20\xF0\x0           ARM32,ARMv6K
+void                    \x61\xBF\x0                  THUMB,ARMv6T2
+void                    \x2F\x03\x20\xF0\x0          ARM32,ARMv6K
 
 [ORRcc]
+reglo,reglo                  \x60\x43\x00            THUMB,ARMv4T
+
 reg32,reg32,reg32            \4\x1\x80               ARM32,ARMv4
 reg32,reg32,reg32,reg32      \5\x1\x80               ARM32,ARMv4
 reg32,reg32,reg32,shifterop  \6\x1\x80               ARM32,ARMv4
 reg32,reg32,immshifter       \7\x3\x80               ARM32,ARMv4
 
 [RSBcc]
+reglo,reglo,immshifter       \x60\x42\x40                  THUMB,ARMv4T
+
 reg32,reg32,reg32            \6\x0\x60                     ARM32,ARMv4
 reg32,reg32,reg32,shifterop  \6\x0\x60                     ARM32,ARMv4
 reg32,reg32,immshifter       \7\x0\x60                     ARM32,ARMv4
@@ -288,6 +360,8 @@ reg32,reg32,reg32,shifterop  \6\x0\xE0                     ARM32,ARMv4
 reg32,reg32,immshifter       \7\x2\xE0                     ARM32,ARMv4
 
 [SBCcc]
+reglo,reglo                 \x60\x41\x80                  THUMB,ARMv4T
+
 reg32,reg32,reg32           \4\x0\xC0                     ARM32,ARMv4
 reg32,reg32,reg32,reg32     \5\x0\xC0                     ARM32,ARMv4
 reg32,reg32,reg32,imm       \6\x0\xC0                     ARM32,ARMv4
@@ -306,13 +380,23 @@ reg32,reg32,reg32,reg32     \x16\x00\xE0\x9               ARM32,ARMv4
 reg32,reg32,reg32,reg32     \x16\x00\xC0\x9               ARM32,ARMv4
 
 [STMcc]
+memam4,reglist              \x69\xC0            THUMB,ARMv4T
+reglo,reglist               \x69\xC0            THUMB,ARMv4T
+
 memam4,reglist		          \x26\x80			   ARM32,ARMv4
 reg32,reglist		          \x26\x80			   ARM32,ARMv4
 
 [STRcc]
+reglo,memam3                \x65\x50\x0\2                  THUMB,ARMv4T
+reglo,memam4                \x66\x60\x0\2                  THUMB,ARMv4T
+reglo,memam5                \x67\x90\x0\2                  THUMB,ARMv4T
+
 reg32,memam2                \x17\x04\x00                   ARM32,ARMv4
 
 [STRBcc]
+reglo,memam3                \x65\x54\x0\0                  THUMB,ARMv4T
+reglo,memam4                \x66\x70\x0\0                  THUMB,ARMv4T
+
 reg32,memam2                \x17\x04\x40                           ARM32,ARMv4
 
 [STRBTcc]
@@ -320,12 +404,21 @@ reg32,memam2                \x17\x04\x60                           ARM32,ARMv4
 reg32,immshifter            \x17\x04\x60                           ARM32,ARMv4
 
 [STRHcc]
+reglo,memam3                \x65\x52\x0\1                  THUMB,ARMv4T
+reglo,memam4                \x66\x80\x0\1                  THUMB,ARMv4T
+
 reg32,memam2                \x22\x00\xB0              ARM32,ARMv4
 
 [STRTcc]
 reg32,memam2                \x17\x04\x20                   ARM32,ARMv4
 
 [SUBcc]
+regsp,regsp,immshifter      \x64\xB0\x80                   THUMB,ARMv4T
+reglo,reglo,reglo           \x60\x1A\x0                    THUMB,ARMv4T
+
+reglo,reglo,immshifter      \x60\x1E\x0                    THUMB,ARMv4T
+reglo,imm8                  \x60\x38\x0                    THUMB,ARMv4T
+
 reg32,reg32,shifterop       \x4\x0\x40                     ARM32,ARMv4
 reg32,reg32,immshifter      \x4\x0\x40                     ARM32,ARMv4
 reg32,reg32,reg32           \x4\x0\x40                     ARM32,ARMv4
@@ -348,6 +441,8 @@ reg32,reg32,shifterop \xE\x1\x20                     ARM32,ARMv4
 reg32,immshifter      \xF\x3\x20                     ARM32,ARMv4
 
 [TSTcc]
+reglo,reglo           \x60\x42\x00                   THUMB,ARMv4T
+
 reg32,reg32           \xC\x1\x00                     ARM32,ARMv4
 reg32,reg32,reg32     \xD\x1\x00                     ARM32,ARMv4
 reg32,reg32,shifterop \xE\x1\x00                     ARM32,ARMv4
@@ -538,12 +633,15 @@ reg32,reg32,reg32          \x16\x06\x20\xFF                    ARM32,ARMv6
 reg32,reg32                \x32\x6\xFF\xF\x30                  ARM32,ARMv6T2
 
 [REVcc]
+reglo,reglo                \x61\xBA\x00                        THUMB,ARMv6
 reg32,reg32                \x32\x6\xBF\xF\x30                  ARM32,ARMv6
 
 [REV16cc]
+reglo,reglo                \x61\xBA\x40                        THUMB,ARMv6
 reg32,reg32                \x32\x6\xBF\xF\xB0                  ARM32,ARMv6
 
 [REVSHcc]
+reglo,reglo                \x61\xBA\xC0                        THUMB,ARMv6
 reg32,reg32                \x32\x6\xFF\xF\xB0                  ARM32,ARMv6
 
 [SADD16cc]
@@ -565,21 +663,33 @@ reg32,reg32,reg32          \x16\x06\x80\xFB                    ARM32,ARMv6
 immshifter                 \x2B\xF1\x01\x0\x0                  ARM32,ARMv6
 
 [SEVcc]
+void                       \x64\xBF\x40                        THUMB,ARMv7
 void                       \x2F\x3\x20\xF0\x4                  ARM32,ARMv6K
 
 [ASRcc]
+reglo,reglo,immshifter     \x60\x1\x0                          THUMB,ARMv4T
+reglo,reglo                \x60\x41\x0                         THUMB,ARMv4T
+
 reg32,reg32,reg32          \x30\x1\xA0\x0\x50                  ARM32,ARMv4
 reg32,reg32,immshifter     \x30\x1\xA0\x0\x40                  ARM32,ARMv4
 
 [LSRcc]
+reglo,reglo,immshifter     \x60\x8\x0                          THUMB,ARMv4T
+reglo,reglo                \x60\x40\xC0                        THUMB,ARMv4T
+
 reg32,reg32,reg32          \x30\x1\xA0\x0\x30                  ARM32,ARMv4
 reg32,reg32,immshifter     \x30\x1\xA0\x0\x20                  ARM32,ARMv4
 
 [LSLcc]
+reglo,reglo,immshifter     \x60\x0\x0                          THUMB,ARMv4T
+reglo,reglo                \x60\x40\x80                        THUMB,ARMv4T
+
 reg32,reg32,reg32          \x30\x1\xA0\x0\x10                  ARM32,ARMv4
 reg32,reg32,immshifter     \x30\x1\xA0\x0\x00                  ARM32,ARMv4
 
 [RORcc]
+reglo,reglo                \x60\x41\xC0                        THUMB,ARMv4T
+
 reg32,reg32,reg32          \x30\x1\xA0\x0\x70                  ARM32,ARMv4
 reg32,reg32,immshifter     \x30\x1\xA0\x0\x60                  ARM32,ARMv4
 
@@ -680,6 +790,8 @@ reg32,reg32,reg32           \x16\x6\xF0\x7                     ARM32,ARMv6
 reg32,reg32,reg32,shifterop \x16\x6\xF0\x7                     ARM32,ARMv6
 
 [SXTBcc]
+reglo,reglo                 \x61\xB2\x40                       THUMB,ARMv6
+
 reg32,reg32                 \x1B\x6\xAF\x7                     ARM32,ARMv6
 reg32,reg32,shifterop       \x1B\x6\xAF\x7                     ARM32,ARMv6
 
@@ -688,10 +800,14 @@ reg32,reg32                 \x1B\x6\x8F\x7                     ARM32,ARMv6
 reg32,reg32,shifterop       \x1B\x6\x8F\x7                     ARM32,ARMv6
 
 [SXTHcc]
+reglo,reglo                 \x61\xB2\x00                       THUMB,ARMv6
+
 reg32,reg32                 \x1B\x6\xBF\x7                     ARM32,ARMv6
 reg32,reg32,shifterop       \x1B\x6\xBF\x7                     ARM32,ARMv6
 
 [UXTBcc]
+reglo,reglo                 \x61\xB2\xC0                       THUMB,ARMv6
+
 reg32,reg32                 \x1B\x6\xEF\x7                     ARM32,ARMv6
 reg32,reg32,shifterop       \x1B\x6\xEF\x7                     ARM32,ARMv6
 
@@ -700,6 +816,8 @@ reg32,reg32                 \x1B\x6\xCF\x7                     ARM32,ARMv6
 reg32,reg32,shifterop       \x1B\x6\xCF\x7                     ARM32,ARMv6
 
 [UXTHcc]
+reglo,reglo                 \x61\xB2\x80                       THUMB,ARMv6
+
 reg32,reg32                 \x1B\x6\xFF\x7                     ARM32,ARMv6
 reg32,reg32,shifterop       \x1B\x6\xFF\x7                     ARM32,ARMv6
 
@@ -771,12 +889,15 @@ reg32,reg32,reg32          \x16\x06\x50\xF7                    ARM32,ARMv6
 reg32,reg32,reg32          \x16\x06\x50\xFF                    ARM32,ARMv6
 
 [WFEcc]
+void                          \x64\xBF\x20                     THUMB,ARMv7
 void                          \x2F\x3\x20\xF0\x2               ARM32,ARMv6K
 
 [WFIcc]
+void                          \x64\xBF\x30                     THUMB,ARMv7
 void                          \x2F\x3\x20\xF0\x3               ARM32,ARMv6K
 
 [YIELDcc]
+void                          \x64\xBF\x10                     THUMB,ARMv7
 void                          \x2F\x3\x20\xF0\x1               ARM32,ARMv6K
 
 ;
@@ -901,9 +1022,11 @@ void                          \x2F\x3\x20\xF0\x1               ARM32,ARMv6K
 ; Thumb-2
 
 [POP]
+reglist                       \x69\xBC                   THUMB,ARMv4T
 reglist		                  \x26\x8B		               ARM32,ARMv4
 
 [PUSH]
+reglist                       \x69\xB4                   THUMB,ARMv4T
 reglist		                  \x26\x80		               ARM32,ARMv4
 
 [SDIVcc]
@@ -967,7 +1090,12 @@ reg32,imm               \x2C\x3\x0                 ARM32,ARMv6T2
 reg32,immshifter        \x2C\x3\x0                 ARM32,ARMv6T2
 
 [CBZ]
+reglo,immshifter        \x68\xB1                   THUMB,ARMv6T2
+reglo,memam2            \x68\xB1                   THUMB,ARMv6T2
+
 [CBNZ]
+reglo,immshifter        \x68\xB9                   THUMB,ARMv6T2
+reglo,memam2            \x68\xB9                   THUMB,ARMv6T2
 
 ; VFP
 [VABScc]
@@ -1049,6 +1177,8 @@ immshifter        \x2E\x01\x60\x00\x70             ARM32,ARMv7
 [NEG]
 
 [SVC]
+immshifter         \x61\xDF\x0                     THUMB,ARMv4T
+
 imm32              \x2\x0F                         ARM32,ARMv4
 immshifter         \x2\x0F                         ARM32,ARMv4
 
@@ -1057,7 +1187,8 @@ reg32              \x3\x01\x2F\xFF\x20             ARM32,ARMv5TEJ
 
 ; Undefined mnemonic
 [UDF]
-void                 void                          none
+immshifter           \x61\xDE\x0                   THUMB,ARMv4T
+void                 void                          ARM32,ARMv4T
 
 ; FPA
 

+ 1 - 1
compiler/arm/armnop.inc

@@ -1,2 +1,2 @@
 { don't edit, this file is generated from armins.dat }
-333;
+421;

+ 617 - 1
compiler/arm/armtab.inc

@@ -7,6 +7,13 @@
     code    : #0;
     flags   : if_none
   ),
+  (
+    opcode  : A_ADC;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglo,ot_none,ot_none,ot_none,ot_none);
+    code    : #96#65#64;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_ADC;
     ops     : 3;
@@ -28,6 +35,62 @@
     code    : #7#2#160;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_ADD;
+    ops     : 2;
+    optypes : (ot_reg32,ot_reg32,ot_none,ot_none,ot_none,ot_none);
+    code    : #97#68#0;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_ADD;
+    ops     : 3;
+    optypes : (ot_reglo,ot_reglo,ot_reglo,ot_none,ot_none,ot_none);
+    code    : #96#24#0;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_ADD;
+    ops     : 3;
+    optypes : (ot_reglo,ot_reglo,ot_immediateshifter,ot_none,ot_none,ot_none);
+    code    : #96#28#0;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_ADD;
+    ops     : 2;
+    optypes : (ot_reglo,ot_immediateshifter,ot_none,ot_none,ot_none,ot_none);
+    code    : #96#48#0;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_ADD;
+    ops     : 3;
+    optypes : (ot_reglo,ot_regsp,ot_immediateshifter,ot_none,ot_none,ot_none);
+    code    : #100#168#0;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_ADD;
+    ops     : 3;
+    optypes : (ot_regsp,ot_regsp,ot_immediateshifter,ot_none,ot_none,ot_none);
+    code    : #100#176#0;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_ADD;
+    ops     : 3;
+    optypes : (ot_reg32,ot_regsp,ot_reg32,ot_none,ot_none,ot_none);
+    code    : #100#68#104;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_ADD;
+    ops     : 2;
+    optypes : (ot_regsp,ot_reg32,ot_none,ot_none,ot_none,ot_none);
+    code    : #100#68#133;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_ADD;
     ops     : 3;
@@ -49,6 +112,20 @@
     code    : #7#2#128;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_ADR;
+    ops     : 2;
+    optypes : (ot_reglo,ot_immediateshifter,ot_none,ot_none,ot_none,ot_none);
+    code    : #103#160#0#2;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_ADR;
+    ops     : 2;
+    optypes : (ot_reglo,ot_memoryam6,ot_none,ot_none,ot_none,ot_none);
+    code    : #103#160#0#2;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_ADR;
     ops     : 2;
@@ -56,6 +133,13 @@
     code    : #51#2#15;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_AND;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglo,ot_none,ot_none,ot_none,ot_none);
+    code    : #96#64#0;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_AND;
     ops     : 3;
@@ -77,6 +161,48 @@
     code    : #7#2#0;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_B;
+    ops     : 1;
+    optypes : (ot_immediate or ot_bits32,ot_none,ot_none,ot_none,ot_none,ot_none);
+    code    : #98#224#0;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_B;
+    ops     : 1;
+    optypes : (ot_immediateshifter,ot_none,ot_none,ot_none,ot_none,ot_none);
+    code    : #98#224#0;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_B;
+    ops     : 1;
+    optypes : (ot_memory or ot_bits32,ot_none,ot_none,ot_none,ot_none,ot_none);
+    code    : #98#224#0;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_B;
+    ops     : 1;
+    optypes : (ot_immediate or ot_bits32,ot_none,ot_none,ot_none,ot_none,ot_none);
+    code    : #99#208#0;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_B;
+    ops     : 1;
+    optypes : (ot_immediateshifter,ot_none,ot_none,ot_none,ot_none,ot_none);
+    code    : #99#208#0;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_B;
+    ops     : 1;
+    optypes : (ot_memory or ot_bits32,ot_none,ot_none,ot_none,ot_none,ot_none);
+    code    : #99#208#0;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_B;
     ops     : 1;
@@ -91,6 +217,13 @@
     code    : #1#10;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_BIC;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglo,ot_none,ot_none,ot_none,ot_none);
+    code    : #96#67#128;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_BIC;
     ops     : 3;
@@ -126,6 +259,13 @@
     code    : #1#11;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_BLX;
+    ops     : 1;
+    optypes : (ot_reg32,ot_none,ot_none,ot_none,ot_none,ot_none);
+    code    : #98#71#128;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_BLX;
     ops     : 1;
@@ -147,6 +287,13 @@
     code    : #3#1#47#255#48;
     flags   : if_arm32 or if_armv5t
   ),
+  (
+    opcode  : A_BKPT;
+    ops     : 1;
+    optypes : (ot_immediateshifter,ot_none,ot_none,ot_none,ot_none,ot_none);
+    code    : #96#190#0;
+    flags   : if_thumb or if_armv5t
+  ),
   (
     opcode  : A_BKPT;
     ops     : 1;
@@ -161,6 +308,13 @@
     code    : #49#1#32#112;
     flags   : if_arm32 or if_armv5t
   ),
+  (
+    opcode  : A_BX;
+    ops     : 1;
+    optypes : (ot_reg32,ot_none,ot_none,ot_none,ot_none,ot_none);
+    code    : #98#71#0;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_BX;
     ops     : 1;
@@ -175,6 +329,13 @@
     code    : #192#1#16#65;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_CMN;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglo,ot_none,ot_none,ot_none,ot_none);
+    code    : #96#66#192;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_CMN;
     ops     : 2;
@@ -196,6 +357,27 @@
     code    : #15#1#96;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_CMP;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglo,ot_none,ot_none,ot_none,ot_none);
+    code    : #96#66#128;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_CMP;
+    ops     : 2;
+    optypes : (ot_reg32,ot_reg32,ot_none,ot_none,ot_none,ot_none);
+    code    : #97#69#0;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_CMP;
+    ops     : 2;
+    optypes : (ot_reglo,ot_immediateshifter,ot_none,ot_none,ot_none,ot_none);
+    code    : #96#40#0;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_CMP;
     ops     : 2;
@@ -231,6 +413,13 @@
     code    : #50#1#111#15#16;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_EOR;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglo,ot_none,ot_none,ot_none,ot_none);
+    code    : #96#64#64;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_EOR;
     ops     : 3;
@@ -259,6 +448,20 @@
     code    : #209#192#1#17#65;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_LDM;
+    ops     : 2;
+    optypes : (ot_memoryam4,ot_reglist,ot_none,ot_none,ot_none,ot_none);
+    code    : #105#200;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_LDM;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglist,ot_none,ot_none,ot_none,ot_none);
+    code    : #105#200;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_LDM;
     ops     : 2;
@@ -287,6 +490,20 @@
     code    : #23#4#112;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_LDRB;
+    ops     : 2;
+    optypes : (ot_reglo,ot_memoryam3,ot_none,ot_none,ot_none,ot_none);
+    code    : #101#92#0#0;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_LDRB;
+    ops     : 2;
+    optypes : (ot_reglo,ot_memoryam4,ot_none,ot_none,ot_none,ot_none);
+    code    : #102#120#0#0;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_LDRB;
     ops     : 2;
@@ -294,6 +511,34 @@
     code    : #23#4#80;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_LDR;
+    ops     : 2;
+    optypes : (ot_reglo,ot_memoryam3,ot_none,ot_none,ot_none,ot_none);
+    code    : #101#88#0#2;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_LDR;
+    ops     : 2;
+    optypes : (ot_reglo,ot_memoryam4,ot_none,ot_none,ot_none,ot_none);
+    code    : #102#104#0#2;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_LDR;
+    ops     : 2;
+    optypes : (ot_reglo,ot_memoryam5,ot_none,ot_none,ot_none,ot_none);
+    code    : #103#152#0#2;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_LDR;
+    ops     : 2;
+    optypes : (ot_reglo,ot_memoryam6,ot_none,ot_none,ot_none,ot_none);
+    code    : #103#72#0#2;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_LDR;
     ops     : 2;
@@ -301,6 +546,20 @@
     code    : #23#4#16;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_LDRH;
+    ops     : 2;
+    optypes : (ot_reglo,ot_memoryam3,ot_none,ot_none,ot_none,ot_none);
+    code    : #101#90#0#1;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_LDRH;
+    ops     : 2;
+    optypes : (ot_reglo,ot_memoryam4,ot_none,ot_none,ot_none,ot_none);
+    code    : #102#136#0#1;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_LDRH;
     ops     : 2;
@@ -308,6 +567,13 @@
     code    : #34#16#176;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_LDRSB;
+    ops     : 2;
+    optypes : (ot_reglo,ot_memoryam3,ot_none,ot_none,ot_none,ot_none);
+    code    : #101#86#0#0;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_LDRSB;
     ops     : 2;
@@ -336,6 +602,13 @@
     code    : #37#16#208;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_LDRSH;
+    ops     : 2;
+    optypes : (ot_reglo,ot_memoryam3,ot_none,ot_none,ot_none,ot_none);
+    code    : #101#94#0#1;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_LDRSH;
     ops     : 2;
@@ -441,6 +714,27 @@
     code    : #21#0#32#9;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_MOV;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglo,ot_none,ot_none,ot_none,ot_none);
+    code    : #96#0#0;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_MOV;
+    ops     : 2;
+    optypes : (ot_reg32,ot_reg32,ot_none,ot_none,ot_none,ot_none);
+    code    : #97#70#192;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_MOV;
+    ops     : 2;
+    optypes : (ot_reglo,ot_immediateshifter,ot_none,ot_none,ot_none,ot_none);
+    code    : #96#32#0;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_MOV;
     ops     : 2;
@@ -483,6 +777,13 @@
     code    : #19#3#40#240;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_MUL;
+    ops     : 3;
+    optypes : (ot_reglo,ot_reglo,ot_reglo,ot_none,ot_none,ot_none);
+    code    : #100#67#64;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_MUL;
     ops     : 3;
@@ -504,6 +805,13 @@
     code    : #242;
     flags   : if_fpa
   ),
+  (
+    opcode  : A_MVN;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglo,ot_none,ot_none,ot_none,ot_none);
+    code    : #96#67#192;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_MVN;
     ops     : 2;
@@ -574,6 +882,13 @@
     code    : #64#12#64#11#16;
     flags   : if_arm32 or if_vfpv2
   ),
+  (
+    opcode  : A_NOP;
+    ops     : 0;
+    optypes : (ot_none,ot_none,ot_none,ot_none,ot_none,ot_none);
+    code    : #97#191#0;
+    flags   : if_thumb or if_armv6t2
+  ),
   (
     opcode  : A_NOP;
     ops     : 0;
@@ -581,6 +896,13 @@
     code    : #47#3#32#240#0;
     flags   : if_arm32 or if_armv6k
   ),
+  (
+    opcode  : A_ORR;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglo,ot_none,ot_none,ot_none,ot_none);
+    code    : #96#67#0;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_ORR;
     ops     : 3;
@@ -609,6 +931,13 @@
     code    : #7#3#128;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_RSB;
+    ops     : 3;
+    optypes : (ot_reglo,ot_reglo,ot_immediateshifter,ot_none,ot_none,ot_none);
+    code    : #96#66#64;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_RSB;
     ops     : 3;
@@ -658,6 +987,13 @@
     code    : #7#2#224;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_SBC;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglo,ot_none,ot_none,ot_none,ot_none);
+    code    : #96#65#128;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_SBC;
     ops     : 3;
@@ -714,6 +1050,20 @@
     code    : #22#0#192#9;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_STM;
+    ops     : 2;
+    optypes : (ot_memoryam4,ot_reglist,ot_none,ot_none,ot_none,ot_none);
+    code    : #105#192;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_STM;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglist,ot_none,ot_none,ot_none,ot_none);
+    code    : #105#192;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_STM;
     ops     : 2;
@@ -728,6 +1078,27 @@
     code    : #38#128;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_STR;
+    ops     : 2;
+    optypes : (ot_reglo,ot_memoryam3,ot_none,ot_none,ot_none,ot_none);
+    code    : #101#80#0#2;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_STR;
+    ops     : 2;
+    optypes : (ot_reglo,ot_memoryam4,ot_none,ot_none,ot_none,ot_none);
+    code    : #102#96#0#2;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_STR;
+    ops     : 2;
+    optypes : (ot_reglo,ot_memoryam5,ot_none,ot_none,ot_none,ot_none);
+    code    : #103#144#0#2;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_STR;
     ops     : 2;
@@ -735,6 +1106,20 @@
     code    : #23#4#0;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_STRB;
+    ops     : 2;
+    optypes : (ot_reglo,ot_memoryam3,ot_none,ot_none,ot_none,ot_none);
+    code    : #101#84#0#0;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_STRB;
+    ops     : 2;
+    optypes : (ot_reglo,ot_memoryam4,ot_none,ot_none,ot_none,ot_none);
+    code    : #102#112#0#0;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_STRB;
     ops     : 2;
@@ -756,6 +1141,20 @@
     code    : #23#4#96;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_STRH;
+    ops     : 2;
+    optypes : (ot_reglo,ot_memoryam3,ot_none,ot_none,ot_none,ot_none);
+    code    : #101#82#0#1;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_STRH;
+    ops     : 2;
+    optypes : (ot_reglo,ot_memoryam4,ot_none,ot_none,ot_none,ot_none);
+    code    : #102#128#0#1;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_STRH;
     ops     : 2;
@@ -770,6 +1169,34 @@
     code    : #23#4#32;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_SUB;
+    ops     : 3;
+    optypes : (ot_regsp,ot_regsp,ot_immediateshifter,ot_none,ot_none,ot_none);
+    code    : #100#176#128;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_SUB;
+    ops     : 3;
+    optypes : (ot_reglo,ot_reglo,ot_reglo,ot_none,ot_none,ot_none);
+    code    : #96#26#0;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_SUB;
+    ops     : 3;
+    optypes : (ot_reglo,ot_reglo,ot_immediateshifter,ot_none,ot_none,ot_none);
+    code    : #96#30#0;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_SUB;
+    ops     : 2;
+    optypes : (ot_reglo,ot_immediate or ot_bits8,ot_none,ot_none,ot_none,ot_none);
+    code    : #96#56#0;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_SUB;
     ops     : 3;
@@ -854,6 +1281,13 @@
     code    : #15#3#32;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_TST;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglo,ot_none,ot_none,ot_none,ot_none);
+    code    : #96#66#0;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_TST;
     ops     : 2;
@@ -1330,6 +1764,13 @@
     code    : #50#6#255#15#48;
     flags   : if_arm32 or if_armv6t2
   ),
+  (
+    opcode  : A_REV;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglo,ot_none,ot_none,ot_none,ot_none);
+    code    : #97#186#0;
+    flags   : if_thumb or if_armv6
+  ),
   (
     opcode  : A_REV;
     ops     : 2;
@@ -1337,6 +1778,13 @@
     code    : #50#6#191#15#48;
     flags   : if_arm32 or if_armv6
   ),
+  (
+    opcode  : A_REV16;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglo,ot_none,ot_none,ot_none,ot_none);
+    code    : #97#186#64;
+    flags   : if_thumb or if_armv6
+  ),
   (
     opcode  : A_REV16;
     ops     : 2;
@@ -1344,6 +1792,13 @@
     code    : #50#6#191#15#176;
     flags   : if_arm32 or if_armv6
   ),
+  (
+    opcode  : A_REVSH;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglo,ot_none,ot_none,ot_none,ot_none);
+    code    : #97#186#192;
+    flags   : if_thumb or if_armv6
+  ),
   (
     opcode  : A_REVSH;
     ops     : 2;
@@ -1393,6 +1848,13 @@
     code    : #43#241#1#0#0;
     flags   : if_arm32 or if_armv6
   ),
+  (
+    opcode  : A_SEV;
+    ops     : 0;
+    optypes : (ot_none,ot_none,ot_none,ot_none,ot_none,ot_none);
+    code    : #100#191#64;
+    flags   : if_thumb or if_armv7
+  ),
   (
     opcode  : A_SEV;
     ops     : 0;
@@ -1400,6 +1862,20 @@
     code    : #47#3#32#240#4;
     flags   : if_arm32 or if_armv6k
   ),
+  (
+    opcode  : A_ASR;
+    ops     : 3;
+    optypes : (ot_reglo,ot_reglo,ot_immediateshifter,ot_none,ot_none,ot_none);
+    code    : #96#1#0;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_ASR;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglo,ot_none,ot_none,ot_none,ot_none);
+    code    : #96#65#0;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_ASR;
     ops     : 3;
@@ -1414,6 +1890,20 @@
     code    : #48#1#160#0#64;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_LSR;
+    ops     : 3;
+    optypes : (ot_reglo,ot_reglo,ot_immediateshifter,ot_none,ot_none,ot_none);
+    code    : #96#8#0;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_LSR;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglo,ot_none,ot_none,ot_none,ot_none);
+    code    : #96#64#192;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_LSR;
     ops     : 3;
@@ -1428,6 +1918,20 @@
     code    : #48#1#160#0#32;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_LSL;
+    ops     : 3;
+    optypes : (ot_reglo,ot_reglo,ot_immediateshifter,ot_none,ot_none,ot_none);
+    code    : #96#0#0;
+    flags   : if_thumb or if_armv4t
+  ),
+  (
+    opcode  : A_LSL;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglo,ot_none,ot_none,ot_none,ot_none);
+    code    : #96#64#128;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_LSL;
     ops     : 3;
@@ -1442,6 +1946,13 @@
     code    : #48#1#160#0#0;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_ROR;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglo,ot_none,ot_none,ot_none,ot_none);
+    code    : #96#65#192;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_ROR;
     ops     : 3;
@@ -1708,6 +2219,13 @@
     code    : #22#6#240#7;
     flags   : if_arm32 or if_armv6
   ),
+  (
+    opcode  : A_SXTB;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglo,ot_none,ot_none,ot_none,ot_none);
+    code    : #97#178#64;
+    flags   : if_thumb or if_armv6
+  ),
   (
     opcode  : A_SXTB;
     ops     : 2;
@@ -1736,6 +2254,13 @@
     code    : #27#6#143#7;
     flags   : if_arm32 or if_armv6
   ),
+  (
+    opcode  : A_SXTH;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglo,ot_none,ot_none,ot_none,ot_none);
+    code    : #97#178#0;
+    flags   : if_thumb or if_armv6
+  ),
   (
     opcode  : A_SXTH;
     ops     : 2;
@@ -1750,6 +2275,13 @@
     code    : #27#6#191#7;
     flags   : if_arm32 or if_armv6
   ),
+  (
+    opcode  : A_UXTB;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglo,ot_none,ot_none,ot_none,ot_none);
+    code    : #97#178#192;
+    flags   : if_thumb or if_armv6
+  ),
   (
     opcode  : A_UXTB;
     ops     : 2;
@@ -1778,6 +2310,13 @@
     code    : #27#6#207#7;
     flags   : if_arm32 or if_armv6
   ),
+  (
+    opcode  : A_UXTH;
+    ops     : 2;
+    optypes : (ot_reglo,ot_reglo,ot_none,ot_none,ot_none,ot_none);
+    code    : #97#178#128;
+    flags   : if_thumb or if_armv6
+  ),
   (
     opcode  : A_UXTH;
     ops     : 2;
@@ -1953,6 +2492,13 @@
     code    : #22#6#80#255;
     flags   : if_arm32 or if_armv6
   ),
+  (
+    opcode  : A_WFE;
+    ops     : 0;
+    optypes : (ot_none,ot_none,ot_none,ot_none,ot_none,ot_none);
+    code    : #100#191#32;
+    flags   : if_thumb or if_armv7
+  ),
   (
     opcode  : A_WFE;
     ops     : 0;
@@ -1960,6 +2506,13 @@
     code    : #47#3#32#240#2;
     flags   : if_arm32 or if_armv6k
   ),
+  (
+    opcode  : A_WFI;
+    ops     : 0;
+    optypes : (ot_none,ot_none,ot_none,ot_none,ot_none,ot_none);
+    code    : #100#191#48;
+    flags   : if_thumb or if_armv7
+  ),
   (
     opcode  : A_WFI;
     ops     : 0;
@@ -1967,6 +2520,13 @@
     code    : #47#3#32#240#3;
     flags   : if_arm32 or if_armv6k
   ),
+  (
+    opcode  : A_YIELD;
+    ops     : 0;
+    optypes : (ot_none,ot_none,ot_none,ot_none,ot_none,ot_none);
+    code    : #100#191#16;
+    flags   : if_thumb or if_armv7
+  ),
   (
     opcode  : A_YIELD;
     ops     : 0;
@@ -1974,6 +2534,13 @@
     code    : #47#3#32#240#1;
     flags   : if_arm32 or if_armv6k
   ),
+  (
+    opcode  : A_POP;
+    ops     : 1;
+    optypes : (ot_reglist,ot_none,ot_none,ot_none,ot_none,ot_none);
+    code    : #105#188;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_POP;
     ops     : 1;
@@ -1981,6 +2548,13 @@
     code    : #38#139;
     flags   : if_arm32 or if_armv4
   ),
+  (
+    opcode  : A_PUSH;
+    ops     : 1;
+    optypes : (ot_reglist,ot_none,ot_none,ot_none,ot_none,ot_none);
+    code    : #105#180;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_PUSH;
     ops     : 1;
@@ -2121,6 +2695,34 @@
     code    : #44#3#0;
     flags   : if_arm32 or if_armv6t2
   ),
+  (
+    opcode  : A_CBZ;
+    ops     : 2;
+    optypes : (ot_reglo,ot_immediateshifter,ot_none,ot_none,ot_none,ot_none);
+    code    : #104#177;
+    flags   : if_thumb or if_armv6t2
+  ),
+  (
+    opcode  : A_CBZ;
+    ops     : 2;
+    optypes : (ot_reglo,ot_memoryam2,ot_none,ot_none,ot_none,ot_none);
+    code    : #104#177;
+    flags   : if_thumb or if_armv6t2
+  ),
+  (
+    opcode  : A_CBNZ;
+    ops     : 2;
+    optypes : (ot_reglo,ot_immediateshifter,ot_none,ot_none,ot_none,ot_none);
+    code    : #104#185;
+    flags   : if_thumb or if_armv6t2
+  ),
+  (
+    opcode  : A_CBNZ;
+    ops     : 2;
+    optypes : (ot_reglo,ot_memoryam2,ot_none,ot_none,ot_none,ot_none);
+    code    : #104#185;
+    flags   : if_thumb or if_armv6t2
+  ),
   (
     opcode  : A_VABS;
     ops     : 2;
@@ -2303,6 +2905,13 @@
     code    : #46#1#96#0#112;
     flags   : if_arm32 or if_armv7
   ),
+  (
+    opcode  : A_SVC;
+    ops     : 1;
+    optypes : (ot_immediateshifter,ot_none,ot_none,ot_none,ot_none,ot_none);
+    code    : #97#223#0;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_SVC;
     ops     : 1;
@@ -2324,11 +2933,18 @@
     code    : #3#1#47#255#32;
     flags   : if_arm32 or if_armv5tej
   ),
+  (
+    opcode  : A_UDF;
+    ops     : 1;
+    optypes : (ot_immediateshifter,ot_none,ot_none,ot_none,ot_none,ot_none);
+    code    : #97#222#0;
+    flags   : if_thumb or if_armv4t
+  ),
   (
     opcode  : A_UDF;
     ops     : 0;
     optypes : (ot_none,ot_none,ot_none,ot_none,ot_none,ot_none);
     code    : #0;
-    flags   : if_none
+    flags   : if_arm32 or if_armv4t
   )
 );