Skip to content

Commit 5370538

Browse files
committed
fixup! [RISCV][VCIX] Add vcix_state to GNU inline assembly register set
1 parent 4e5bccc commit 5370538

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

clang/lib/Basic/Targets/RISCV.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ ArrayRef<const char *> RISCVTargetInfo::getGCCRegNames() const {
4444
"v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31",
4545

4646
// CSRs
47-
"fflags", "frm", "vtype", "vl", "vxsat", "vxrm", "sf_vcix_state"
47+
"fflags", "frm", "vtype", "vl", "vxsat", "vxrm", "sf.vcix_state"
4848
};
4949
// clang-format on
5050
return llvm::ArrayRef(GCCRegNames);

llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,12 @@ Register RISCVRegisterInfo::getFrameRegister(const MachineFunction &MF) const {
715715
return TFI->hasFP(MF) ? RISCV::X8 : RISCV::X2;
716716
}
717717

718+
StringRef RISCVRegisterInfo::getRegAsmName(MCRegister Reg) const {
719+
if (Reg == RISCV::SF_VCIX_STATE)
720+
return "sf.vcix_state";
721+
return TargetRegisterInfo::getRegAsmName(Reg);
722+
}
723+
718724
const uint32_t *
719725
RISCVRegisterInfo::getCallPreservedMask(const MachineFunction & MF,
720726
CallingConv::ID CC) const {

llvm/lib/Target/RISCV/RISCVRegisterInfo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ struct RISCVRegisterInfo : public RISCVGenRegisterInfo {
102102

103103
Register getFrameRegister(const MachineFunction &MF) const override;
104104

105+
StringRef getRegAsmName(MCRegister Reg) const override;
106+
105107
bool requiresRegisterScavenging(const MachineFunction &MF) const override {
106108
return true;
107109
}

llvm/test/CodeGen/RISCV/inline-asm-xsfvcp.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ define void @test_reorder(<vscale x 1 x i64> %vreg) {
1717
; CHECK-NEXT: ret
1818
entry:
1919
call void @llvm.riscv.sf.vc.iv.se.iXLen.nxv1i64.iXLen.iXLen(iXLen 0, iXLen 0, <vscale x 1 x i64> %vreg, iXLen 0, iXLen 0)
20-
call iXLen asm sideeffect "sf.vc.vv 0x3, 0x0, $1, $1;", "=r,^vr,~{memory},~{vl},~{sf_vcix_state}"(<vscale x 1 x i64> %vreg)
20+
call iXLen asm sideeffect "sf.vc.vv 0x3, 0x0, $1, $1;", "=r,^vr,~{memory},~{vl},~{sf.vcix_state}"(<vscale x 1 x i64> %vreg)
2121
ret void
2222
}

0 commit comments

Comments
 (0)