cranelift: remove load_complex and store_complex (#3976)

This change removes all variants of `load*_complex` and `store*_complex`
from Cranelift; this is a breaking change to the instructions exposed by
CLIF. The complete list of instructions removed is: `load_complex`,
`store_complex`, `uload8_complex`, `sload8_complex`, `istore8_complex`,
`sload8_complex`, `uload16_complex`, `sload16_complex`,
`istore16_complex`, `uload32_complex`, `sload32_complex`,
`istore32_complex`, `uload8x8_complex`, `sload8x8_complex`,
`sload16x4_complex`, `uload16x4_complex`, `uload32x2_complex`,
`sload32x2_complex`.

The rationale for this removal is that the Cranelift backend now has the
ability to pattern-match multiple upstream additions in order to
calculate the address to access. Previously, this was not possible so
the `*_complex` instructions were needed. Over time, these instructions
have fallen out of use in this repository, making the additional
overhead of maintaining them a chore.
This commit is contained in:
Andrew Brown
2022-03-31 10:05:10 -07:00
committed by GitHub
parent c8daf0b8db
commit bd6fe11ca9
20 changed files with 51 additions and 892 deletions

View File

@@ -792,7 +792,6 @@ pub(crate) fn define(
let a = &Operand::new("a", Mem).with_doc("Value loaded");
let p = &Operand::new("p", iAddr);
let MemFlags = &Operand::new("MemFlags", &imm.memflags);
let args = &Operand::new("args", &entities.varargs).with_doc("Address arguments");
ig.push(
Inst::new(
@@ -810,22 +809,6 @@ pub(crate) fn define(
.can_load(true),
);
ig.push(
Inst::new(
"load_complex",
r#"
Load from memory at ``sum(args) + Offset``.
This is a polymorphic instruction that can load any value type which
has a memory representation.
"#,
&formats.load_complex,
)
.operands_in(vec![MemFlags, args, Offset])
.operands_out(vec![a])
.can_load(true),
);
ig.push(
Inst::new(
"store",
@@ -841,21 +824,6 @@ pub(crate) fn define(
.can_store(true),
);
ig.push(
Inst::new(
"store_complex",
r#"
Store ``x`` to memory at ``sum(args) + Offset``.
This is a polymorphic instruction that can store any value type with a
memory representation.
"#,
&formats.store_complex,
)
.operands_in(vec![MemFlags, x, args, Offset])
.can_store(true),
);
let iExt8 = &TypeVar::new(
"iExt8",
"An integer type with more than 8 bits",
@@ -879,21 +847,6 @@ pub(crate) fn define(
.can_load(true),
);
ig.push(
Inst::new(
"uload8_complex",
r#"
Load 8 bits from memory at ``sum(args) + Offset`` and zero-extend.
This is equivalent to ``load.i8`` followed by ``uextend``.
"#,
&formats.load_complex,
)
.operands_in(vec![MemFlags, args, Offset])
.operands_out(vec![a])
.can_load(true),
);
ig.push(
Inst::new(
"sload8",
@@ -909,21 +862,6 @@ pub(crate) fn define(
.can_load(true),
);
ig.push(
Inst::new(
"sload8_complex",
r#"
Load 8 bits from memory at ``sum(args) + Offset`` and sign-extend.
This is equivalent to ``load.i8`` followed by ``sextend``.
"#,
&formats.load_complex,
)
.operands_in(vec![MemFlags, args, Offset])
.operands_out(vec![a])
.can_load(true),
);
ig.push(
Inst::new(
"istore8",
@@ -938,20 +876,6 @@ pub(crate) fn define(
.can_store(true),
);
ig.push(
Inst::new(
"istore8_complex",
r#"
Store the low 8 bits of ``x`` to memory at ``sum(args) + Offset``.
This is equivalent to ``ireduce.i8`` followed by ``store.i8``.
"#,
&formats.store_complex,
)
.operands_in(vec![MemFlags, x, args, Offset])
.can_store(true),
);
let iExt16 = &TypeVar::new(
"iExt16",
"An integer type with more than 16 bits",
@@ -975,21 +899,6 @@ pub(crate) fn define(
.can_load(true),
);
ig.push(
Inst::new(
"uload16_complex",
r#"
Load 16 bits from memory at ``sum(args) + Offset`` and zero-extend.
This is equivalent to ``load.i16`` followed by ``uextend``.
"#,
&formats.load_complex,
)
.operands_in(vec![MemFlags, args, Offset])
.operands_out(vec![a])
.can_load(true),
);
ig.push(
Inst::new(
"sload16",
@@ -1005,21 +914,6 @@ pub(crate) fn define(
.can_load(true),
);
ig.push(
Inst::new(
"sload16_complex",
r#"
Load 16 bits from memory at ``sum(args) + Offset`` and sign-extend.
This is equivalent to ``load.i16`` followed by ``sextend``.
"#,
&formats.load_complex,
)
.operands_in(vec![MemFlags, args, Offset])
.operands_out(vec![a])
.can_load(true),
);
ig.push(
Inst::new(
"istore16",
@@ -1034,20 +928,6 @@ pub(crate) fn define(
.can_store(true),
);
ig.push(
Inst::new(
"istore16_complex",
r#"
Store the low 16 bits of ``x`` to memory at ``sum(args) + Offset``.
This is equivalent to ``ireduce.i16`` followed by ``store.i16``.
"#,
&formats.store_complex,
)
.operands_in(vec![MemFlags, x, args, Offset])
.can_store(true),
);
let iExt32 = &TypeVar::new(
"iExt32",
"An integer type with more than 32 bits",
@@ -1071,21 +951,6 @@ pub(crate) fn define(
.can_load(true),
);
ig.push(
Inst::new(
"uload32_complex",
r#"
Load 32 bits from memory at ``sum(args) + Offset`` and zero-extend.
This is equivalent to ``load.i32`` followed by ``uextend``.
"#,
&formats.load_complex,
)
.operands_in(vec![MemFlags, args, Offset])
.operands_out(vec![a])
.can_load(true),
);
ig.push(
Inst::new(
"sload32",
@@ -1101,21 +966,6 @@ pub(crate) fn define(
.can_load(true),
);
ig.push(
Inst::new(
"sload32_complex",
r#"
Load 32 bits from memory at ``sum(args) + Offset`` and sign-extend.
This is equivalent to ``load.i32`` followed by ``sextend``.
"#,
&formats.load_complex,
)
.operands_in(vec![MemFlags, args, Offset])
.operands_out(vec![a])
.can_load(true),
);
ig.push(
Inst::new(
"istore32",
@@ -1130,20 +980,6 @@ pub(crate) fn define(
.can_store(true),
);
ig.push(
Inst::new(
"istore32_complex",
r#"
Store the low 32 bits of ``x`` to memory at ``sum(args) + Offset``.
This is equivalent to ``ireduce.i32`` followed by ``store.i32``.
"#,
&formats.store_complex,
)
.operands_in(vec![MemFlags, x, args, Offset])
.can_store(true),
);
let I16x8 = &TypeVar::new(
"I16x8",
"A SIMD vector with exactly 8 lanes of 16-bit values",
@@ -1169,20 +1005,6 @@ pub(crate) fn define(
.can_load(true),
);
ig.push(
Inst::new(
"uload8x8_complex",
r#"
Load an 8x8 vector (64 bits) from memory at ``sum(args) + Offset`` and zero-extend into an
i16x8 vector.
"#,
&formats.load_complex,
)
.operands_in(vec![MemFlags, args, Offset])
.operands_out(vec![a])
.can_load(true),
);
ig.push(
Inst::new(
"sload8x8",
@@ -1197,20 +1019,6 @@ pub(crate) fn define(
.can_load(true),
);
ig.push(
Inst::new(
"sload8x8_complex",
r#"
Load an 8x8 vector (64 bits) from memory at ``sum(args) + Offset`` and sign-extend into an
i16x8 vector.
"#,
&formats.load_complex,
)
.operands_in(vec![MemFlags, args, Offset])
.operands_out(vec![a])
.can_load(true),
);
let I32x4 = &TypeVar::new(
"I32x4",
"A SIMD vector with exactly 4 lanes of 32-bit values",
@@ -1236,20 +1044,6 @@ pub(crate) fn define(
.can_load(true),
);
ig.push(
Inst::new(
"uload16x4_complex",
r#"
Load a 16x4 vector (64 bits) from memory at ``sum(args) + Offset`` and zero-extend into an
i32x4 vector.
"#,
&formats.load_complex,
)
.operands_in(vec![MemFlags, args, Offset])
.operands_out(vec![a])
.can_load(true),
);
ig.push(
Inst::new(
"sload16x4",
@@ -1264,20 +1058,6 @@ pub(crate) fn define(
.can_load(true),
);
ig.push(
Inst::new(
"sload16x4_complex",
r#"
Load a 16x4 vector (64 bits) from memory at ``sum(args) + Offset`` and sign-extend into an
i32x4 vector.
"#,
&formats.load_complex,
)
.operands_in(vec![MemFlags, args, Offset])
.operands_out(vec![a])
.can_load(true),
);
let I64x2 = &TypeVar::new(
"I64x2",
"A SIMD vector with exactly 2 lanes of 64-bit values",
@@ -1303,20 +1083,6 @@ pub(crate) fn define(
.can_load(true),
);
ig.push(
Inst::new(
"uload32x2_complex",
r#"
Load a 32x2 vector (64 bits) from memory at ``sum(args) + Offset`` and zero-extend into an
i64x2 vector.
"#,
&formats.load_complex,
)
.operands_in(vec![MemFlags, args, Offset])
.operands_out(vec![a])
.can_load(true),
);
ig.push(
Inst::new(
"sload32x2",
@@ -1331,20 +1097,6 @@ pub(crate) fn define(
.can_load(true),
);
ig.push(
Inst::new(
"sload32x2_complex",
r#"
Load a 32x2 vector (64 bits) from memory at ``sum(args) + Offset`` and sign-extend into an
i64x2 vector.
"#,
&formats.load_complex,
)
.operands_in(vec![MemFlags, args, Offset])
.operands_out(vec![a])
.can_load(true),
);
let x = &Operand::new("x", Mem).with_doc("Value to be stored");
let a = &Operand::new("a", Mem).with_doc("Value loaded");
let Offset =