Skip to content

Commit 830d32a

Browse files
authored
Rename atomic.notify, *.atomic.wait (#1564)
atomic.notify -> memory.atomic.notify i32.atomic.wait -> memory.atomic.wait32 i64.atomic.wait -> memory.atomic.wait64 These were renamed upstream a while ago, but the new names were not added to wabt.
1 parent 8e42376 commit 830d32a

File tree

11 files changed

+548
-539
lines changed

11 files changed

+548
-539
lines changed

src/binary-reader.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,7 @@ Result BinaryReader::ReadFunctionBody(Offset end_offset) {
13731373
CALLBACK0(OnOpcodeBare);
13741374
break;
13751375

1376-
case Opcode::AtomicNotify: {
1376+
case Opcode::MemoryAtomicNotify: {
13771377
Address alignment_log2;
13781378
CHECK_RESULT(ReadAlignment(&alignment_log2, "load alignment"));
13791379
Address offset;
@@ -1384,8 +1384,8 @@ Result BinaryReader::ReadFunctionBody(Offset end_offset) {
13841384
break;
13851385
}
13861386

1387-
case Opcode::I32AtomicWait:
1388-
case Opcode::I64AtomicWait: {
1387+
case Opcode::MemoryAtomicWait32:
1388+
case Opcode::MemoryAtomicWait64: {
13891389
Address alignment_log2;
13901390
CHECK_RESULT(ReadAlignment(&alignment_log2, "load alignment"));
13911391
Address offset;

src/interp/interp.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,9 +1635,9 @@ RunResult Thread::StepInternal(Trap::Ptr* out_trap) {
16351635
case O::I32X4Abs: return DoSimdUnop(IntAbs<u32>);
16361636

16371637
case O::AtomicFence:
1638-
case O::AtomicNotify:
1639-
case O::I32AtomicWait:
1640-
case O::I64AtomicWait:
1638+
case O::MemoryAtomicNotify:
1639+
case O::MemoryAtomicWait32:
1640+
case O::MemoryAtomicWait64:
16411641
return TRAP("not implemented");
16421642

16431643
case O::I32AtomicLoad: return DoAtomicLoad<u32>(instr, out_trap);

src/interp/istream.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ Instr Istream::Read(Offset* offset) const {
541541
instr.imm_u32x2.snd = ReadAt<u32>(offset);
542542
break;
543543

544-
case Opcode::AtomicNotify:
544+
case Opcode::MemoryAtomicNotify:
545545
case Opcode::F32Store:
546546
case Opcode::F64Store:
547547
case Opcode::I32AtomicRmw16AddU:
@@ -610,12 +610,12 @@ Instr Istream::Read(Offset* offset) const {
610610
case Opcode::I32AtomicRmw16CmpxchgU:
611611
case Opcode::I32AtomicRmw8CmpxchgU:
612612
case Opcode::I32AtomicRmwCmpxchg:
613-
case Opcode::I32AtomicWait:
614613
case Opcode::I64AtomicRmw16CmpxchgU:
615614
case Opcode::I64AtomicRmw32CmpxchgU:
616615
case Opcode::I64AtomicRmw8CmpxchgU:
617616
case Opcode::I64AtomicRmwCmpxchg:
618-
case Opcode::I64AtomicWait:
617+
case Opcode::MemoryAtomicWait32:
618+
case Opcode::MemoryAtomicWait64:
619619
// Index and memory offset immediates, 3 operands.
620620
instr.kind = InstrKind::Imm_Index_Offset_Op_3;
621621
instr.imm_u32x2.fst = ReadAt<u32>(offset);

src/lexer-keywords.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ assert_return, TokenType::AssertReturn
2525
assert_trap, TokenType::AssertTrap
2626
assert_unlinkable, TokenType::AssertUnlinkable
2727
atomic.fence, TokenType::AtomicFence, Opcode::AtomicFence
28-
atomic.notify, TokenType::AtomicNotify, Opcode::AtomicNotify
2928
binary, TokenType::Bin
3029
block, TokenType::Block, Opcode::Block
3130
br_if, TokenType::BrIf, Opcode::BrIf
@@ -243,7 +242,6 @@ i32.atomic.rmw.xor, TokenType::AtomicRmw, Opcode::I32AtomicRmwXor
243242
i32.atomic.store16, TokenType::AtomicStore, Opcode::I32AtomicStore16
244243
i32.atomic.store8, TokenType::AtomicStore, Opcode::I32AtomicStore8
245244
i32.atomic.store, TokenType::AtomicStore, Opcode::I32AtomicStore
246-
i32.atomic.wait, TokenType::AtomicWait, Opcode::I32AtomicWait
247245
i32.clz, TokenType::Unary, Opcode::I32Clz
248246
i32.const, TokenType::Const, Opcode::I32Const
249247
i32.ctz, TokenType::Unary, Opcode::I32Ctz
@@ -368,7 +366,6 @@ i64.atomic.store16, TokenType::AtomicStore, Opcode::I64AtomicStore16
368366
i64.atomic.store32, TokenType::AtomicStore, Opcode::I64AtomicStore32
369367
i64.atomic.store8, TokenType::AtomicStore, Opcode::I64AtomicStore8
370368
i64.atomic.store, TokenType::AtomicStore, Opcode::I64AtomicStore
371-
i64.atomic.wait, TokenType::AtomicWait, Opcode::I64AtomicWait
372369
i64.clz, TokenType::Unary, Opcode::I64Clz
373370
i64.const, TokenType::Const, Opcode::I64Const
374371
i64.ctz, TokenType::Unary, Opcode::I64Ctz
@@ -482,6 +479,9 @@ local.set, TokenType::LocalSet, Opcode::LocalSet
482479
local.tee, TokenType::LocalTee, Opcode::LocalTee
483480
local, TokenType::Local
484481
loop, TokenType::Loop, Opcode::Loop
482+
memory.atomic.notify, TokenType::AtomicNotify, Opcode::MemoryAtomicNotify
483+
memory.atomic.wait32, TokenType::AtomicWait, Opcode::MemoryAtomicWait32
484+
memory.atomic.wait64, TokenType::AtomicWait, Opcode::MemoryAtomicWait64
485485
memory.copy, TokenType::MemoryCopy, Opcode::MemoryCopy
486486
memory.fill, TokenType::MemoryFill, Opcode::MemoryFill
487487
memory.grow, TokenType::MemoryGrow, Opcode::MemoryGrow
@@ -541,6 +541,9 @@ v128.load8_splat, TokenType::Load, Opcode::V128Load8Splat
541541
i8x16.shuffle, TokenType::SimdShuffleOp, Opcode::I8X16Shuffle
542542
i8x16.swizzle, TokenType::Binary, Opcode::I8X16Swizzle
543543
# Deprecated names.
544+
atomic.notify, TokenType::AtomicNotify, Opcode::MemoryAtomicNotify
545+
i32.atomic.wait, TokenType::AtomicWait, Opcode::MemoryAtomicWait32
546+
i64.atomic.wait, TokenType::AtomicWait, Opcode::MemoryAtomicWait64
544547
anyfunc, Type::FuncRef
545548
f32.convert_s/i32, TokenType::Convert, Opcode::F32ConvertI32S
546549
f32.convert_s/i64, TokenType::Convert, Opcode::F32ConvertI64S

src/opcode.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ bool Opcode::IsEnabled(const Features& features) const {
9191
case Opcode::I64Extend32S:
9292
return features.sign_extension_enabled();
9393

94-
case Opcode::AtomicNotify:
95-
case Opcode::I32AtomicWait:
96-
case Opcode::I64AtomicWait:
94+
case Opcode::MemoryAtomicNotify:
95+
case Opcode::MemoryAtomicWait32:
96+
case Opcode::MemoryAtomicWait64:
9797
case Opcode::AtomicFence:
9898
case Opcode::I32AtomicLoad:
9999
case Opcode::I64AtomicLoad:

src/opcode.def

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,9 @@ WABT_OPCODE(V128, V128, ___, ___, 0, 0xfd, 0xfa, F32X4ConvertI32X4S, "f32x4.c
452452
WABT_OPCODE(V128, V128, ___, ___, 0, 0xfd, 0xfb, F32X4ConvertI32X4U, "f32x4.convert_i32x4_u", "")
453453

454454
/* Thread opcodes (--enable-threads) */
455-
WABT_OPCODE(I32, I32, I32, ___, 4, 0xfe, 0x00, AtomicNotify, "atomic.notify", "")
456-
WABT_OPCODE(I32, I32, I32, I64, 4, 0xfe, 0x01, I32AtomicWait, "i32.atomic.wait", "")
457-
WABT_OPCODE(I32, I32, I64, I64, 8, 0xfe, 0x02, I64AtomicWait, "i64.atomic.wait", "")
455+
WABT_OPCODE(I32, I32, I32, ___, 4, 0xfe, 0x00, MemoryAtomicNotify, "memory.atomic.notify", "")
456+
WABT_OPCODE(I32, I32, I32, I64, 4, 0xfe, 0x01, MemoryAtomicWait32, "memory.atomic.wait32", "")
457+
WABT_OPCODE(I32, I32, I64, I64, 8, 0xfe, 0x02, MemoryAtomicWait64, "memory.atomic.wait64", "")
458458
WABT_OPCODE(___, ___, ___, ___, 0, 0xfe, 0x03, AtomicFence, "atomic.fence", "")
459459
WABT_OPCODE(I32, I32, ___, ___, 4, 0xfe, 0x10, I32AtomicLoad, "i32.atomic.load", "")
460460
WABT_OPCODE(I64, I32, ___, ___, 8, 0xfe, 0x11, I64AtomicLoad, "i64.atomic.load", "")

0 commit comments

Comments
 (0)