diff options
| author | Tim Northover <tnorthover@apple.com> | 2017-03-20 16:52:08 +0000 |
|---|---|---|
| committer | Tim Northover <tnorthover@apple.com> | 2017-03-20 16:52:08 +0000 |
| commit | 89268b183ffe58c1ca5b40857afaf5727334f4ee (patch) | |
| tree | 68a8a46ec946e4cd73ac15f11716b33012774d9a | |
| parent | 14534eb8a285f6d15b8c6e408bea2379988864ab (diff) | |
| download | bcm5719-llvm-89268b183ffe58c1ca5b40857afaf5727334f4ee.tar.gz bcm5719-llvm-89268b183ffe58c1ca5b40857afaf5727334f4ee.zip | |
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.
llvm-svn: 298273
| -rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 5 | ||||
| -rw-r--r-- | llvm/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 7039aecc219..c0a8b95ed8a 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/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/llvm/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll b/llvm/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll index 087faa293de..0194fa058e2 100644 --- a/llvm/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll +++ b/llvm/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: <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 +} |

