From 633f88c86c9a931cad1ce99f960987c36bc16ca8 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Wed, 23 Jan 2019 16:17:50 -0800 Subject: [PATCH 1/4] Specify v128.const text format --- proposals/simd/SIMD.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/proposals/simd/SIMD.md b/proposals/simd/SIMD.md index 4df5f9a3d..51dc6bdaa 100644 --- a/proposals/simd/SIMD.md +++ b/proposals/simd/SIMD.md @@ -217,6 +217,24 @@ Materialize a constant `v128` SIMD value from the 16 immediate bytes in the immediate mode operand `imm` . The `v128.const` instruction is encoded with 16 immediate bytes which provide the bits of the vector directly. +The `v128.const` instruction has multiple valid text formats corresponding to +different lane interpretations. The valid text formats are + +``` +v128.const i8x16 *i8* *i8* *i8* *i8* *i8* *i8* *i8* *i8* *i8* *i8* *i8* *i8* *i8* *i8* *i8* *i8* +v128.const i16x8 *i16* *i16* *i16* *i16* *i16* *i16* *i16* *i16* +v128.const i32x4 *i32* *i32* *i32* *i32* +v128.const i64x2 *i64* *i64* +v128.const f32x4 *f32* *f32* *f32* *f32* +v128.const f64x2 *f64* *f64* +``` + +The canonical text format used for printing `v128.const` instructions is + +``` +v128.const i32x4 0x*NNNNNNNN* 0x*NNNNNNNN* 0x*NNNNNNNN* 0x*NNNNNNNN* +``` + ### Create vector with identical lanes * `i8x16.splat(x: i32) -> v128` * `i16x8.splat(x: i32) -> v128` From b0f13a779ebf0d8c2fb8286e49f6f2be4feab0de Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Wed, 23 Jan 2019 16:21:32 -0800 Subject: [PATCH 2/4] Remove asterisks in code blocks --- proposals/simd/SIMD.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/proposals/simd/SIMD.md b/proposals/simd/SIMD.md index 51dc6bdaa..33333236f 100644 --- a/proposals/simd/SIMD.md +++ b/proposals/simd/SIMD.md @@ -221,12 +221,12 @@ The `v128.const` instruction has multiple valid text formats corresponding to different lane interpretations. The valid text formats are ``` -v128.const i8x16 *i8* *i8* *i8* *i8* *i8* *i8* *i8* *i8* *i8* *i8* *i8* *i8* *i8* *i8* *i8* *i8* -v128.const i16x8 *i16* *i16* *i16* *i16* *i16* *i16* *i16* *i16* -v128.const i32x4 *i32* *i32* *i32* *i32* -v128.const i64x2 *i64* *i64* -v128.const f32x4 *f32* *f32* *f32* *f32* -v128.const f64x2 *f64* *f64* +v128.const i8x16 i8 i8 i8 i8 i8 i8 i8 i8 i8 i8 i8 i8 i8 i8 i8 i8 +v128.const i16x8 i16 i16 i16 i16 i16 i16 i16 i16 +v128.const i32x4 i32 i32 i32 i32 +v128.const i64x2 i64 i64 +v128.const f32x4 f32 f32 f32 f32 +v128.const f64x2 f64 f64 ``` The canonical text format used for printing `v128.const` instructions is From 05781d3e05e741c873cd3f428532763e504831d9 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Wed, 23 Jan 2019 16:22:58 -0800 Subject: [PATCH 3/4] More asterisks --- proposals/simd/SIMD.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/simd/SIMD.md b/proposals/simd/SIMD.md index 33333236f..cc24ffb43 100644 --- a/proposals/simd/SIMD.md +++ b/proposals/simd/SIMD.md @@ -232,7 +232,7 @@ v128.const f64x2 f64 f64 The canonical text format used for printing `v128.const` instructions is ``` -v128.const i32x4 0x*NNNNNNNN* 0x*NNNNNNNN* 0x*NNNNNNNN* 0x*NNNNNNNN* +v128.const i32x4 0xNNNNNNNN 0xNNNNNNNN 0xNNNNNNNN 0xNNNNNNNN ``` ### Create vector with identical lanes From 0a1c563b4926c6d0eb8ac7e88ceca5626e9aa1f4 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Mon, 28 Jan 2019 14:58:56 -0800 Subject: [PATCH 4/4] Move text format discussion to new file --- proposals/simd/SIMD.md | 18 ------------------ proposals/simd/TextSIMD.md | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 18 deletions(-) create mode 100644 proposals/simd/TextSIMD.md diff --git a/proposals/simd/SIMD.md b/proposals/simd/SIMD.md index cc24ffb43..4df5f9a3d 100644 --- a/proposals/simd/SIMD.md +++ b/proposals/simd/SIMD.md @@ -217,24 +217,6 @@ Materialize a constant `v128` SIMD value from the 16 immediate bytes in the immediate mode operand `imm` . The `v128.const` instruction is encoded with 16 immediate bytes which provide the bits of the vector directly. -The `v128.const` instruction has multiple valid text formats corresponding to -different lane interpretations. The valid text formats are - -``` -v128.const i8x16 i8 i8 i8 i8 i8 i8 i8 i8 i8 i8 i8 i8 i8 i8 i8 i8 -v128.const i16x8 i16 i16 i16 i16 i16 i16 i16 i16 -v128.const i32x4 i32 i32 i32 i32 -v128.const i64x2 i64 i64 -v128.const f32x4 f32 f32 f32 f32 -v128.const f64x2 f64 f64 -``` - -The canonical text format used for printing `v128.const` instructions is - -``` -v128.const i32x4 0xNNNNNNNN 0xNNNNNNNN 0xNNNNNNNN 0xNNNNNNNN -``` - ### Create vector with identical lanes * `i8x16.splat(x: i32) -> v128` * `i16x8.splat(x: i32) -> v128` diff --git a/proposals/simd/TextSIMD.md b/proposals/simd/TextSIMD.md new file mode 100644 index 000000000..21b4272e8 --- /dev/null +++ b/proposals/simd/TextSIMD.md @@ -0,0 +1,21 @@ +# Text format for SIMD + +### v128.const + +The `v128.const` instruction has multiple valid text formats corresponding to +different lane interpretations. The valid text formats are + +``` +v128.const i8x16 i8 i8 i8 i8 i8 i8 i8 i8 i8 i8 i8 i8 i8 i8 i8 i8 +v128.const i16x8 i16 i16 i16 i16 i16 i16 i16 i16 +v128.const i32x4 i32 i32 i32 i32 +v128.const i64x2 i64 i64 +v128.const f32x4 f32 f32 f32 f32 +v128.const f64x2 f64 f64 +``` + +The canonical text format used for printing `v128.const` instructions is + +``` +v128.const i32x4 0xNNNNNNNN 0xNNNNNNNN 0xNNNNNNNN 0xNNNNNNNN +```