Skip to content

Commit 444b063

Browse files
committed
Fix spec test generator alignment and clang-format for atomic CI.
Use natural access width (not value_type) when encoding atomic memarg alignment in generate_atomic_spec_test.py, and regenerate acquire-release-atomics/basic.wast so sub-word atomics parse correctly. Signed-off-by: Gaurav Chaudhary <chaudharygaurav2004@gmail.com>
1 parent ac16c5d commit 444b063

3 files changed

Lines changed: 7 additions & 11 deletions

File tree

‎src/parser/contexts.h‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2457,13 +2457,8 @@ struct ParseDefsCtx : TypeParserCtx<ParseDefsCtx>, AnnotationParserCtx {
24572457
auto m = getMemory(pos, mem);
24582458
CHECK_ERR(m);
24592459
return withLoc(pos,
2460-
irBuilder.makeAtomicRMW(op,
2461-
bytes,
2462-
memarg.offset,
2463-
memarg.align,
2464-
type,
2465-
*m,
2466-
order));
2460+
irBuilder.makeAtomicRMW(
2461+
op, bytes, memarg.offset, memarg.align, type, *m, order));
24672462
}
24682463

24692464
Result<> makeAtomicCmpxchg(Index pos,
@@ -2497,8 +2492,8 @@ struct ParseDefsCtx : TypeParserCtx<ParseDefsCtx>, AnnotationParserCtx {
24972492
Memarg memarg) {
24982493
auto m = getMemory(pos, mem);
24992494
CHECK_ERR(m);
2500-
return withLoc(
2501-
pos, irBuilder.makeAtomicNotify(memarg.offset, memarg.align, *m));
2495+
return withLoc(pos,
2496+
irBuilder.makeAtomicNotify(memarg.offset, memarg.align, *m));
25022497
}
25032498

25042499
Result<> makeAtomicFence(Index pos,

‎src/wasm/wasm-binary.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4007,7 +4007,7 @@ Result<> WasmBinaryReader::readInst() {
40074007
#define RMW(op) \
40084008
case BinaryConsts::I32AtomicRMW##op: { \
40094009
auto [mem, align, offset, memoryOrder] = getRMWMemarg(); \
4010-
return builder.makeAtomicRMW( \
4010+
return builder.makeAtomicRMW( \
40114011
RMW##op, 4, offset, align, Type::i32, mem, memoryOrder); \
40124012
} \
40134013
case BinaryConsts::I32AtomicRMW##op##8U: { \

‎src/wasm/wasm-ir-builder.cpp‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1709,7 +1709,8 @@ Result<> IRBuilder::makeAtomicCmpxchg(unsigned bytes,
17091709
return Ok{};
17101710
}
17111711

1712-
Result<> IRBuilder::makeAtomicWait(Type type, Address offset, Address align, Name mem) {
1712+
Result<>
1713+
IRBuilder::makeAtomicWait(Type type, Address offset, Address align, Name mem) {
17131714
CHECK_ERR(requireNaturalAtomicAlign(align, type == Type::i32 ? 4 : 8));
17141715
AtomicWait curr;
17151716
curr.memory = mem;

0 commit comments

Comments
 (0)