Skip to content

Commit

Permalink
Fix naming issues
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasSte committed Dec 2, 2024
1 parent c6516a5 commit fe185ba
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 14 deletions.
5 changes: 3 additions & 2 deletions llvm/lib/Target/SBF/SBFISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -939,15 +939,16 @@ SBFTargetLowering::EmitSubregExt(MachineInstr &MI, MachineBasicBlock *BB,
MachineRegisterInfo &RegInfo = F->getRegInfo();

if (!isSigned) {
unsigned MovOp = Subtarget->getExplicitSignExt()
unsigned MovOp =
Subtarget->getHasExplicitSignExt()
? SBF::MOV_rr : SBF::MOV_32_64;
Register PromotedReg0 = RegInfo.createVirtualRegister(RC);
BuildMI(BB, DL, TII.get(MovOp), PromotedReg0).addReg(Reg);
return PromotedReg0;
}
Register PromotedReg0 = RegInfo.createVirtualRegister(RC);
BuildMI(BB, DL, TII.get(SBF::MOV_32_64), PromotedReg0).addReg(Reg);
if (Subtarget->getExplicitSignExt())
if (Subtarget->getHasExplicitSignExt())
return PromotedReg0;

Register PromotedReg1 = RegInfo.createVirtualRegister(RC);
Expand Down
9 changes: 5 additions & 4 deletions llvm/lib/Target/SBF/SBFInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ using namespace llvm;
SBFInstrInfo::SBFInstrInfo()
: SBFGenInstrInfo(SBF::ADJCALLSTACKDOWN, SBF::ADJCALLSTACKUP) {}

void SBFInstrInfo::setHasExplicitSext(bool HasExplicitSext) {
this->HasExpliciSext = HasExplicitSext;
void SBFInstrInfo::setHasExplicitSignExt(bool HasExplicitSext) {
this->HasExplicitSignExt = HasExplicitSext;
}

void SBFInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
Expand All @@ -40,8 +40,9 @@ void SBFInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
BuildMI(MBB, I, DL, get(SBF::MOV_rr), DestReg)
.addReg(SrcReg, getKillRegState(KillSrc));
else if (SBF::GPR32RegClass.contains(DestReg, SrcReg)) {
unsigned OpCode = HasExpliciSext
? SBF::MOV_rr_32_no_sext_v2 : SBF::MOV_rr_32_no_sext_v1;
unsigned OpCode =
HasExplicitSignExt ? SBF::MOV_rr_32_no_sext_v2
: SBF::MOV_rr_32_no_sext_v1;
BuildMI(MBB, I, DL, get(OpCode), DestReg)
.addReg(SrcReg, getKillRegState(KillSrc));
}
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/SBF/SBFInstrInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ class SBFInstrInfo : public SBFGenInstrInfo {
MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,
const DebugLoc &DL,
int *BytesAdded = nullptr) const override;
void setHasExplicitSext(bool HasExplicitSext);
void setHasExplicitSignExt(bool HasExplicitSext);

private:
void expandMEMCPY(MachineBasicBlock::iterator) const;
bool HasExpliciSext;
bool HasExplicitSignExt;
};
}

Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/SBF/SBFInstrInfo.td
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def SBFNoCallxSrc : Predicate<"!Subtarget->getCallXRegSrc()">;
def SBFPqrInstr : Predicate<"Subtarget->getHasPqrClass()">;
def SBFNoPqrInstr : Predicate<"!Subtarget->getHasPqrClass()">;
def SBFHasStoreImm : Predicate<"Subtarget->getHasStoreImm()">;
def SBFExplicitSignExt : Predicate<"Subtarget->getExplicitSignExt()">;
def SBFNoExplicitSignExt : Predicate<"!Subtarget->getExplicitSignExt()">;
def SBFExplicitSignExt : Predicate<"Subtarget->getHasExplicitSignExt()">;
def SBFNoExplicitSignExt : Predicate<"!Subtarget->getHasExplicitSignExt()">;

def brtarget : Operand<OtherVT> {
let PrintMethod = "printBrTargetOperand";
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/SBF/SBFSubtarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SBFSubtarget &SBFSubtarget::initializeSubtargetDependencies(const Triple &TT,
StringRef FS) {
initializeEnvironment(TT);
initSubtargetFeatures(CPU, FS);
InstrInfo.setHasExplicitSext(ExplicitSignExt);
InstrInfo.setHasExplicitSignExt(HasExplicitSignExt);
return *this;
}

Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/SBF/SBFSubtarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class SBFSubtarget : public SBFGenSubtargetInfo {
bool HasStoreImm;

// Whether we have the explicit sign extension instruction (mov32)
bool ExplicitSignExt;
bool HasExplicitSignExt;

public:
// This constructor initializes the data members to match that
Expand All @@ -108,7 +108,7 @@ class SBFSubtarget : public SBFGenSubtargetInfo {
return HasDynamicFrames && NewCallConvention;
}
bool getHasStoreImm() const { return HasStoreImm; }
bool getExplicitSignExt() const { return ExplicitSignExt; }
bool getHasExplicitSignExt() const { return HasExplicitSignExt; }
const SBFInstrInfo *getInstrInfo() const override { return &InstrInfo; }
const SBFFrameLowering *getFrameLowering() const override {
return &FrameLowering;
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/SBF/SBFTargetFeatures.td
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def FeatureCallConv : SubtargetFeature<"new-call-conv", "NewCallConvention", "tr
def FeatureStoreImm : SubtargetFeature<"store-imm", "HasStoreImm", "true",
"Enable store imm instructions">;

def FeatureExplicitSext : SubtargetFeature<"explicit-sext", "ExplicitSignExt",
def FeatureExplicitSext : SubtargetFeature<"explicit-sext", "HasExplicitSignExt",
"true", "Enable the explicit sign extension instruction mov32">;

class Proc<string Name, list<SubtargetFeature> Features>
Expand Down

0 comments on commit fe185ba

Please sign in to comment.