]> granicus.if.org Git - llvm/commitdiff
GlobalISel: allow quad-precision values to be dumped.
authorTim Northover <tnorthover@apple.com>
Mon, 20 Mar 2017 16:52:08 +0000 (16:52 +0000)
committerTim Northover <tnorthover@apple.com>
Mon, 20 Mar 2017 16:52:08 +0000 (16:52 +0000)
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

lib/CodeGen/MachineInstr.cpp
test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll

index 7039aecc2198595d6693be84c3ad58e0a8432c70..c0a8b95ed8a06dfccdb908b9d52fa1e9064caca2 100644 (file)
@@ -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();
     }
index 087faa293ded47fb30bc050a6ce65a62068b8e42..0194fa058e28bbb371731438d57e1fba36a7a5af 100644 (file)
@@ -138,3 +138,11 @@ broken:
 continue:
   ret void
 }
+
+; Check that we fallback on invoke translation failures.
+; FALLBACK-WITH-REPORT-ERR: remark: <unknown>:0:0: unable to legalize instruction: %vreg0<def>(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
+}