Skip to content

Commit

Permalink
Fix everything
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasSte committed Dec 12, 2024
1 parent 8552c58 commit c9ef884
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion llvm/lib/Target/SBF/Disassembler/SBFDisassembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ DecodeStatus SBFDisassembler::getInstruction(MCInst &Instr, uint64_t &Size,
STI.hasFeature(SBF::FeatureNewMemEncoding) &&
STI.hasFeature(SBF::ALU32))
Result =
decodeInstruction(DecoderTableSBFALU32MEM64,
decodeInstruction(DecoderTableSBFALU32MEMv264,
Instr, Insn, Address, this, STI);
else if (isNewMem(Insn) && STI.hasFeature(SBF::FeatureNewMemEncoding))
Result =
Expand Down
29 changes: 15 additions & 14 deletions llvm/lib/Target/SBF/SBFInstrInfo.td
Original file line number Diff line number Diff line change
Expand Up @@ -1298,18 +1298,18 @@ class STORE32_V2<SBFSizeModifier SizeOp, string Mnemonic>

multiclass STOREi32<SBFWidthModifer SizeV1, SBFSizeModifier SizeV2,
string Mnemonic> {
def _V1 : STORE32_V1<SizeV1, Mnemonic>, Requires<[SBFOldMemEncoding]>;
let DecoderNamespace = "SBFALU32" in {
def _V1 : STORE32_V1<SizeV1, Mnemonic>, Requires<[SBFOldMemEncoding]>;
}

let DecoderNamespace = "SBFALU32v2" in {
let DecoderNamespace = "SBFALU32MEMv2" in {
def _V2 : STORE32_V2<SizeV2, Mnemonic>, Requires<[SBFNewMemEncoding]>;
}
}

let DecoderNamespace = "SBFALU32MEM" in {
defm STW32 : STOREi32<SBF_W, SBF_W_V2, "stxw">;
defm STH32 : STOREi32<SBF_H, SBF_H_V2, "stxh">;
defm STB32 : STOREi32<SBF_B, SBF_B_V2, "stxb">;
}
defm STW32 : STOREi32<SBF_W, SBF_W_V2, "stxw">;
defm STH32 : STOREi32<SBF_H, SBF_H_V2, "stxh">;
defm STB32 : STOREi32<SBF_B, SBF_B_V2, "stxb">;

let Predicates = [SBFHasALU32, SBFOldMemEncoding] in {
def : Pat<(store GPR32:$src, ADDRri:$addr),
Expand Down Expand Up @@ -1362,17 +1362,18 @@ class LOAD32_V2<SBFSizeModifier SizeOp, string Mnemonic>

multiclass LOADi32<SBFWidthModifer SizeV1, SBFSizeModifier SizeV2,
string Mnemonic> {
def _V1 : LOAD32_V1<SizeV1, Mnemonic>, Requires<[SBFOldMemEncoding]>;
let DecoderNamespace = "SBFALU32v2" in {
let DecoderNamespace = "SBFALU32" in {
def _V1 : LOAD32_V1<SizeV1, Mnemonic>, Requires<[SBFOldMemEncoding]>;
}
let DecoderNamespace = "SBFALU32MEMv2" in {
def _V2 : LOAD32_V2<SizeV2, Mnemonic>, Requires<[SBFNewMemEncoding]>;
}
}

let DecoderNamespace = "SBFALU32MEM" in {
defm LDW32 : LOADi32<SBF_W, SBF_W_V2, "ldxw">;
defm LDH32 : LOADi32<SBF_H, SBF_H_V2, "ldxh">;
defm LDB32 : LOADi32<SBF_B, SBF_B_V2, "ldxb">;
}

defm LDW32 : LOADi32<SBF_W, SBF_W_V2, "ldxw">;
defm LDH32 : LOADi32<SBF_H, SBF_H_V2, "ldxh">;
defm LDB32 : LOADi32<SBF_B, SBF_B_V2, "ldxb">;

let Predicates = [SBFHasALU32, SBFOldMemEncoding] in {
def : Pat<(load ADDRri:$addr),
Expand Down

0 comments on commit c9ef884

Please sign in to comment.