From: Tim Northover Date: Mon, 20 Mar 2017 16:52:08 +0000 (+0000) Subject: GlobalISel: allow quad-precision values to be dumped. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=80122f82f9d083a141360962f993667195ebc104;p=llvm GlobalISel: allow quad-precision values to be dumped. Otherwise the fallback path fails with an assertion on AAPCS AArch64 targets, when "long double" is encountered. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298273 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 7039aecc219..c0a8b95ed8a 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -420,6 +420,11 @@ void MachineOperand::print(raw_ostream &OS, ModuleSlotTracker &MST, bool Unused; APF.convert(APFloat::IEEEsingle(), APFloat::rmNearestTiesToEven, &Unused); OS << "half " << APF.convertToFloat(); + } else if (getFPImm()->getType()->isFP128Ty()) { + APFloat APF = getFPImm()->getValueAPF(); + SmallString<16> Str; + getFPImm()->getValueAPF().toString(Str); + OS << "quad " << Str; } else { OS << getFPImm()->getValueAPF().convertToDouble(); } diff --git a/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll b/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll index 087faa293de..0194fa058e2 100644 --- a/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll +++ b/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll @@ -138,3 +138,11 @@ broken: continue: ret void } + +; Check that we fallback on invoke translation failures. +; FALLBACK-WITH-REPORT-ERR: remark: :0:0: unable to legalize instruction: %vreg0(s128) = G_FCONSTANT quad 2 +; FALLBACK-WITH-REPORT-ERR: warning: Instruction selection used fallback path for test_quad_dump +; FALLBACK-WITH-REPORT-OUT-LABEL: test_quad_dump: +define fp128 @test_quad_dump() { + ret fp128 0xL00000000000000004000000000000000 +}