Skip to content

Commit d29dc18

Browse files
authored
AMDGPU: Remove dead code for printing DFP immediates (#156644)
Nothing in the backend uses these, so there's no reason to support printing them.
1 parent dc05c5d commit d29dc18

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -792,22 +792,6 @@ void AMDGPUInstPrinter::printRegularOperand(const MCInst *MI, unsigned OpNo,
792792
// custom printer.
793793
llvm_unreachable("unexpected immediate operand type");
794794
}
795-
} else if (Op.isDFPImm()) {
796-
double Value = bit_cast<double>(Op.getDFPImm());
797-
// We special case 0.0 because otherwise it will be printed as an integer.
798-
if (Value == 0.0)
799-
O << "0.0";
800-
else {
801-
const MCInstrDesc &Desc = MII.get(MI->getOpcode());
802-
int RCID = Desc.operands()[OpNo].RegClass;
803-
unsigned RCBits = AMDGPU::getRegBitWidth(MRI.getRegClass(RCID));
804-
if (RCBits == 32)
805-
printImmediate32(llvm::bit_cast<uint32_t>((float)Value), STI, O);
806-
else if (RCBits == 64)
807-
printImmediate64(llvm::bit_cast<uint64_t>(Value), STI, O, true);
808-
else
809-
llvm_unreachable("Invalid register class size");
810-
}
811795
} else if (Op.isExpr()) {
812796
const MCExpr *Exp = Op.getExpr();
813797
MAI.printExpr(O, *Exp);
@@ -890,7 +874,7 @@ void AMDGPUInstPrinter::printOperandAndFPInputMods(const MCInst *MI,
890874
if (OpNo + 1 < MI->getNumOperands() &&
891875
(InputModifiers & SISrcMods::ABS) == 0) {
892876
const MCOperand &Op = MI->getOperand(OpNo + 1);
893-
NegMnemo = Op.isImm() || Op.isDFPImm();
877+
NegMnemo = Op.isImm();
894878
}
895879
if (NegMnemo) {
896880
O << "neg(";

0 commit comments

Comments
 (0)