llvm.org GIT mirror llvm / 0ef6742
[llvm-objdump] Tidy up AMDGCNPrettyPrinter git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363650 91177308-0d34-0410-b5e6-96231b3b80d8 Fangrui Song 27 days ago
2 changed file(s) with 14 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
7777 ; CHECK-NEXT: s_nop 0
7878 ; CHECK-NEXT: s_nop 0 // 0000000001FC: BF800000
7979
80 ; CHECK-NEXT: {{^$}}
80 ; CHECK-EMPTY:
8181 ; CHECK-NEXT: kernel1:
8282 ; CHECK-NEXT: s_endpgm
8383 define amdgpu_kernel void @kernel1(i32 addrspace(1)* addrspace(4)* %ptr.out) align 256 {
657657 }
658658 };
659659 PrettyPrinter PrettyPrinterInst;
660
660661 class HexagonPrettyPrinter : public PrettyPrinter {
661662 public:
662663 void printLead(ArrayRef Bytes, uint64_t Address,
747748 if (SP && (PrintSource || PrintLines))
748749 SP->printSourceLine(OS, Address);
749750
750 typedef support::ulittle32_t U32;
751
752751 if (MI) {
753752 SmallString<40> InstStr;
754753 raw_svector_ostream IS(InstStr);
762761 // remaining
763762 if (Bytes.size() >= 4) {
764763 OS << format("\t.long 0x%08" PRIx32 " ",
765 static_cast(*reinterpret_cast(Bytes.data())));
764 support::endian::read32(Bytes.data()));
766765 OS.indent(42);
767766 } else {
768767 OS << format("\t.byte 0x%02" PRIx8, Bytes[0]);
772771 }
773772 }
774773
775 OS << format("// %012" PRIX64 ": ", Address.Address);
776 if (Bytes.size() >=4) {
777 for (auto D : makeArrayRef(reinterpret_cast(Bytes.data()),
778 Bytes.size() / sizeof(U32)))
779 // D should be explicitly casted to uint32_t here as it is passed
780 // by format to snprintf as vararg.
781 OS << format("%08" PRIX32 " ", static_cast(D));
774 OS << format("// %012" PRIX64 ":", Address.Address);
775 if (Bytes.size() >= 4) {
776 // D should be casted to uint32_t here as it is passed by format to
777 // snprintf as vararg.
778 for (uint32_t D : makeArrayRef(
779 reinterpret_cast(Bytes.data()),
780 Bytes.size() / 4))
781 OS << format(" %08" PRIX32, D);
782782 } else {
783 for (unsigned int i = 0; i < Bytes.size(); i++)
784 OS << format("%02" PRIX8 " ", Bytes[i]);
783 for (unsigned char B : Bytes)
784 OS << format(" %02" PRIX8, B);
785785 }
786786
787787 if (!Annot.empty())
788 OS << "// " << Annot;
788 OS << " // " << Annot;
789789 }
790790 };
791791 AMDGCNPrettyPrinter AMDGCNPrettyPrinterInst;