Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Target/RISCV/RISCVInstrInfoB.td
Show First 20 Lines • Show All 651 Lines • ▼ Show 20 Lines | |||||
let Predicates = [HasStdExtZbbOrZbp] in { | let Predicates = [HasStdExtZbbOrZbp] in { | ||||
def : Pat<(rotl GPR:$rs1, GPR:$rs2), (ROL GPR:$rs1, GPR:$rs2)>; | def : Pat<(rotl GPR:$rs1, GPR:$rs2), (ROL GPR:$rs1, GPR:$rs2)>; | ||||
def : Pat<(fshl GPR:$rs1, GPR:$rs1, GPR:$rs2), (ROL GPR:$rs1, GPR:$rs2)>; | def : Pat<(fshl GPR:$rs1, GPR:$rs1, GPR:$rs2), (ROL GPR:$rs1, GPR:$rs2)>; | ||||
def : Pat<(rotr GPR:$rs1, GPR:$rs2), (ROR GPR:$rs1, GPR:$rs2)>; | def : Pat<(rotr GPR:$rs1, GPR:$rs2), (ROR GPR:$rs1, GPR:$rs2)>; | ||||
def : Pat<(fshr GPR:$rs1, GPR:$rs1, GPR:$rs2), (ROR GPR:$rs1, GPR:$rs2)>; | def : Pat<(fshr GPR:$rs1, GPR:$rs1, GPR:$rs2), (ROR GPR:$rs1, GPR:$rs2)>; | ||||
} // Predicates = [HasStdExtZbbOrZbp] | } // Predicates = [HasStdExtZbbOrZbp] | ||||
let Predicates = [HasStdExtZbs, IsRV32] in { | |||||
def : Pat<(and (xor (shl 1, GPR:$rs2), -1), GPR:$rs1), | |||||
(SBCLR GPR:$rs1, GPR:$rs2)>; | |||||
def : Pat<(and (rotl -2, GPR:$rs2), GPR:$rs1), (SBCLR GPR:$rs1, GPR:$rs2)>; | |||||
} // Predicates = [HasStdExtZbs, IsRV32] | |||||
let Predicates = [HasStdExtZbs, IsRV64] in | |||||
def : Pat<(and (xor (riscv_sllw 1, GPR:$rs2), -1), GPR:$rs1), | |||||
lewis-revill: Why does this need to be `riscv_sllw` as opposed to `shl`? Isn't the former intended for… | |||||
PaoloSAuthorUnsubmitted Indeed. That happened because some constants in the samples used to discover the patterns were set by default to 32 bit. Fixed, thank you. PaoloS: Indeed. That happened because some constants in the samples used to discover the patterns were… | |||||
(SBCLR GPR:$rs1, GPR:$rs2)>; | |||||
let Predicates = [HasStdExtZbs, IsRV32] in | |||||
def : Pat<(or (shl 1, GPR:$rs2), GPR:$rs1), (SBSET GPR:$rs1, GPR:$rs2)>; | |||||
let Predicates = [HasStdExtZbs, IsRV64] in | |||||
def : Pat<(or (riscv_sllw 1, GPR:$rs2), GPR:$rs1), (SBSET GPR:$rs1, GPR:$rs2)>; | |||||
let Predicates = [HasStdExtZbs, IsRV32] in | |||||
def : Pat<(xor (shl 1, GPR:$rs2), GPR:$rs1), (SBINV GPR:$rs1, GPR:$rs2)>; | |||||
let Predicates = [HasStdExtZbs, IsRV64] in | |||||
def : Pat<(xor (riscv_sllw 1, GPR:$rs2), GPR:$rs1), (SBINV GPR:$rs1, GPR:$rs2)>; | |||||
let Predicates = [HasStdExtZbs] in | |||||
def : Pat<(and (srl GPR:$rs1, GPR:$rs2), 1), (SBEXT GPR:$rs1, GPR:$rs2)>; | |||||
let Predicates = [HasStdExtZbp, IsRV32] in { | let Predicates = [HasStdExtZbp, IsRV32] in { | ||||
def : Pat<(or (or (and (srl GPR:$rs1, (i32 1)), (i32 0x55555555)), GPR:$rs1), | def : Pat<(or (or (and (srl GPR:$rs1, (i32 1)), (i32 0x55555555)), GPR:$rs1), | ||||
(and (shl GPR:$rs1, (i32 1)), (i32 0xAAAAAAAA))), | (and (shl GPR:$rs1, (i32 1)), (i32 0xAAAAAAAA))), | ||||
(GORCI GPR:$rs1, (i32 1))>; | (GORCI GPR:$rs1, (i32 1))>; | ||||
def : Pat<(or (or (and (srl GPR:$rs1, (i32 2)), (i32 0x33333333)), GPR:$rs1), | def : Pat<(or (or (and (srl GPR:$rs1, (i32 2)), (i32 0x33333333)), GPR:$rs1), | ||||
(and (shl GPR:$rs1, (i32 2)), (i32 0xCCCCCCCC))), | (and (shl GPR:$rs1, (i32 2)), (i32 0xCCCCCCCC))), | ||||
(GORCI GPR:$rs1, (i32 2))>; | (GORCI GPR:$rs1, (i32 2))>; | ||||
def : Pat<(or (or (and (srl GPR:$rs1, (i32 4)), (i32 0x0F0F0F0F)), GPR:$rs1), | def : Pat<(or (or (and (srl GPR:$rs1, (i32 4)), (i32 0x0F0F0F0F)), GPR:$rs1), | ||||
▲ Show 20 Lines • Show All 184 Lines • Show Last 20 Lines |
Why does this need to be riscv_sllw as opposed to shl? Isn't the former intended for matching patterns resulting from a 32 bit operation?