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
This commit is contained in:
Tim Northover 2017-03-20 16:52:08 +00:00
parent 22910652da
commit 80122f82f9
2 changed files with 13 additions and 0 deletions

View 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();
}

View 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
}