Skip to content

Commit dbcbdc4

Browse files
authored
[RISCV] Add IsSignExtendingOpW to P-ext CLS, CLSW, and ABSW instructions. (#151037)
This matches other W instructions. CLS is included since it can only return 0-64 which has bits [63:31] as zero. This is similar to CLZ. This doesn't do anything yet since we don't have CodeGen support for P.
1 parent 19ba224 commit dbcbdc4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfoP.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ class RVPUnary_ri<bits<2> w, bits<5> uf, string opcodestr>
136136
//===----------------------------------------------------------------------===//
137137

138138
let Predicates = [HasStdExtP] in {
139+
let IsSignExtendingOpW = 1 in
139140
def CLS : Unary_r<0b011000000011, 0b001, "cls">;
140141
def ABS : Unary_r<0b011000000111, 0b001, "abs">;
141142
} // Predicates = [HasStdExtP]
@@ -146,8 +147,10 @@ let Predicates = [HasStdExtP, IsRV64] in {
146147
def REV16 : Unary_r<0b011010110000, 0b101, "rev16">;
147148
def REV_RV64 : Unary_r<0b011010111111, 0b101, "rev">;
148149

150+
let IsSignExtendingOpW = 1 in {
149151
def CLSW : UnaryW_r<0b011000000011, 0b001, "clsw">;
150152
def ABSW : UnaryW_r<0b011000000111, 0b001, "absw">;
153+
}
151154
} // Predicates = [HasStdExtP, IsRV64]
152155

153156
let Predicates = [HasStdExtP] in {

0 commit comments

Comments
 (0)