Lines Matching refs:format
104 int FormatVFPRegister(Instruction* instr, const char* format);
106 int FormatVFPinstruction(Instruction* instr, const char* format);
117 void Format(Instruction* instr, const char* format);
322 int Decoder::FormatRegister(Instruction* instr, const char* format) {
323 ASSERT(format[0] == 'r');
324 if (format[1] == 'n') { // 'rn: Rn register
328 } else if (format[1] == 'd') { // 'rd: Rd register
332 } else if (format[1] == 's') { // 'rs: Rs register
336 } else if (format[1] == 'm') { // 'rm: Rm register
340 } else if (format[1] == 't') { // 'rt: Rt register
344 } else if (format[1] == 'l') {
346 ASSERT(STRING_STARTS_WITH(format, "rlist"));
371 int Decoder::FormatVFPRegister(Instruction* instr, const char* format) {
372 ASSERT((format[0] == 'S') || (format[0] == 'D'));
375 format[0] == 'D' ? kDoublePrecision : kSinglePrecision;
379 if (format[1] == 'n') {
381 } else if (format[1] == 'm') {
383 } else if (format[1] == 'd') {
385 if (format[2] == '+') {
387 if (format[0] == 'S') reg += immed8 - 1;
388 if (format[0] == 'D') reg += (immed8 / 2 - 1);
390 if (format[2] == '+') retval = 3;
405 int Decoder::FormatVFPinstruction(Instruction* instr, const char* format) {
406 Print(format);
422 // the current instructions. The format string points to the first
426 int Decoder::FormatOption(Instruction* instr, const char* format) {
427 switch (format[0]) {
443 ASSERT(STRING_STARTS_WITH(format, "cond"));
477 int width = (format[3] - '0') * 10 + (format[4] - '0');
478 int lsb = (format[6] - '0') * 10 + (format[7] - '0');
496 if (format[1] == 'w') {
501 if (format[1] == 'e') { // 'memop: load/store instructions.
502 ASSERT(STRING_STARTS_WITH(format, "memop"));
520 ASSERT(STRING_STARTS_WITH(format, "msg"));
528 if ((format[3] == '1') && (format[4] == '2')) {
530 ASSERT(STRING_STARTS_WITH(format, "off12"));
534 } else if (format[3] == '0') {
536 ASSERT(STRING_STARTS_WITH(format, "off0to3and8to19"));
544 ASSERT(STRING_STARTS_WITH(format, "off8"));
551 ASSERT(STRING_STARTS_WITH(format, "pu"));
556 return FormatRegister(instr, format);
559 if (format[1] == 'h') { // 'shift_op or 'shift_rm or 'shift_sat.
560 if (format[6] == 'o') { // 'shift_op
561 ASSERT(STRING_STARTS_WITH(format, "shift_op"));
569 } else if (format[6] == 's') { // 'shift_sat.
570 ASSERT(STRING_STARTS_WITH(format, "shift_sat"));
574 ASSERT(STRING_STARTS_WITH(format, "shift_rm"));
578 } else if (format[1] == 'v') { // 'svc
579 ASSERT(STRING_STARTS_WITH(format, "svc"));
582 } else if (format[1] == 'i') { // 'sign: signed extra loads and stores
583 ASSERT(STRING_STARTS_WITH(format, "sign"));
596 ASSERT(STRING_STARTS_WITH(format, "target"));
626 return FormatVFPinstruction(instr, format);
630 return FormatVFPRegister(instr, format);
648 // Format takes a formatting string for a whole instruction and prints it into
651 void Decoder::Format(Instruction* instr, const char* format) {
652 char cur = *format++;
655 format += FormatOption(instr, format);
659 cur = *format++;
677 Format(instr, "unknown");
693 Format(instr, "mul'cond's 'rn, 'rm, 'rs");
699 Format(instr, "mla'cond's 'rn, 'rm, 'rs, 'rd");
708 Format(instr, "'um'al'cond's 'rd, 'rn, 'rm, 'rs");
718 Format(instr, "'memop'cond's 'rd, ['rn], -'rm");
720 Format(instr, "'memop'cond's 'rd, ['rn], #-'off8");
726 Format(instr, "'memop'cond's 'rd, ['rn], +'rm");
728 Format(instr, "'memop'cond's 'rd, ['rn], #+'off8");
734 Format(instr, "'memop'cond's 'rd, ['rn, -'rm]'w");
736 Format(instr, "'memop'cond's 'rd, ['rn, #-'off8]'w");
742 Format(instr, "'memop'cond's 'rd, ['rn, +'rm]'w");
744 Format(instr, "'memop'cond's 'rd, ['rn, #+'off8]'w");
759 Format(instr, "'memop'cond'sign'h 'rd, ['rn], -'rm");
761 Format(instr, "'memop'cond'sign'h 'rd, ['rn], #-'off8");
767 Format(instr, "'memop'cond'sign'h 'rd, ['rn], +'rm");
769 Format(instr, "'memop'cond'sign'h 'rd, ['rn], #+'off8");
775 Format(instr, "'memop'cond'sign'h 'rd, ['rn, -'rm]'w");
777 Format(instr, "'memop'cond'sign'h 'rd, ['rn, #-'off8]'w");
783 Format(instr, "'memop'cond'sign'h 'rd, ['rn, +'rm]'w");
785 Format(instr, "'memop'cond'sign'h 'rd, ['rn, #+'off8]'w");
801 Format(instr, "bx'cond 'rm");
804 Format(instr, "blx'cond 'rm");
807 Format(instr, "bkpt 'off0to3and8to19");
816 Format(instr, "clz'cond 'rd, 'rm");
828 Format(instr, "and'cond's 'rd, 'rn, 'shift_op");
832 Format(instr, "eor'cond's 'rd, 'rn, 'shift_op");
836 Format(instr, "sub'cond's 'rd, 'rn, 'shift_op");
840 Format(instr, "rsb'cond's 'rd, 'rn, 'shift_op");
844 Format(instr, "add'cond's 'rd, 'rn, 'shift_op");
848 Format(instr, "adc'cond's 'rd, 'rn, 'shift_op");
852 Format(instr, "sbc'cond's 'rd, 'rn, 'shift_op");
856 Format(instr, "rsc'cond's 'rd, 'rn, 'shift_op");
861 Format(instr, "tst'cond 'rn, 'shift_op");
863 Format(instr, "movw'cond 'mw");
869 Format(instr, "teq'cond 'rn, 'shift_op");
879 Format(instr, "cmp'cond 'rn, 'shift_op");
881 Format(instr, "movt'cond 'mw");
887 Format(instr, "cmn'cond 'rn, 'shift_op");
896 Format(instr, "orr'cond's 'rd, 'rn, 'shift_op");
900 Format(instr, "mov'cond's 'rd, 'shift_op");
904 Format(instr, "bic'cond's 'rd, 'rn, 'shift_op");
908 Format(instr, "mvn'cond's 'rd, 'shift_op");
928 Format(instr, "'memop'cond'b 'rd, ['rn], #-'off12");
936 Format(instr, "'memop'cond'b 'rd, ['rn], #+'off12");
940 Format(instr, "'memop'cond'b 'rd, ['rn, #-'off12]'w");
944 Format(instr, "'memop'cond'b 'rd, ['rn, #+'off12]'w");
960 Format(instr, "'memop'cond'b 'rd, ['rn], -'shift_rm");
967 Format(instr, "usat 'rd, #'imm05@16, 'rm'shift_sat");
972 Format(instr, "'memop'cond'b 'rd, ['rn], +'shift_rm");
977 Format(instr, "'memop'cond'b 'rd, ['rn, -'shift_rm]'w");
987 Format(instr, "ubfx'cond 'rd, 'rm, 'f");
989 Format(instr, "sbfx'cond 'rd, 'rm, 'f");
999 Format(instr, "bfc'cond 'rd, 'f");
1001 Format(instr, "bfi'cond 'rd, 'rm, 'f");
1007 Format(instr, "'memop'cond'b 'rd, ['rn, +'shift_rm]'w");
1026 Format(instr, "ldm'cond'pu 'rn'w, 'rlist");
1028 Format(instr, "stm'cond'pu 'rn'w, 'rlist");
1035 Format(instr, "b'l'cond 'target");
1047 Format(instr, "stop'cond 'svc");
1061 Format(instr, "svc'cond 'svc");
1095 Format(instr, "vmov.f64'cond 'Dd, 'Dm");
1097 Format(instr, "vmov.f32'cond 'Sd, 'Sm");
1101 Format(instr, "vabs.f64'cond 'Dd, 'Dm");
1104 Format(instr, "vneg.f64'cond 'Dd, 'Dm");
1116 Format(instr, "vsqrt.f64'cond 'Dd, 'Dm");
1119 Format(instr, "vmov.f64'cond 'Dd, 'd");
1129 Format(instr, "vsub.f64'cond 'Dd, 'Dn, 'Dm");
1131 Format(instr, "vadd.f64'cond 'Dd, 'Dn, 'Dm");
1138 Format(instr, "vmul.f64'cond 'Dd, 'Dn, 'Dm");
1144 Format(instr, "vdiv.f64'cond 'Dd, 'Dn, 'Dm");
1160 Format(instr, "vmsr'cond FPSCR, APSR");
1162 Format(instr, "vmsr'cond FPSCR, 'rt");
1166 Format(instr, "vmrs'cond APSR, FPSCR");
1168 Format(instr, "vmrs'cond 'rt, FPSCR");
1184 Format(instr, "vmov'cond 'rt, 'Sn");
1186 Format(instr, "vmov'cond 'Sn, 'rt");
1202 Format(instr, "vcmp.f64'cond 'Dd, 'Dm");
1204 Format(instr, "vcmp.f64'cond 'Dd, #0.0");
1221 Format(instr, "vcvt.f32.f64'cond 'Sd, 'Dm");
1223 Format(instr, "vcvt.f64.f32'cond 'Dd, 'Sm");
1240 Format(instr, "vcvt.u32.f64'cond 'Sd, 'Dm");
1242 Format(instr, "vcvt.s32.f64'cond 'Sd, 'Dm");
1246 Format(instr, "vcvt.u32.f32'cond 'Sd, 'Sm");
1248 Format(instr, "vcvt.s32.f32'cond 'Sd, 'Sm");
1256 Format(instr, "vcvt.f64.u32'cond 'Dd, 'Sm");
1258 Format(instr, "vcvt.f64.s32'cond 'Dd, 'Sm");
1262 Format(instr, "vcvt.f32.u32'cond 'Sd, 'Sm");
1264 Format(instr, "vcvt.f32.s32'cond 'Sd, 'Sm");
1284 Format(instr, "vldr'cond 'Sd, ['rn - 4*'imm08@00]");
1286 Format(instr, "vstr'cond 'Sd, ['rn - 4*'imm08@00]");
1292 Format(instr, "vldr'cond 'Sd, ['rn + 4*'imm08@00]");
1294 Format(instr, "vstr'cond 'Sd, ['rn + 4*'imm08@00]");
1305 Format(instr, "vldm'cond'pu 'rn'w, {'Sd-'Sd+}");
1307 Format(instr, "vstm'cond'pu 'rn'w, {'Sd-'Sd+}");
1321 Format(instr, "vmov'cond 'rt, 'rn, 'Dm");
1323 Format(instr, "vmov'cond 'Dm, 'rt, 'rn");
1328 Format(instr, "vldr'cond 'Dd, ['rn - 4*'imm08@00]");
1330 Format(instr, "vstr'cond 'Dd, ['rn - 4*'imm08@00]");
1335 Format(instr, "vldr'cond 'Dd, ['rn + 4*'imm08@00]");
1337 Format(instr, "vstr'cond 'Dd, ['rn + 4*'imm08@00]");
1345 Format(instr, "vldm'cond'pu 'rn'w, {'Dd-'Dd+}");
1347 Format(instr, "vstm'cond'pu 'rn'w, {'Dd-'Dd+}");