Codegen: Allow encoding of (r32|r64).(load|store)

Accessing Wasm reference globals that are reference types will
want to use the plain load/store instructions. This commit adds
encodings for these instructions to match loading a i32/i64.
Producers of IR are required to insert the appropriate barriers
around the loads/stores.
This commit is contained in:
Ryan Hunt
2020-01-06 15:49:06 -06:00
parent 848baa0aa7
commit bbc0a328c7
4 changed files with 29 additions and 0 deletions

View File

@@ -37,6 +37,12 @@ impl CpuMode {
assert!(self.default_legalize.is_none());
self.default_legalize = Some(group.id);
}
pub fn legalize_value_type(&mut self, lane_type: impl Into<ValueType>, group: &TransformGroup) {
assert!(self
.typed_legalize
.insert(lane_type.into(), group.id)
.is_none());
}
pub fn legalize_type(&mut self, lane_type: impl Into<LaneType>, group: &TransformGroup) {
assert!(self
.typed_legalize