Index: llvm/lib/Target/SystemZ/SystemZInstrFP.td =================================================================== --- llvm/lib/Target/SystemZ/SystemZInstrFP.td +++ llvm/lib/Target/SystemZ/SystemZInstrFP.td @@ -438,8 +438,8 @@ def ADBR : BinaryRRE<"adbr", 0xB31A, any_fadd, FP64, FP64>; def AXBR : BinaryRRE<"axbr", 0xB34A, any_fadd, FP128, FP128>; } - def AEB : BinaryRXE<"aeb", 0xED0A, any_fadd, FP32, load, 4>; - def ADB : BinaryRXE<"adb", 0xED1A, any_fadd, FP64, load, 8>; + defm AEB : BinaryRXEAndPseudo<"aeb", 0xED0A, any_fadd, FP32, load, 4>; + defm ADB : BinaryRXEAndPseudo<"adb", 0xED1A, any_fadd, FP64, load, 8>; } // Subtraction. @@ -449,8 +449,8 @@ def SDBR : BinaryRRE<"sdbr", 0xB31B, any_fsub, FP64, FP64>; def SXBR : BinaryRRE<"sxbr", 0xB34B, any_fsub, FP128, FP128>; - def SEB : BinaryRXE<"seb", 0xED0B, any_fsub, FP32, load, 4>; - def SDB : BinaryRXE<"sdb", 0xED1B, any_fsub, FP64, load, 8>; + defm SEB : BinaryRXEAndPseudo<"seb", 0xED0B, any_fsub, FP32, load, 4>; + defm SDB : BinaryRXEAndPseudo<"sdb", 0xED1B, any_fsub, FP64, load, 8>; } // Multiplication. @@ -460,8 +460,8 @@ def MDBR : BinaryRRE<"mdbr", 0xB31C, any_fmul, FP64, FP64>; def MXBR : BinaryRRE<"mxbr", 0xB34C, any_fmul, FP128, FP128>; } - def MEEB : BinaryRXE<"meeb", 0xED17, any_fmul, FP32, load, 4>; - def MDB : BinaryRXE<"mdb", 0xED1C, any_fmul, FP64, load, 8>; + defm MEEB : BinaryRXEAndPseudo<"meeb", 0xED17, any_fmul, FP32, load, 4>; + defm MDB : BinaryRXEAndPseudo<"mdb", 0xED1C, any_fmul, FP64, load, 8>; } // f64 multiplication of two FP32 registers. @@ -503,8 +503,8 @@ def MAEBR : TernaryRRD<"maebr", 0xB30E, z_any_fma, FP32, FP32>; def MADBR : TernaryRRD<"madbr", 0xB31E, z_any_fma, FP64, FP64>; - def MAEB : TernaryRXF<"maeb", 0xED0E, z_any_fma, FP32, FP32, load, 4>; - def MADB : TernaryRXF<"madb", 0xED1E, z_any_fma, FP64, FP64, load, 8>; + defm MAEB : TernaryRXFAndPseudo<"maeb", 0xED0E, z_any_fma, FP32, FP32, load, 4>; + defm MADB : TernaryRXFAndPseudo<"madb", 0xED1E, z_any_fma, FP64, FP64, load, 8>; } // Fused multiply-subtract. @@ -512,8 +512,8 @@ def MSEBR : TernaryRRD<"msebr", 0xB30F, z_any_fms, FP32, FP32>; def MSDBR : TernaryRRD<"msdbr", 0xB31F, z_any_fms, FP64, FP64>; - def MSEB : TernaryRXF<"mseb", 0xED0F, z_any_fms, FP32, FP32, load, 4>; - def MSDB : TernaryRXF<"msdb", 0xED1F, z_any_fms, FP64, FP64, load, 8>; + defm MSEB : TernaryRXFAndPseudo<"mseb", 0xED0F, z_any_fms, FP32, FP32, load, 4>; + defm MSDB : TernaryRXFAndPseudo<"msdb", 0xED1F, z_any_fms, FP64, FP64, load, 8>; } // Division. @@ -522,8 +522,8 @@ def DDBR : BinaryRRE<"ddbr", 0xB31D, any_fdiv, FP64, FP64>; def DXBR : BinaryRRE<"dxbr", 0xB34D, any_fdiv, FP128, FP128>; - def DEB : BinaryRXE<"deb", 0xED0D, any_fdiv, FP32, load, 4>; - def DDB : BinaryRXE<"ddb", 0xED1D, any_fdiv, FP64, load, 8>; + defm DEB : BinaryRXEAndPseudo<"deb", 0xED0D, any_fdiv, FP32, load, 4>; + defm DDB : BinaryRXEAndPseudo<"ddb", 0xED1D, any_fdiv, FP64, load, 8>; } // Divide to integer. Index: llvm/lib/Target/SystemZ/SystemZInstrFormats.td =================================================================== --- llvm/lib/Target/SystemZ/SystemZInstrFormats.td +++ llvm/lib/Target/SystemZ/SystemZInstrFormats.td @@ -2920,6 +2920,17 @@ let M5 = m5; } +// A UnaryVRRa that also treats this as the register part in a reg -> mem +// mapping. +class UnaryVRRa_r opcode, SDPatternOperator operator, + TypedReg tr1, TypedReg tr2, bits<4> type = 0, bits<4> m4 = 0, + bits<4> m5 = 0> + : UnaryVRRa { + let OpKey = !subst("w", "", !subst("wf", "", !subst("sb", "eb", mnemonic)))#"r"# + !subst("VR", "FP", !cast(tr1.op)); + let OpType = "reg"; +} + class UnaryVRRaGeneric opcode, bits<4> m4 = 0, bits<4> m5 = 0> : InstVRRa mem +// (-fold pseudo) mapping. +class BinaryVRRc_r opcode, SDPatternOperator operator, + TypedReg tr1, TypedReg tr2, bits<4> type = 0, bits<4> m5 = 0, + bits<4> m6 = 0> + : BinaryVRRc { + let OpKey = mnemonic#tr1.op; + let OpType = "reg"; +} + class BinaryVRRcGeneric opcode, bits<4> m5 = 0, bits<4> m6 = 0> : InstVRRc mem +// mapping. +class CompareVRRa_r opcode, SDPatternOperator operator, + TypedReg tr, bits<4> type> + : CompareVRRa { + let OpKey = !subst("wf", "", !subst("sb", "eb", mnemonic))#"r"# + !subst("VR", "FP", !cast(tr.op)); + let OpType = "reg"; +} + class CompareVRRaGeneric opcode> : InstVRRa { @@ -4418,6 +4449,15 @@ let M6 = type; } +// A TernaryVRRe that also treats this as the register part in a reg -> mem +// (-fold pseudo) mapping. +class TernaryVRRe_r opcode, SDPatternOperator operator, + TypedReg tr1, TypedReg tr2, bits<4> m5 = 0, bits<4> type = 0> + : TernaryVRRe { + let OpKey = mnemonic#tr1.op; + let OpType = "reg"; +} + class TernaryVRReFloatGeneric opcode> : InstVRRe bytes, + AddressingMode mode> + : MemFoldPseudo { + let OpKey = "wf"#!subst("eb", "sb", !subst("eeb", "eb", mnemonic)) + #!subst("FP", "VR", !cast(cls)); +} + +class MemFoldPseudo_FPTern bytes, + AddressingMode mode> + : Pseudo<(outs cls:$R1), (ins cls:$R2, cls:$R3, mode:$XBD2), []> { + let OpKey = "wf"#!subst("eb", "sb", mnemonic) + #!subst("FP", "VR", !cast(cls)); + let OpType = "mem"; + let MemKey = mnemonic#cls; + let MemType = "pseudo"; + let mayLoad = 1; + let AccessBytes = bytes; + let HasIndex = 1; + let hasNoSchedulingInfo = 1; +} + // Same as MemFoldPseudo but for Load On Condition with CC operands. class MemFoldPseudo_CondMove bytes, AddressingMode mode> @@ -5072,7 +5134,6 @@ SDPatternOperator operator, RegisterOperand cls, SDPatternOperator load, bits<5> bytes, AddressingMode mode = bdxaddr20only> { - def "" : BinaryRXY { let MemKey = mnemonic#cls; let MemType = "target"; @@ -5099,6 +5160,27 @@ def _MemFoldPseudo : MemFoldPseudo; } +multiclass BinaryRXEAndPseudo opcode, + SDPatternOperator operator, RegisterOperand cls, + SDPatternOperator load, bits<5> bytes> { + def "" : BinaryRXE { + let MemKey = mnemonic#cls; + let MemType = "target"; + } + def _MemFoldPseudo : MemFoldPseudo_FP; +} + +multiclass TernaryRXFAndPseudo opcode, + SDPatternOperator operator, RegisterOperand cls1, + RegisterOperand cls2, SDPatternOperator load, + bits<5> bytes> { + def "" : TernaryRXF { + let MemKey = mnemonic#cls1; + let MemType = "target"; + } + def _MemFoldPseudo : MemFoldPseudo_FPTern; +} + multiclass CondUnaryRSYPairAndMemFold opcode, SDPatternOperator operator, RegisterOperand cls, bits<5> bytes, Index: llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp =================================================================== --- llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp +++ llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp @@ -993,33 +993,32 @@ MachineBasicBlock::iterator InsertPt, int FrameIndex, LiveIntervals *LIS, VirtRegMap *VRM) const { const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo(); + MachineRegisterInfo &MRI = MF.getRegInfo(); const MachineFrameInfo &MFI = MF.getFrameInfo(); unsigned Size = MFI.getObjectSize(FrameIndex); unsigned Opcode = MI.getOpcode(); + // Check CC liveness if new instruction introduces a dead def of CC. + MCRegUnitIterator CCUnit(SystemZ::CC, TRI); + SlotIndex MISlot = LIS ? + LIS->getSlotIndexes()->getInstructionIndex(MI).getRegSlot() : SlotIndex(); + LiveRange *const CCLiveRange = LIS ? &LIS->getRegUnit(*CCUnit) : nullptr; + bool CCLiveAtMI = LIS ? CCLiveRange->liveAt(MISlot) : true; + ++CCUnit; + assert(!CCUnit.isValid() && "CC only has one reg unit."); + if (Ops.size() == 2 && Ops[0] == 0 && Ops[1] == 1) { - if (LIS != nullptr && (Opcode == SystemZ::LA || Opcode == SystemZ::LAY) && + if (!CCLiveAtMI && (Opcode == SystemZ::LA || Opcode == SystemZ::LAY) && isInt<8>(MI.getOperand(2).getImm()) && !MI.getOperand(3).getReg()) { - - // Check CC liveness, since new instruction introduces a dead - // def of CC. - MCRegUnitIterator CCUnit(SystemZ::CC, TRI); - LiveRange &CCLiveRange = LIS->getRegUnit(*CCUnit); - ++CCUnit; - assert(!CCUnit.isValid() && "CC only has one reg unit."); - SlotIndex MISlot = - LIS->getSlotIndexes()->getInstructionIndex(MI).getRegSlot(); - if (!CCLiveRange.liveAt(MISlot)) { - // LA(Y) %reg, CONST(%reg) -> AGSI %mem, CONST - MachineInstr *BuiltMI = BuildMI(*InsertPt->getParent(), InsertPt, - MI.getDebugLoc(), get(SystemZ::AGSI)) - .addFrameIndex(FrameIndex) - .addImm(0) - .addImm(MI.getOperand(2).getImm()); - BuiltMI->findRegisterDefOperand(SystemZ::CC)->setIsDead(true); - CCLiveRange.createDeadDef(MISlot, LIS->getVNInfoAllocator()); - return BuiltMI; - } + // LA(Y) %reg, CONST(%reg) -> AGSI %mem, CONST + MachineInstr *BuiltMI = BuildMI(*InsertPt->getParent(), InsertPt, + MI.getDebugLoc(), get(SystemZ::AGSI)) + .addFrameIndex(FrameIndex) + .addImm(0) + .addImm(MI.getOperand(2).getImm()); + BuiltMI->findRegisterDefOperand(SystemZ::CC)->setIsDead(true); + CCLiveRange->createDeadDef(MISlot, LIS->getVNInfoAllocator()); + return BuiltMI; } return nullptr; } @@ -1176,13 +1175,62 @@ // commutable, try to change R into . unsigned NumOps = MI.getNumExplicitOperands(); int MemOpcode = SystemZ::getMemOpcode(Opcode); - if (MemOpcode == -1) + if (MemOpcode == -1 || + (CCLiveAtMI && !MI.definesRegister(SystemZ::CC) && + get(MemOpcode).hasImplicitDefOfPhysReg(SystemZ::CC))) return nullptr; + bool Vec3AddrToFP = (Opcode == SystemZ::WFADB || Opcode == SystemZ::WFASB || + Opcode == SystemZ::WFSDB || Opcode == SystemZ::WFSSB || + Opcode == SystemZ::WFDDB || Opcode == SystemZ::WFDSB || + Opcode == SystemZ::WFMDB || Opcode == SystemZ::WFMSB); + bool FusedFPOp = (Opcode == SystemZ::WFMADB || Opcode == SystemZ::WFMASB || + Opcode == SystemZ::WFMSDB || Opcode == SystemZ::WFMSSB); + bool VecOpsOther = (Opcode == SystemZ::WFCDB || Opcode == SystemZ::WFCSB || + Opcode == SystemZ::WFKDB || Opcode == SystemZ::WFKSB || + Opcode == SystemZ::WLDEB || Opcode == SystemZ::WFSQDB || + Opcode == SystemZ::WFSQSB); + if (Vec3AddrToFP || FusedFPOp || VecOpsOther) { + if (VRM == nullptr) + return nullptr; + if (FusedFPOp) { + Register DstReg = VRM->getPhys(MI.getOperand(0).getReg()); + Register AccReg = VRM->getPhys(MI.getOperand(3).getReg()); + if (OpNum == 0 || OpNum == 3 || DstReg != AccReg) + return nullptr; + } + // Check if all other vregs have a usable allocation for the FP mem opcode. + for (unsigned i = 0; i < NumOps; ++i) { + if (i == OpNum) + continue; + Register Reg = MI.getOperand(i).getReg(); + Register PhysReg = + Register::isVirtualRegister(Reg) ? VRM->getPhys(Reg) : Reg; + if (!PhysReg || + !(SystemZ::FP32BitRegClass.contains(PhysReg) || + SystemZ::FP64BitRegClass.contains(PhysReg) || + SystemZ::VF128BitRegClass.contains(PhysReg))) + return nullptr; + } + } +#ifndef NDEBUG + // Check that there are no stray mappings from vector to fp instructions. + else + for (unsigned I = 0; I < NumOps; ++I) { + const TargetRegisterClass *RC = getRegClass(MI.getDesc(), I, TRI, MF); + assert(RC != &SystemZ::VR32BitRegClass && + RC != &SystemZ::VR64BitRegClass && + RC != &SystemZ::VR128BitRegClass && + "Unexpected vector instruction!"); + } +#endif + // Try to swap compare operands if possible. bool NeedsCommute = false; if ((MI.getOpcode() == SystemZ::CR || MI.getOpcode() == SystemZ::CGR || - MI.getOpcode() == SystemZ::CLR || MI.getOpcode() == SystemZ::CLGR) && + MI.getOpcode() == SystemZ::CLR || MI.getOpcode() == SystemZ::CLGR || + MI.getOpcode() == SystemZ::WFCDB || MI.getOpcode() == SystemZ::WFCSB || + MI.getOpcode() == SystemZ::WFKDB || MI.getOpcode() == SystemZ::WFKSB) && OpNum == 0 && prepareCompareSwapOperands(MI)) NeedsCommute = true; @@ -1218,7 +1266,7 @@ } } - if ((OpNum == NumOps - 1) || NeedsCommute) { + if ((OpNum == NumOps - 1) || NeedsCommute || FusedFPOp) { const MCInstrDesc &MemDesc = get(MemOpcode); uint64_t AccessBytes = SystemZII::getAccessSize(MemDesc.TSFlags); assert(AccessBytes != 0 && "Size of access should be known"); @@ -1230,6 +1278,11 @@ assert(NumOps == 2 && "Expected 2 register operands for a compare."); MIB.add(MI.getOperand(NeedsCommute ? 1 : 0)); } + else if (FusedFPOp) { + MIB.add(MI.getOperand(0)); + MIB.add(MI.getOperand(3)); + MIB.add(MI.getOperand(OpNum == 1 ? 2 : 1)); + } else { MIB.add(MI.getOperand(0)); if (NeedsCommute) @@ -1247,8 +1300,26 @@ MIB.addImm(CCValid); MIB.addImm(NeedsCommute ? CCMask ^ CCValid : CCMask); } + if (!MI.definesRegister(SystemZ::CC) && MIB->definesRegister(SystemZ::CC)) { + MIB->addRegisterDead(SystemZ::CC, TRI); + CCLiveRange->createDeadDef(MISlot, LIS->getVNInfoAllocator()); + } + // Constrain the register classes if converted from a vector opcode. The + // allocated regs are in an FP reg-class per previous check above. + for (const MachineOperand &MO : MIB->operands()) + if (MO.isReg() && Register::isVirtualRegister(MO.getReg())) { + unsigned Reg = MO.getReg(); + if (MRI.getRegClass(Reg) == &SystemZ::VR32BitRegClass) + MRI.setRegClass(Reg, &SystemZ::FP32BitRegClass); + else if (MRI.getRegClass(Reg) == &SystemZ::VR64BitRegClass) + MRI.setRegClass(Reg, &SystemZ::FP64BitRegClass); + else if (MRI.getRegClass(Reg) == &SystemZ::VR128BitRegClass) + MRI.setRegClass(Reg, &SystemZ::VF128BitRegClass); + } + transferDeadCC(&MI, MIB); transferMIFlag(&MI, MIB, MachineInstr::NoSWrap); + transferMIFlag(&MI, MIB, MachineInstr::NoFPExcept); return MIB; } Index: llvm/lib/Target/SystemZ/SystemZInstrVector.td =================================================================== --- llvm/lib/Target/SystemZ/SystemZInstrVector.td +++ llvm/lib/Target/SystemZ/SystemZInstrVector.td @@ -1039,10 +1039,10 @@ let Uses = [FPC], mayRaiseFPException = 1, isCommutable = 1 in { def VFA : BinaryVRRcFloatGeneric<"vfa", 0xE7E3>; def VFADB : BinaryVRRc<"vfadb", 0xE7E3, any_fadd, v128db, v128db, 3, 0>; - def WFADB : BinaryVRRc<"wfadb", 0xE7E3, any_fadd, v64db, v64db, 3, 8>; + def WFADB : BinaryVRRc_r<"wfadb", 0xE7E3, any_fadd, v64db, v64db, 3, 8>; let Predicates = [FeatureVectorEnhancements1] in { def VFASB : BinaryVRRc<"vfasb", 0xE7E3, any_fadd, v128sb, v128sb, 2, 0>; - def WFASB : BinaryVRRc<"wfasb", 0xE7E3, any_fadd, v32sb, v32sb, 2, 8>; + def WFASB : BinaryVRRc_r<"wfasb", 0xE7E3, any_fadd, v32sb, v32sb, 2, 8>; def WFAXB : BinaryVRRc<"wfaxb", 0xE7E3, any_fadd, v128xb, v128xb, 4, 8>; } } @@ -1123,10 +1123,10 @@ let Uses = [FPC], mayRaiseFPException = 1 in { def VFD : BinaryVRRcFloatGeneric<"vfd", 0xE7E5>; def VFDDB : BinaryVRRc<"vfddb", 0xE7E5, any_fdiv, v128db, v128db, 3, 0>; - def WFDDB : BinaryVRRc<"wfddb", 0xE7E5, any_fdiv, v64db, v64db, 3, 8>; + def WFDDB : BinaryVRRc_r<"wfddb", 0xE7E5, any_fdiv, v64db, v64db, 3, 8>; let Predicates = [FeatureVectorEnhancements1] in { def VFDSB : BinaryVRRc<"vfdsb", 0xE7E5, any_fdiv, v128sb, v128sb, 2, 0>; - def WFDSB : BinaryVRRc<"wfdsb", 0xE7E5, any_fdiv, v32sb, v32sb, 2, 8>; + def WFDSB : BinaryVRRc_r<"wfdsb", 0xE7E5, any_fdiv, v32sb, v32sb, 2, 8>; def WFDXB : BinaryVRRc<"wfdxb", 0xE7E5, any_fdiv, v128xb, v128xb, 4, 8>; } } @@ -1154,7 +1154,7 @@ let Uses = [FPC], mayRaiseFPException = 1 in { def VLDE : UnaryVRRaFloatGeneric<"vlde", 0xE7C4>; def VLDEB : UnaryVRRa<"vldeb", 0xE7C4, z_any_vextend, v128db, v128sb, 2, 0>; - def WLDEB : UnaryVRRa<"wldeb", 0xE7C4, any_fpextend, v64db, v32sb, 2, 8>; + def WLDEB : UnaryVRRa_r<"wldeb", 0xE7C4, any_fpextend, v64db, v32sb, 2, 8>; } let Predicates = [FeatureVectorEnhancements1] in { let Uses = [FPC], mayRaiseFPException = 1 in { @@ -1247,10 +1247,10 @@ let Uses = [FPC], mayRaiseFPException = 1, isCommutable = 1 in { def VFM : BinaryVRRcFloatGeneric<"vfm", 0xE7E7>; def VFMDB : BinaryVRRc<"vfmdb", 0xE7E7, any_fmul, v128db, v128db, 3, 0>; - def WFMDB : BinaryVRRc<"wfmdb", 0xE7E7, any_fmul, v64db, v64db, 3, 8>; + def WFMDB : BinaryVRRc_r<"wfmdb", 0xE7E7, any_fmul, v64db, v64db, 3, 8>; let Predicates = [FeatureVectorEnhancements1] in { def VFMSB : BinaryVRRc<"vfmsb", 0xE7E7, any_fmul, v128sb, v128sb, 2, 0>; - def WFMSB : BinaryVRRc<"wfmsb", 0xE7E7, any_fmul, v32sb, v32sb, 2, 8>; + def WFMSB : BinaryVRRc_r<"wfmsb", 0xE7E7, any_fmul, v32sb, v32sb, 2, 8>; def WFMXB : BinaryVRRc<"wfmxb", 0xE7E7, any_fmul, v128xb, v128xb, 4, 8>; } } @@ -1259,10 +1259,10 @@ let Uses = [FPC], mayRaiseFPException = 1, isCommutable = 1 in { def VFMA : TernaryVRReFloatGeneric<"vfma", 0xE78F>; def VFMADB : TernaryVRRe<"vfmadb", 0xE78F, any_fma, v128db, v128db, 0, 3>; - def WFMADB : TernaryVRRe<"wfmadb", 0xE78F, any_fma, v64db, v64db, 8, 3>; + def WFMADB : TernaryVRRe_r<"wfmadb", 0xE78F, any_fma, v64db, v64db, 8, 3>; let Predicates = [FeatureVectorEnhancements1] in { def VFMASB : TernaryVRRe<"vfmasb", 0xE78F, any_fma, v128sb, v128sb, 0, 2>; - def WFMASB : TernaryVRRe<"wfmasb", 0xE78F, any_fma, v32sb, v32sb, 8, 2>; + def WFMASB : TernaryVRRe_r<"wfmasb", 0xE78F, any_fma, v32sb, v32sb, 8, 2>; def WFMAXB : TernaryVRRe<"wfmaxb", 0xE78F, any_fma, v128xb, v128xb, 8, 4>; } } @@ -1271,10 +1271,10 @@ let Uses = [FPC], mayRaiseFPException = 1, isCommutable = 1 in { def VFMS : TernaryVRReFloatGeneric<"vfms", 0xE78E>; def VFMSDB : TernaryVRRe<"vfmsdb", 0xE78E, any_fms, v128db, v128db, 0, 3>; - def WFMSDB : TernaryVRRe<"wfmsdb", 0xE78E, any_fms, v64db, v64db, 8, 3>; + def WFMSDB : TernaryVRRe_r<"wfmsdb", 0xE78E, any_fms, v64db, v64db, 8, 3>; let Predicates = [FeatureVectorEnhancements1] in { def VFMSSB : TernaryVRRe<"vfmssb", 0xE78E, any_fms, v128sb, v128sb, 0, 2>; - def WFMSSB : TernaryVRRe<"wfmssb", 0xE78E, any_fms, v32sb, v32sb, 8, 2>; + def WFMSSB : TernaryVRRe_r<"wfmssb", 0xE78E, any_fms, v32sb, v32sb, 8, 2>; def WFMSXB : TernaryVRRe<"wfmsxb", 0xE78E, any_fms, v128xb, v128xb, 8, 4>; } } @@ -1342,10 +1342,10 @@ let Uses = [FPC], mayRaiseFPException = 1 in { def VFSQ : UnaryVRRaFloatGeneric<"vfsq", 0xE7CE>; def VFSQDB : UnaryVRRa<"vfsqdb", 0xE7CE, any_fsqrt, v128db, v128db, 3, 0>; - def WFSQDB : UnaryVRRa<"wfsqdb", 0xE7CE, any_fsqrt, v64db, v64db, 3, 8>; + def WFSQDB : UnaryVRRa_r<"wfsqdb", 0xE7CE, any_fsqrt, v64db, v64db, 3, 8>; let Predicates = [FeatureVectorEnhancements1] in { def VFSQSB : UnaryVRRa<"vfsqsb", 0xE7CE, any_fsqrt, v128sb, v128sb, 2, 0>; - def WFSQSB : UnaryVRRa<"wfsqsb", 0xE7CE, any_fsqrt, v32sb, v32sb, 2, 8>; + def WFSQSB : UnaryVRRa_r<"wfsqsb", 0xE7CE, any_fsqrt, v32sb, v32sb, 2, 8>; def WFSQXB : UnaryVRRa<"wfsqxb", 0xE7CE, any_fsqrt, v128xb, v128xb, 4, 8>; } } @@ -1354,10 +1354,10 @@ let Uses = [FPC], mayRaiseFPException = 1 in { def VFS : BinaryVRRcFloatGeneric<"vfs", 0xE7E2>; def VFSDB : BinaryVRRc<"vfsdb", 0xE7E2, any_fsub, v128db, v128db, 3, 0>; - def WFSDB : BinaryVRRc<"wfsdb", 0xE7E2, any_fsub, v64db, v64db, 3, 8>; + def WFSDB : BinaryVRRc_r<"wfsdb", 0xE7E2, any_fsub, v64db, v64db, 3, 8>; let Predicates = [FeatureVectorEnhancements1] in { def VFSSB : BinaryVRRc<"vfssb", 0xE7E2, any_fsub, v128sb, v128sb, 2, 0>; - def WFSSB : BinaryVRRc<"wfssb", 0xE7E2, any_fsub, v32sb, v32sb, 2, 8>; + def WFSSB : BinaryVRRc_r<"wfssb", 0xE7E2, any_fsub, v32sb, v32sb, 2, 8>; def WFSXB : BinaryVRRc<"wfsxb", 0xE7E2, any_fsub, v128xb, v128xb, 4, 8>; } } @@ -1383,9 +1383,9 @@ // Compare scalar. let Uses = [FPC], mayRaiseFPException = 1, Defs = [CC] in { def WFC : CompareVRRaFloatGeneric<"wfc", 0xE7CB>; - def WFCDB : CompareVRRa<"wfcdb", 0xE7CB, z_any_fcmp, v64db, 3>; + def WFCDB : CompareVRRa_r<"wfcdb", 0xE7CB, z_any_fcmp, v64db, 3>; let Predicates = [FeatureVectorEnhancements1] in { - def WFCSB : CompareVRRa<"wfcsb", 0xE7CB, z_any_fcmp, v32sb, 2>; + def WFCSB : CompareVRRa_r<"wfcsb", 0xE7CB, z_any_fcmp, v32sb, 2>; def WFCXB : CompareVRRa<"wfcxb", 0xE7CB, z_any_fcmp, v128xb, 4>; } } @@ -1393,9 +1393,9 @@ // Compare and signal scalar. let Uses = [FPC], mayRaiseFPException = 1, Defs = [CC] in { def WFK : CompareVRRaFloatGeneric<"wfk", 0xE7CA>; - def WFKDB : CompareVRRa<"wfkdb", 0xE7CA, z_strict_fcmps, v64db, 3>; + def WFKDB : CompareVRRa_r<"wfkdb", 0xE7CA, z_strict_fcmps, v64db, 3>; let Predicates = [FeatureVectorEnhancements1] in { - def WFKSB : CompareVRRa<"wfksb", 0xE7CA, z_strict_fcmps, v32sb, 2>; + def WFKSB : CompareVRRa_r<"wfksb", 0xE7CA, z_strict_fcmps, v32sb, 2>; def WFKXB : CompareVRRa<"wfkxb", 0xE7CA, z_strict_fcmps, v128xb, 4>; } } Index: llvm/test/CodeGen/SystemZ/foldmemop-vec-binops.mir =================================================================== --- /dev/null +++ llvm/test/CodeGen/SystemZ/foldmemop-vec-binops.mir @@ -0,0 +1,828 @@ +# RUN: llc -mtriple=s390x-linux-gnu -mcpu=z14 -start-before=greedy %s -o - \ +# RUN: | FileCheck %s +# +# Test folding of a memory operand into an fp memory instruction. + +--- | + define void @fun0(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun1(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun2(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun3(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun4(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun5(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun6(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun7(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun8(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun9(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun10(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun11(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun12(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun13(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun14(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun15(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun16(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun17(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun18(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun19(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun20(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun21(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun22(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun23(float %arg0, float %arg1, float* %Dst) { ret void } + +... + +# Test with both orders of operands since some operations are commutative. + +# CHECK-LABEL: fun0: +# CHECK: adb %f0, 160(%r15) # 8-byte Folded Reload +--- +name: fun0 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: fp64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp64bit = COPY $f2d + %0:fp64bit = COPY $f0d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr64bit = nofpexcept WFADB %0, %1, implicit $fpc + VST64 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun1: +# CHECK: adb %f0, 160(%r15) # 8-byte Folded Reload +--- +name: fun1 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: fp64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp64bit = COPY $f2d + %0:fp64bit = COPY $f0d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr64bit = nofpexcept WFADB %1, %0, implicit $fpc + VST64 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + +# ADB can't be used if one operand is a VR64 (and not FP64). +# CHECK-LABEL: fun2: +# CHECK: wfadb %f0, %v16, %f0 +--- +name: fun2 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: vr64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:vr64bit = COPY $f2d + %0:fp64bit = COPY $f0d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr64bit = nofpexcept WFADB %1, %0, implicit $fpc + VST64 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun3: +# CHECK: aeb %f0, 164(%r15) # 4-byte Folded Reload +--- +name: fun3 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: fp32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s, $f2s, $r2d + + %2:addr64bit = COPY $r2d + %1:fp32bit = COPY $f2s + %0:fp32bit = COPY $f0s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr32bit = nofpexcept WFASB %0, %1, implicit $fpc + VST32 %3, %2, 0, $noreg :: (store 4 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun4: +# CHECK: aeb %f0, 164(%r15) # 4-byte Folded Reload +--- +name: fun4 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: fp32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s, $f2s, $r2d + + %2:addr64bit = COPY $r2d + %1:fp32bit = COPY $f2s + %0:fp32bit = COPY $f0s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr32bit = nofpexcept WFASB %1, %0, implicit $fpc + VST32 %3, %2, 0, $noreg :: (store 4 into %ir.Dst) + Return + +... + + +# AEB can't be used if one operand is a VR64 (and not FP64). +# CHECK-LABEL: fun5: +# CHECK: wfasb %f0, %v16, %f0 +--- +name: fun5 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: vr32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s, $f2s, $r2d + + %2:addr64bit = COPY $r2d + %1:vr32bit = COPY $f2s + %0:fp32bit = COPY $f0s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr32bit = nofpexcept WFASB %1, %0, implicit $fpc + VST32 %3, %2, 0, $noreg :: (store 4 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun6: +# CHECK: sdb %f0, 160(%r15) # 8-byte Folded Reload +--- +name: fun6 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: fp64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp64bit = COPY $f2d + %0:fp64bit = COPY $f0d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr64bit = nofpexcept WFSDB %0, %1, implicit $fpc + VST64 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun7: +# CHECK: wfsdb %f0, %f1, %f0 +--- +name: fun7 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: fp64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp64bit = COPY $f2d + %0:fp64bit = COPY $f0d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr64bit = nofpexcept WFSDB %1, %0, implicit $fpc + VST64 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + +# SDB can't be used if one operand is a VR64 (and not FP64). +# CHECK-LABEL: fun8: +# CHECK: wfsdb %f0, %f0, %v16 +--- +name: fun8 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: vr64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:vr64bit = COPY $f2d + %0:fp64bit = COPY $f0d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr64bit = nofpexcept WFSDB %0, %1, implicit $fpc + VST64 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun9: +# CHECK: seb %f0, 164(%r15) # 4-byte Folded Reload +--- +name: fun9 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: fp32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s, $f2s, $r2d + + %2:addr64bit = COPY $r2d + %1:fp32bit = COPY $f2s + %0:fp32bit = COPY $f0s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr32bit = nofpexcept WFSSB %0, %1, implicit $fpc + VST32 %3, %2, 0, $noreg :: (store 4 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun10: +# CHECK: wfssb %f0, %f1, %f0 +--- +name: fun10 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: fp32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s, $f2s, $r2d + + %2:addr64bit = COPY $r2d + %1:fp32bit = COPY $f2s + %0:fp32bit = COPY $f0s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr32bit = nofpexcept WFSSB %1, %0, implicit $fpc + VST32 %3, %2, 0, $noreg :: (store 4 into %ir.Dst) + Return + +... + + +# SEB can't be used if one operand is a VR32 (and not FP32). +# CHECK-LABEL: fun11: +# CHECK: wfssb %f0, %f0, %v16 +--- +name: fun11 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: vr32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s, $f2s, $r2d + + %2:addr64bit = COPY $r2d + %1:vr32bit = COPY $f2s + %0:fp32bit = COPY $f0s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr32bit = nofpexcept WFSSB %0, %1, implicit $fpc + VST32 %3, %2, 0, $noreg :: (store 4 into %ir.Dst) + Return + +... + +# CHECK-LABEL: fun12: +# CHECK: ddb %f0, 160(%r15) # 8-byte Folded Reload +--- +name: fun12 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: fp64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp64bit = COPY $f2d + %0:fp64bit = COPY $f0d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr64bit = nofpexcept WFDDB %0, %1, implicit $fpc + VST64 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun13: +# CHECK: wfddb %f0, %f1, %f0 +--- +name: fun13 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: fp64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp64bit = COPY $f2d + %0:fp64bit = COPY $f0d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr64bit = nofpexcept WFDDB %1, %0, implicit $fpc + VST64 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + +# DDB can't be used if one operand is a VR64 (and not FP64). +# CHECK-LABEL: fun14: +# CHECK: wfddb %f0, %f0, %v16 +--- +name: fun14 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: vr64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:vr64bit = COPY $f2d + %0:fp64bit = COPY $f0d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr64bit = nofpexcept WFDDB %0, %1, implicit $fpc + VST64 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun15: +# CHECK: deb %f0, 164(%r15) # 4-byte Folded Reload +--- +name: fun15 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: fp32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s, $f2s, $r2d + + %2:addr64bit = COPY $r2d + %1:fp32bit = COPY $f2s + %0:fp32bit = COPY $f0s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr32bit = nofpexcept WFDSB %0, %1, implicit $fpc + VST32 %3, %2, 0, $noreg :: (store 4 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun16: +# CHECK: wfdsb %f0, %f1, %f0 +--- +name: fun16 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: fp32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s, $f2s, $r2d + + %2:addr64bit = COPY $r2d + %1:fp32bit = COPY $f2s + %0:fp32bit = COPY $f0s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr32bit = nofpexcept WFDSB %1, %0, implicit $fpc + VST32 %3, %2, 0, $noreg :: (store 4 into %ir.Dst) + Return + +... + + +# DEB can't be used if one operand is a VR32 (and not FP32). +# CHECK-LABEL: fun17: +# CHECK: wfdsb %f0, %f0, %v16 +--- +name: fun17 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: vr32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s, $f2s, $r2d + + %2:addr64bit = COPY $r2d + %1:vr32bit = COPY $f2s + %0:fp32bit = COPY $f0s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr32bit = nofpexcept WFDSB %0, %1, implicit $fpc + VST32 %3, %2, 0, $noreg :: (store 4 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun18: +# CHECK: mdb %f0, 160(%r15) # 8-byte Folded Reload +--- +name: fun18 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: fp64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp64bit = COPY $f2d + %0:fp64bit = COPY $f0d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr64bit = nofpexcept WFMDB %0, %1, implicit $fpc + VST64 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun19: +# CHECK: mdb %f0, 160(%r15) # 8-byte Folded Reload +--- +name: fun19 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: fp64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp64bit = COPY $f2d + %0:fp64bit = COPY $f0d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr64bit = nofpexcept WFMDB %1, %0, implicit $fpc + VST64 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + +# MDB can't be used if one operand is a VR64 (and not FP64). +# CHECK-LABEL: fun20: +# CHECK: wfmdb %f0, %v16, %f0 +--- +name: fun20 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: vr64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:vr64bit = COPY $f2d + %0:fp64bit = COPY $f0d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr64bit = nofpexcept WFMDB %1, %0, implicit $fpc + VST64 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun21: +# CHECK: meeb %f0, 164(%r15) # 4-byte Folded Reload +--- +name: fun21 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: fp32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s, $f2s, $r2d + + %2:addr64bit = COPY $r2d + %1:fp32bit = COPY $f2s + %0:fp32bit = COPY $f0s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr32bit = nofpexcept WFMSB %0, %1, implicit $fpc + VST32 %3, %2, 0, $noreg :: (store 4 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun22: +# CHECK: meeb %f0, 164(%r15) # 4-byte Folded Reload +--- +name: fun22 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: fp32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s, $f2s, $r2d + + %2:addr64bit = COPY $r2d + %1:fp32bit = COPY $f2s + %0:fp32bit = COPY $f0s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr32bit = nofpexcept WFMSB %1, %0, implicit $fpc + VST32 %3, %2, 0, $noreg :: (store 4 into %ir.Dst) + Return + +... + + +# MEEB can't be used if one operand is a VR32 (and not FP32). +# CHECK-LABEL: fun23: +# CHECK: wfmsb %f0, %v16, %f0 +--- +name: fun23 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: vr32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s, $f2s, $r2d + + %2:addr64bit = COPY $r2d + %1:vr32bit = COPY $f2s + %0:fp32bit = COPY $f0s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr32bit = nofpexcept WFMSB %1, %0, implicit $fpc + VST32 %3, %2, 0, $noreg :: (store 4 into %ir.Dst) + Return + +... Index: llvm/test/CodeGen/SystemZ/foldmemop-vec-cmp.mir =================================================================== --- /dev/null +++ llvm/test/CodeGen/SystemZ/foldmemop-vec-cmp.mir @@ -0,0 +1,498 @@ +# RUN: llc -mtriple=s390x-linux-gnu -mcpu=z14 -start-before=greedy %s -o - \ +# RUN: | FileCheck %s +# +# Test folding of a memory operand into an fp memory instruction. + +--- | + define void @fun0(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun1(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun2(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun3(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun4(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun5(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun6(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun7(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun8(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun9(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun10(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun11(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun12(float %arg0, float %arg1, float* %Dst) { ret void } + +... + +# CHECK-LABEL: fun0: +# CHECK: cdb %f0, 160(%r15) # 8-byte Folded Reload +--- +name: fun0 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: fp64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } + - { id: 4, class: gr64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp64bit = COPY $f2d + %0:fp64bit = COPY $f0d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + nofpexcept WFCDB %0, %1, implicit-def $cc, implicit $fpc + %4:gr64bit = LGHI 0 + %4:gr64bit = LOCGHI %4, 1, 15, 8, implicit killed $cc + STG %4, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun1: +# CHECK: cdb %f0, 160(%r15) # 8-byte Folded Reload +--- +name: fun1 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: fp64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } + - { id: 4, class: gr64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp64bit = COPY $f2d + %0:fp64bit = COPY $f0d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + nofpexcept WFCDB %1, %0, implicit-def $cc, implicit $fpc + %4:gr64bit = LGHI 0 + %4:gr64bit = LOCGHI %4, 1, 15, 8, implicit killed $cc + STG %4, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CDB can't be used if one operand is a VR64 (and not FP64). +# CHECK-LABEL: fun2: +# CHECK: ld %f0, 160(%r15) # 8-byte Folded Reload +# CHECK-NEXT: wfcdb %v16, %f0 +--- +name: fun2 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: vr64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } + - { id: 4, class: gr64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:vr64bit = COPY $f2d + %0:fp64bit = COPY $f0d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f0d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + nofpexcept WFCDB %1, %0, implicit-def $cc, implicit $fpc + %4:gr64bit = LGHI 0 + %4:gr64bit = LOCGHI %4, 1, 15, 8, implicit killed $cc + STG %4, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun3: +# CHECK: ceb %f0, 164(%r15) # 4-byte Folded Reload +--- +name: fun3 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: fp32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } + - { id: 4, class: gr64bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s, $f2s, $r2d + + %2:addr64bit = COPY $r2d + %1:fp32bit = COPY $f2s + %0:fp32bit = COPY $f0s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + nofpexcept WFCSB %0, %1, implicit-def $cc, implicit $fpc + %4:gr64bit = LGHI 0 + %4:gr64bit = LOCGHI %4, 1, 15, 8, implicit killed $cc + STG %4, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun4: +# CHECK: ceb %f0, 164(%r15) # 4-byte Folded Reload +--- +name: fun4 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: fp32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } + - { id: 4, class: gr64bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s, $f2s, $r2d + + %2:addr64bit = COPY $r2d + %1:fp32bit = COPY $f2s + %0:fp32bit = COPY $f0s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + nofpexcept WFCSB %1, %0, implicit-def $cc, implicit $fpc + %4:gr64bit = LGHI 0 + %4:gr64bit = LOCGHI %4, 1, 15, 8, implicit killed $cc + STG %4, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CEB can't be used if one operand is a VR32 (and not FP32). +# CHECK-LABEL: fun5: +# CHECK: lde %f0, 164(%r15) # 4-byte Folded Reload +# CHECK-NEXT: wfcsb %v16, %f0 +--- +name: fun5 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: vr32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } + - { id: 4, class: gr64bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s, $f2s, $r2d + + %2:addr64bit = COPY $r2d + %1:vr32bit = COPY $f2s + %0:fp32bit = COPY $f0s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f0d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + nofpexcept WFCSB %1, %0, implicit-def $cc, implicit $fpc + %4:gr64bit = LGHI 0 + %4:gr64bit = LOCGHI %4, 1, 15, 8, implicit killed $cc + STG %4, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun6: +# CHECK: kdb %f0, 160(%r15) # 8-byte Folded Reload +--- +name: fun6 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: fp64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } + - { id: 4, class: gr64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp64bit = COPY $f2d + %0:fp64bit = COPY $f0d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + nofpexcept WFKDB %0, %1, implicit-def $cc, implicit $fpc + %4:gr64bit = LGHI 0 + %4:gr64bit = LOCGHI %4, 1, 15, 8, implicit killed $cc + STG %4, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun7: +# CHECK: kdb %f0, 160(%r15) # 8-byte Folded Reload +--- +name: fun7 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: fp64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } + - { id: 4, class: gr64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp64bit = COPY $f2d + %0:fp64bit = COPY $f0d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + nofpexcept WFKDB %1, %0, implicit-def $cc, implicit $fpc + %4:gr64bit = LGHI 0 + %4:gr64bit = LOCGHI %4, 1, 15, 8, implicit killed $cc + STG %4, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# KDB can't be used if one operand is a VR64 (and not FP64). +# CHECK-LABEL: fun8: +# CHECK: ld %f0, 160(%r15) # 8-byte Folded Reload +# CHECK-NEXT: wfkdb %v16, %f0 +--- +name: fun8 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: vr64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } + - { id: 4, class: gr64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:vr64bit = COPY $f2d + %0:fp64bit = COPY $f0d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f0d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + nofpexcept WFKDB %1, %0, implicit-def $cc, implicit $fpc + %4:gr64bit = LGHI 0 + %4:gr64bit = LOCGHI %4, 1, 15, 8, implicit killed $cc + STG %4, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun9: +# CHECK: keb %f0, 164(%r15) # 4-byte Folded Reload +--- +name: fun9 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: fp32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } + - { id: 4, class: gr64bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s, $f2s, $r2d + + %2:addr64bit = COPY $r2d + %1:fp32bit = COPY $f2s + %0:fp32bit = COPY $f0s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + nofpexcept WFKSB %0, %1, implicit-def $cc, implicit $fpc + %4:gr64bit = LGHI 0 + %4:gr64bit = LOCGHI %4, 1, 15, 8, implicit killed $cc + STG %4, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun10: +# CHECK: keb %f0, 164(%r15) # 4-byte Folded Reload +--- +name: fun10 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: fp32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } + - { id: 4, class: gr64bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s, $f2s, $r2d + + %2:addr64bit = COPY $r2d + %1:fp32bit = COPY $f2s + %0:fp32bit = COPY $f0s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + nofpexcept WFKSB %1, %0, implicit-def $cc, implicit $fpc + %4:gr64bit = LGHI 0 + %4:gr64bit = LOCGHI %4, 1, 15, 8, implicit killed $cc + STG %4, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CEB can't be used if one operand is a VR32 (and not FP32). +# CHECK-LABEL: fun11: +# CHECK: lde %f0, 164(%r15) # 4-byte Folded Reload +# CHECK-NEXT: wfksb %v16, %f0 +--- +name: fun11 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: vr32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } + - { id: 4, class: gr64bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s, $f2s, $r2d + + %2:addr64bit = COPY $r2d + %1:vr32bit = COPY $f2s + %0:fp32bit = COPY $f0s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f0d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + nofpexcept WFKSB %1, %0, implicit-def $cc, implicit $fpc + %4:gr64bit = LGHI 0 + %4:gr64bit = LOCGHI %4, 1, 15, 8, implicit killed $cc + STG %4, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# This test case involves a 128 bit operand (VGMF generating float 1.0). +# CHECK-LABEL: fun12: +# CHECK: vgmf %v0, 2, 8 +# CHECK-NEXT: ceb %f0, 164(%r15) # 4-byte Folded Reload +--- +name: fun12 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: vr128bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } + - { id: 4, class: gr64bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s, $f2s, $r2d + + %2:addr64bit = COPY $r2d + %0:fp32bit = COPY $f0s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f0d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %1:vr128bit = VGMF 2, 8 + nofpexcept WFCSB %0, %1.subreg_h32:vr128bit, implicit-def $cc, implicit $fpc + %4:gr64bit = LGHI 0 + %4:gr64bit = LOCGHI %4, 1, 15, 8, implicit killed $cc + STG %4, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... Index: llvm/test/CodeGen/SystemZ/foldmemop-vec-fusedfp.mir =================================================================== --- /dev/null +++ llvm/test/CodeGen/SystemZ/foldmemop-vec-fusedfp.mir @@ -0,0 +1,589 @@ +# RUN: llc -mtriple=s390x-linux-gnu -mcpu=z14 -start-before=greedy %s -o - \ +# RUN: | FileCheck %s +# +# Test folding of a memory operand into an fp memory instruction. + +--- | + define void @fun0(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun1(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun2(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun3(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun4(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun5(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun6(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun7(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun8(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun9(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun10(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun11(double %arg0, double %arg1, double* %Dst) { ret void } + define void @fun12(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun13(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun14(float %arg0, float %arg1, float* %Dst) { ret void } + define void @fun15(float %arg0, float %arg1, float* %Dst) { ret void } + +... + +# CHECK-LABEL: fun0: +# CHECK: madb %f0, %f1, 160(%r15) # 8-byte Folded Reload +--- +name: fun0 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: fp64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } + - { id: 4, class: fp64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp64bit = COPY $f2d + %0:fp64bit = COPY $f0d + %4:fp64bit = COPY $f2d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr64bit = nofpexcept WFMADB %0, %1, %4, implicit $fpc + VST64 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun1: +# CHECK: madb %f0, %f1, 160(%r15) # 8-byte Folded Reload +--- +name: fun1 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: fp64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } + - { id: 4, class: fp64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp64bit = COPY $f2d + %0:fp64bit = COPY $f0d + %4:fp64bit = COPY $f2d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr64bit = nofpexcept WFMADB %1, %0, %4, implicit $fpc + VST64 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + +# MADB can't be used if one operand is a VR64 (and not FP64). +# CHECK-LABEL: fun2: +# CHECK: wfmadb %f0, %v16, %f1, %f0 +--- +name: fun2 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: vr64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } + - { id: 4, class: fp64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:vr64bit = COPY $f2d + %0:fp64bit = COPY $f0d + %4:fp64bit = COPY $f2d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr64bit = nofpexcept WFMADB %1, %0, %4, implicit $fpc + VST64 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# MADB can't be used unless accumulator and result registers are the same. +# CHECK-LABEL: fun3: +# CHECK: wfmadb %f0, %f0, %f1, %f2 +--- +name: fun3 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: fp64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } + - { id: 4, class: fp64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp64bit = COPY $f2d + %0:fp64bit = COPY $f0d + %4:fp64bit = COPY $f2d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr64bit = nofpexcept WFMADB %4, %1, %0, implicit $fpc + VST64 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun4: +# CHECK: maeb %f0, %f1, 160(%r15) # 4-byte Folded Reload +--- +name: fun4 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: fp32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } + - { id: 4, class: fp32bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp32bit = COPY $f2s + %0:fp32bit = COPY $f0s + %4:fp32bit = COPY $f2s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr32bit = nofpexcept WFMASB %0, %1, %4, implicit $fpc + VST32 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun5: +# CHECK: maeb %f0, %f1, 160(%r15) # 4-byte Folded Reload +--- +name: fun5 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: fp32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } + - { id: 4, class: fp32bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp32bit = COPY $f2s + %0:fp32bit = COPY $f0s + %4:fp32bit = COPY $f2s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr32bit = nofpexcept WFMASB %1, %0, %4, implicit $fpc + VST32 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# MAEB can't be used if one operand is a VR32 (and not FP32). +# CHECK-LABEL: fun6: +# CHECK: wfmasb %f0, %v16, %f1, %f0 +--- +name: fun6 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: vr32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } + - { id: 4, class: fp32bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:vr32bit = COPY $f2s + %0:fp32bit = COPY $f0s + %4:fp32bit = COPY $f2s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr32bit = nofpexcept WFMASB %1, %0, %4, implicit $fpc + VST32 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# MAEB can't be used unless accumulator and result registers are the same. +# CHECK-LABEL: fun7: +# CHECK: wfmasb %f0, %f0, %f1, %f2 +--- +name: fun7 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: fp32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } + - { id: 4, class: fp32bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp32bit = COPY $f2s + %0:fp32bit = COPY $f0s + %4:fp32bit = COPY $f2s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr32bit = nofpexcept WFMASB %4, %1, %0, implicit $fpc + VST32 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun8: +# CHECK: msdb %f0, %f1, 160(%r15) # 8-byte Folded Reload +--- +name: fun8 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: fp64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } + - { id: 4, class: fp64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp64bit = COPY $f2d + %0:fp64bit = COPY $f0d + %4:fp64bit = COPY $f2d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr64bit = nofpexcept WFMSDB %0, %1, %4, implicit $fpc + VST64 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun9: +# CHECK: msdb %f0, %f1, 160(%r15) # 8-byte Folded Reload +--- +name: fun9 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: fp64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } + - { id: 4, class: fp64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp64bit = COPY $f2d + %0:fp64bit = COPY $f0d + %4:fp64bit = COPY $f2d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr64bit = nofpexcept WFMSDB %1, %0, %4, implicit $fpc + VST64 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + +# MSDB can't be used if one operand is a VR64 (and not FP64). +# CHECK-LABEL: fun10: +# CHECK: wfmsdb %f0, %v16, %f1, %f0 +--- +name: fun10 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: vr64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } + - { id: 4, class: fp64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:vr64bit = COPY $f2d + %0:fp64bit = COPY $f0d + %4:fp64bit = COPY $f2d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr64bit = nofpexcept WFMSDB %1, %0, %4, implicit $fpc + VST64 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# MSDB can't be used unless accumulator and result registers are the same. +# CHECK-LABEL: fun11: +# CHECK: wfmsdb %f0, %f0, %f1, %f2 +--- +name: fun11 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: fp64bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr64bit } + - { id: 4, class: fp64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } + - { reg: '$f2d', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp64bit = COPY $f2d + %0:fp64bit = COPY $f0d + %4:fp64bit = COPY $f2d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr64bit = nofpexcept WFMSDB %4, %1, %0, implicit $fpc + VST64 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun12: +# CHECK: mseb %f0, %f1, 160(%r15) # 4-byte Folded Reload +--- +name: fun12 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: fp32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } + - { id: 4, class: fp32bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp32bit = COPY $f2s + %0:fp32bit = COPY $f0s + %4:fp32bit = COPY $f2s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr32bit = nofpexcept WFMSSB %0, %1, %4, implicit $fpc + VST32 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# CHECK-LABEL: fun13: +# CHECK: mseb %f0, %f1, 160(%r15) # 4-byte Folded Reload +--- +name: fun13 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: fp32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } + - { id: 4, class: fp32bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp32bit = COPY $f2s + %0:fp32bit = COPY $f0s + %4:fp32bit = COPY $f2s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr32bit = nofpexcept WFMSSB %1, %0, %4, implicit $fpc + VST32 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# MSEB can't be used if one operand is a VR32 (and not FP32). +# CHECK-LABEL: fun14: +# CHECK: wfmssb %f0, %v16, %f1, %f0 +--- +name: fun14 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: vr32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } + - { id: 4, class: fp32bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:vr32bit = COPY $f2s + %0:fp32bit = COPY $f0s + %4:fp32bit = COPY $f2s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr32bit = nofpexcept WFMSSB %1, %0, %4, implicit $fpc + VST32 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... + + +# MSEB can't be used unless accumulator and result registers are the same. +# CHECK-LABEL: fun15: +# CHECK: wfmssb %f0, %f0, %f1, %f2 +--- +name: fun15 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: fp32bit } + - { id: 2, class: addr64bit } + - { id: 3, class: vr32bit } + - { id: 4, class: fp32bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } + - { reg: '$f2s', virtual-reg: '%1' } + - { reg: '$r2d', virtual-reg: '%2' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d, $f2d, $r2d + + %2:addr64bit = COPY $r2d + %1:fp32bit = COPY $f2s + %0:fp32bit = COPY $f0s + %4:fp32bit = COPY $f2s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %3:vr32bit = nofpexcept WFMSSB %4, %1, %0, implicit $fpc + VST32 %3, %2, 0, $noreg :: (store 8 into %ir.Dst) + Return + +... Index: llvm/test/CodeGen/SystemZ/foldmemop-vec-unary.mir =================================================================== --- /dev/null +++ llvm/test/CodeGen/SystemZ/foldmemop-vec-unary.mir @@ -0,0 +1,215 @@ +# RUN: llc -mtriple=s390x-linux-gnu -mcpu=z14 -start-before=greedy %s -o - \ +# RUN: | FileCheck %s +# +# Test folding of a memory operand into an fp memory instruction. + +--- | + define double @fun0(float %arg0) { ret double 0.0 } + define double @fun1(float %arg0) { ret double 0.0 } + define double @fun2(float %arg0) { ret double 0.0 } + define double @fun3(double %arg0) { ret double 0.0 } + define double @fun4(double %arg0) { ret double 0.0 } + define float @fun5(float %arg0) { ret float 0.0 } + define float @fun6(float %arg0) { ret float 0.0 } + +... + + +# CHECK-LABEL: fun0: +# CHECK: ldeb %f0, 164(%r15) # 4-byte Folded Reload +--- +name: fun0 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: vr64bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s + + %0:fp32bit = COPY $f0s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f0d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %1:vr64bit = nofpexcept WLDEB %0, implicit $fpc + $f0d = COPY %1 + Return implicit $f0d + +... + + +# LDEB can't be used if dst operand is a VR32 (and not FP32). +# CHECK-LABEL: fun1: +# CHECK: lde %f0, 164(%r15) # 4-byte Folded Reload +# CHECK-NEXT: wldeb %v16, %f0 +--- +name: fun1 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: vr64bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s + + %0:fp32bit = COPY $f0s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f0d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %1:vr64bit = nofpexcept WLDEB %0, implicit $fpc + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f0d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + $f0d = COPY %1 + Return implicit $f0d + +... + + +# Spilling the destination of an fp extension needs an extra store instruction. +# CHECK-LABEL: fun2: +# CHECK: ldebr %f0, %f0 +# CHECK-NEXT: std %f0, 160(%r15) # 8-byte Folded Spill +--- +name: fun2 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: fp64bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s + + %0:fp32bit = COPY $f0s + %1:fp64bit = nofpexcept WLDEB %0, implicit $fpc + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f0d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + $f0d = COPY %1 + Return implicit $f0d + +... + + +# CHECK-LABEL: fun3: +# CHECK: sqdb %f0, 160(%r15) # 8-byte Folded Reload +--- +name: fun3 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: vr64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d + + %0:fp64bit = COPY $f0d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f0d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %1:vr64bit = nofpexcept WFSQDB %0, implicit $fpc + $f0d = COPY %1 + Return implicit $f0d + +... + + +# SQDB can't be used if dst operand is a VR64 (and not FP64). +# CHECK-LABEL: fun4: +# CHECK: ld %f0, 160(%r15) # 8-byte Folded Reload +# CHECK-NEXT: wfsqdb %v16, %f0 +--- +name: fun4 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp64bit } + - { id: 1, class: vr64bit } +liveins: + - { reg: '$f0d', virtual-reg: '%0' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0d + + %0:fp64bit = COPY $f0d + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f0d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %1:vr64bit = nofpexcept WFSQDB %0, implicit $fpc + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f0d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + $f0d = COPY %1 + Return implicit $f0d + +... + + +# CHECK-LABEL: fun5: +# CHECK: sqeb %f0, 164(%r15) # 4-byte Folded Reload +--- +name: fun5 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: vr32bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s + + %0:fp32bit = COPY $f0s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f0d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %1:vr32bit = nofpexcept WFSQSB %0, implicit $fpc + $f0s = COPY %1 + Return implicit $f0d + +... + + +# SQEB can't be used if dst operand is a VR32 (and not FP32). +# CHECK-LABEL: fun6: +# CHECK: lde %f0, 164(%r15) # 4-byte Folded Reload +# CHECK-NEXT: wfsqsb %v16, %f0 +--- +name: fun6 +alignment: 16 +tracksRegLiveness: true +registers: + - { id: 0, class: fp32bit } + - { id: 1, class: vr32bit } +liveins: + - { reg: '$f0s', virtual-reg: '%0' } +frameInfo: + maxAlignment: 1 +machineFunctionInfo: {} +body: | + bb.0: + liveins: $f0s + + %0:fp32bit = COPY $f0s + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f0d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + %1:vr32bit = nofpexcept WFSQSB %0, implicit $fpc + INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def dead early-clobber $f0d, 12, implicit-def dead early-clobber $f1d, 12, implicit-def dead early-clobber $f2d, 12, implicit-def dead early-clobber $f3d, 12, implicit-def dead early-clobber $f4d, 12, implicit-def dead early-clobber $f5d, 12, implicit-def dead early-clobber $f6d, 12, implicit-def dead early-clobber $f7d, 12, implicit-def dead early-clobber $f8d, 12, implicit-def dead early-clobber $f9d, 12, implicit-def dead early-clobber $f10d, 12, implicit-def dead early-clobber $f11d, 12, implicit-def dead early-clobber $f12d, 12, implicit-def dead early-clobber $f13d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f14d, 12, implicit-def dead early-clobber $f15d + $f0s = COPY %1 + Return implicit $f0s + +... Index: llvm/test/CodeGen/SystemZ/int-cmp-56.mir =================================================================== --- llvm/test/CodeGen/SystemZ/int-cmp-56.mir +++ llvm/test/CodeGen/SystemZ/int-cmp-56.mir @@ -18,7 +18,7 @@ # Test CGR -> CG # CHECK: name: fun1 # CHECK: CG %10, %stack.0, 0, $noreg, implicit-def $cc :: (load 8 from %stack.0) -# CHECK-NEXT: %12:gr64bit = LOCGHI %12, 8, 14, 12, implicit killed $cc +# CHECK-NEXT: %12:gr64bit = LOCGHI %12, 8, 14, 12, implicit $cc --- name: fun1 alignment: 16 @@ -95,7 +95,7 @@ # Test CLGR -> CLG # CHECK: name: fun2 # CHECK: CLG %10, %stack.0, 0, $noreg, implicit-def $cc :: (load 8 from %stack.0) -# CHECK-NEXT: %12:gr64bit = LOCGHI %12, 8, 14, 12, implicit killed $cc +# CHECK-NEXT: %12:gr64bit = LOCGHI %12, 8, 14, 12, implicit $cc --- name: fun2 alignment: 16 @@ -172,7 +172,7 @@ # Test CR -> C # CHECK: name: fun3 # CHECK: C %10, %stack.0, 0, $noreg, implicit-def $cc :: (load 4 from %stack.0) -# CHECK: %12:gr32bit = LOCHIMux %12, 8, 14, 12, implicit killed $cc +# CHECK: %12:gr32bit = LOCHIMux %12, 8, 14, 12, implicit $cc --- name: fun3 alignment: 16 @@ -249,7 +249,7 @@ # Test CLR -> CL # CHECK: name: fun4 # CHECK: CL %10, %stack.0, 0, $noreg, implicit-def $cc :: (load 4 from %stack.0) -# CHECK: %12:gr32bit = LOCHIMux %12, 8, 14, 12, implicit killed $cc +# CHECK: %12:gr32bit = LOCHIMux %12, 8, 14, 12, implicit $cc --- name: fun4 alignment: 16