mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-14 15:28:20 +00:00
[FastISel][AArch64] Use the proper FMOV instruction to materialize a +0.0.
Use FMOVWSr/FMOVXDr instead of FMOVSr/FMOVDr, which have the proper register class to be used with the zero register. This makes the MachineInstruction verifier happy again. This is related to <rdar://problem/18027157>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216040 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -291,7 +291,7 @@ unsigned AArch64FastISel::AArch64MaterializeFP(const ConstantFP *CFP, MVT VT) {
|
|||||||
// register, because the immediate version of fmov cannot encode zero.
|
// register, because the immediate version of fmov cannot encode zero.
|
||||||
if (Val.isPosZero()) {
|
if (Val.isPosZero()) {
|
||||||
unsigned ZReg = Is64Bit ? AArch64::XZR : AArch64::WZR;
|
unsigned ZReg = Is64Bit ? AArch64::XZR : AArch64::WZR;
|
||||||
unsigned Opc = Is64Bit ? AArch64::FMOVDr : AArch64::FMOVSr;
|
unsigned Opc = Is64Bit ? AArch64::FMOVXDr : AArch64::FMOVWSr;
|
||||||
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(Opc), ResultReg)
|
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(Opc), ResultReg)
|
||||||
.addReg(ZReg, getKillRegState(true));
|
.addReg(ZReg, getKillRegState(true));
|
||||||
return ResultReg;
|
return ResultReg;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
; RUN: llc -O0 -fast-isel-abort -mtriple=arm64-apple-darwin < %s | FileCheck %s
|
; RUN: llc -O0 -fast-isel-abort -verify-machineinstrs -mtriple=arm64-apple-darwin < %s | FileCheck %s
|
||||||
|
|
||||||
; Materialize using fmov
|
; Materialize using fmov
|
||||||
define float @fmov_float1() {
|
define float @fmov_float1() {
|
||||||
|
Reference in New Issue
Block a user