65  static bool IsConstantPoolAt(uint8_t* instr_ptr);
 
   66  static int ConstantPoolSizeAt(uint8_t* instr_ptr);
 
   71  void Print(
const char* str);
 
   75  void PrintSRegister(
int reg);
 
   76  void PrintDRegister(
int reg);
 
   77  void PrintQRegister(
int reg);
 
   78  int FormatVFPRegister(Instruction* 
instr, 
const char* format,
 
   80  void PrintMovwMovt(Instruction* 
instr);
 
   81  int FormatVFPinstruction(Instruction* 
instr, 
const char* format);
 
   82  void PrintCondition(Instruction* 
instr);
 
   83  void PrintShiftRm(Instruction* 
instr);
 
   84  void PrintShiftImm(Instruction* 
instr);
 
   85  void PrintShiftSat(Instruction* 
instr);
 
   86  void PrintPU(Instruction* 
instr);
 
   91  void FormatNeonList(
int Vd, 
int type);
 
   92  void FormatNeonMemory(
int Rn, 
int align, 
int Rm);
 
   94  void Format(Instruction* 
instr, 
const char* format);
 
  101  void DecodeType01(Instruction* 
instr);
 
  102  void DecodeType2(Instruction* 
instr);
 
  103  void DecodeType3(Instruction* 
instr);
 
  104  void DecodeType4(Instruction* 
instr);
 
  105  void DecodeType5(Instruction* 
instr);
 
  106  void DecodeType6(Instruction* 
instr);
 
  108  int DecodeType7(Instruction* 
instr);
 
  110  void DecodeTypeCP15(Instruction* 
instr);
 
  112  void DecodeTypeVFP(Instruction* 
instr);
 
  113  void DecodeType6CoprocessorIns(Instruction* 
instr);
 
  115  void DecodeSpecialCondition(Instruction* 
instr);
 
  118  void DecodeFloatingPointDataProcessing(Instruction* 
instr);
 
  120  void DecodeUnconditional(Instruction* 
instr);
 
  122  void DecodeAdvancedSIMDDataProcessing(Instruction* 
instr);
 
  125  void DecodeAdvancedSIMDTwoOrThreeRegisters(Instruction* 
instr);
 
  127  void DecodeMemoryHintsAndBarriers(Instruction* 
instr);
 
  129  void DecodeAdvancedSIMDElementOrStructureLoadStore(Instruction* 
instr);
 
  131  void DecodeVMOVBetweenCoreAndSinglePrecisionRegisters(Instruction* 
instr);
 
  132  void DecodeVCMP(Instruction* 
instr);
 
  133  void DecodeVCVTBetweenDoubleAndSingle(Instruction* 
instr);
 
  134  void DecodeVCVTBetweenFloatingPointAndInteger(Instruction* 
instr);
 
  135  void DecodeVmovImmediate(Instruction* 
instr);
 
  143#define STRING_STARTS_WITH(string, compare_string) \ 
  144  (strncmp(string, compare_string, strlen(compare_string)) == 0) 
  162    "eq", 
"ne", 
"cs", 
"cc", 
"mi", 
"pl", 
"vs", 
"vc",
 
  163    "hi", 
"ls", 
"ge", 
"lt", 
"gt", 
"le", 
"",   
"invalid",
 
  167void Decoder::PrintCondition(Instruction* 
instr) {
 
  183void Decoder::PrintQRegister(
int reg) {
 
  189static const char* 
const shift_names[
kNumberOfShifts] = {
"lsl", 
"lsr", 
"asr",
 
  194void Decoder::PrintShiftRm(Instruction* 
instr) {
 
  196  int shift_index = 
instr->ShiftValue();
 
  197  int shift_amount = 
instr->ShiftAmountValue();
 
  198  int rm = 
instr->RmValue();
 
  202  if ((
instr->RegShiftValue() == 0) && (shift == 
LSL) && (shift_amount == 0)) {
 
  206  if (
instr->RegShiftValue() == 0) {
 
  208    if ((shift == 
ROR) && (shift_amount == 0)) {
 
  211    } 
else if (((shift == 
LSR) || (shift == 
ASR)) && (shift_amount == 0)) {
 
  215                                      shift_names[shift_index], shift_amount);
 
  218    int rs = 
instr->RsValue();
 
  220                                      shift_names[shift_index]);
 
  227void Decoder::PrintShiftImm(Instruction* 
instr) {
 
  228  int rotate = 
instr->RotateValue() * 2;
 
  229  int immed8 = 
instr->Immed8Value();
 
  235void Decoder::PrintShiftSat(Instruction* 
instr) {
 
  236  int shift = 
instr->Bits(11, 7);
 
  240                       shift_names[
instr->Bit(6) * 2], 
instr->Bits(11, 7));
 
  245void Decoder::PrintPU(Instruction* 
instr) {
 
  246  switch (
instr->PUField()) {
 
  274      Print(
"call rt redirected");
 
  296  if (format[1] == 
'n') {  
 
  300  } 
else if (format[1] == 
'd') {  
 
  304  } 
else if (format[1] == 
's') {  
 
  308  } 
else if (format[1] == 
'm') {  
 
  312  } 
else if (format[1] == 
't') {  
 
  316  } 
else if (format[1] == 
'l') {
 
  319    int rlist = 
instr->RlistValue();
 
  324      if ((rlist & 1) != 0) {
 
  326        if ((rlist >> 1) != 0) {
 
  341int Decoder::FormatVFPRegister(Instruction* 
instr, 
const char* format,
 
  345  if (format[1] == 
'n') {
 
  347  } 
else if (format[1] == 
'm') {
 
  349  } 
else if (format[1] == 
'd') {
 
  350    if ((
instr->TypeValue() == 7) && (
instr->Bit(24) == 0x0) &&
 
  351        (
instr->Bits(11, 9) == 0x5) && (
instr->Bit(4) == 0x1)) {
 
  358    if (format[2] == 
'+') {
 
  360      int immed8 = 
instr->Immed8Value();
 
  364    if (format[2] == 
'+') retval = 3;
 
  381int Decoder::FormatVFPinstruction(Instruction* 
instr, 
const char* format) {
 
  386void Decoder::FormatNeonList(
int Vd, 
int type) {
 
  390  } 
else if (type == 
nlt_2) {
 
  393  } 
else if (type == 
nlt_3) {
 
  395                                      "{d%d, d%d, d%d}", Vd, Vd + 1, Vd + 2);
 
  396  } 
else if (type == 
nlt_4) {
 
  399                       Vd, Vd + 1, Vd + 2, Vd + 3);
 
  403void Decoder::FormatNeonMemory(
int Rn, 
int align, 
int Rm) {
 
  412  } 
else if (Rm == 13) {
 
  421void Decoder::PrintMovwMovt(Instruction* 
instr) {
 
  422  int imm = 
instr->ImmedMovwMovtValue();
 
  423  int rd = 
instr->RdValue();
 
  437      if (
instr->Bit(21) == 0) {
 
  452      PrintCondition(
instr);
 
  456      double d = 
instr->DoubleImmedVmov().get_scalar();
 
  462      uint32_t lsbit = 
instr->Bits(11, 7);
 
  463      uint32_t width = 
instr->Bits(20, 16) + 1;
 
  464      if (
instr->Bit(21) == 0) {
 
  472                                        "#%d, #%d", lsbit, width);
 
  485      int width = (format[3] - 
'0') * 10 + (format[4] - 
'0');
 
  486      int lsb = (format[6] - 
'0') * 10 + (format[7] - 
'0');
 
  488      DCHECK((width >= 1) && (width <= 32));
 
  489      DCHECK((lsb >= 0) && (lsb <= 31));
 
  493                                        instr->Bits(width + lsb - 1, lsb));
 
  497      if (
instr->HasLink()) {
 
  503      if (format[1] == 
'w') {
 
  505        PrintMovwMovt(
instr);
 
  508      if (format[1] == 
'e') {  
 
  513          if ((
instr->Bits(27, 25) == 0) && (
instr->Bit(20) == 0) &&
 
  514              (
instr->Bits(7, 6) == 3) && (
instr->Bit(4) == 1)) {
 
  515            if (
instr->Bit(5) == 1) {
 
  529          reinterpret_cast<uint8_t*
>(
instr->InstructionBits() & 0x0FFFFFFF);
 
  535      if ((format[3] == 
'1') && (format[4] == 
'2')) {
 
  539                                          instr->Offset12Value());
 
  541      } 
else if (format[3] == 
'0') {
 
  546                           (
instr->Bits(19, 8) << 4) + 
instr->Bits(3, 0));
 
  551      int offs8 = (
instr->ImmedHValue() << 4) | 
instr->ImmedLValue();
 
  565      if (format[1] == 
'h') {    
 
  566        if (format[6] == 
'o') {  
 
  568          if (
instr->TypeValue() == 0) {
 
  572            PrintShiftImm(
instr);
 
  575        } 
else if (format[6] == 
's') {  
 
  577          PrintShiftSat(
instr);
 
  584      } 
else if (format[1] == 
'v') {  
 
  586        PrintSoftwareInterrupt(
instr->SvcValue());
 
  588      } 
else if (format[1] == 
'i') {  
 
  589        if (format[2] == 
'g') {
 
  591          if (
instr->HasSign()) {
 
  599          int sz = 8 << (format[4] == 
'2' ? 
instr->Bits(19, 18)
 
  600                                          : 
instr->Bits(21, 20));
 
  605      } 
else if (format[1] == 
'p') {
 
  606        if (format[8] == 
'_') {  
 
  618          if (
instr->Bit(22) == 0) {
 
  634      int off = (
static_cast<uint32_t
>(
instr->SImmed24Value()) << 2) + 8u;
 
  653      if (
instr->Bit(22) == 0) {
 
  661      return FormatVFPinstruction(
instr, format);
 
  669      switch (
instr->PUField()) {
 
  684                         reinterpret_cast<uintptr_t
>(addr));
 
  710  char cur = *format++;
 
  724#define VERIFY(condition) \ 
  725  if (!(condition)) {     \ 
  734void Decoder::DecodeType01(Instruction* 
instr) {
 
  735  int type = 
instr->TypeValue();
 
  736  if ((type == 0) && 
instr->IsSpecialType0()) {
 
  738    if (
instr->Bits(7, 4) == 9) {
 
  739      if (
instr->Bit(24) == 0) {
 
  741        if (
instr->Bit(23) == 0) {
 
  742          if (
instr->Bit(21) == 0) {
 
  748            if (
instr->Bit(22) == 0) {
 
  772        if (
instr->Bits(24, 23) == 3) {
 
  773          if (
instr->Bit(20) == 1) {
 
  775            switch (
instr->Bits(22, 21)) {
 
  795            switch (
instr->Bits(22, 21)) {
 
  816    } 
else if ((
instr->Bit(20) == 0) && ((
instr->Bits(7, 4) & 0xD) == 0xD)) {
 
  818      switch (
instr->PUField()) {
 
  820          if (
instr->Bit(22) == 0) {
 
  823            Format(
instr, 
"'memop'cond's 'rd, ['rn], #-'off8");
 
  828          if (
instr->Bit(22) == 0) {
 
  831            Format(
instr, 
"'memop'cond's 'rd, ['rn], #+'off8");
 
  836          if (
instr->Bit(22) == 0) {
 
  839            Format(
instr, 
"'memop'cond's 'rd, ['rn, #-'off8]'w");
 
  844          if (
instr->Bit(22) == 0) {
 
  847            Format(
instr, 
"'memop'cond's 'rd, ['rn, #+'off8]'w");
 
  858      switch (
instr->PUField()) {
 
  860          if (
instr->Bit(22) == 0) {
 
  861            Format(
instr, 
"'memop'cond'sign'h 'rd, ['rn], -'rm");
 
  863            Format(
instr, 
"'memop'cond'sign'h 'rd, ['rn], #-'off8");
 
  868          if (
instr->Bit(22) == 0) {
 
  869            Format(
instr, 
"'memop'cond'sign'h 'rd, ['rn], +'rm");
 
  871            Format(
instr, 
"'memop'cond'sign'h 'rd, ['rn], #+'off8");
 
  876          if (
instr->Bit(22) == 0) {
 
  877            Format(
instr, 
"'memop'cond'sign'h 'rd, ['rn, -'rm]'w");
 
  879            Format(
instr, 
"'memop'cond'sign'h 'rd, ['rn, #-'off8]'w");
 
  884          if (
instr->Bit(22) == 0) {
 
  885            Format(
instr, 
"'memop'cond'sign'h 'rd, ['rn, +'rm]'w");
 
  887            Format(
instr, 
"'memop'cond'sign'h 'rd, ['rn, #+'off8]'w");
 
  898  } 
else if ((type == 0) && 
instr->IsMiscType0()) {
 
  899    if ((
instr->Bits(27, 23) == 2) && (
instr->Bits(21, 20) == 2) &&
 
  900        (
instr->Bits(15, 4) == 0xF00)) {
 
  901      Format(
instr, 
"msr'cond 'spec_reg'spec_reg_fields, 'rm");
 
  902    } 
else if ((
instr->Bits(27, 23) == 2) && (
instr->Bits(21, 20) == 0) &&
 
  903               (
instr->Bits(11, 0) == 0)) {
 
  905    } 
else if (
instr->Bits(22, 21) == 1) {
 
  906      switch (
instr->BitField(7, 4)) {
 
  920    } 
else if (
instr->Bits(22, 21) == 3) {
 
  921      switch (
instr->BitField(7, 4)) {
 
  932  } 
else if ((type == 1) && 
instr->IsNopLikeType1()) {
 
  933    if (
instr->BitField(7, 0) == 0) {
 
  935    } 
else if (
instr->BitField(7, 0) == 20) {
 
  941    switch (
instr->OpcodeField()) {
 
 1001        if (
instr->HasS()) {
 
 1034void Decoder::DecodeType2(Instruction* 
instr) {
 
 1035  switch (
instr->PUField()) {
 
 1037      if (
instr->HasW()) {
 
 1041      Format(
instr, 
"'memop'cond'b 'rd, ['rn], #-'off12");
 
 1045      if (
instr->HasW()) {
 
 1049      Format(
instr, 
"'memop'cond'b 'rd, ['rn], #+'off12");
 
 1054        Format(
instr, 
"'memop'cond'b 'rd, [pc, #-'off12]'w (addr 'A)");
 
 1056        Format(
instr, 
"'memop'cond'b 'rd, ['rn, #-'off12]'w");
 
 1062        Format(
instr, 
"'memop'cond'b 'rd, [pc, #+'off12]'w (addr 'A)");
 
 1064        Format(
instr, 
"'memop'cond'b 'rd, ['rn, #+'off12]'w");
 
 1075void Decoder::DecodeType3(Instruction* 
instr) {
 
 1076  switch (
instr->PUField()) {
 
 1078      VERIFY(!
instr->HasW());
 
 1079      Format(
instr, 
"'memop'cond'b 'rd, ['rn], -'shift_rm");
 
 1083      if (
instr->Bit(4) == 0) {
 
 1084        Format(
instr, 
"'memop'cond'b 'rd, ['rn], +'shift_rm");
 
 1086        if (
instr->Bit(5) == 0) {
 
 1087          switch (
instr->Bits(22, 21)) {
 
 1089              if (
instr->Bit(20) == 0) {
 
 1090                if (
instr->Bit(6) == 0) {
 
 1091                  Format(
instr, 
"pkhbt'cond 'rd, 'rn, 'rm, lsl #'imm05@07");
 
 1093                  if (
instr->Bits(11, 7) == 0) {
 
 1094                    Format(
instr, 
"pkhtb'cond 'rd, 'rn, 'rm, asr #32");
 
 1096                    Format(
instr, 
"pkhtb'cond 'rd, 'rn, 'rm, asr #'imm05@07");
 
 1108              Format(
instr, 
"usat 'rd, #'imm05@16, 'rm'shift_sat");
 
 1112          switch (
instr->Bits(22, 21)) {
 
 1116              if (
instr->Bits(9, 6) == 1) {
 
 1117                if (
instr->Bit(20) == 0) {
 
 1118                  if (
instr->Bits(19, 16) == 0xF) {
 
 1119                    switch (
instr->Bits(11, 10)) {
 
 1134                    switch (
instr->Bits(11, 10)) {
 
 1139                        Format(
instr, 
"sxtab'cond 'rd, 'rn, 'rm, ror #8");
 
 1142                        Format(
instr, 
"sxtab'cond 'rd, 'rn, 'rm, ror #16");
 
 1145                        Format(
instr, 
"sxtab'cond 'rd, 'rn, 'rm, ror #24");
 
 1150                  if (
instr->Bits(19, 16) == 0xF) {
 
 1151                    switch (
instr->Bits(11, 10)) {
 
 1166                    switch (
instr->Bits(11, 10)) {
 
 1171                        Format(
instr, 
"sxtah'cond 'rd, 'rn, 'rm, ror #8");
 
 1174                        Format(
instr, 
"sxtah'cond 'rd, 'rn, 'rm, ror #16");
 
 1177                        Format(
instr, 
"sxtah'cond 'rd, 'rn, 'rm, ror #24");
 
 1182              } 
else if (
instr->Bits(27, 16) == 0x6BF &&
 
 1183                         instr->Bits(11, 4) == 0xF3) {
 
 1190              if ((
instr->Bit(20) == 0) && (
instr->Bits(9, 6) == 1)) {
 
 1191                if (
instr->Bits(19, 16) == 0xF) {
 
 1192                  switch (
instr->Bits(11, 10)) {
 
 1214              if ((
instr->Bits(9, 6) == 1)) {
 
 1215                if ((
instr->Bit(20) == 0)) {
 
 1216                  if (
instr->Bits(19, 16) == 0xF) {
 
 1217                    switch (
instr->Bits(11, 10)) {
 
 1232                    switch (
instr->Bits(11, 10)) {
 
 1237                        Format(
instr, 
"uxtab'cond 'rd, 'rn, 'rm, ror #8");
 
 1240                        Format(
instr, 
"uxtab'cond 'rd, 'rn, 'rm, ror #16");
 
 1243                        Format(
instr, 
"uxtab'cond 'rd, 'rn, 'rm, ror #24");
 
 1248                  if (
instr->Bits(19, 16) == 0xF) {
 
 1249                    switch (
instr->Bits(11, 10)) {
 
 1264                    switch (
instr->Bits(11, 10)) {
 
 1269                        Format(
instr, 
"uxtah'cond 'rd, 'rn, 'rm, ror #8");
 
 1272                        Format(
instr, 
"uxtah'cond 'rd, 'rn, 'rm, ror #16");
 
 1275                        Format(
instr, 
"uxtah'cond 'rd, 'rn, 'rm, ror #24");
 
 1282                if ((
instr->Bits(20, 16) == 0x1F) &&
 
 1283                    (
instr->Bits(11, 4) == 0xF3)) {
 
 1296      if (
instr->Bits(22, 20) == 0x5) {
 
 1297        if (
instr->Bits(7, 4) == 0x1) {
 
 1298          if (
instr->Bits(15, 12) == 0xF) {
 
 1307      if (
instr->Bits(5, 4) == 0x1) {
 
 1308        if ((
instr->Bit(22) == 0x0) && (
instr->Bit(20) == 0x1)) {
 
 1309          if (
instr->Bit(21) == 0x1) {
 
 1319      Format(
instr, 
"'memop'cond'b 'rd, ['rn, -'shift_rm]'w");
 
 1323      if (
instr->HasW() && (
instr->Bits(6, 4) == 0x5)) {
 
 1324        uint32_t widthminus1 = 
static_cast<uint32_t
>(
instr->Bits(20, 16));
 
 1325        uint32_t lsbit = 
static_cast<uint32_t
>(
instr->Bits(11, 7));
 
 1326        uint32_t msbit = widthminus1 + lsbit;
 
 1328          if (
instr->Bit(22)) {
 
 1336      } 
else if (!
instr->HasW() && (
instr->Bits(6, 4) == 0x1)) {
 
 1337        uint32_t lsbit = 
static_cast<uint32_t
>(
instr->Bits(11, 7));
 
 1338        uint32_t msbit = 
static_cast<uint32_t
>(
instr->Bits(20, 16));
 
 1339        if (msbit >= lsbit) {
 
 1340          if (
instr->RmValue() == 15) {
 
 1349        Format(
instr, 
"'memop'cond'b 'rd, ['rn, +'shift_rm]'w");
 
 1360void Decoder::DecodeType4(Instruction* 
instr) {
 
 1361  if (
instr->Bit(22) != 0) {
 
 1365    if (
instr->HasL()) {
 
 1373void Decoder::DecodeType5(Instruction* 
instr) {
 
 1377void Decoder::DecodeType6(Instruction* 
instr) {
 
 1378  DecodeType6CoprocessorIns(
instr);
 
 1381int Decoder::DecodeType7(Instruction* 
instr) {
 
 1382  if (
instr->Bit(24) == 1) {
 
 1389    switch (
instr->CoprocessorValue()) {
 
 1392        DecodeTypeVFP(
instr);
 
 1395        DecodeTypeCP15(
instr);
 
 1436void Decoder::DecodeTypeVFP(Instruction* 
instr) {
 
 1437  VERIFY((
instr->TypeValue() == 7) && (
instr->Bit(24) == 0x0));
 
 1438  VERIFY(
instr->Bits(11, 9) == 0x5);
 
 1440  if (
instr->Bit(4) == 0) {
 
 1441    if (
instr->Opc1Value() == 0x7) {
 
 1443      if ((
instr->Opc2Value() == 0x0) && (
instr->Opc3Value() == 0x1)) {
 
 1445        if (
instr->SzValue() == 0x1) {
 
 1450      } 
else if ((
instr->Opc2Value() == 0x0) && (
instr->Opc3Value() == 0x3)) {
 
 1452        if (
instr->SzValue() == 0x1) {
 
 1457      } 
else if ((
instr->Opc2Value() == 0x1) && (
instr->Opc3Value() == 0x1)) {
 
 1459        if (
instr->SzValue() == 0x1) {
 
 1464      } 
else if ((
instr->Opc2Value() == 0x7) && (
instr->Opc3Value() == 0x3)) {
 
 1465        DecodeVCVTBetweenDoubleAndSingle(
instr);
 
 1466      } 
else if ((
instr->Opc2Value() == 0x8) && (
instr->Opc3Value() & 0x1)) {
 
 1467        DecodeVCVTBetweenFloatingPointAndInteger(
instr);
 
 1468      } 
else if ((
instr->Opc2Value() == 0xA) && (
instr->Opc3Value() == 0x3) &&
 
 1469                 (
instr->Bit(8) == 1)) {
 
 1471        int fraction_bits = 32 - ((
instr->Bits(3, 0) << 1) | 
instr->Bit(5));
 
 1474                                          ", #%d", fraction_bits);
 
 1475      } 
else if (((
instr->Opc2Value() >> 1) == 0x6) &&
 
 1476                 (
instr->Opc3Value() & 0x1)) {
 
 1477        DecodeVCVTBetweenFloatingPointAndInteger(
instr);
 
 1478      } 
else if (((
instr->Opc2Value() == 0x4) || (
instr->Opc2Value() == 0x5)) &&
 
 1479                 (
instr->Opc3Value() & 0x1)) {
 
 1481      } 
else if (((
instr->Opc2Value() == 0x1)) && (
instr->Opc3Value() == 0x3)) {
 
 1482        if (
instr->SzValue() == 0x1) {
 
 1487      } 
else if (
instr->Opc3Value() == 0x0) {
 
 1488        if (
instr->SzValue() == 0x1) {
 
 1493      } 
else if (((
instr->Opc2Value() == 0x6)) && 
instr->Opc3Value() == 0x3) {
 
 1495        if (
instr->SzValue() == 0x1) {
 
 1503    } 
else if (
instr->Opc1Value() == 0x3) {
 
 1504      if (
instr->SzValue() == 0x1) {
 
 1505        if (
instr->Opc3Value() & 0x1) {
 
 1511        if (
instr->Opc3Value() & 0x1) {
 
 1517    } 
else if ((
instr->Opc1Value() == 0x2) && !(
instr->Opc3Value() & 0x1)) {
 
 1518      if (
instr->SzValue() == 0x1) {
 
 1523    } 
else if ((
instr->Opc1Value() == 0x0) && !(
instr->Opc3Value() & 0x1)) {
 
 1524      if (
instr->SzValue() == 0x1) {
 
 1529    } 
else if ((
instr->Opc1Value() == 0x0) && (
instr->Opc3Value() & 0x1)) {
 
 1530      if (
instr->SzValue() == 0x1) {
 
 1535    } 
else if ((
instr->Opc1Value() == 0x4) && !(
instr->Opc3Value() & 0x1)) {
 
 1536      if (
instr->SzValue() == 0x1) {
 
 1545    if ((
instr->VCValue() == 0x0) && (
instr->VAValue() == 0x0)) {
 
 1546      DecodeVMOVBetweenCoreAndSinglePrecisionRegisters(
instr);
 
 1547    } 
else if ((
instr->VLValue() == 0x0) && (
instr->VCValue() == 0x1)) {
 
 1549      if (
instr->Bit(23) == 0) {
 
 1550        int opc1_opc2 = (
instr->Bits(22, 21) << 2) | 
instr->Bits(6, 5);
 
 1551        if ((opc1_opc2 & 0xB) == 0) {
 
 1553          if (
instr->Bit(21) == 0x0) {
 
 1560          if ((opc1_opc2 & 0x8) != 0) {
 
 1562            int i = opc1_opc2 & 0x7;
 
 1565                               "vmov.8 d%d[%d], %s", vd, 
i, rt_name);
 
 1566          } 
else if ((opc1_opc2 & 0x1) != 0) {
 
 1568            int i = (opc1_opc2 >> 1) & 0x3;
 
 1571                               "vmov.16 d%d[%d], %s", vd, 
i, rt_name);
 
 1578        if (
instr->Bit(5) != 0) {
 
 1580        } 
else if (
instr->Bit(22) != 0) {
 
 1585                                          "vdup.%i q%d, %s", size, Vd, rt_name);
 
 1587    } 
else if ((
instr->VLValue() == 0x1) && (
instr->VCValue() == 0x1)) {
 
 1588      int opc1_opc2 = (
instr->Bits(22, 21) << 2) | 
instr->Bits(6, 5);
 
 1589      if ((opc1_opc2 & 0xB) == 0) {
 
 1591        if (
instr->Bit(21) == 0x0) {
 
 1597        char sign = 
instr->Bit(23) != 0 ? 
'u' : 
's';
 
 1600        if ((opc1_opc2 & 0x8) != 0) {
 
 1602          int i = opc1_opc2 & 0x7;
 
 1605                             "vmov.%c8 %s, d%d[%d]", 
sign, rt_name, vn, 
i);
 
 1606        } 
else if ((opc1_opc2 & 0x1) != 0) {
 
 1608          int i = (opc1_opc2 >> 1) & 0x3;
 
 1611                             "vmov.%c16 %s, d%d[%d]", 
sign, rt_name, vn, 
i);
 
 1616    } 
else if ((
instr->VCValue() == 0x0) && (
instr->VAValue() == 0x7) &&
 
 1617               (
instr->Bits(19, 16) == 0x1)) {
 
 1618      if (
instr->VLValue() == 0) {
 
 1619        if (
instr->Bits(15, 12) == 0xF) {
 
 1625        if (
instr->Bits(15, 12) == 0xF) {
 
 1637void Decoder::DecodeTypeCP15(Instruction* 
instr) {
 
 1638  VERIFY((
instr->TypeValue() == 7) && (
instr->Bit(24) == 0x0));
 
 1639  VERIFY(
instr->CoprocessorValue() == 15);
 
 1641  if (
instr->Bit(4) == 1) {
 
 1642    int crn = 
instr->Bits(19, 16);
 
 1643    int crm = 
instr->Bits(3, 0);
 
 1644    int opc1 = 
instr->Bits(23, 21);
 
 1645    int opc2 = 
instr->Bits(7, 5);
 
 1646    if ((opc1 == 0) && (crn == 7)) {
 
 1649      if ((crm == 10) && (opc2 == 5)) {
 
 1651      } 
else if ((crm == 10) && (opc2 == 4)) {
 
 1653      } 
else if ((crm == 5) && (opc2 == 4)) {
 
 1666void Decoder::DecodeVMOVBetweenCoreAndSinglePrecisionRegisters(
 
 1667    Instruction* 
instr) {
 
 1668  VERIFY((
instr->Bit(4) == 1) && (
instr->VCValue() == 0x0) &&
 
 1669         (
instr->VAValue() == 0x0));
 
 1671  bool to_arm_register = (
instr->VLValue() == 0x1);
 
 1673  if (to_arm_register) {
 
 1680void Decoder::DecodeVCMP(Instruction* 
instr) {
 
 1681  VERIFY((
instr->Bit(4) == 0) && (
instr->Opc1Value() == 0x7));
 
 1682  VERIFY(((
instr->Opc2Value() == 0x4) || (
instr->Opc2Value() == 0x5)) &&
 
 1683         (
instr->Opc3Value() & 0x1));
 
 1686  bool dp_operation = (
instr->SzValue() == 1);
 
 1687  bool raise_exception_for_qnan = (
instr->Bit(7) == 0x1);
 
 1689  if (dp_operation && !raise_exception_for_qnan) {
 
 1690    if (
instr->Opc2Value() == 0x4) {
 
 1692    } 
else if (
instr->Opc2Value() == 0x5) {
 
 1697  } 
else if (!raise_exception_for_qnan) {
 
 1698    if (
instr->Opc2Value() == 0x4) {
 
 1700    } 
else if (
instr->Opc2Value() == 0x5) {
 
 1710void Decoder::DecodeVCVTBetweenDoubleAndSingle(Instruction* 
instr) {
 
 1711  VERIFY((
instr->Bit(4) == 0) && (
instr->Opc1Value() == 0x7));
 
 1712  VERIFY((
instr->Opc2Value() == 0x7) && (
instr->Opc3Value() == 0x3));
 
 1714  bool double_to_single = (
instr->SzValue() == 1);
 
 1716  if (double_to_single) {
 
 1723void Decoder::DecodeVCVTBetweenFloatingPointAndInteger(Instruction* 
instr) {
 
 1724  VERIFY((
instr->Bit(4) == 0) && (
instr->Opc1Value() == 0x7));
 
 1725  VERIFY(((
instr->Opc2Value() == 0x8) && (
instr->Opc3Value() & 0x1)) ||
 
 1726         (((
instr->Opc2Value() >> 1) == 0x6) && (
instr->Opc3Value() & 0x1)));
 
 1728  bool to_integer = (
instr->Bit(18) == 1);
 
 1729  bool dp_operation = (
instr->SzValue() == 1);
 
 1731    bool unsigned_integer = (
instr->Bit(16) == 0);
 
 1734      if (unsigned_integer) {
 
 1740      if (unsigned_integer) {
 
 1747    bool unsigned_integer = (
instr->Bit(7) == 0);
 
 1750      if (unsigned_integer) {
 
 1756      if (unsigned_integer) {
 
 1765void Decoder::DecodeVmovImmediate(Instruction* 
instr) {
 
 1766  uint8_t cmode = 
instr->Bits(11, 8);
 
 1768  int a = 
instr->Bit(24);
 
 1769  int bcd = 
instr->Bits(18, 16);
 
 1770  int efgh = 
instr->Bits(3, 0);
 
 1771  uint8_t imm = a << 7 | bcd << 4 | efgh;
 
 1774      uint32_t imm32 = imm;
 
 1776                                        "vmov.i32 q%d, %d", vd, imm32);
 
 1781                                        "vmov.i8 q%d, %d", vd, imm);
 
 1794void Decoder::DecodeType6CoprocessorIns(Instruction* 
instr) {
 
 1795  VERIFY(
instr->TypeValue() == 6);
 
 1797  if (
instr->CoprocessorValue() == 0xA) {
 
 1798    switch (
instr->OpcodeValue()) {
 
 1801        if (
instr->HasL()) {
 
 1802          Format(
instr, 
"vldr'cond 'Sd, ['rn - 4*'imm08@00]");
 
 1804          Format(
instr, 
"vstr'cond 'Sd, ['rn - 4*'imm08@00]");
 
 1809        if (
instr->HasL()) {
 
 1810          Format(
instr, 
"vldr'cond 'Sd, ['rn + 4*'imm08@00]");
 
 1812          Format(
instr, 
"vstr'cond 'Sd, ['rn + 4*'imm08@00]");
 
 1821        bool to_vfp_register = (
instr->VLValue() == 0x1);
 
 1822        if (to_vfp_register) {
 
 1832  } 
else if (
instr->CoprocessorValue() == 0xB) {
 
 1833    switch (
instr->OpcodeValue()) {
 
 1836        if (
instr->Bits(7, 6) != 0 || 
instr->Bit(4) != 1) {
 
 1838        } 
else if (
instr->HasL()) {
 
 1846        if (
instr->HasL()) {
 
 1847          Format(
instr, 
"vldr'cond 'Dd, ['rn - 4*'imm08@00]");
 
 1849          Format(
instr, 
"vstr'cond 'Dd, ['rn - 4*'imm08@00]");
 
 1854        if (
instr->HasL()) {
 
 1855          Format(
instr, 
"vldr'cond 'Dd, ['rn + 4*'imm08@00]");
 
 1857          Format(
instr, 
"vstr'cond 'Dd, ['rn + 4*'imm08@00]");
 
 1866        bool to_vfp_register = (
instr->VLValue() == 0x1);
 
 1867        if (to_vfp_register) {
 
 1882static const char* 
const barrier_option_names[] = {
 
 1883    "invalid", 
"oshld", 
"oshst", 
"osh", 
"invalid", 
"nshld", 
"nshst", 
"nsh",
 
 1884    "invalid", 
"ishld", 
"ishst", 
"ish", 
"invalid", 
"ld",    
"st",    
"sy",
 
 1887void Decoder::DecodeSpecialCondition(Instruction* 
instr) {
 
 1888  int op0 = 
instr->Bits(25, 24);
 
 1889  int op1 = 
instr->Bits(11, 9);
 
 1890  int op2 = 
instr->Bit(4);
 
 1892  if (
instr->Bit(27) == 0) {
 
 1893    DecodeUnconditional(
instr);
 
 1894  } 
else if ((
instr->Bits(27, 26) == 0b11) && (op0 == 0b10) &&
 
 1895             ((op1 >> 1) == 0b10) && !op2) {
 
 1896    DecodeFloatingPointDataProcessing(
instr);
 
 1902void Decoder::DecodeFloatingPointDataProcessing(Instruction* 
instr) {
 
 1904  int op0 = 
instr->Bits(23, 20);
 
 1905  int op1 = 
instr->Bits(19, 16);
 
 1906  int op2 = 
instr->Bits(9, 8);
 
 1907  int op3 = 
instr->Bit(6);
 
 1908  if (((op0 & 0b1000) == 0) && op2 && !op3) {
 
 1911    bool dp_operation = (
instr->SzValue() == 1);
 
 1912    switch (
instr->Bits(21, 20)) {
 
 1944  } 
else if (
instr->Opc1Value() == 0x4 && op2) {
 
 1947    if (
instr->SzValue() == 0x1) {
 
 1948      if (
instr->Bit(6) == 0x1) {
 
 1954      if (
instr->Bit(6) == 0x1) {
 
 1960  } 
else if (
instr->Opc1Value() == 0x7 && (op1 >> 3) && op2 && op3) {
 
 1963    bool dp_operation = (
instr->SzValue() == 1);
 
 2004void Decoder::DecodeUnconditional(Instruction* 
instr) {
 
 2006  int op0 = 
instr->Bits(26, 25);
 
 2007  int op1 = 
instr->Bit(20);
 
 2015    DecodeAdvancedSIMDDataProcessing(
instr);
 
 2016  } 
else if ((op0 & 0b10) == 0b10 && op1) {
 
 2017    DecodeMemoryHintsAndBarriers(
instr);
 
 2018  } 
else if (op0 == 0b10 && !op1) {
 
 2019    DecodeAdvancedSIMDElementOrStructureLoadStore(
instr);
 
 2025void Decoder::DecodeAdvancedSIMDDataProcessing(Instruction* 
instr) {
 
 2026  int op0 = 
instr->Bit(23);
 
 2027  int op1 = 
instr->Bit(4);
 
 2031    if (
instr->Bit(6) == 0) {
 
 2039    int u = 
instr->Bit(24);
 
 2040    int opc = 
instr->Bits(11, 8);
 
 2041    int q = 
instr->Bit(6);
 
 2042    int sz = 
instr->Bits(21, 20);
 
 2044    if (!u && opc == 0 && op1) {
 
 2046    } 
else if (!u && opc == 1 && sz == 2 && q && op1) {
 
 2052    } 
else if (!u && opc == 1 && sz == 1 && q && op1) {
 
 2054    } 
else if (!u && opc == 1 && sz == 0 && q && op1) {
 
 2056    } 
else if (!u && opc == 2 && op1) {
 
 2058    } 
else if (!u && opc == 3 && op1) {
 
 2060    } 
else if (!u && opc == 3 && !op1) {
 
 2062    } 
else if (!u && opc == 4 && !op1) {
 
 2064    } 
else if (!u && opc == 6 && op1) {
 
 2066    } 
else if (!u && opc == 6 && !op1) {
 
 2068    } 
else if (!u && opc == 8 && op1) {
 
 2070    } 
else if (!u && opc == 8 && !op1) {
 
 2072    } 
else if (opc == 9 && op1) {
 
 2074    } 
else if (!u && opc == 0xA && op1) {
 
 2076    } 
else if (!u && opc == 0xA && !op1) {
 
 2078    } 
else if (u && opc == 0XB) {
 
 2080    } 
else if (!u && opc == 0xB) {
 
 2082    } 
else if (!u && !(sz >> 1) && opc == 0xD && !op1) {
 
 2084    } 
else if (!u && (sz >> 1) && opc == 0xD && !op1) {
 
 2086    } 
else if (!u && opc == 0xE && !sz && !op1) {
 
 2088    } 
else if (!u && !(sz >> 1) && opc == 0xF && op1) {
 
 2090    } 
else if (!u && (sz >> 1) && opc == 0xF && op1) {
 
 2092    } 
else if (!u && !(sz >> 1) && opc == 0xF && !op1) {
 
 2094    } 
else if (!u && (sz >> 1) && opc == 0xF && !op1) {
 
 2096    } 
else if (u && opc == 0 && op1) {
 
 2098    } 
else if (u && opc == 1 && sz == 1 && op1) {
 
 2100    } 
else if (u && opc == 1 && sz == 0 && q && op1) {
 
 2102    } 
else if (u && opc == 1 && sz == 0 && !q && op1) {
 
 2104    } 
else if (u && opc == 1 && !op1) {
 
 2106    } 
else if (u && opc == 2 && op1) {
 
 2108    } 
else if (u && opc == 3 && op1) {
 
 2110    } 
else if (u && opc == 3 && !op1) {
 
 2112    } 
else if (u && opc == 4 && !op1) {
 
 2114    } 
else if (u && opc == 6 && op1) {
 
 2116    } 
else if (u && opc == 6 && !op1) {
 
 2118    } 
else if (u && opc == 8 && op1) {
 
 2120    } 
else if (u && opc == 8 && !op1) {
 
 2122    } 
else if (u && opc == 0xA && op1) {
 
 2124    } 
else if (u && opc == 0xA && !op1) {
 
 2126    } 
else if (u && opc == 0xD && sz == 0 && q && op1) {
 
 2128    } 
else if (u && opc == 0xD && sz == 0 && !q && !op1) {
 
 2130    } 
else if (u && opc == 0xE && !(sz >> 1) && !op1) {
 
 2132    } 
else if (u && opc == 0xE && (sz >> 1) && !op1) {
 
 2137  } 
else if (op0 == 1 && op1 == 0) {
 
 2138    DecodeAdvancedSIMDTwoOrThreeRegisters(
instr);
 
 2139  } 
else if (op0 == 1 && op1 == 1) {
 
 2141    if (
instr->Bits(21, 19) == 0 && 
instr->Bit(7) == 0) {
 
 2143      DecodeVmovImmediate(
instr);
 
 2146      int u = 
instr->Bit(24);
 
 2147      int imm3H = 
instr->Bits(21, 19);
 
 2148      int imm3L = 
instr->Bits(18, 16);
 
 2149      int opc = 
instr->Bits(11, 8);
 
 2150      int l = 
instr->Bit(7);
 
 2151      int q = 
instr->Bit(6);
 
 2152      int imm3H_L = imm3H << 1 | 
l;
 
 2154      if (imm3H_L != 0 && opc == 0) {
 
 2156        int imm7 = (l << 6) | 
instr->Bits(21, 16);
 
 2158        int shift = 2 * size - imm7;
 
 2163                                            "vshr.%s%d q%d, q%d, #%d",
 
 2164                                            u ? 
"u" : 
"s", size, Vd, Vm, shift);
 
 2169                                            "vshr.%s%d d%d, d%d, #%d",
 
 2170                                            u ? 
"u" : 
"s", size, Vd, Vm, shift);
 
 2172      } 
else if (imm3H_L != 0 && opc == 1) {
 
 2175        int imm7 = (l << 6) | 
instr->Bits(21, 16);
 
 2177        int shift = 2 * size - imm7;
 
 2182                                            "vsra.%s%d q%d, q%d, #%d",
 
 2183                                            u ? 
"u" : 
"s", size, Vd, Vm, shift);
 
 2188                                            "vsra.%s%d d%d, d%d, #%d",
 
 2189                                            u ? 
"u" : 
"s", size, Vd, Vm, shift);
 
 2191      } 
else if (imm3H_L != 0 && imm3L == 0 && opc == 0b1010 && !q) {
 
 2196        int imm3H = 
instr->Bits(21, 19);
 
 2199                           u ? 
"u" : 
"s", imm3H * 8, Vd, Vm);
 
 2200      } 
else if (!u && imm3H_L != 0 && opc == 0b0101) {
 
 2202        int imm7 = (l << 6) | 
instr->Bits(21, 16);
 
 2204        int shift = imm7 - 
size;
 
 2209                           "vshl.i%d q%d, q%d, #%d", size, Vd, Vm, shift);
 
 2210      } 
else if (u && imm3H_L != 0 && (opc & 0b1110) == 0b0100) {
 
 2213        int imm7 = (l << 6) | 
instr->Bits(21, 16);
 
 2217        if (
instr->Bit(8) == 1) {
 
 2218          shift = imm7 - 
size;
 
 2221          shift = 2 * size - imm7;
 
 2228                                          size, Vd, Vm, shift);
 
 2236void Decoder::DecodeAdvancedSIMDTwoOrThreeRegisters(Instruction* 
instr) {
 
 2238  int op0 = 
instr->Bit(24);
 
 2239  int op1 = 
instr->Bits(21, 20);
 
 2240  int op2 = 
instr->Bits(11, 10);
 
 2241  int op3 = 
instr->Bit(6);
 
 2242  if (!op0 && op1 == 0b11) {
 
 2244    int imm4 = 
instr->Bits(11, 8);
 
 2250                       "vext.8 q%d, q%d, q%d, #%d", Vd, Vn, Vm, imm4);
 
 2251  } 
else if (op0 && op1 == 0b11 && ((op2 >> 1) == 0)) {
 
 2253    int size = 
instr->Bits(19, 18);
 
 2254    int opc1 = 
instr->Bits(17, 16);
 
 2255    int opc2 = 
instr->Bits(10, 7);
 
 2256    int q = 
instr->Bit(6);
 
 2261    if (opc1 == 0 && (opc2 >> 2) == 0) {
 
 2267    } 
else if (opc1 == 0 && opc2 == 0b1100) {
 
 2268      Format(
instr, q ? 
"vpadal.s'size2 'Qd, 'Qm" : 
"vpadal.s'size2 'Dd, 'Dm");
 
 2269    } 
else if (opc1 == 0 && opc2 == 0b1101) {
 
 2270      Format(
instr, q ? 
"vpadal.u'size2 'Qd, 'Qm" : 
"vpadal.u'size2 'Dd, 'Dm");
 
 2271    } 
else if (opc1 == 0 && opc2 == 0b0100) {
 
 2272      Format(
instr, q ? 
"vpaddl.s'size2 'Qd, 'Qm" : 
"vpaddl.s'size2 'Dd, 'Dm");
 
 2273    } 
else if (opc1 == 0 && opc2 == 0b0101) {
 
 2274      Format(
instr, q ? 
"vpaddl.u'size2 'Qd, 'Qm" : 
"vpaddl.u'size2 'Dd, 'Dm");
 
 2275    } 
else if (size == 0 && opc1 == 0b10 && opc2 == 0) {
 
 2276      Format(
instr, q ? 
"vswp 'Qd, 'Qm" : 
"vswp 'Dd, 'Dm");
 
 2277    } 
else if (opc1 == 0 && opc2 == 0b1010) {
 
 2279      Format(
instr, q ? 
"vcnt.8 'Qd, 'Qm" : 
"vcnt.8 'Dd, 'Dm");
 
 2280    } 
else if (opc1 == 0 && opc2 == 0b1011) {
 
 2282    } 
else if (opc1 == 0b01 && opc2 == 0b0010) {
 
 2285             q ? 
"vceq.s'size2 'Qd, 'Qm, #0" : 
"vceq.s.'size2 'Dd, 'Dm, #0");
 
 2286    } 
else if (opc1 == 0b01 && opc2 == 0b0100) {
 
 2289             q ? 
"vclt.s'size2 'Qd, 'Qm, #0" : 
"vclt.s.'size2 'Dd, 'Dm, #0");
 
 2290    } 
else if (opc1 == 0b01 && opc2 == 0b0110) {
 
 2291      Format(
instr, q ? 
"vabs.s'size2 'Qd, 'Qm" : 
"vabs.s.'size2 'Dd, 'Dm");
 
 2292    } 
else if (opc1 == 0b01 && opc2 == 0b1110) {
 
 2293      Format(
instr, q ? 
"vabs.f'size2 'Qd, 'Qm" : 
"vabs.f.'size2 'Dd, 'Dm");
 
 2294    } 
else if (opc1 == 0b01 && opc2 == 0b0111) {
 
 2295      Format(
instr, q ? 
"vneg.s'size2 'Qd, 'Qm" : 
"vneg.s.'size2 'Dd, 'Dm");
 
 2296    } 
else if (opc1 == 0b01 && opc2 == 0b1111) {
 
 2297      Format(
instr, q ? 
"vneg.f'size2 'Qd, 'Qm" : 
"vneg.f.'size2 'Dd, 'Dm");
 
 2298    } 
else if (opc1 == 0b10 && opc2 == 0b0001) {
 
 2299      Format(
instr, q ? 
"vtrn.'size2 'Qd, 'Qm" : 
"vtrn.'size2 'Dd, 'Dm");
 
 2300    } 
else if (opc1 == 0b10 && opc2 == 0b0010) {
 
 2301      Format(
instr, q ? 
"vuzp.'size2 'Qd, 'Qm" : 
"vuzp.'size2 'Dd, 'Dm");
 
 2302    } 
else if (opc1 == 0b10 && opc2 == 0b0011) {
 
 2303      Format(
instr, q ? 
"vzip.'size2 'Qd, 'Qm" : 
"vzip.'size2 'Dd, 'Dm");
 
 2304    } 
else if (opc1 == 0b10 && (opc2 & 0b1110) == 0b0100) {
 
 2308      int op = 
instr->Bits(7, 6);
 
 2309      const char* name = op == 0b01 ? 
"vqmovun" : 
"vqmovn";
 
 2310      char type = op == 0b11 ? 
'u' : 
's';
 
 2313                         name, type, esize << 1, Vd, Vm);
 
 2314    } 
else if (opc1 == 0b10 && opc2 == 0b1000) {
 
 2315      Format(
instr, q ? 
"vrintn.f32 'Qd, 'Qm" : 
"vrintn.f32 'Dd, 'Dm");
 
 2316    } 
else if (opc1 == 0b10 && opc2 == 0b1011) {
 
 2317      Format(
instr, q ? 
"vrintz.f32 'Qd, 'Qm" : 
"vrintz.f32 'Dd, 'Dm");
 
 2318    } 
else if (opc1 == 0b10 && opc2 == 0b1101) {
 
 2319      Format(
instr, q ? 
"vrintm.f32 'Qd, 'Qm" : 
"vrintm.f32 'Qd, 'Qm");
 
 2320    } 
else if (opc1 == 0b10 && opc2 == 0b1111) {
 
 2321      Format(
instr, q ? 
"vrintp.f32 'Qd, 'Qm" : 
"vrintp.f32 'Qd, 'Qm");
 
 2322    } 
else if (opc1 == 0b11 && (opc2 & 0b1101) == 0b1000) {
 
 2324    } 
else if (opc1 == 0b11 && (opc2 & 0b1101) == 0b1001) {
 
 2326    } 
else if (opc1 == 0b11 && (opc2 & 0b1100) == 0b1100) {
 
 2327      const char* suffix = 
nullptr;
 
 2328      int op = 
instr->Bits(8, 7);
 
 2344                                        "vcvt.%s q%d, q%d", suffix, Vd, Vm);
 
 2346  } 
else if (op0 && op1 == 0b11 && op2 == 0b10) {
 
 2351    int len = 
instr->Bits(9, 8);
 
 2355                       instr->Bit(6) == 0 ? 
"vtbl.8" : 
"vtbx.8", Vd);
 
 2356    FormatNeonList(Vn, list.type());
 
 2359  } 
else if (op0 && op1 == 0b11 && op2 == 0b11) {
 
 2361    if (
instr->Bits(9, 7) == 0) {
 
 2364      int imm4 = 
instr->Bits(19, 16);
 
 2365      int esize = 0, index = 0;
 
 2366      if ((imm4 & 0x1) != 0) {
 
 2369      } 
else if ((imm4 & 0x2) != 0) {
 
 2376      if (
instr->Bit(6) == 0) {
 
 2380                           "vdup.%i d%d, d%d[%d]", esize, Vd, Vm, index);
 
 2385                           "vdup.%i q%d, d%d[%d]", esize, Vd, Vm, index);
 
 2390  } 
else if (op1 != 0b11 && !op3) {
 
 2392    int u = 
instr->Bit(24);
 
 2393    int opc = 
instr->Bits(11, 8);
 
 2394    if (opc == 0b1000) {
 
 2396             u ? 
"vmlal.u'size3 'Qd, 'Dn, 'Dm" : 
"vmlal.s'size3 'Qd, 'Dn, 'Dm");
 
 2397    } 
else if (opc == 0b1100) {
 
 2399             u ? 
"vmull.u'size3 'Qd, 'Dn, 'Dm" : 
"vmull.s'size3 'Qd, 'Dn, 'Dm");
 
 2401  } 
else if (op1 != 0b11 && op3) {
 
 2409void Decoder::DecodeMemoryHintsAndBarriers(Instruction* 
instr) {
 
 2410  int op0 = 
instr->Bits(25, 21);
 
 2411  if (op0 == 0b01011) {
 
 2413    int option = 
instr->Bits(3, 0);
 
 2414    switch (
instr->Bits(7, 4)) {
 
 2418                           barrier_option_names[option]);
 
 2423                           barrier_option_names[option]);
 
 2428                           barrier_option_names[option]);
 
 2433  } 
else if ((op0 & 0b10001) == 0b00000 && !
instr->Bit(4)) {
 
 2435    const char* rn_name = 
converter_.NameOfCPURegister(
instr->Bits(19, 16));
 
 2440    } 
else if (
instr->Bit(23) == 0) {
 
 2442                                        "pld [%s, #-%d]", rn_name, 
offset);
 
 2445                                        "pld [%s, #+%d]", rn_name, 
offset);
 
 2452void Decoder::DecodeAdvancedSIMDElementOrStructureLoadStore(
 
 2453    Instruction* 
instr) {
 
 2454  int op0 = 
instr->Bit(23);
 
 2455  int op1 = 
instr->Bits(11, 10);
 
 2456  int l = 
instr->Bit(21);
 
 2457  int n = 
instr->Bits(9, 8);
 
 2459  int Rn = 
instr->VnValue();
 
 2460  int Rm = 
instr->VmValue();
 
 2464    int itype = 
instr->Bits(11, 8);
 
 2467      int size = 
instr->Bits(7, 6);
 
 2468      int align = 
instr->Bits(5, 4);
 
 2469      const char* op = l ? 
"vld1.%d " : 
"vst1.%d ";
 
 2472      FormatNeonList(Vd, itype);
 
 2474      FormatNeonMemory(Rn, align, Rm);
 
 2478  } 
else if (op1 == 0b11) {
 
 2480    if (l && n == 0b00) {
 
 2482      int size = 
instr->Bits(7, 6);
 
 2486                                        "vld1.%d ", (1 << size) << 3);
 
 2487      FormatNeonList(Vd, type);
 
 2490      FormatNeonMemory(Rn, 0, Rm);
 
 2494  } 
else if (op1 != 0b11) {
 
 2497    int index_align = 
instr->Bits(7, 4);
 
 2498    int index = index_align >> (size + 1);
 
 2505                         (l ? 
"ld" : 
"st"), (1 << size) << 3, Vd, index);
 
 2507      FormatNeonMemory(Rn, 0, Rm);
 
 2518bool Decoder::IsConstantPoolAt(uint8_t* instr_ptr) {
 
 2519  int instruction_bits = *(
reinterpret_cast<int*
>(instr_ptr));
 
 2523int Decoder::ConstantPoolSizeAt(uint8_t* instr_ptr) {
 
 2524  if (IsConstantPoolAt(instr_ptr)) {
 
 2525    int instruction_bits = *(
reinterpret_cast<int*
>(instr_ptr));
 
 2537                                    "%08x       ", 
instr->InstructionBits());
 
 2539    DecodeSpecialCondition(
instr);
 
 2542  int instruction_bits = *(
reinterpret_cast<int*
>(instr_ptr));
 
 2549  switch (
instr->TypeValue()) {
 
 2552      DecodeType01(
instr);
 
 2576      return DecodeType7(
instr);
 
 2603  return RegisterName(i::Register::from_code(
reg));
 
 2623                                    uint8_t* instruction) {
 
 2625  return d.InstructionDecode(instruction);
 
 2629  return v8::internal::Decoder::ConstantPoolSizeAt(instruction);
 
 2633                               UnimplementedOpcodeAction unimplemented_action) {
 
 2634  NameConverter converter;
 
 2636  for (uint8_t* 
pc = begin; 
pc < 
end;) {
 
 2639    uint8_t* prev_pc = 
pc;
 
 2640    pc += d.InstructionDecode(buffer, 
pc);
 
 2646#undef STRING_STARTS_WITH 
static V8_EXPORT_PRIVATE void Disassemble(FILE *f, uint8_t *begin, uint8_t *end, UnimplementedOpcodeAction unimplemented_action=kAbortOnUnimplementedOpcode)
 
V8_EXPORT_PRIVATE int InstructionDecode(v8::base::Vector< char > buffer, uint8_t *instruction)
 
int ConstantPoolSizeAt(uint8_t *instruction)
 
Disassembler(const NameConverter &converter, UnimplementedOpcodeAction unimplemented_opcode_action=kAbortOnUnimplementedOpcode)
 
const NameConverter & converter_
 
virtual const char * NameOfAddress(uint8_t *addr) const
 
virtual const char * NameOfXMMRegister(int reg) const
 
virtual const char * NameInCode(uint8_t *addr) const
 
virtual const char * NameOfConstant(uint8_t *addr) const
 
v8::base::EmbeddedVector< char, 128 > tmp_buffer_
 
virtual const char * NameOfByteCPURegister(int reg) const
 
virtual const char * NameOfCPURegister(int reg) const
 
constexpr T * begin() const
 
void Format(Instruction *instr, const char *format)
 
int InstructionDecode(uint8_t *instruction)
 
void Unknown(Instruction *instr)
 
const disasm::NameConverter & converter_
 
void PrintRegister(int reg)
 
void PrintChar(const char ch)
 
v8::base::Vector< char > out_buffer_
 
int FormatOption(Instruction *instr, const char *option)
 
int FormatRegister(Instruction *instr, const char *option)
 
void Print(const char *str)
 
Decoder & operator=(const Decoder &)=delete
 
static constexpr int kPcLoadDelta
 
static Instruction * At(Address pc)
 
static constexpr QwNeonRegister from_code(int8_t code)
 
static const char * Name(int reg, bool is_double)
 
#define STRING_STARTS_WITH(string, compare_string)
 
ArrayReduceDirection direction
 
RoundingMode rounding_mode
 
uint32_t RoundDownToPowerOfTwo32(uint32_t value)
 
constexpr uint32_t RotateRight32(uint32_t value, uint32_t shift)
 
int SNPrintF(Vector< char > str, const char *format,...)
 
constexpr MiscInstructionsBits74 CLZ
 
constexpr BlockAddrMode ia_x
 
constexpr int kBitsPerByte
 
constexpr int kPCRegister
 
constexpr SoftwareInterruptCodes kStopCode
 
constexpr BlockAddrMode db_x
 
void PrintF(const char *format,...)
 
int DecodeConstantPoolLength(int instr)
 
constexpr NeonSize Neon64
 
constexpr NeonListType nlt_3
 
constexpr NeonListType nlt_2
 
constexpr MiscInstructionsBits74 BKPT
 
constexpr SoftwareInterruptCodes kBreakpoint
 
constexpr VFPRegPrecision kDoublePrecision
 
constexpr SoftwareInterruptCodes kCallRtRedirected
 
constexpr BlockAddrMode da_x
 
const int kConstantPoolMarkerMask
 
constexpr ShiftOp kNumberOfShifts
 
constexpr MiscInstructionsBits74 BLX
 
constexpr uint8_t kInstrSize
 
constexpr NeonListType nlt_1
 
constexpr MiscInstructionsBits74 BX
 
constexpr NeonListType nlt_4
 
constexpr VFPRegPrecision kSinglePrecision
 
constexpr VFPRegPrecision kSimd128Precision
 
constexpr BlockAddrMode ib_x
 
const int kConstantPoolMarker
 
constexpr uint32_t kStopCodeMask
 
#define DCHECK_LE(v1, v2)
 
#define DCHECK_NE(v1, v2)
 
#define DCHECK(condition)
 
#define DCHECK_EQ(v1, v2)
 
#define DCHECK_GT(v1, v2)