Skip to content
This repository was archived by the owner on Aug 17, 2022. It is now read-only.

Update string.(lift|lower)_memory to read u32 + string.size #102

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions proposals/interface-types/working-notes/Instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ string.size #encoding

The type of this instruction is:
```
[string] -> [i32]
[string] -> [u32]
```

The output is the number of bytes needed to represent the input string in `#encoding`.
Expand All @@ -125,7 +125,7 @@ string.lift_memory #memidx #encoding

The type of this instruction is:
```
[$base: i32, $len: i32] -> [string]
[$base: u32, $len: u32] -> [string]
```

The output is a sequence of unicode code points taken by interpreting `store.memory[$memidx].bytes[$base .. $base + $len]` with `#encoding`.
Expand All @@ -141,7 +141,7 @@ string.lower_memory #memidx #encoding

The type of this instruction is:
```
[$base: i32, string] -> []
[$base: u32, string] -> []
```

The instruction will encode the string with `#encoding` into the memory specified by `#memidx` at the offset `$base`.
Expand Down