nak: Fix shl64 for pre-Volta
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30275>
This commit is contained in:

committed by
Marge Bot

parent
e02dfb6a34
commit
1006283732
@@ -148,16 +148,37 @@ pub trait SSABuilder: Builder {
|
|||||||
debug_assert!(shift.src_mod.is_none());
|
debug_assert!(shift.src_mod.is_none());
|
||||||
|
|
||||||
let dst = self.alloc_ssa(RegFile::GPR, 2);
|
let dst = self.alloc_ssa(RegFile::GPR, 2);
|
||||||
self.push_op(OpShf {
|
if self.sm() >= 70 {
|
||||||
dst: dst[0].into(),
|
self.push_op(OpShf {
|
||||||
low: x[0].into(),
|
dst: dst[0].into(),
|
||||||
high: 0.into(),
|
low: x[0].into(),
|
||||||
shift,
|
high: 0.into(),
|
||||||
right: false,
|
shift,
|
||||||
wrap: true,
|
right: false,
|
||||||
data_type: IntType::U64,
|
wrap: true,
|
||||||
dst_high: false,
|
data_type: IntType::U64,
|
||||||
});
|
dst_high: false,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// On Maxwell and earlier, shf.l doesn't work without .high so we
|
||||||
|
// have to use a regular 32-bit shift here. 32-bit shift doesn't
|
||||||
|
// have the NIR wrap semantics so we need to wrap manually.
|
||||||
|
let shift = if let SrcRef::Imm32(imm) = shift.src_ref {
|
||||||
|
(imm & 0x3f).into()
|
||||||
|
} else {
|
||||||
|
self.lop2(LogicOp2::And, shift, 0x3f.into()).into()
|
||||||
|
};
|
||||||
|
self.push_op(OpShf {
|
||||||
|
dst: dst[0].into(),
|
||||||
|
low: 0.into(),
|
||||||
|
high: x[0].into(),
|
||||||
|
shift,
|
||||||
|
right: false,
|
||||||
|
wrap: false,
|
||||||
|
data_type: IntType::U32,
|
||||||
|
dst_high: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
self.push_op(OpShf {
|
self.push_op(OpShf {
|
||||||
dst: dst[1].into(),
|
dst: dst[1].into(),
|
||||||
low: x[0].into(),
|
low: x[0].into(),
|
||||||
|
Reference in New Issue
Block a user