Skip to content

Commit 9d70265

Browse files
authored
[RISCV] Correct the precedence in isVRegClass (#116579)
Right shift has higher precedence than bitwise and, so it should be parentheses around & operator. This case works as expected because IsVRegClassShift is 0, other cases will fail.
1 parent e370946 commit 9d70265

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/RISCV/RISCVRegisterInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ enum {
3939

4040
/// \returns the IsVRegClass for the register class.
4141
static inline bool isVRegClass(uint64_t TSFlags) {
42-
return TSFlags & IsVRegClassShiftMask >> IsVRegClassShift;
42+
return (TSFlags & IsVRegClassShiftMask) >> IsVRegClassShift;
4343
}
4444

4545
/// \returns the LMUL for the register class.

0 commit comments

Comments
 (0)