Lines Matching defs:Offset

95                                 uint64_t Offset = 0) {
102 if (Offset)
103 OS << format("+0x%" PRIX64 " (0x%" PRIX64 ")", Offset, Address);
255 uint64_t Offset) {
258 if (RelocationOffset == Offset)
278 uint32_t Offset = CoffSym.getValue() + SymbolOffset - CS.getValue();
279 if (Offset <= SymbolOffset) {
280 SymbolOffset = Offset;
328 bool Decoder::opcode_0xxxxxxx(const uint8_t *OC, unsigned &Offset,
330 uint8_t Imm = OC[Offset] & 0x7f;
332 OC[Offset],
335 ++Offset;
339 bool Decoder::opcode_10Lxxxxx(const uint8_t *OC, unsigned &Offset,
341 unsigned Link = (OC[Offset] & 0x20) >> 5;
343 | ((OC[Offset + 0] & 0x1f) << 8)
344 | ((OC[Offset + 1] & 0xff) << 0);
349 OC[Offset + 0], OC[Offset + 1],
354 Offset += 2;
358 bool Decoder::opcode_1100xxxx(const uint8_t *OC, unsigned &Offset,
362 OC[Offset], OC[Offset] & 0xf);
365 OC[Offset], OC[Offset] & 0xf);
366 ++Offset;
370 bool Decoder::opcode_11010Lxx(const uint8_t *OC, unsigned &Offset,
372 unsigned Link = (OC[Offset] & 0x4) >> 2;
373 unsigned Count = (OC[Offset] & 0x3);
378 SW.startLine() << format("0x%02x ; %s ", OC[Offset],
383 ++Offset;
387 bool Decoder::opcode_11011Lxx(const uint8_t *OC, unsigned &Offset,
389 unsigned Link = (OC[Offset] & 0x4) >> 2;
390 unsigned Count = (OC[Offset] & 0x3) + 4;
395 SW.startLine() << format("0x%02x ; %s.w ", OC[Offset],
400 ++Offset;
404 bool Decoder::opcode_11100xxx(const uint8_t *OC, unsigned &Offset,
406 unsigned High = (OC[Offset] & 0x7);
409 SW.startLine() << format("0x%02x ; %s ", OC[Offset],
414 ++Offset;
418 bool Decoder::opcode_111010xx(const uint8_t *OC, unsigned &Offset,
420 uint16_t Imm = ((OC[Offset + 0] & 0x03) << 8) | ((OC[Offset + 1] & 0xff) << 0);
423 OC[Offset + 0], OC[Offset + 1],
427 Offset += 2;
431 bool Decoder::opcode_1110110L(const uint8_t *OC, unsigned &Offset,
433 uint16_t GPRMask = ((OC[Offset + 0] & 0x01) << (Prologue ? 14 : 15))
434 | ((OC[Offset + 1] & 0xff) << 0);
436 SW.startLine() << format("0x%02x 0x%02x ; %s ", OC[Offset + 0],
437 OC[Offset + 1], Prologue ? "push" : "pop");
441 Offset += 2;
445 bool Decoder::opcode_11101110(const uint8_t *OC, unsigned &Offset,
449 if (OC[Offset + 1] & 0xf0)
451 OC[Offset + 0], OC[Offset + 1]);
455 OC[Offset + 0], OC[Offset + 1], OC[Offset + 1] & 0x0f);
457 Offset += 2;
461 bool Decoder::opcode_11101111(const uint8_t *OC, unsigned &Offset,
463 if (OC[Offset + 1] & 0xf0)
465 OC[Offset + 0], OC[Offset + 1]);
469 OC[Offset + 0], OC[Offset + 1], OC[Offset + 1] << 2);
473 OC[Offset + 0], OC[Offset + 1], OC[Offset + 1] << 2);
475 Offset += 2;
479 bool Decoder::opcode_11110101(const uint8_t *OC, unsigned &Offset,
481 unsigned Start = (OC[Offset + 1] & 0xf0) >> 4;
482 unsigned End = (OC[Offset + 1] & 0x0f) >> 0;
485 SW.startLine() << format("0x%02x 0x%02x ; %s ", OC[Offset + 0],
486 OC[Offset + 1], Prologue ? "vpush" : "vpop");
490 Offset += 2;
494 bool Decoder::opcode_11110110(const uint8_t *OC, unsigned &Offset,
496 unsigned Start = (OC[Offset + 1] & 0xf0) >> 4;
497 unsigned End = (OC[Offset + 1] & 0x0f) >> 0;
500 SW.startLine() << format("0x%02x 0x%02x ; %s ", OC[Offset + 0],
501 OC[Offset + 1], Prologue ? "vpush" : "vpop");
505 Offset += 2;
509 bool Decoder::opcode_11110111(const uint8_t *OC, unsigned &Offset,
511 uint32_t Imm = (OC[Offset + 1] << 8) | (OC[Offset + 2] << 0);
514 OC[Offset + 0], OC[Offset + 1], OC[Offset + 2],
518 Offset += 3;
522 bool Decoder::opcode_11111000(const uint8_t *OC, unsigned &Offset,
524 uint32_t Imm = (OC[Offset + 1] << 16)
525 | (OC[Offset + 2] << 8)
526 | (OC[Offset + 3] << 0);
530 OC[Offset + 0], OC[Offset + 1], OC[Offset + 2], OC[Offset + 3],
533 Offset += 4;
537 bool Decoder::opcode_11111001(const uint8_t *OC, unsigned &Offset,
539 uint32_t Imm = (OC[Offset + 1] << 8) | (OC[Offset + 2] << 0);
543 OC[Offset + 0], OC[Offset + 1], OC[Offset + 2],
546 Offset += 3;
550 bool Decoder::opcode_11111010(const uint8_t *OC, unsigned &Offset,
552 uint32_t Imm = (OC[Offset + 1] << 16)
553 | (OC[Offset + 2] << 8)
554 | (OC[Offset + 3] << 0);
558 OC[Offset + 0], OC[Offset + 1], OC[Offset + 2], OC[Offset + 3],
561 Offset += 4;
565 bool Decoder::opcode_11111011(const uint8_t *OC, unsigned &Offset,
567 SW.startLine() << format("0x%02x ; nop\n", OC[Offset]);
568 ++Offset;
572 bool Decoder::opcode_11111100(const uint8_t *OC, unsigned &Offset,
574 SW.startLine() << format("0x%02x ; nop.w\n", OC[Offset]);
575 ++Offset;
579 bool Decoder::opcode_11111101(const uint8_t *OC, unsigned &Offset,
581 SW.startLine() << format("0x%02x ; bx <reg>\n", OC[Offset]);
582 ++Offset;
586 bool Decoder::opcode_11111110(const uint8_t *OC, unsigned &Offset,
588 SW.startLine() << format("0x%02x ; b.w <target>\n", OC[Offset]);
589 ++Offset;
593 bool Decoder::opcode_11111111(const uint8_t *OC, unsigned &Offset,
595 ++Offset;
600 bool Decoder::opcode_alloc_s(const uint8_t *OC, unsigned &Offset,
602 uint32_t NumBytes = (OC[Offset] & 0x1F) << 4;
603 SW.startLine() << format("0x%02x ; %s sp, #%u\n", OC[Offset],
606 ++Offset;
610 bool Decoder::opcode_save_r19r20_x(const uint8_t *OC, unsigned &Offset,
612 uint32_t Off = (OC[Offset] & 0x1F) << 3;
615 "0x%02x ; stp x19, x20, [sp, #-%u]!\n", OC[Offset], Off);
618 "0x%02x ; ldp x19, x20, [sp], #%u\n", OC[Offset], Off);
619 ++Offset;
623 bool Decoder::opcode_save_fplr(const uint8_t *OC, unsigned &Offset,
625 uint32_t Off = (OC[Offset] & 0x3F) << 3;
627 "0x%02x ; %s x29, x30, [sp, #%u]\n", OC[Offset],
629 ++Offset;
633 bool Decoder::opcode_save_fplr_x(const uint8_t *OC, unsigned &Offset,
635 uint32_t Off = ((OC[Offset] & 0x3F) + 1) << 3;
638 "0x%02x ; stp x29, x30, [sp, #-%u]!\n", OC[Offset], Off);
641 "0x%02x ; ldp x29, x30, [sp], #%u\n", OC[Offset], Off);
642 ++Offset;
646 bool Decoder::opcode_alloc_m(const uint8_t *OC, unsigned &Offset,
648 uint32_t NumBytes = ((OC[Offset] & 0x07) << 8);
649 NumBytes |= (OC[Offset + 1] & 0xFF);
652 OC[Offset], OC[Offset + 1],
655 Offset += 2;
659 bool Decoder::opcode_save_regp(const uint8_t *OC, unsigned &Offset,
661 uint32_t Reg = ((OC[Offset] & 0x03) << 8);
662 Reg |= (OC[Offset + 1] & 0xC0);
665 uint32_t Off = (OC[Offset + 1] & 0x3F) << 3;
668 OC[Offset], OC[Offset + 1],
670 Offset += 2;
674 bool Decoder::opcode_save_regp_x(const uint8_t *OC, unsigned &Offset,
676 uint32_t Reg = ((OC[Offset] & 0x03) << 8);
677 Reg |= (OC[Offset + 1] & 0xC0);
680 uint32_t Off = ((OC[Offset + 1] & 0x3F) + 1) << 3;
684 OC[Offset], OC[Offset + 1], Reg,
689 OC[Offset], OC[Offset + 1], Reg,
691 Offset += 2;
695 bool Decoder::opcode_save_reg(const uint8_t *OC, unsigned &Offset,
697 uint32_t Reg = (OC[Offset] & 0x03) << 8;
698 Reg |= (OC[Offset + 1] & 0xC0);
701 uint32_t Off = (OC[Offset + 1] & 0x3F) << 3;
703 OC[Offset], OC[Offset + 1],
706 Offset += 2;
710 bool Decoder::opcode_save_reg_x(const uint8_t *OC, unsigned &Offset,
712 uint32_t Reg = (OC[Offset] & 0x01) << 8;
713 Reg |= (OC[Offset + 1] & 0xE0);
716 uint32_t Off = ((OC[Offset + 1] & 0x1F) + 1) << 3;
719 OC[Offset], OC[Offset + 1], Reg, Off);
722 OC[Offset], OC[Offset + 1], Reg, Off);
723 Offset += 2;
727 bool Decoder::opcode_save_lrpair(const uint8_t *OC, unsigned &Offset,
729 uint32_t Reg = (OC[Offset] & 0x01) << 8;
730 Reg |= (OC[Offset + 1] & 0xC0);
734 uint32_t Off = (OC[Offset + 1] & 0x3F) << 3;
736 OC[Offset], OC[Offset + 1],
739 Offset += 2;
743 bool Decoder::opcode_save_fregp(const uint8_t *OC, unsigned &Offset,
745 uint32_t Reg = (OC[Offset] & 0x01) << 8;
746 Reg |= (OC[Offset + 1] & 0xC0);
749 uint32_t Off = (OC[Offset + 1] & 0x3F) << 3;
751 OC[Offset], OC[Offset + 1],
754 Offset += 2;
758 bool Decoder::opcode_save_fregp_x(const uint8_t *OC, unsigned &Offset,
760 uint32_t Reg = (OC[Offset] & 0x01) << 8;
761 Reg |= (OC[Offset + 1] & 0xC0);
764 uint32_t Off = ((OC[Offset + 1] & 0x3F) + 1) << 3;
767 "0x%02x%02x ; stp d%u, d%u, [sp, #-%u]!\n", OC[Offset],
768 OC[Offset + 1], Reg, Reg + 1, Off);
771 "0x%02x%02x ; ldp d%u, d%u, [sp], #%u\n", OC[Offset],
772 OC[Offset + 1], Reg, Reg + 1, Off);
773 Offset += 2;
777 bool Decoder::opcode_save_freg(const uint8_t *OC, unsigned &Offset,
779 uint32_t Reg = (OC[Offset] & 0x01) << 8;
780 Reg |= (OC[Offset + 1] & 0xC0);
783 uint32_t Off = (OC[Offset + 1] & 0x3F) << 3;
785 OC[Offset], OC[Offset + 1],
788 Offset += 2;
792 bool Decoder::opcode_save_freg_x(const uint8_t *OC, unsigned &Offset,
794 uint32_t Reg = ((OC[Offset + 1] & 0xE0) >> 5) + 8;
795 uint32_t Off = ((OC[Offset + 1] & 0x1F) + 1) << 3;
798 "0x%02x%02x ; str d%u, [sp, #-%u]!\n", OC[Offset],
799 OC[Offset + 1], Reg, Off);
802 "0x%02x%02x ; ldr d%u, [sp], #%u\n", OC[Offset],
803 OC[Offset + 1], Reg, Off);
804 Offset += 2;
808 bool Decoder::opcode_alloc_l(const uint8_t *OC, unsigned &Offset,
811 (OC[Offset + 1] << 16) | (OC[Offset + 2] << 8) | (OC[Offset + 3] << 0);
814 "0x%02x%02x%02x%02x ; %s sp, #%u\n", OC[Offset], OC[Offset + 1],
815 OC[Offset + 2], OC[Offset + 3],
817 Offset += 4;
821 bool Decoder::opcode_setfp(const uint8_t *OC, unsigned &Offset, unsigned Length,
823 SW.startLine() << format("0x%02x ; mov %s, %s\n", OC[Offset],
826 ++Offset;
830 bool Decoder::opcode_addfp(const uint8_t *OC, unsigned &Offset, unsigned Length,
832 unsigned NumBytes = OC[Offset + 1] << 3;
834 "0x%02x%02x ; %s %s, %s, #%u\n", OC[Offset], OC[Offset + 1],
838 Offset += 2;
842 bool Decoder::opcode_nop(const uint8_t *OC, unsigned &Offset, unsigned Length,
844 SW.startLine() << format("0x%02x ; nop\n", OC[Offset]);
845 ++Offset;
849 bool Decoder::opcode_end(const uint8_t *OC, unsigned &Offset, unsigned Length,
851 SW.startLine() << format("0x%02x ; end\n", OC[Offset]);
852 ++Offset;
856 bool Decoder::opcode_end_c(const uint8_t *OC, unsigned &Offset, unsigned Length,
858 SW.startLine() << format("0x%02x ; end_c\n", OC[Offset]);
859 ++Offset;
863 bool Decoder::opcode_save_next(const uint8_t *OC, unsigned &Offset,
866 SW.startLine() << format("0x%02x ; save next\n", OC[Offset]);
869 OC[Offset]);
870 ++Offset;
874 bool Decoder::opcode_save_any_reg(const uint8_t *OC, unsigned &Offset,
877 bool Writeback = (OC[Offset + 1] & 0x20) == 0x20;
880 bool Paired = (OC[Offset + 1] & 0x40) == 0x40;
885 int RegKind = (OC[Offset + 2] & 0xC0) >> 6;
887 int Reg = OC[Offset + 1] & 0x1F;
889 int StackOffset = OC[Offset + 2] & 0x3F;
897 SW.startLine() << format("0x%02x%02x%02x ; ", OC[Offset],
898 OC[Offset + 1], OC[Offset + 2]);
908 if ((OC[Offset + 1] & 0x80) == 0x80 || RegKind == 3 || Reg > MaxReg) {
910 Offset += 3;
947 Offset += 3;
951 bool Decoder::opcode_trap_frame(const uint8_t *OC, unsigned &Offset,
953 SW.startLine() << format("0x%02x ; trap frame\n", OC[Offset]);
954 ++Offset;
958 bool Decoder::opcode_machine_frame(const uint8_t *OC, unsigned &Offset,
961 OC[Offset]);
962 ++Offset;
966 bool Decoder::opcode_context(const uint8_t *OC, unsigned &Offset,
968 SW.startLine() << format("0x%02x ; context\n", OC[Offset]);
969 ++Offset;
973 bool Decoder::opcode_ec_context(const uint8_t *OC, unsigned &Offset,
975 SW.startLine() << format("0x%02x ; EC context\n", OC[Offset]);
976 ++Offset;
980 bool Decoder::opcode_clear_unwound_to_call(const uint8_t *OC, unsigned &Offset,
983 OC[Offset]);
984 ++Offset;
988 bool Decoder::opcode_pac_sign_lr(const uint8_t *OC, unsigned &Offset,
991 SW.startLine() << format("0x%02x ; pacibsp\n", OC[Offset]);
993 SW.startLine() << format("0x%02x ; autibsp\n", OC[Offset]);
994 ++Offset;
998 void Decoder::decodeOpcodes(ArrayRef<uint8_t> Opcodes, unsigned Offset,
1000 assert((!Prologue || Offset == 0) && "prologue should always use offset 0");
1003 for (unsigned OI = Offset, OE = Opcodes.size(); !Terminated && OI < OE; ) {
1036 uint64_t Offset = VA - SectionVA;
1038 reinterpret_cast<const ulittle32_t *>(Contents.data() + Offset);
1043 if (Contents.size() - Offset < 8)
1061 if ((int64_t)(Contents.size() - Offset - 4 * HeaderWords(XData) -
1113 COFF, Section, Offset + HandlerOffset * sizeof(uint32_t),
1140 const SectionRef Section, uint64_t Offset,
1147 COFF, Section, Offset, RF.BeginAddress, FunctionAddress, FunctionOffset,
1152 COFF, Section, Offset + 4, RF.ExceptionInformationRVA(), XDataAddress,
1208 const SectionRef Section, uint64_t Offset,
1216 COFF, Section, Offset, RF.BeginAddress, FunctionAddress, FunctionOffset,
1306 const SectionRef Section, uint64_t Offset,
1315 COFF, Section, Offset, RF.BeginAddress, FunctionAddress, FunctionOffset,
1441 uint64_t Offset = PDataEntrySize * Index;
1443 reinterpret_cast<const ulittle32_t *>(Contents.data() + Offset);
1448 return dumpUnpackedEntry(COFF, Section, Offset, Index, Entry);
1451 return dumpPackedARM64Entry(COFF, Section, Offset, Index, EntryARM64);
1453 return dumpPackedEntry(COFF, Section, Offset, Index, Entry);