shader_recompiler: constant propagation bitwise operations + S_CMPK_EQ_U32 fix (#613)

* rebase on main branch impl of V_LSHL_B64

* remove V_LSHR_B64

* fix S_CMPK_EQ_u32

* fix conflicts

* fix broken merge

* remove duplicate cases

* remove duplicate declaration
This commit is contained in:
0xsegf4ult 2024-08-28 12:10:21 +02:00 committed by GitHub
parent 990da7edcc
commit 9f4e55a8e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 29 additions and 4 deletions

View file

@ -1115,8 +1115,18 @@ U32U64 IREmitter::ShiftRightArithmetic(const U32U64& base, const U32& shift) {
}
}
U32 IREmitter::BitwiseAnd(const U32& a, const U32& b) {
return Inst<U32>(Opcode::BitwiseAnd32, a, b);
U32U64 IREmitter::BitwiseAnd(const U32U64& a, const U32U64& b) {
if (a.Type() != b.Type()) {
UNREACHABLE_MSG("Mismatching types {} and {}", a.Type(), b.Type());
}
switch (a.Type()) {
case Type::U32:
return Inst<U32>(Opcode::BitwiseAnd32, a, b);
case Type::U64:
return Inst<U64>(Opcode::BitwiseAnd64, a, b);
default:
ThrowInvalidType(a.Type());
}
}
U32U64 IREmitter::BitwiseOr(const U32U64& a, const U32U64& b) {