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

committed by
Marge Bot

parent
a33507d621
commit
efd86d6daa
@@ -584,16 +584,64 @@ pub trait SSABuilder: Builder {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
IntCmpOp::Ge | IntCmpOp::Gt | IntCmpOp::Le | IntCmpOp::Lt => {
|
IntCmpOp::Ge | IntCmpOp::Gt | IntCmpOp::Le | IntCmpOp::Lt => {
|
||||||
self.push_op(OpISetP {
|
if self.sm() >= 70 {
|
||||||
dst: dst.into(),
|
self.push_op(OpISetP {
|
||||||
set_op: PredSetOp::And,
|
dst: dst.into(),
|
||||||
cmp_op: cmp_op,
|
set_op: PredSetOp::And,
|
||||||
cmp_type: cmp_type,
|
cmp_op,
|
||||||
ex: true,
|
cmp_type,
|
||||||
srcs: [x[1].into(), y[1].into()],
|
ex: true,
|
||||||
accum: true.into(),
|
srcs: [x[1].into(), y[1].into()],
|
||||||
low_cmp: low.into(),
|
accum: true.into(),
|
||||||
});
|
low_cmp: low.into(),
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// On Maxwell, iset.ex only has one source for both accum
|
||||||
|
// and low_cmp and it does a weird truth table dance. (See
|
||||||
|
// Foldable for OpISetP for details.)
|
||||||
|
let low_or_accum = self.alloc_ssa(RegFile::Pred, 1);
|
||||||
|
let set_op = match cmp_op {
|
||||||
|
IntCmpOp::Ge | IntCmpOp::Gt => {
|
||||||
|
// When x != y, we want low_or_accum == false
|
||||||
|
self.push_op(OpISetP {
|
||||||
|
dst: low_or_accum.into(),
|
||||||
|
set_op: PredSetOp::And,
|
||||||
|
cmp_op: IntCmpOp::Eq,
|
||||||
|
cmp_type: IntCmpType::U32,
|
||||||
|
ex: false,
|
||||||
|
srcs: [x[1].into(), y[1].into()],
|
||||||
|
accum: low.into(),
|
||||||
|
low_cmp: true.into(),
|
||||||
|
});
|
||||||
|
PredSetOp::Or
|
||||||
|
}
|
||||||
|
IntCmpOp::Le | IntCmpOp::Lt => {
|
||||||
|
// When x != y, we want low_or_accum == true
|
||||||
|
self.push_op(OpISetP {
|
||||||
|
dst: low_or_accum.into(),
|
||||||
|
set_op: PredSetOp::Or,
|
||||||
|
cmp_op: IntCmpOp::Ne,
|
||||||
|
cmp_type: IntCmpType::U32,
|
||||||
|
ex: false,
|
||||||
|
srcs: [x[1].into(), y[1].into()],
|
||||||
|
accum: low.into(),
|
||||||
|
low_cmp: true.into(),
|
||||||
|
});
|
||||||
|
PredSetOp::And
|
||||||
|
}
|
||||||
|
_ => panic!("Not an integer inequality"),
|
||||||
|
};
|
||||||
|
self.push_op(OpISetP {
|
||||||
|
dst: dst.into(),
|
||||||
|
set_op,
|
||||||
|
cmp_op,
|
||||||
|
cmp_type,
|
||||||
|
ex: true,
|
||||||
|
srcs: [x[1].into(), y[1].into()],
|
||||||
|
accum: low_or_accum.into(),
|
||||||
|
low_cmp: low_or_accum.into(),
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dst
|
dst
|
||||||
|
Reference in New Issue
Block a user