Mark fpromote and fdemote as operating on float scalars (#6014)

This commit is contained in:
Trevor Elliott
2023-03-13 17:47:40 -07:00
committed by GitHub
parent 873d3b50a0
commit 188f712025

View File

@@ -3320,13 +3320,16 @@ pub(crate) fn define(
); );
} }
let FloatTo = &TypeVar::new( let FloatScalar = &TypeVar::new(
"FloatTo", "FloatScalar",
"A scalar or vector floating point number", "A scalar only floating point number",
TypeSetBuilder::new() TypeSetBuilder::new().floats(Interval::All).build(),
.floats(Interval::All) );
.simd_lanes(Interval::All)
.build(), let FloatScalarTo = &TypeVar::new(
"FloatScalarTo",
"A scalar only floating point number",
TypeSetBuilder::new().floats(Interval::All).build(),
); );
ig.push( ig.push(
@@ -3346,8 +3349,8 @@ pub(crate) fn define(
"#, "#,
&formats.unary, &formats.unary,
) )
.operands_in(vec![Operand::new("x", Float)]) .operands_in(vec![Operand::new("x", FloatScalar)])
.operands_out(vec![Operand::new("a", FloatTo)]), .operands_out(vec![Operand::new("a", FloatScalarTo)]),
); );
ig.push( ig.push(
@@ -3367,8 +3370,8 @@ pub(crate) fn define(
"#, "#,
&formats.unary, &formats.unary,
) )
.operands_in(vec![Operand::new("x", Float)]) .operands_in(vec![Operand::new("x", FloatScalar)])
.operands_out(vec![Operand::new("a", FloatTo)]), .operands_out(vec![Operand::new("a", FloatScalarTo)]),
); );
let F64x2 = &TypeVar::new( let F64x2 = &TypeVar::new(
@@ -3431,11 +3434,6 @@ pub(crate) fn define(
.operands_out(vec![Operand::new("x", F64x2)]), .operands_out(vec![Operand::new("x", F64x2)]),
); );
let FloatScalar = &TypeVar::new(
"FloatScalar",
"A scalar only floating point number",
TypeSetBuilder::new().floats(Interval::All).build(),
);
let IntTo = &TypeVar::new( let IntTo = &TypeVar::new(
"IntTo", "IntTo",
"An scalar only integer type", "An scalar only integer type",
@@ -3539,6 +3537,15 @@ pub(crate) fn define(
.build(), .build(),
); );
let FloatTo = &TypeVar::new(
"FloatTo",
"A scalar or vector floating point number",
TypeSetBuilder::new()
.floats(Interval::All)
.simd_lanes(Interval::All)
.build(),
);
ig.push( ig.push(
Inst::new( Inst::new(
"fcvt_from_uint", "fcvt_from_uint",