Cranelift: division/remainder CLIF ops are scalar-only. (#4141)

In #4104 we discussed whether it makes sense for the division and
remainder ops to support vector types. We concluded that because most
hardware doesn't support it directly, it probably is not ideal to force
all backends to polyfill it. In the future we can always reverse this
decision, perhaps with a platform-independent legalization.

This PR restricts the allowed types on the CLIF ops to integer types
only.
This commit is contained in:
Chris Fallin
2022-05-11 11:10:02 -07:00
committed by GitHub
parent 67eb161d04
commit 7c5a56b836

View File

@@ -1913,6 +1913,14 @@ pub(crate) fn define(
.operands_out(vec![qa]),
);
{
// Integer division and remainder are scalar-only; most
// hardware does not directly support vector integer division.
let x = &Operand::new("x", iB);
let y = &Operand::new("y", iB);
let a = &Operand::new("a", iB);
ig.push(
Inst::new(
"udiv",
@@ -1975,6 +1983,7 @@ pub(crate) fn define(
.operands_out(vec![a])
.can_trap(true),
);
}
let a = &Operand::new("a", iB);
let x = &Operand::new("x", iB);