Add scalar_to_vector instruction

Moves scalar values in a GPR register to an FPR register
This commit is contained in:
Andrew Brown
2019-07-11 10:50:06 -07:00
committed by Dan Gohman
parent 356e6dafe2
commit 5f0e5567c1
3 changed files with 84 additions and 3 deletions

View File

@@ -106,6 +106,16 @@ pub fn define(
.build(),
);
let Scalar = &TypeVar::new(
"scalar",
"Any scalar value that can be used as a lane in a vector",
TypeSetBuilder::new()
.bools(Interval::All)
.ints(Interval::All)
.floats(Interval::All)
.build(),
);
let Any = &TypeVar::new(
"Any",
"Any integer, float, or boolean scalar or vector type",
@@ -2630,6 +2640,22 @@ pub fn define(
.operands_out(vec![a]),
);
let s = &operand_doc("s", Scalar, "A scalar value");
let a = &operand_doc("a", TxN, "A vector value (i.e. held in an XMM register)");
ig.push(
Inst::new(
"scalar_to_vector",
r#"
Scalar To Vector -- move a value out of a scalar register and into a vector
register; the scalar will be moved to the lowest-order bits of the vector
register and any higher bits will be zeroed.
"#,
)
.operands_in(vec![s])
.operands_out(vec![a]),
);
let Bool = &TypeVar::new(
"Bool",
"A scalar or vector boolean type",