Skip to content

Commit 3532eed

Browse files
authored
[spec] Update align and offset type in text format for memory64 (#1888)
1 parent 27d5644 commit 3532eed

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

Diff for: document/core/text/instructions.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,10 @@ Lexically, an |Toffset| or |Talign| phrase is considered a single :ref:`keyword
385385
\production{memory argument} & \Tmemarg_N &::=&
386386
o{:}\Toffset~~a{:}\Talign_N &\Rightarrow& \{ \ALIGN~n,~\OFFSET~o \} & (\iff a = 2^n) \\
387387
\production{memory offset} & \Toffset &::=&
388-
\text{offset{=}}o{:}\Tu32 &\Rightarrow& o \\ &&|&
388+
\text{offset{=}}o{:}\Tu64 &\Rightarrow& o \\ &&|&
389389
\epsilon &\Rightarrow& 0 \\
390390
\production{memory alignment} & \Talign_N &::=&
391-
\text{align{=}}a{:}\Tu32 &\Rightarrow& a \\ &&|&
391+
\text{align{=}}a{:}\Tu64 &\Rightarrow& a \\ &&|&
392392
\epsilon &\Rightarrow& N \\
393393
\production{instruction} & \Tplaininstr_I &::=& \dots \phantom{averylonginstructionnameforvectext} && \phantom{vechasreallylonginstructionnames} \\ &&|&
394394
\text{i32.load}~~x{:}\Tmemidx~~m{:}\Tmemarg_4 &\Rightarrow& \I32.\LOAD~x~m \\ &&|&

Diff for: test/core/align.wast

+22
Original file line numberDiff line numberDiff line change
@@ -1000,3 +1000,25 @@
10001000
)
10011001
"malformed memop flags"
10021002
)
1003+
1004+
;; Max align and offset in non-malformed text
1005+
(module
1006+
(memory i64 1)
1007+
(func
1008+
i64.const 0
1009+
i32.load offset=0xFFFF_FFFF_FFFF_FFFF
1010+
drop
1011+
)
1012+
)
1013+
1014+
(assert_invalid
1015+
(module
1016+
(memory 1)
1017+
(func
1018+
i32.const 0
1019+
i32.load offset=0xFFFF_FFFF_FFFF_FFFF align=0x8000_0000_0000_0000
1020+
drop
1021+
)
1022+
)
1023+
"alignment must not be larger than natural"
1024+
)

0 commit comments

Comments
 (0)