Support big- and little-endian lane order with bitcast (#5196)
Add a MemFlags operand to the bitcast instruction, where only the `big` and `little` flags are accepted. These define the lane order to be used when casting between types of different lane counts. Update all users to pass an appropriate MemFlags argument. Implement lane swaps where necessary in the s390x back-end. This is the final part necessary to fix https://github.com/bytecodealliance/wasmtime/issues/4566.
This commit is contained in:
@@ -3104,6 +3104,7 @@ pub(crate) fn define(
|
||||
|
||||
let x = &Operand::new("x", Mem);
|
||||
let a = &Operand::new("a", MemTo).with_doc("Bits of `x` reinterpreted");
|
||||
let MemFlags = &Operand::new("MemFlags", &imm.memflags);
|
||||
|
||||
ig.push(
|
||||
Inst::new(
|
||||
@@ -3113,11 +3114,16 @@ pub(crate) fn define(
|
||||
|
||||
The input and output types must be storable to memory and of the same
|
||||
size. A bitcast is equivalent to storing one type and loading the other
|
||||
type from the same address.
|
||||
type from the same address, both using the specified MemFlags.
|
||||
|
||||
Note that this operation only supports the `big` or `little` MemFlags.
|
||||
The specified byte order only affects the result in the case where
|
||||
input and output types differ in lane count/size. In this case, the
|
||||
operation is only valid if a byte order specifier is provided.
|
||||
"#,
|
||||
&formats.unary,
|
||||
&formats.load_no_offset,
|
||||
)
|
||||
.operands_in(vec![x])
|
||||
.operands_in(vec![MemFlags, x])
|
||||
.operands_out(vec![a]),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user