diff --git a/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp b/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp --- a/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp +++ b/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp @@ -569,6 +569,18 @@ // register. std::advance(MBBI, getUnmanagedCSI(MF, CSI).size()); + if (MF.getFunction().hasFnAttribute("interrupt") && STI.hasStdExtF()) { + + BuildMI(MBB, MBBI, DL, TII->get(RISCV::CSRRS)) + .addReg(RISCV::X5, RegState::Define) + .addImm(RISCVSysReg::lookupSysRegByName("FCSR")->Encoding) + .addReg(RISCV::X0); + + TII->storeRegToStackSlot(MBB, MBBI, RISCV::X5, /* IsKill */ false, + RVFI->getFcsrFI(), &RISCV::GPRRegClass, RI, + Register()); + } + // Iterate over list of callee-saved registers and emit .cfi_offset // directives. for (const auto &Entry : CSI) { @@ -697,6 +709,7 @@ auto *RVFI = MF.getInfo(); Register FPReg = getFPReg(STI); Register SPReg = getSPReg(STI); + const RISCVInstrInfo *TII = STI.getInstrInfo(); // All calls are tail calls in GHC calling conv, and functions have no // prologue/epilogue. @@ -730,6 +743,18 @@ if (!CSI.empty()) LastFrameDestroy = std::prev(MBBI, CSI.size()); + if (MF.getFunction().hasFnAttribute("interrupt") && STI.hasStdExtF()) { + + TII->loadRegFromStackSlot(MBB, LastFrameDestroy, RISCV::X5, + RVFI->getFcsrFI(), &RISCV::GPRRegClass, RI, + Register()); + + BuildMI(MBB, LastFrameDestroy, DL, TII->get(RISCV::CSRRW)) + .addReg(RISCV::X0, RegState::Define) + .addImm(RISCVSysReg::lookupSysRegByName("FCSR")->Encoding) + .addReg(RISCV::X5); + } + uint64_t StackSize = getStackSizeWithRVVPadding(MF); uint64_t RealStackSize = StackSize + RVFI->getLibCallStackSize() + RVFI->getRVPushStackSize(); @@ -825,7 +850,10 @@ MaxCSFI = CSI[CSI.size() - 1].getFrameIdx(); } - if (FI >= MinCSFI && FI <= MaxCSFI) { + if ((FI >= MinCSFI && FI <= MaxCSFI) || + (MF.getFunction().hasFnAttribute("interrupt") && + MF.getSubtarget().hasStdExtF() && + FI == RVFI->getFcsrFI())) { FrameReg = RISCV::X2; if (FirstSPAdjustAmount) @@ -1011,6 +1039,14 @@ SavedRegs.set(Regs[i]); } } + if (MF.getFunction().hasFnAttribute("interrupt") && + MF.getSubtarget().hasStdExtF()) { + SavedRegs.set(RISCV::X5); + MF.getInfo()->setFcsrFI( + MF.getFrameInfo().CreateStackObject( + STI.getRegisterInfo()->getSpillSize(RISCV::GPRRegClass), + STI.getRegisterInfo()->getSpillAlign(RISCV::GPRRegClass), false)); + } } std::pair diff --git a/llvm/lib/Target/RISCV/RISCVMachineFunctionInfo.h b/llvm/lib/Target/RISCV/RISCVMachineFunctionInfo.h --- a/llvm/lib/Target/RISCV/RISCVMachineFunctionInfo.h +++ b/llvm/lib/Target/RISCV/RISCVMachineFunctionInfo.h @@ -76,6 +76,8 @@ unsigned RVPushRegs = 0; int RVPushRlist = llvm::RISCVZC::RLISTENCODE::INVALID_RLIST; + int FcsrFI = 0; + public: RISCVMachineFunctionInfo(const Function &F, const TargetSubtargetInfo *STI) {} @@ -149,6 +151,9 @@ bool isVectorCall() const { return IsVectorCall; } void setIsVectorCall() { IsVectorCall = true; } + + void setFcsrFI(int FI) { FcsrFI = FI;} + int getFcsrFI() const { return FcsrFI; } }; } // end namespace llvm diff --git a/llvm/test/CodeGen/RISCV/interrupt-attr-nocall.ll b/llvm/test/CodeGen/RISCV/interrupt-attr-nocall.ll --- a/llvm/test/CodeGen/RISCV/interrupt-attr-nocall.ll +++ b/llvm/test/CodeGen/RISCV/interrupt-attr-nocall.ll @@ -43,8 +43,11 @@ ; CHECK-RV32IF-LABEL: foo_i32: ; CHECK-RV32IF: # %bb.0: ; CHECK-RV32IF-NEXT: addi sp, sp, -16 -; CHECK-RV32IF-NEXT: sw a0, 12(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: sw a1, 8(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw t0, 12(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw a0, 8(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw a1, 4(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: frcsr t0 +; CHECK-RV32IF-NEXT: sw t0, 0(sp) ; CHECK-RV32IF-NEXT: lui a0, %hi(a) ; CHECK-RV32IF-NEXT: lw a0, %lo(a)(a0) ; CHECK-RV32IF-NEXT: lui a1, %hi(b) @@ -52,16 +55,22 @@ ; CHECK-RV32IF-NEXT: add a0, a1, a0 ; CHECK-RV32IF-NEXT: lui a1, %hi(c) ; CHECK-RV32IF-NEXT: sw a0, %lo(c)(a1) -; CHECK-RV32IF-NEXT: lw a0, 12(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: lw a1, 8(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw t0, 0(sp) +; CHECK-RV32IF-NEXT: fscsr t0 +; CHECK-RV32IF-NEXT: lw t0, 12(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw a0, 8(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw a1, 4(sp) # 4-byte Folded Reload ; CHECK-RV32IF-NEXT: addi sp, sp, 16 ; CHECK-RV32IF-NEXT: mret ; ; CHECK-RV32IFD-LABEL: foo_i32: ; CHECK-RV32IFD: # %bb.0: ; CHECK-RV32IFD-NEXT: addi sp, sp, -16 -; CHECK-RV32IFD-NEXT: sw a0, 12(sp) # 4-byte Folded Spill -; CHECK-RV32IFD-NEXT: sw a1, 8(sp) # 4-byte Folded Spill +; CHECK-RV32IFD-NEXT: sw t0, 12(sp) # 4-byte Folded Spill +; CHECK-RV32IFD-NEXT: sw a0, 8(sp) # 4-byte Folded Spill +; CHECK-RV32IFD-NEXT: sw a1, 4(sp) # 4-byte Folded Spill +; CHECK-RV32IFD-NEXT: frcsr t0 +; CHECK-RV32IFD-NEXT: sw t0, 0(sp) ; CHECK-RV32IFD-NEXT: lui a0, %hi(a) ; CHECK-RV32IFD-NEXT: lw a0, %lo(a)(a0) ; CHECK-RV32IFD-NEXT: lui a1, %hi(b) @@ -69,8 +78,11 @@ ; CHECK-RV32IFD-NEXT: add a0, a1, a0 ; CHECK-RV32IFD-NEXT: lui a1, %hi(c) ; CHECK-RV32IFD-NEXT: sw a0, %lo(c)(a1) -; CHECK-RV32IFD-NEXT: lw a0, 12(sp) # 4-byte Folded Reload -; CHECK-RV32IFD-NEXT: lw a1, 8(sp) # 4-byte Folded Reload +; CHECK-RV32IFD-NEXT: lw t0, 0(sp) +; CHECK-RV32IFD-NEXT: fscsr t0 +; CHECK-RV32IFD-NEXT: lw t0, 12(sp) # 4-byte Folded Reload +; CHECK-RV32IFD-NEXT: lw a0, 8(sp) # 4-byte Folded Reload +; CHECK-RV32IFD-NEXT: lw a1, 4(sp) # 4-byte Folded Reload ; CHECK-RV32IFD-NEXT: addi sp, sp, 16 ; CHECK-RV32IFD-NEXT: mret %1 = load i32, ptr @a @@ -109,12 +121,15 @@ ; ; CHECK-RV32IF-LABEL: foo_fp_i32: ; CHECK-RV32IF: # %bb.0: -; CHECK-RV32IF-NEXT: addi sp, sp, -16 -; CHECK-RV32IF-NEXT: sw ra, 12(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: sw s0, 8(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: sw a0, 4(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: sw a1, 0(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: addi s0, sp, 16 +; CHECK-RV32IF-NEXT: addi sp, sp, -32 +; CHECK-RV32IF-NEXT: sw ra, 28(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw t0, 24(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw s0, 20(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw a0, 16(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw a1, 12(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: frcsr t0 +; CHECK-RV32IF-NEXT: sw t0, 8(sp) +; CHECK-RV32IF-NEXT: addi s0, sp, 32 ; CHECK-RV32IF-NEXT: lui a0, %hi(a) ; CHECK-RV32IF-NEXT: lw a0, %lo(a)(a0) ; CHECK-RV32IF-NEXT: lui a1, %hi(b) @@ -122,21 +137,27 @@ ; CHECK-RV32IF-NEXT: add a0, a1, a0 ; CHECK-RV32IF-NEXT: lui a1, %hi(c) ; CHECK-RV32IF-NEXT: sw a0, %lo(c)(a1) -; CHECK-RV32IF-NEXT: lw ra, 12(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: lw s0, 8(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: lw a0, 4(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: lw a1, 0(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: addi sp, sp, 16 +; CHECK-RV32IF-NEXT: lw t0, 8(sp) +; CHECK-RV32IF-NEXT: fscsr t0 +; CHECK-RV32IF-NEXT: lw ra, 28(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw t0, 24(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw s0, 20(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw a0, 16(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw a1, 12(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: addi sp, sp, 32 ; CHECK-RV32IF-NEXT: mret ; ; CHECK-RV32IFD-LABEL: foo_fp_i32: ; CHECK-RV32IFD: # %bb.0: -; CHECK-RV32IFD-NEXT: addi sp, sp, -16 -; CHECK-RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill -; CHECK-RV32IFD-NEXT: sw s0, 8(sp) # 4-byte Folded Spill -; CHECK-RV32IFD-NEXT: sw a0, 4(sp) # 4-byte Folded Spill -; CHECK-RV32IFD-NEXT: sw a1, 0(sp) # 4-byte Folded Spill -; CHECK-RV32IFD-NEXT: addi s0, sp, 16 +; CHECK-RV32IFD-NEXT: addi sp, sp, -32 +; CHECK-RV32IFD-NEXT: sw ra, 28(sp) # 4-byte Folded Spill +; CHECK-RV32IFD-NEXT: sw t0, 24(sp) # 4-byte Folded Spill +; CHECK-RV32IFD-NEXT: sw s0, 20(sp) # 4-byte Folded Spill +; CHECK-RV32IFD-NEXT: sw a0, 16(sp) # 4-byte Folded Spill +; CHECK-RV32IFD-NEXT: sw a1, 12(sp) # 4-byte Folded Spill +; CHECK-RV32IFD-NEXT: frcsr t0 +; CHECK-RV32IFD-NEXT: sw t0, 8(sp) +; CHECK-RV32IFD-NEXT: addi s0, sp, 32 ; CHECK-RV32IFD-NEXT: lui a0, %hi(a) ; CHECK-RV32IFD-NEXT: lw a0, %lo(a)(a0) ; CHECK-RV32IFD-NEXT: lui a1, %hi(b) @@ -144,11 +165,14 @@ ; CHECK-RV32IFD-NEXT: add a0, a1, a0 ; CHECK-RV32IFD-NEXT: lui a1, %hi(c) ; CHECK-RV32IFD-NEXT: sw a0, %lo(c)(a1) -; CHECK-RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload -; CHECK-RV32IFD-NEXT: lw s0, 8(sp) # 4-byte Folded Reload -; CHECK-RV32IFD-NEXT: lw a0, 4(sp) # 4-byte Folded Reload -; CHECK-RV32IFD-NEXT: lw a1, 0(sp) # 4-byte Folded Reload -; CHECK-RV32IFD-NEXT: addi sp, sp, 16 +; CHECK-RV32IFD-NEXT: lw t0, 8(sp) +; CHECK-RV32IFD-NEXT: fscsr t0 +; CHECK-RV32IFD-NEXT: lw ra, 28(sp) # 4-byte Folded Reload +; CHECK-RV32IFD-NEXT: lw t0, 24(sp) # 4-byte Folded Reload +; CHECK-RV32IFD-NEXT: lw s0, 20(sp) # 4-byte Folded Reload +; CHECK-RV32IFD-NEXT: lw a0, 16(sp) # 4-byte Folded Reload +; CHECK-RV32IFD-NEXT: lw a1, 12(sp) # 4-byte Folded Reload +; CHECK-RV32IFD-NEXT: addi sp, sp, 32 ; CHECK-RV32IFD-NEXT: mret %1 = load i32, ptr @a %2 = load i32, ptr @b @@ -209,10 +233,13 @@ ; ; CHECK-RV32IF-LABEL: foo_float: ; CHECK-RV32IF: # %bb.0: -; CHECK-RV32IF-NEXT: addi sp, sp, -16 -; CHECK-RV32IF-NEXT: sw a0, 12(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fa4, 8(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fa5, 4(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: addi sp, sp, -32 +; CHECK-RV32IF-NEXT: sw t0, 28(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw a0, 24(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fa4, 20(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fa5, 16(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: frcsr t0 +; CHECK-RV32IF-NEXT: sw t0, 12(sp) ; CHECK-RV32IF-NEXT: lui a0, %hi(e) ; CHECK-RV32IF-NEXT: flw fa5, %lo(e)(a0) ; CHECK-RV32IF-NEXT: lui a0, %hi(f) @@ -220,18 +247,24 @@ ; CHECK-RV32IF-NEXT: fadd.s fa5, fa5, fa4 ; CHECK-RV32IF-NEXT: lui a0, %hi(d) ; CHECK-RV32IF-NEXT: fsw fa5, %lo(d)(a0) -; CHECK-RV32IF-NEXT: lw a0, 12(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fa4, 8(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fa5, 4(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: addi sp, sp, 16 +; CHECK-RV32IF-NEXT: lw t0, 12(sp) +; CHECK-RV32IF-NEXT: fscsr t0 +; CHECK-RV32IF-NEXT: lw t0, 28(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw a0, 24(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fa4, 20(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fa5, 16(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: addi sp, sp, 32 ; CHECK-RV32IF-NEXT: mret ; ; CHECK-RV32IFD-LABEL: foo_float: ; CHECK-RV32IFD: # %bb.0: ; CHECK-RV32IFD-NEXT: addi sp, sp, -32 -; CHECK-RV32IFD-NEXT: sw a0, 28(sp) # 4-byte Folded Spill +; CHECK-RV32IFD-NEXT: sw t0, 28(sp) # 4-byte Folded Spill +; CHECK-RV32IFD-NEXT: sw a0, 24(sp) # 4-byte Folded Spill ; CHECK-RV32IFD-NEXT: fsd fa4, 16(sp) # 8-byte Folded Spill ; CHECK-RV32IFD-NEXT: fsd fa5, 8(sp) # 8-byte Folded Spill +; CHECK-RV32IFD-NEXT: frcsr t0 +; CHECK-RV32IFD-NEXT: sw t0, 4(sp) ; CHECK-RV32IFD-NEXT: lui a0, %hi(e) ; CHECK-RV32IFD-NEXT: flw fa5, %lo(e)(a0) ; CHECK-RV32IFD-NEXT: lui a0, %hi(f) @@ -239,7 +272,10 @@ ; CHECK-RV32IFD-NEXT: fadd.s fa5, fa5, fa4 ; CHECK-RV32IFD-NEXT: lui a0, %hi(d) ; CHECK-RV32IFD-NEXT: fsw fa5, %lo(d)(a0) -; CHECK-RV32IFD-NEXT: lw a0, 28(sp) # 4-byte Folded Reload +; CHECK-RV32IFD-NEXT: lw t0, 4(sp) +; CHECK-RV32IFD-NEXT: fscsr t0 +; CHECK-RV32IFD-NEXT: lw t0, 28(sp) # 4-byte Folded Reload +; CHECK-RV32IFD-NEXT: lw a0, 24(sp) # 4-byte Folded Reload ; CHECK-RV32IFD-NEXT: fld fa4, 16(sp) # 8-byte Folded Reload ; CHECK-RV32IFD-NEXT: fld fa5, 8(sp) # 8-byte Folded Reload ; CHECK-RV32IFD-NEXT: addi sp, sp, 32 @@ -307,10 +343,13 @@ ; CHECK-RV32IF: # %bb.0: ; CHECK-RV32IF-NEXT: addi sp, sp, -32 ; CHECK-RV32IF-NEXT: sw ra, 28(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: sw s0, 24(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: sw a0, 20(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fa4, 16(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fa5, 12(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw t0, 24(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw s0, 20(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw a0, 16(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fa4, 12(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fa5, 8(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: frcsr t0 +; CHECK-RV32IF-NEXT: sw t0, 4(sp) ; CHECK-RV32IF-NEXT: addi s0, sp, 32 ; CHECK-RV32IF-NEXT: lui a0, %hi(e) ; CHECK-RV32IF-NEXT: flw fa5, %lo(e)(a0) @@ -319,23 +358,29 @@ ; CHECK-RV32IF-NEXT: fadd.s fa5, fa5, fa4 ; CHECK-RV32IF-NEXT: lui a0, %hi(d) ; CHECK-RV32IF-NEXT: fsw fa5, %lo(d)(a0) +; CHECK-RV32IF-NEXT: lw t0, 4(sp) +; CHECK-RV32IF-NEXT: fscsr t0 ; CHECK-RV32IF-NEXT: lw ra, 28(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: lw s0, 24(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: lw a0, 20(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fa4, 16(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fa5, 12(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw t0, 24(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw s0, 20(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw a0, 16(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fa4, 12(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fa5, 8(sp) # 4-byte Folded Reload ; CHECK-RV32IF-NEXT: addi sp, sp, 32 ; CHECK-RV32IF-NEXT: mret ; ; CHECK-RV32IFD-LABEL: foo_fp_float: ; CHECK-RV32IFD: # %bb.0: -; CHECK-RV32IFD-NEXT: addi sp, sp, -32 -; CHECK-RV32IFD-NEXT: sw ra, 28(sp) # 4-byte Folded Spill -; CHECK-RV32IFD-NEXT: sw s0, 24(sp) # 4-byte Folded Spill -; CHECK-RV32IFD-NEXT: sw a0, 20(sp) # 4-byte Folded Spill -; CHECK-RV32IFD-NEXT: fsd fa4, 8(sp) # 8-byte Folded Spill -; CHECK-RV32IFD-NEXT: fsd fa5, 0(sp) # 8-byte Folded Spill -; CHECK-RV32IFD-NEXT: addi s0, sp, 32 +; CHECK-RV32IFD-NEXT: addi sp, sp, -48 +; CHECK-RV32IFD-NEXT: sw ra, 44(sp) # 4-byte Folded Spill +; CHECK-RV32IFD-NEXT: sw t0, 40(sp) # 4-byte Folded Spill +; CHECK-RV32IFD-NEXT: sw s0, 36(sp) # 4-byte Folded Spill +; CHECK-RV32IFD-NEXT: sw a0, 32(sp) # 4-byte Folded Spill +; CHECK-RV32IFD-NEXT: fsd fa4, 24(sp) # 8-byte Folded Spill +; CHECK-RV32IFD-NEXT: fsd fa5, 16(sp) # 8-byte Folded Spill +; CHECK-RV32IFD-NEXT: frcsr t0 +; CHECK-RV32IFD-NEXT: sw t0, 12(sp) +; CHECK-RV32IFD-NEXT: addi s0, sp, 48 ; CHECK-RV32IFD-NEXT: lui a0, %hi(e) ; CHECK-RV32IFD-NEXT: flw fa5, %lo(e)(a0) ; CHECK-RV32IFD-NEXT: lui a0, %hi(f) @@ -343,12 +388,15 @@ ; CHECK-RV32IFD-NEXT: fadd.s fa5, fa5, fa4 ; CHECK-RV32IFD-NEXT: lui a0, %hi(d) ; CHECK-RV32IFD-NEXT: fsw fa5, %lo(d)(a0) -; CHECK-RV32IFD-NEXT: lw ra, 28(sp) # 4-byte Folded Reload -; CHECK-RV32IFD-NEXT: lw s0, 24(sp) # 4-byte Folded Reload -; CHECK-RV32IFD-NEXT: lw a0, 20(sp) # 4-byte Folded Reload -; CHECK-RV32IFD-NEXT: fld fa4, 8(sp) # 8-byte Folded Reload -; CHECK-RV32IFD-NEXT: fld fa5, 0(sp) # 8-byte Folded Reload -; CHECK-RV32IFD-NEXT: addi sp, sp, 32 +; CHECK-RV32IFD-NEXT: lw t0, 12(sp) +; CHECK-RV32IFD-NEXT: fscsr t0 +; CHECK-RV32IFD-NEXT: lw ra, 44(sp) # 4-byte Folded Reload +; CHECK-RV32IFD-NEXT: lw t0, 40(sp) # 4-byte Folded Reload +; CHECK-RV32IFD-NEXT: lw s0, 36(sp) # 4-byte Folded Reload +; CHECK-RV32IFD-NEXT: lw a0, 32(sp) # 4-byte Folded Reload +; CHECK-RV32IFD-NEXT: fld fa4, 24(sp) # 8-byte Folded Reload +; CHECK-RV32IFD-NEXT: fld fa5, 16(sp) # 8-byte Folded Reload +; CHECK-RV32IFD-NEXT: addi sp, sp, 48 ; CHECK-RV32IFD-NEXT: mret %1 = load float, ptr @e %2 = load float, ptr @f @@ -412,55 +460,57 @@ ; ; CHECK-RV32IF-LABEL: foo_double: ; CHECK-RV32IF: # %bb.0: -; CHECK-RV32IF-NEXT: addi sp, sp, -192 -; CHECK-RV32IF-NEXT: sw ra, 188(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: sw t0, 184(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: sw t1, 180(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: sw t2, 176(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: sw a0, 172(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: sw a1, 168(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: sw a2, 164(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: sw a3, 160(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: sw a4, 156(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: sw a5, 152(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: sw a6, 148(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: sw a7, 144(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: sw t3, 140(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: sw t4, 136(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: sw t5, 132(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: sw t6, 128(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw ft0, 124(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw ft1, 120(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw ft2, 116(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw ft3, 112(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw ft4, 108(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw ft5, 104(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw ft6, 100(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw ft7, 96(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fs0, 92(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fs1, 88(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fa0, 84(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fa1, 80(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fa2, 76(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fa3, 72(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fa4, 68(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fa5, 64(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fa6, 60(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fa7, 56(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fs2, 52(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fs3, 48(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fs4, 44(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fs5, 40(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fs6, 36(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fs7, 32(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fs8, 28(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fs9, 24(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fs10, 20(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw fs11, 16(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw ft8, 12(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw ft9, 8(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw ft10, 4(sp) # 4-byte Folded Spill -; CHECK-RV32IF-NEXT: fsw ft11, 0(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: addi sp, sp, -208 +; CHECK-RV32IF-NEXT: sw ra, 204(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw t0, 200(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw t1, 196(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw t2, 192(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw a0, 188(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw a1, 184(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw a2, 180(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw a3, 176(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw a4, 172(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw a5, 168(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw a6, 164(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw a7, 160(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw t3, 156(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw t4, 152(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw t5, 148(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: sw t6, 144(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw ft0, 140(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw ft1, 136(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw ft2, 132(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw ft3, 128(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw ft4, 124(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw ft5, 120(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw ft6, 116(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw ft7, 112(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fs0, 108(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fs1, 104(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fa0, 100(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fa1, 96(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fa2, 92(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fa3, 88(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fa4, 84(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fa5, 80(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fa6, 76(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fa7, 72(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fs2, 68(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fs3, 64(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fs4, 60(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fs5, 56(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fs6, 52(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fs7, 48(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fs8, 44(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fs9, 40(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fs10, 36(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw fs11, 32(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw ft8, 28(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw ft9, 24(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw ft10, 20(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: fsw ft11, 16(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: frcsr t0 +; CHECK-RV32IF-NEXT: sw t0, 12(sp) ; CHECK-RV32IF-NEXT: lui a1, %hi(h) ; CHECK-RV32IF-NEXT: lw a0, %lo(h)(a1) ; CHECK-RV32IF-NEXT: lw a1, %lo(h+4)(a1) @@ -471,63 +521,68 @@ ; CHECK-RV32IF-NEXT: lui a2, %hi(g) ; CHECK-RV32IF-NEXT: sw a1, %lo(g+4)(a2) ; CHECK-RV32IF-NEXT: sw a0, %lo(g)(a2) -; CHECK-RV32IF-NEXT: lw ra, 188(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: lw t0, 184(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: lw t1, 180(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: lw t2, 176(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: lw a0, 172(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: lw a1, 168(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: lw a2, 164(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: lw a3, 160(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: lw a4, 156(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: lw a5, 152(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: lw a6, 148(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: lw a7, 144(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: lw t3, 140(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: lw t4, 136(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: lw t5, 132(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: lw t6, 128(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw ft0, 124(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw ft1, 120(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw ft2, 116(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw ft3, 112(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw ft4, 108(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw ft5, 104(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw ft6, 100(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw ft7, 96(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fs0, 92(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fs1, 88(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fa0, 84(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fa1, 80(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fa2, 76(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fa3, 72(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fa4, 68(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fa5, 64(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fa6, 60(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fa7, 56(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fs2, 52(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fs3, 48(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fs4, 44(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fs5, 40(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fs6, 36(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fs7, 32(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fs8, 28(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fs9, 24(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fs10, 20(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw fs11, 16(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw ft8, 12(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw ft9, 8(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw ft10, 4(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: flw ft11, 0(sp) # 4-byte Folded Reload -; CHECK-RV32IF-NEXT: addi sp, sp, 192 +; CHECK-RV32IF-NEXT: lw t0, 12(sp) +; CHECK-RV32IF-NEXT: fscsr t0 +; CHECK-RV32IF-NEXT: lw ra, 204(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw t0, 200(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw t1, 196(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw t2, 192(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw a0, 188(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw a1, 184(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw a2, 180(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw a3, 176(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw a4, 172(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw a5, 168(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw a6, 164(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw a7, 160(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw t3, 156(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw t4, 152(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw t5, 148(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: lw t6, 144(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw ft0, 140(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw ft1, 136(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw ft2, 132(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw ft3, 128(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw ft4, 124(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw ft5, 120(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw ft6, 116(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw ft7, 112(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fs0, 108(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fs1, 104(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fa0, 100(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fa1, 96(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fa2, 92(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fa3, 88(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fa4, 84(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fa5, 80(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fa6, 76(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fa7, 72(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fs2, 68(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fs3, 64(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fs4, 60(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fs5, 56(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fs6, 52(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fs7, 48(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fs8, 44(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fs9, 40(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fs10, 36(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw fs11, 32(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw ft8, 28(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw ft9, 24(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw ft10, 20(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: flw ft11, 16(sp) # 4-byte Folded Reload +; CHECK-RV32IF-NEXT: addi sp, sp, 208 ; CHECK-RV32IF-NEXT: mret ; ; CHECK-RV32IFD-LABEL: foo_double: ; CHECK-RV32IFD: # %bb.0: ; CHECK-RV32IFD-NEXT: addi sp, sp, -32 -; CHECK-RV32IFD-NEXT: sw a0, 28(sp) # 4-byte Folded Spill +; CHECK-RV32IFD-NEXT: sw t0, 28(sp) # 4-byte Folded Spill +; CHECK-RV32IFD-NEXT: sw a0, 24(sp) # 4-byte Folded Spill ; CHECK-RV32IFD-NEXT: fsd fa4, 16(sp) # 8-byte Folded Spill ; CHECK-RV32IFD-NEXT: fsd fa5, 8(sp) # 8-byte Folded Spill +; CHECK-RV32IFD-NEXT: frcsr t0 +; CHECK-RV32IFD-NEXT: sw t0, 4(sp) ; CHECK-RV32IFD-NEXT: lui a0, %hi(h) ; CHECK-RV32IFD-NEXT: fld fa5, %lo(h)(a0) ; CHECK-RV32IFD-NEXT: lui a0, %hi(i) @@ -535,7 +590,10 @@ ; CHECK-RV32IFD-NEXT: fadd.d fa5, fa5, fa4 ; CHECK-RV32IFD-NEXT: lui a0, %hi(g) ; CHECK-RV32IFD-NEXT: fsd fa5, %lo(g)(a0) -; CHECK-RV32IFD-NEXT: lw a0, 28(sp) # 4-byte Folded Reload +; CHECK-RV32IFD-NEXT: lw t0, 4(sp) +; CHECK-RV32IFD-NEXT: fscsr t0 +; CHECK-RV32IFD-NEXT: lw t0, 28(sp) # 4-byte Folded Reload +; CHECK-RV32IFD-NEXT: lw a0, 24(sp) # 4-byte Folded Reload ; CHECK-RV32IFD-NEXT: fld fa4, 16(sp) # 8-byte Folded Reload ; CHECK-RV32IFD-NEXT: fld fa5, 8(sp) # 8-byte Folded Reload ; CHECK-RV32IFD-NEXT: addi sp, sp, 32 @@ -654,6 +712,8 @@ ; CHECK-RV32IF-NEXT: fsw ft9, 20(sp) # 4-byte Folded Spill ; CHECK-RV32IF-NEXT: fsw ft10, 16(sp) # 4-byte Folded Spill ; CHECK-RV32IF-NEXT: fsw ft11, 12(sp) # 4-byte Folded Spill +; CHECK-RV32IF-NEXT: frcsr t0 +; CHECK-RV32IF-NEXT: sw t0, 8(sp) ; CHECK-RV32IF-NEXT: addi s0, sp, 208 ; CHECK-RV32IF-NEXT: lui a1, %hi(h) ; CHECK-RV32IF-NEXT: lw a0, %lo(h)(a1) @@ -665,6 +725,8 @@ ; CHECK-RV32IF-NEXT: lui a2, %hi(g) ; CHECK-RV32IF-NEXT: sw a1, %lo(g+4)(a2) ; CHECK-RV32IF-NEXT: sw a0, %lo(g)(a2) +; CHECK-RV32IF-NEXT: lw t0, 8(sp) +; CHECK-RV32IF-NEXT: fscsr t0 ; CHECK-RV32IF-NEXT: lw ra, 204(sp) # 4-byte Folded Reload ; CHECK-RV32IF-NEXT: lw t0, 200(sp) # 4-byte Folded Reload ; CHECK-RV32IF-NEXT: lw t1, 196(sp) # 4-byte Folded Reload @@ -719,13 +781,16 @@ ; ; CHECK-RV32IFD-LABEL: foo_fp_double: ; CHECK-RV32IFD: # %bb.0: -; CHECK-RV32IFD-NEXT: addi sp, sp, -32 -; CHECK-RV32IFD-NEXT: sw ra, 28(sp) # 4-byte Folded Spill -; CHECK-RV32IFD-NEXT: sw s0, 24(sp) # 4-byte Folded Spill -; CHECK-RV32IFD-NEXT: sw a0, 20(sp) # 4-byte Folded Spill -; CHECK-RV32IFD-NEXT: fsd fa4, 8(sp) # 8-byte Folded Spill -; CHECK-RV32IFD-NEXT: fsd fa5, 0(sp) # 8-byte Folded Spill -; CHECK-RV32IFD-NEXT: addi s0, sp, 32 +; CHECK-RV32IFD-NEXT: addi sp, sp, -48 +; CHECK-RV32IFD-NEXT: sw ra, 44(sp) # 4-byte Folded Spill +; CHECK-RV32IFD-NEXT: sw t0, 40(sp) # 4-byte Folded Spill +; CHECK-RV32IFD-NEXT: sw s0, 36(sp) # 4-byte Folded Spill +; CHECK-RV32IFD-NEXT: sw a0, 32(sp) # 4-byte Folded Spill +; CHECK-RV32IFD-NEXT: fsd fa4, 24(sp) # 8-byte Folded Spill +; CHECK-RV32IFD-NEXT: fsd fa5, 16(sp) # 8-byte Folded Spill +; CHECK-RV32IFD-NEXT: frcsr t0 +; CHECK-RV32IFD-NEXT: sw t0, 12(sp) +; CHECK-RV32IFD-NEXT: addi s0, sp, 48 ; CHECK-RV32IFD-NEXT: lui a0, %hi(h) ; CHECK-RV32IFD-NEXT: fld fa5, %lo(h)(a0) ; CHECK-RV32IFD-NEXT: lui a0, %hi(i) @@ -733,12 +798,15 @@ ; CHECK-RV32IFD-NEXT: fadd.d fa5, fa5, fa4 ; CHECK-RV32IFD-NEXT: lui a0, %hi(g) ; CHECK-RV32IFD-NEXT: fsd fa5, %lo(g)(a0) -; CHECK-RV32IFD-NEXT: lw ra, 28(sp) # 4-byte Folded Reload -; CHECK-RV32IFD-NEXT: lw s0, 24(sp) # 4-byte Folded Reload -; CHECK-RV32IFD-NEXT: lw a0, 20(sp) # 4-byte Folded Reload -; CHECK-RV32IFD-NEXT: fld fa4, 8(sp) # 8-byte Folded Reload -; CHECK-RV32IFD-NEXT: fld fa5, 0(sp) # 8-byte Folded Reload -; CHECK-RV32IFD-NEXT: addi sp, sp, 32 +; CHECK-RV32IFD-NEXT: lw t0, 12(sp) +; CHECK-RV32IFD-NEXT: fscsr t0 +; CHECK-RV32IFD-NEXT: lw ra, 44(sp) # 4-byte Folded Reload +; CHECK-RV32IFD-NEXT: lw t0, 40(sp) # 4-byte Folded Reload +; CHECK-RV32IFD-NEXT: lw s0, 36(sp) # 4-byte Folded Reload +; CHECK-RV32IFD-NEXT: lw a0, 32(sp) # 4-byte Folded Reload +; CHECK-RV32IFD-NEXT: fld fa4, 24(sp) # 8-byte Folded Reload +; CHECK-RV32IFD-NEXT: fld fa5, 16(sp) # 8-byte Folded Reload +; CHECK-RV32IFD-NEXT: addi sp, sp, 48 ; CHECK-RV32IFD-NEXT: mret %1 = load double, ptr @h %2 = load double, ptr @i diff --git a/llvm/test/CodeGen/RISCV/interrupt-attr.ll b/llvm/test/CodeGen/RISCV/interrupt-attr.ll --- a/llvm/test/CodeGen/RISCV/interrupt-attr.ll +++ b/llvm/test/CodeGen/RISCV/interrupt-attr.ll @@ -2,16 +2,16 @@ ; RUN: llc -mtriple riscv32-unknown-elf -o - %s \ ; RUN: 2>&1 | FileCheck %s -check-prefix CHECK -check-prefix CHECK-RV32 ; RUN: llc -mtriple riscv32-unknown-elf -mattr=+f -o - %s \ -; RUN: 2>&1 | FileCheck %s -check-prefix CHECK -check-prefix CHECK-RV32-F +; RUN: 2>&1 | FileCheck %s -check-prefix CHECK-RV32-FLOAT -check-prefix CHECK-RV32-F ; RUN: llc -mtriple riscv32-unknown-elf -mattr=+f,+d -o - %s \ -; RUN: 2>&1 | FileCheck %s -check-prefix CHECK -check-prefix CHECK-RV32-FD +; RUN: 2>&1 | FileCheck %s -check-prefix CHECK-RV32-FLOAT -check-prefix CHECK-RV32-FD ; ; RUN: llc -mtriple riscv64-unknown-elf -o - %s \ ; RUN: 2>&1 | FileCheck %s -check-prefix CHECK -check-prefix CHECK-RV64 ; RUN: llc -mtriple riscv64-unknown-elf -mattr=+f -o - %s \ -; RUN: 2>&1 | FileCheck %s -check-prefix CHECK -check-prefix CHECK-RV64-F +; RUN: 2>&1 | FileCheck %s -check-prefix CHECK-RV64-FLOAT -check-prefix CHECK-RV64-F ; RUN: llc -mtriple riscv64-unknown-elf -mattr=+f,+d -o - %s \ -; RUN: 2>&1 | FileCheck %s -check-prefix CHECK -check-prefix CHECK-RV64-FD +; RUN: 2>&1 | FileCheck %s -check-prefix CHECK-RV64-FLOAT -check-prefix CHECK-RV64-FD ; ; Checking for special return instructions (sret, mret). @@ -20,6 +20,30 @@ ; CHECK-LABEL: foo_supervisor: ; CHECK: # %bb.0: ; CHECK-NEXT: sret +; +; CHECK-RV32-FLOAT-LABEL: foo_supervisor: +; CHECK-RV32-FLOAT: # %bb.0: +; CHECK-RV32-FLOAT-NEXT: addi sp, sp, -16 +; CHECK-RV32-FLOAT-NEXT: sw t0, 12(sp) # 4-byte Folded Spill +; CHECK-RV32-FLOAT-NEXT: frcsr t0 +; CHECK-RV32-FLOAT-NEXT: sw t0, 8(sp) +; CHECK-RV32-FLOAT-NEXT: lw t0, 8(sp) +; CHECK-RV32-FLOAT-NEXT: fscsr t0 +; CHECK-RV32-FLOAT-NEXT: lw t0, 12(sp) # 4-byte Folded Reload +; CHECK-RV32-FLOAT-NEXT: addi sp, sp, 16 +; CHECK-RV32-FLOAT-NEXT: sret +; +; CHECK-RV64-FLOAT-LABEL: foo_supervisor: +; CHECK-RV64-FLOAT: # %bb.0: +; CHECK-RV64-FLOAT-NEXT: addi sp, sp, -16 +; CHECK-RV64-FLOAT-NEXT: sd t0, 8(sp) # 8-byte Folded Spill +; CHECK-RV64-FLOAT-NEXT: frcsr t0 +; CHECK-RV64-FLOAT-NEXT: sd t0, 0(sp) +; CHECK-RV64-FLOAT-NEXT: ld t0, 0(sp) +; CHECK-RV64-FLOAT-NEXT: fscsr t0 +; CHECK-RV64-FLOAT-NEXT: ld t0, 8(sp) # 8-byte Folded Reload +; CHECK-RV64-FLOAT-NEXT: addi sp, sp, 16 +; CHECK-RV64-FLOAT-NEXT: sret ret void } @@ -27,6 +51,30 @@ ; CHECK-LABEL: foo_machine: ; CHECK: # %bb.0: ; CHECK-NEXT: mret +; +; CHECK-RV32-FLOAT-LABEL: foo_machine: +; CHECK-RV32-FLOAT: # %bb.0: +; CHECK-RV32-FLOAT-NEXT: addi sp, sp, -16 +; CHECK-RV32-FLOAT-NEXT: sw t0, 12(sp) # 4-byte Folded Spill +; CHECK-RV32-FLOAT-NEXT: frcsr t0 +; CHECK-RV32-FLOAT-NEXT: sw t0, 8(sp) +; CHECK-RV32-FLOAT-NEXT: lw t0, 8(sp) +; CHECK-RV32-FLOAT-NEXT: fscsr t0 +; CHECK-RV32-FLOAT-NEXT: lw t0, 12(sp) # 4-byte Folded Reload +; CHECK-RV32-FLOAT-NEXT: addi sp, sp, 16 +; CHECK-RV32-FLOAT-NEXT: mret +; +; CHECK-RV64-FLOAT-LABEL: foo_machine: +; CHECK-RV64-FLOAT: # %bb.0: +; CHECK-RV64-FLOAT-NEXT: addi sp, sp, -16 +; CHECK-RV64-FLOAT-NEXT: sd t0, 8(sp) # 8-byte Folded Spill +; CHECK-RV64-FLOAT-NEXT: frcsr t0 +; CHECK-RV64-FLOAT-NEXT: sd t0, 0(sp) +; CHECK-RV64-FLOAT-NEXT: ld t0, 0(sp) +; CHECK-RV64-FLOAT-NEXT: fscsr t0 +; CHECK-RV64-FLOAT-NEXT: ld t0, 8(sp) # 8-byte Folded Reload +; CHECK-RV64-FLOAT-NEXT: addi sp, sp, 16 +; CHECK-RV64-FLOAT-NEXT: mret ret void } @@ -85,208 +133,216 @@ ; ; CHECK-RV32-F-LABEL: foo_with_call: ; CHECK-RV32-F: # %bb.0: -; CHECK-RV32-F-NEXT: addi sp, sp, -192 -; CHECK-RV32-F-NEXT: sw ra, 188(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: sw t0, 184(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: sw t1, 180(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: sw t2, 176(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: sw a0, 172(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: sw a1, 168(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: sw a2, 164(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: sw a3, 160(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: sw a4, 156(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: sw a5, 152(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: sw a6, 148(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: sw a7, 144(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: sw t3, 140(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: sw t4, 136(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: sw t5, 132(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: sw t6, 128(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw ft0, 124(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw ft1, 120(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw ft2, 116(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw ft3, 112(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw ft4, 108(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw ft5, 104(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw ft6, 100(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw ft7, 96(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw fs0, 92(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw fs1, 88(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw fa0, 84(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw fa1, 80(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw fa2, 76(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw fa3, 72(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw fa4, 68(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw fa5, 64(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw fa6, 60(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw fa7, 56(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw fs2, 52(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw fs3, 48(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw fs4, 44(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw fs5, 40(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw fs6, 36(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw fs7, 32(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw fs8, 28(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw fs9, 24(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw fs10, 20(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw fs11, 16(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw ft8, 12(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw ft9, 8(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw ft10, 4(sp) # 4-byte Folded Spill -; CHECK-RV32-F-NEXT: fsw ft11, 0(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: addi sp, sp, -208 +; CHECK-RV32-F-NEXT: sw ra, 204(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: sw t0, 200(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: sw t1, 196(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: sw t2, 192(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: sw a0, 188(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: sw a1, 184(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: sw a2, 180(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: sw a3, 176(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: sw a4, 172(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: sw a5, 168(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: sw a6, 164(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: sw a7, 160(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: sw t3, 156(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: sw t4, 152(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: sw t5, 148(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: sw t6, 144(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw ft0, 140(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw ft1, 136(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw ft2, 132(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw ft3, 128(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw ft4, 124(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw ft5, 120(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw ft6, 116(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw ft7, 112(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw fs0, 108(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw fs1, 104(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw fa0, 100(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw fa1, 96(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw fa2, 92(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw fa3, 88(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw fa4, 84(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw fa5, 80(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw fa6, 76(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw fa7, 72(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw fs2, 68(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw fs3, 64(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw fs4, 60(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw fs5, 56(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw fs6, 52(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw fs7, 48(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw fs8, 44(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw fs9, 40(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw fs10, 36(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw fs11, 32(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw ft8, 28(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw ft9, 24(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw ft10, 20(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: fsw ft11, 16(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: frcsr t0 +; CHECK-RV32-F-NEXT: sw t0, 12(sp) ; CHECK-RV32-F-NEXT: call otherfoo@plt -; CHECK-RV32-F-NEXT: lw ra, 188(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: lw t0, 184(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: lw t1, 180(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: lw t2, 176(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: lw a0, 172(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: lw a1, 168(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: lw a2, 164(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: lw a3, 160(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: lw a4, 156(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: lw a5, 152(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: lw a6, 148(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: lw a7, 144(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: lw t3, 140(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: lw t4, 136(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: lw t5, 132(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: lw t6, 128(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw ft0, 124(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw ft1, 120(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw ft2, 116(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw ft3, 112(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw ft4, 108(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw ft5, 104(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw ft6, 100(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw ft7, 96(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw fs0, 92(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw fs1, 88(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw fa0, 84(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw fa1, 80(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw fa2, 76(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw fa3, 72(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw fa4, 68(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw fa5, 64(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw fa6, 60(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw fa7, 56(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw fs2, 52(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw fs3, 48(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw fs4, 44(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw fs5, 40(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw fs6, 36(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw fs7, 32(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw fs8, 28(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw fs9, 24(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw fs10, 20(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw fs11, 16(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw ft8, 12(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw ft9, 8(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw ft10, 4(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: flw ft11, 0(sp) # 4-byte Folded Reload -; CHECK-RV32-F-NEXT: addi sp, sp, 192 +; CHECK-RV32-F-NEXT: lw t0, 12(sp) +; CHECK-RV32-F-NEXT: fscsr t0 +; CHECK-RV32-F-NEXT: lw ra, 204(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: lw t0, 200(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: lw t1, 196(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: lw t2, 192(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: lw a0, 188(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: lw a1, 184(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: lw a2, 180(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: lw a3, 176(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: lw a4, 172(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: lw a5, 168(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: lw a6, 164(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: lw a7, 160(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: lw t3, 156(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: lw t4, 152(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: lw t5, 148(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: lw t6, 144(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw ft0, 140(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw ft1, 136(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw ft2, 132(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw ft3, 128(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw ft4, 124(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw ft5, 120(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw ft6, 116(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw ft7, 112(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw fs0, 108(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw fs1, 104(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw fa0, 100(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw fa1, 96(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw fa2, 92(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw fa3, 88(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw fa4, 84(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw fa5, 80(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw fa6, 76(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw fa7, 72(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw fs2, 68(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw fs3, 64(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw fs4, 60(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw fs5, 56(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw fs6, 52(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw fs7, 48(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw fs8, 44(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw fs9, 40(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw fs10, 36(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw fs11, 32(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw ft8, 28(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw ft9, 24(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw ft10, 20(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: flw ft11, 16(sp) # 4-byte Folded Reload +; CHECK-RV32-F-NEXT: addi sp, sp, 208 ; CHECK-RV32-F-NEXT: mret ; ; CHECK-RV32-FD-LABEL: foo_with_call: ; CHECK-RV32-FD: # %bb.0: -; CHECK-RV32-FD-NEXT: addi sp, sp, -320 -; CHECK-RV32-FD-NEXT: sw ra, 316(sp) # 4-byte Folded Spill -; CHECK-RV32-FD-NEXT: sw t0, 312(sp) # 4-byte Folded Spill -; CHECK-RV32-FD-NEXT: sw t1, 308(sp) # 4-byte Folded Spill -; CHECK-RV32-FD-NEXT: sw t2, 304(sp) # 4-byte Folded Spill -; CHECK-RV32-FD-NEXT: sw a0, 300(sp) # 4-byte Folded Spill -; CHECK-RV32-FD-NEXT: sw a1, 296(sp) # 4-byte Folded Spill -; CHECK-RV32-FD-NEXT: sw a2, 292(sp) # 4-byte Folded Spill -; CHECK-RV32-FD-NEXT: sw a3, 288(sp) # 4-byte Folded Spill -; CHECK-RV32-FD-NEXT: sw a4, 284(sp) # 4-byte Folded Spill -; CHECK-RV32-FD-NEXT: sw a5, 280(sp) # 4-byte Folded Spill -; CHECK-RV32-FD-NEXT: sw a6, 276(sp) # 4-byte Folded Spill -; CHECK-RV32-FD-NEXT: sw a7, 272(sp) # 4-byte Folded Spill -; CHECK-RV32-FD-NEXT: sw t3, 268(sp) # 4-byte Folded Spill -; CHECK-RV32-FD-NEXT: sw t4, 264(sp) # 4-byte Folded Spill -; CHECK-RV32-FD-NEXT: sw t5, 260(sp) # 4-byte Folded Spill -; CHECK-RV32-FD-NEXT: sw t6, 256(sp) # 4-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd ft0, 248(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd ft1, 240(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd ft2, 232(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd ft3, 224(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd ft4, 216(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd ft5, 208(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd ft6, 200(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd ft7, 192(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd fs0, 184(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd fs1, 176(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd fa0, 168(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd fa1, 160(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd fa2, 152(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd fa3, 144(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd fa4, 136(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd fa5, 128(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd fa6, 120(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd fa7, 112(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd fs2, 104(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd fs3, 96(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd fs4, 88(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd fs5, 80(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd fs6, 72(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd fs7, 64(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd fs8, 56(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd fs9, 48(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd fs10, 40(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd fs11, 32(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd ft8, 24(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd ft9, 16(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd ft10, 8(sp) # 8-byte Folded Spill -; CHECK-RV32-FD-NEXT: fsd ft11, 0(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: addi sp, sp, -336 +; CHECK-RV32-FD-NEXT: sw ra, 332(sp) # 4-byte Folded Spill +; CHECK-RV32-FD-NEXT: sw t0, 328(sp) # 4-byte Folded Spill +; CHECK-RV32-FD-NEXT: sw t1, 324(sp) # 4-byte Folded Spill +; CHECK-RV32-FD-NEXT: sw t2, 320(sp) # 4-byte Folded Spill +; CHECK-RV32-FD-NEXT: sw a0, 316(sp) # 4-byte Folded Spill +; CHECK-RV32-FD-NEXT: sw a1, 312(sp) # 4-byte Folded Spill +; CHECK-RV32-FD-NEXT: sw a2, 308(sp) # 4-byte Folded Spill +; CHECK-RV32-FD-NEXT: sw a3, 304(sp) # 4-byte Folded Spill +; CHECK-RV32-FD-NEXT: sw a4, 300(sp) # 4-byte Folded Spill +; CHECK-RV32-FD-NEXT: sw a5, 296(sp) # 4-byte Folded Spill +; CHECK-RV32-FD-NEXT: sw a6, 292(sp) # 4-byte Folded Spill +; CHECK-RV32-FD-NEXT: sw a7, 288(sp) # 4-byte Folded Spill +; CHECK-RV32-FD-NEXT: sw t3, 284(sp) # 4-byte Folded Spill +; CHECK-RV32-FD-NEXT: sw t4, 280(sp) # 4-byte Folded Spill +; CHECK-RV32-FD-NEXT: sw t5, 276(sp) # 4-byte Folded Spill +; CHECK-RV32-FD-NEXT: sw t6, 272(sp) # 4-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd ft0, 264(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd ft1, 256(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd ft2, 248(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd ft3, 240(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd ft4, 232(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd ft5, 224(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd ft6, 216(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd ft7, 208(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd fs0, 200(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd fs1, 192(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd fa0, 184(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd fa1, 176(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd fa2, 168(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd fa3, 160(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd fa4, 152(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd fa5, 144(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd fa6, 136(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd fa7, 128(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd fs2, 120(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd fs3, 112(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd fs4, 104(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd fs5, 96(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd fs6, 88(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd fs7, 80(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd fs8, 72(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd fs9, 64(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd fs10, 56(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd fs11, 48(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd ft8, 40(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd ft9, 32(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd ft10, 24(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: fsd ft11, 16(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: frcsr t0 +; CHECK-RV32-FD-NEXT: sw t0, 12(sp) ; CHECK-RV32-FD-NEXT: call otherfoo@plt -; CHECK-RV32-FD-NEXT: lw ra, 316(sp) # 4-byte Folded Reload -; CHECK-RV32-FD-NEXT: lw t0, 312(sp) # 4-byte Folded Reload -; CHECK-RV32-FD-NEXT: lw t1, 308(sp) # 4-byte Folded Reload -; CHECK-RV32-FD-NEXT: lw t2, 304(sp) # 4-byte Folded Reload -; CHECK-RV32-FD-NEXT: lw a0, 300(sp) # 4-byte Folded Reload -; CHECK-RV32-FD-NEXT: lw a1, 296(sp) # 4-byte Folded Reload -; CHECK-RV32-FD-NEXT: lw a2, 292(sp) # 4-byte Folded Reload -; CHECK-RV32-FD-NEXT: lw a3, 288(sp) # 4-byte Folded Reload -; CHECK-RV32-FD-NEXT: lw a4, 284(sp) # 4-byte Folded Reload -; CHECK-RV32-FD-NEXT: lw a5, 280(sp) # 4-byte Folded Reload -; CHECK-RV32-FD-NEXT: lw a6, 276(sp) # 4-byte Folded Reload -; CHECK-RV32-FD-NEXT: lw a7, 272(sp) # 4-byte Folded Reload -; CHECK-RV32-FD-NEXT: lw t3, 268(sp) # 4-byte Folded Reload -; CHECK-RV32-FD-NEXT: lw t4, 264(sp) # 4-byte Folded Reload -; CHECK-RV32-FD-NEXT: lw t5, 260(sp) # 4-byte Folded Reload -; CHECK-RV32-FD-NEXT: lw t6, 256(sp) # 4-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld ft0, 248(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld ft1, 240(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld ft2, 232(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld ft3, 224(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld ft4, 216(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld ft5, 208(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld ft6, 200(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld ft7, 192(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld fs0, 184(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld fs1, 176(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld fa0, 168(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld fa1, 160(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld fa2, 152(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld fa3, 144(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld fa4, 136(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld fa5, 128(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld fa6, 120(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld fa7, 112(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld fs2, 104(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld fs3, 96(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld fs4, 88(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld fs5, 80(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld fs6, 72(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld fs7, 64(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld fs8, 56(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld fs9, 48(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld fs10, 40(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld fs11, 32(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld ft8, 24(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld ft9, 16(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld ft10, 8(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: fld ft11, 0(sp) # 8-byte Folded Reload -; CHECK-RV32-FD-NEXT: addi sp, sp, 320 +; CHECK-RV32-FD-NEXT: lw t0, 12(sp) +; CHECK-RV32-FD-NEXT: fscsr t0 +; CHECK-RV32-FD-NEXT: lw ra, 332(sp) # 4-byte Folded Reload +; CHECK-RV32-FD-NEXT: lw t0, 328(sp) # 4-byte Folded Reload +; CHECK-RV32-FD-NEXT: lw t1, 324(sp) # 4-byte Folded Reload +; CHECK-RV32-FD-NEXT: lw t2, 320(sp) # 4-byte Folded Reload +; CHECK-RV32-FD-NEXT: lw a0, 316(sp) # 4-byte Folded Reload +; CHECK-RV32-FD-NEXT: lw a1, 312(sp) # 4-byte Folded Reload +; CHECK-RV32-FD-NEXT: lw a2, 308(sp) # 4-byte Folded Reload +; CHECK-RV32-FD-NEXT: lw a3, 304(sp) # 4-byte Folded Reload +; CHECK-RV32-FD-NEXT: lw a4, 300(sp) # 4-byte Folded Reload +; CHECK-RV32-FD-NEXT: lw a5, 296(sp) # 4-byte Folded Reload +; CHECK-RV32-FD-NEXT: lw a6, 292(sp) # 4-byte Folded Reload +; CHECK-RV32-FD-NEXT: lw a7, 288(sp) # 4-byte Folded Reload +; CHECK-RV32-FD-NEXT: lw t3, 284(sp) # 4-byte Folded Reload +; CHECK-RV32-FD-NEXT: lw t4, 280(sp) # 4-byte Folded Reload +; CHECK-RV32-FD-NEXT: lw t5, 276(sp) # 4-byte Folded Reload +; CHECK-RV32-FD-NEXT: lw t6, 272(sp) # 4-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld ft0, 264(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld ft1, 256(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld ft2, 248(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld ft3, 240(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld ft4, 232(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld ft5, 224(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld ft6, 216(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld ft7, 208(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld fs0, 200(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld fs1, 192(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld fa0, 184(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld fa1, 176(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld fa2, 168(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld fa3, 160(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld fa4, 152(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld fa5, 144(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld fa6, 136(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld fa7, 128(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld fs2, 120(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld fs3, 112(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld fs4, 104(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld fs5, 96(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld fs6, 88(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld fs7, 80(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld fs8, 72(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld fs9, 64(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld fs10, 56(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld fs11, 48(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld ft8, 40(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld ft9, 32(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld ft10, 24(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: fld ft11, 16(sp) # 8-byte Folded Reload +; CHECK-RV32-FD-NEXT: addi sp, sp, 336 ; CHECK-RV32-FD-NEXT: mret ; ; CHECK-RV64-LABEL: foo_with_call: @@ -330,208 +386,216 @@ ; ; CHECK-RV64-F-LABEL: foo_with_call: ; CHECK-RV64-F: # %bb.0: -; CHECK-RV64-F-NEXT: addi sp, sp, -256 -; CHECK-RV64-F-NEXT: sd ra, 248(sp) # 8-byte Folded Spill -; CHECK-RV64-F-NEXT: sd t0, 240(sp) # 8-byte Folded Spill -; CHECK-RV64-F-NEXT: sd t1, 232(sp) # 8-byte Folded Spill -; CHECK-RV64-F-NEXT: sd t2, 224(sp) # 8-byte Folded Spill -; CHECK-RV64-F-NEXT: sd a0, 216(sp) # 8-byte Folded Spill -; CHECK-RV64-F-NEXT: sd a1, 208(sp) # 8-byte Folded Spill -; CHECK-RV64-F-NEXT: sd a2, 200(sp) # 8-byte Folded Spill -; CHECK-RV64-F-NEXT: sd a3, 192(sp) # 8-byte Folded Spill -; CHECK-RV64-F-NEXT: sd a4, 184(sp) # 8-byte Folded Spill -; CHECK-RV64-F-NEXT: sd a5, 176(sp) # 8-byte Folded Spill -; CHECK-RV64-F-NEXT: sd a6, 168(sp) # 8-byte Folded Spill -; CHECK-RV64-F-NEXT: sd a7, 160(sp) # 8-byte Folded Spill -; CHECK-RV64-F-NEXT: sd t3, 152(sp) # 8-byte Folded Spill -; CHECK-RV64-F-NEXT: sd t4, 144(sp) # 8-byte Folded Spill -; CHECK-RV64-F-NEXT: sd t5, 136(sp) # 8-byte Folded Spill -; CHECK-RV64-F-NEXT: sd t6, 128(sp) # 8-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw ft0, 124(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw ft1, 120(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw ft2, 116(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw ft3, 112(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw ft4, 108(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw ft5, 104(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw ft6, 100(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw ft7, 96(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw fs0, 92(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw fs1, 88(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw fa0, 84(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw fa1, 80(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw fa2, 76(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw fa3, 72(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw fa4, 68(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw fa5, 64(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw fa6, 60(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw fa7, 56(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw fs2, 52(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw fs3, 48(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw fs4, 44(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw fs5, 40(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw fs6, 36(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw fs7, 32(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw fs8, 28(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw fs9, 24(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw fs10, 20(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw fs11, 16(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw ft8, 12(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw ft9, 8(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw ft10, 4(sp) # 4-byte Folded Spill -; CHECK-RV64-F-NEXT: fsw ft11, 0(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: addi sp, sp, -272 +; CHECK-RV64-F-NEXT: sd ra, 264(sp) # 8-byte Folded Spill +; CHECK-RV64-F-NEXT: sd t0, 256(sp) # 8-byte Folded Spill +; CHECK-RV64-F-NEXT: sd t1, 248(sp) # 8-byte Folded Spill +; CHECK-RV64-F-NEXT: sd t2, 240(sp) # 8-byte Folded Spill +; CHECK-RV64-F-NEXT: sd a0, 232(sp) # 8-byte Folded Spill +; CHECK-RV64-F-NEXT: sd a1, 224(sp) # 8-byte Folded Spill +; CHECK-RV64-F-NEXT: sd a2, 216(sp) # 8-byte Folded Spill +; CHECK-RV64-F-NEXT: sd a3, 208(sp) # 8-byte Folded Spill +; CHECK-RV64-F-NEXT: sd a4, 200(sp) # 8-byte Folded Spill +; CHECK-RV64-F-NEXT: sd a5, 192(sp) # 8-byte Folded Spill +; CHECK-RV64-F-NEXT: sd a6, 184(sp) # 8-byte Folded Spill +; CHECK-RV64-F-NEXT: sd a7, 176(sp) # 8-byte Folded Spill +; CHECK-RV64-F-NEXT: sd t3, 168(sp) # 8-byte Folded Spill +; CHECK-RV64-F-NEXT: sd t4, 160(sp) # 8-byte Folded Spill +; CHECK-RV64-F-NEXT: sd t5, 152(sp) # 8-byte Folded Spill +; CHECK-RV64-F-NEXT: sd t6, 144(sp) # 8-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw ft0, 140(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw ft1, 136(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw ft2, 132(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw ft3, 128(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw ft4, 124(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw ft5, 120(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw ft6, 116(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw ft7, 112(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw fs0, 108(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw fs1, 104(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw fa0, 100(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw fa1, 96(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw fa2, 92(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw fa3, 88(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw fa4, 84(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw fa5, 80(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw fa6, 76(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw fa7, 72(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw fs2, 68(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw fs3, 64(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw fs4, 60(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw fs5, 56(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw fs6, 52(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw fs7, 48(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw fs8, 44(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw fs9, 40(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw fs10, 36(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw fs11, 32(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw ft8, 28(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw ft9, 24(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw ft10, 20(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: fsw ft11, 16(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: frcsr t0 +; CHECK-RV64-F-NEXT: sd t0, 8(sp) ; CHECK-RV64-F-NEXT: call otherfoo@plt -; CHECK-RV64-F-NEXT: ld ra, 248(sp) # 8-byte Folded Reload -; CHECK-RV64-F-NEXT: ld t0, 240(sp) # 8-byte Folded Reload -; CHECK-RV64-F-NEXT: ld t1, 232(sp) # 8-byte Folded Reload -; CHECK-RV64-F-NEXT: ld t2, 224(sp) # 8-byte Folded Reload -; CHECK-RV64-F-NEXT: ld a0, 216(sp) # 8-byte Folded Reload -; CHECK-RV64-F-NEXT: ld a1, 208(sp) # 8-byte Folded Reload -; CHECK-RV64-F-NEXT: ld a2, 200(sp) # 8-byte Folded Reload -; CHECK-RV64-F-NEXT: ld a3, 192(sp) # 8-byte Folded Reload -; CHECK-RV64-F-NEXT: ld a4, 184(sp) # 8-byte Folded Reload -; CHECK-RV64-F-NEXT: ld a5, 176(sp) # 8-byte Folded Reload -; CHECK-RV64-F-NEXT: ld a6, 168(sp) # 8-byte Folded Reload -; CHECK-RV64-F-NEXT: ld a7, 160(sp) # 8-byte Folded Reload -; CHECK-RV64-F-NEXT: ld t3, 152(sp) # 8-byte Folded Reload -; CHECK-RV64-F-NEXT: ld t4, 144(sp) # 8-byte Folded Reload -; CHECK-RV64-F-NEXT: ld t5, 136(sp) # 8-byte Folded Reload -; CHECK-RV64-F-NEXT: ld t6, 128(sp) # 8-byte Folded Reload -; CHECK-RV64-F-NEXT: flw ft0, 124(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw ft1, 120(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw ft2, 116(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw ft3, 112(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw ft4, 108(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw ft5, 104(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw ft6, 100(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw ft7, 96(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw fs0, 92(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw fs1, 88(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw fa0, 84(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw fa1, 80(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw fa2, 76(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw fa3, 72(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw fa4, 68(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw fa5, 64(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw fa6, 60(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw fa7, 56(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw fs2, 52(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw fs3, 48(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw fs4, 44(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw fs5, 40(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw fs6, 36(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw fs7, 32(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw fs8, 28(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw fs9, 24(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw fs10, 20(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw fs11, 16(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw ft8, 12(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw ft9, 8(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw ft10, 4(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: flw ft11, 0(sp) # 4-byte Folded Reload -; CHECK-RV64-F-NEXT: addi sp, sp, 256 +; CHECK-RV64-F-NEXT: ld t0, 8(sp) +; CHECK-RV64-F-NEXT: fscsr t0 +; CHECK-RV64-F-NEXT: ld ra, 264(sp) # 8-byte Folded Reload +; CHECK-RV64-F-NEXT: ld t0, 256(sp) # 8-byte Folded Reload +; CHECK-RV64-F-NEXT: ld t1, 248(sp) # 8-byte Folded Reload +; CHECK-RV64-F-NEXT: ld t2, 240(sp) # 8-byte Folded Reload +; CHECK-RV64-F-NEXT: ld a0, 232(sp) # 8-byte Folded Reload +; CHECK-RV64-F-NEXT: ld a1, 224(sp) # 8-byte Folded Reload +; CHECK-RV64-F-NEXT: ld a2, 216(sp) # 8-byte Folded Reload +; CHECK-RV64-F-NEXT: ld a3, 208(sp) # 8-byte Folded Reload +; CHECK-RV64-F-NEXT: ld a4, 200(sp) # 8-byte Folded Reload +; CHECK-RV64-F-NEXT: ld a5, 192(sp) # 8-byte Folded Reload +; CHECK-RV64-F-NEXT: ld a6, 184(sp) # 8-byte Folded Reload +; CHECK-RV64-F-NEXT: ld a7, 176(sp) # 8-byte Folded Reload +; CHECK-RV64-F-NEXT: ld t3, 168(sp) # 8-byte Folded Reload +; CHECK-RV64-F-NEXT: ld t4, 160(sp) # 8-byte Folded Reload +; CHECK-RV64-F-NEXT: ld t5, 152(sp) # 8-byte Folded Reload +; CHECK-RV64-F-NEXT: ld t6, 144(sp) # 8-byte Folded Reload +; CHECK-RV64-F-NEXT: flw ft0, 140(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw ft1, 136(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw ft2, 132(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw ft3, 128(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw ft4, 124(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw ft5, 120(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw ft6, 116(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw ft7, 112(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw fs0, 108(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw fs1, 104(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw fa0, 100(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw fa1, 96(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw fa2, 92(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw fa3, 88(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw fa4, 84(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw fa5, 80(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw fa6, 76(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw fa7, 72(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw fs2, 68(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw fs3, 64(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw fs4, 60(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw fs5, 56(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw fs6, 52(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw fs7, 48(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw fs8, 44(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw fs9, 40(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw fs10, 36(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw fs11, 32(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw ft8, 28(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw ft9, 24(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw ft10, 20(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: flw ft11, 16(sp) # 4-byte Folded Reload +; CHECK-RV64-F-NEXT: addi sp, sp, 272 ; CHECK-RV64-F-NEXT: mret ; ; CHECK-RV64-FD-LABEL: foo_with_call: ; CHECK-RV64-FD: # %bb.0: -; CHECK-RV64-FD-NEXT: addi sp, sp, -384 -; CHECK-RV64-FD-NEXT: sd ra, 376(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: sd t0, 368(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: sd t1, 360(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: sd t2, 352(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: sd a0, 344(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: sd a1, 336(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: sd a2, 328(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: sd a3, 320(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: sd a4, 312(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: sd a5, 304(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: sd a6, 296(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: sd a7, 288(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: sd t3, 280(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: sd t4, 272(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: sd t5, 264(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: sd t6, 256(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd ft0, 248(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd ft1, 240(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd ft2, 232(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd ft3, 224(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd ft4, 216(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd ft5, 208(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd ft6, 200(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd ft7, 192(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd fs0, 184(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd fs1, 176(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd fa0, 168(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd fa1, 160(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd fa2, 152(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd fa3, 144(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd fa4, 136(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd fa5, 128(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd fa6, 120(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd fa7, 112(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd fs2, 104(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd fs3, 96(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd fs4, 88(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd fs5, 80(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd fs6, 72(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd fs7, 64(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd fs8, 56(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd fs9, 48(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd fs10, 40(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd fs11, 32(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd ft8, 24(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd ft9, 16(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd ft10, 8(sp) # 8-byte Folded Spill -; CHECK-RV64-FD-NEXT: fsd ft11, 0(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: addi sp, sp, -400 +; CHECK-RV64-FD-NEXT: sd ra, 392(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: sd t0, 384(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: sd t1, 376(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: sd t2, 368(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: sd a0, 360(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: sd a1, 352(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: sd a2, 344(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: sd a3, 336(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: sd a4, 328(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: sd a5, 320(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: sd a6, 312(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: sd a7, 304(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: sd t3, 296(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: sd t4, 288(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: sd t5, 280(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: sd t6, 272(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd ft0, 264(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd ft1, 256(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd ft2, 248(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd ft3, 240(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd ft4, 232(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd ft5, 224(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd ft6, 216(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd ft7, 208(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd fs0, 200(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd fs1, 192(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd fa0, 184(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd fa1, 176(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd fa2, 168(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd fa3, 160(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd fa4, 152(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd fa5, 144(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd fa6, 136(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd fa7, 128(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd fs2, 120(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd fs3, 112(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd fs4, 104(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd fs5, 96(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd fs6, 88(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd fs7, 80(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd fs8, 72(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd fs9, 64(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd fs10, 56(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd fs11, 48(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd ft8, 40(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd ft9, 32(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd ft10, 24(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: fsd ft11, 16(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: frcsr t0 +; CHECK-RV64-FD-NEXT: sd t0, 8(sp) ; CHECK-RV64-FD-NEXT: call otherfoo@plt -; CHECK-RV64-FD-NEXT: ld ra, 376(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: ld t0, 368(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: ld t1, 360(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: ld t2, 352(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: ld a0, 344(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: ld a1, 336(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: ld a2, 328(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: ld a3, 320(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: ld a4, 312(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: ld a5, 304(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: ld a6, 296(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: ld a7, 288(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: ld t3, 280(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: ld t4, 272(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: ld t5, 264(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: ld t6, 256(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld ft0, 248(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld ft1, 240(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld ft2, 232(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld ft3, 224(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld ft4, 216(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld ft5, 208(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld ft6, 200(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld ft7, 192(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld fs0, 184(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld fs1, 176(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld fa0, 168(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld fa1, 160(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld fa2, 152(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld fa3, 144(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld fa4, 136(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld fa5, 128(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld fa6, 120(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld fa7, 112(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld fs2, 104(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld fs3, 96(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld fs4, 88(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld fs5, 80(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld fs6, 72(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld fs7, 64(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld fs8, 56(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld fs9, 48(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld fs10, 40(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld fs11, 32(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld ft8, 24(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld ft9, 16(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld ft10, 8(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: fld ft11, 0(sp) # 8-byte Folded Reload -; CHECK-RV64-FD-NEXT: addi sp, sp, 384 +; CHECK-RV64-FD-NEXT: ld t0, 8(sp) +; CHECK-RV64-FD-NEXT: fscsr t0 +; CHECK-RV64-FD-NEXT: ld ra, 392(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: ld t0, 384(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: ld t1, 376(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: ld t2, 368(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: ld a0, 360(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: ld a1, 352(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: ld a2, 344(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: ld a3, 336(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: ld a4, 328(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: ld a5, 320(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: ld a6, 312(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: ld a7, 304(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: ld t3, 296(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: ld t4, 288(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: ld t5, 280(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: ld t6, 272(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld ft0, 264(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld ft1, 256(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld ft2, 248(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld ft3, 240(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld ft4, 232(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld ft5, 224(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld ft6, 216(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld ft7, 208(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld fs0, 200(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld fs1, 192(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld fa0, 184(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld fa1, 176(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld fa2, 168(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld fa3, 160(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld fa4, 152(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld fa5, 144(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld fa6, 136(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld fa7, 128(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld fs2, 120(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld fs3, 112(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld fs4, 104(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld fs5, 96(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld fs6, 88(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld fs7, 80(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld fs8, 72(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld fs9, 64(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld fs10, 56(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld fs11, 48(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld ft8, 40(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld ft9, 32(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld ft10, 24(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: fld ft11, 16(sp) # 8-byte Folded Reload +; CHECK-RV64-FD-NEXT: addi sp, sp, 400 ; CHECK-RV64-FD-NEXT: mret %call = call i32 @otherfoo() ret void @@ -636,8 +700,12 @@ ; CHECK-RV32-F-NEXT: fsw ft9, 20(sp) # 4-byte Folded Spill ; CHECK-RV32-F-NEXT: fsw ft10, 16(sp) # 4-byte Folded Spill ; CHECK-RV32-F-NEXT: fsw ft11, 12(sp) # 4-byte Folded Spill +; CHECK-RV32-F-NEXT: frcsr t0 +; CHECK-RV32-F-NEXT: sw t0, 8(sp) ; CHECK-RV32-F-NEXT: addi s0, sp, 208 ; CHECK-RV32-F-NEXT: call otherfoo@plt +; CHECK-RV32-F-NEXT: lw t0, 8(sp) +; CHECK-RV32-F-NEXT: fscsr t0 ; CHECK-RV32-F-NEXT: lw ra, 204(sp) # 4-byte Folded Reload ; CHECK-RV32-F-NEXT: lw t0, 200(sp) # 4-byte Folded Reload ; CHECK-RV32-F-NEXT: lw t1, 196(sp) # 4-byte Folded Reload @@ -742,8 +810,12 @@ ; CHECK-RV32-FD-NEXT: fsd ft9, 24(sp) # 8-byte Folded Spill ; CHECK-RV32-FD-NEXT: fsd ft10, 16(sp) # 8-byte Folded Spill ; CHECK-RV32-FD-NEXT: fsd ft11, 8(sp) # 8-byte Folded Spill +; CHECK-RV32-FD-NEXT: frcsr t0 +; CHECK-RV32-FD-NEXT: sw t0, 4(sp) ; CHECK-RV32-FD-NEXT: addi s0, sp, 336 ; CHECK-RV32-FD-NEXT: call otherfoo@plt +; CHECK-RV32-FD-NEXT: lw t0, 4(sp) +; CHECK-RV32-FD-NEXT: fscsr t0 ; CHECK-RV32-FD-NEXT: lw ra, 332(sp) # 4-byte Folded Reload ; CHECK-RV32-FD-NEXT: lw t0, 328(sp) # 4-byte Folded Reload ; CHECK-RV32-FD-NEXT: lw t1, 324(sp) # 4-byte Folded Reload @@ -890,8 +962,12 @@ ; CHECK-RV64-F-NEXT: fsw ft9, 16(sp) # 4-byte Folded Spill ; CHECK-RV64-F-NEXT: fsw ft10, 12(sp) # 4-byte Folded Spill ; CHECK-RV64-F-NEXT: fsw ft11, 8(sp) # 4-byte Folded Spill +; CHECK-RV64-F-NEXT: frcsr t0 +; CHECK-RV64-F-NEXT: sd t0, 0(sp) ; CHECK-RV64-F-NEXT: addi s0, sp, 272 ; CHECK-RV64-F-NEXT: call otherfoo@plt +; CHECK-RV64-F-NEXT: ld t0, 0(sp) +; CHECK-RV64-F-NEXT: fscsr t0 ; CHECK-RV64-F-NEXT: ld ra, 264(sp) # 8-byte Folded Reload ; CHECK-RV64-F-NEXT: ld t0, 256(sp) # 8-byte Folded Reload ; CHECK-RV64-F-NEXT: ld t1, 248(sp) # 8-byte Folded Reload @@ -996,8 +1072,12 @@ ; CHECK-RV64-FD-NEXT: fsd ft9, 24(sp) # 8-byte Folded Spill ; CHECK-RV64-FD-NEXT: fsd ft10, 16(sp) # 8-byte Folded Spill ; CHECK-RV64-FD-NEXT: fsd ft11, 8(sp) # 8-byte Folded Spill +; CHECK-RV64-FD-NEXT: frcsr t0 +; CHECK-RV64-FD-NEXT: sd t0, 0(sp) ; CHECK-RV64-FD-NEXT: addi s0, sp, 400 ; CHECK-RV64-FD-NEXT: call otherfoo@plt +; CHECK-RV64-FD-NEXT: ld t0, 0(sp) +; CHECK-RV64-FD-NEXT: fscsr t0 ; CHECK-RV64-FD-NEXT: ld ra, 392(sp) # 8-byte Folded Reload ; CHECK-RV64-FD-NEXT: ld t0, 384(sp) # 8-byte Folded Reload ; CHECK-RV64-FD-NEXT: ld t1, 376(sp) # 8-byte Folded Reload