Skip to content

Commit

Permalink
Merge extended features in default
Browse files Browse the repository at this point in the history
Signed-off-by: HyukWoo Park <[email protected]>
  • Loading branch information
clover2123 authored and ksh8281 committed Oct 15, 2024
1 parent 0463316 commit 8fe33fa
Show file tree
Hide file tree
Showing 17 changed files with 4 additions and 165 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,27 +252,6 @@ jobs:
uses: mxschmitt/action-tmate@v3
timeout-minutes: 15

build-test-extended-feature:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Packages
run: |
sudo apt update
sudo apt install -y ninja-build gcc-multilib g++-multilib
- name: Build x64
env:
BUILD_OPTIONS: -DWALRUS_ARCH=x64 -DWALRUS_HOST=linux -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell -DWALRUS_EXTENDED_FEATURES=ON -GNinja
run: |
cmake -H. -Bout/extended $BUILD_OPTIONS
ninja -Cout/extended
- name: Run Tests
run: |
$RUNNER --engine="$GITHUB_WORKSPACE/out/extended/walrus" wasm-test-extended
$RUNNER --jit --engine="$GITHUB_WORKSPACE/out/extended/walrus" wasm-test-extended
build-test-performance:
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 0 additions & 4 deletions build/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ IF (${WALRUS_OUTPUT} STREQUAL "shared_lib" AND ${WALRUS_HOST} STREQUAL "android"
SET (WALRUS_LDFLAGS ${WALRUS_LDFLAGS} -shared)
ENDIF()

IF (WALRUS_EXTENDED_FEATURES)
SET (WALRUS_DEFINITIONS ${WALRUS_DEFINITIONS} -DENABLE_EXTENDED_FEATURES)
ENDIF()

#######################################################
# FLAGS FOR ADDITIONAL FUNCTION
#######################################################
Expand Down
10 changes: 0 additions & 10 deletions src/interpreter/ByteCode.h
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,6 @@ class FunctionType;
F(I8X16Shuffle)

// Extended Features
#if defined(ENABLE_EXTENDED_FEATURES)
#define FOR_EACH_BYTECODE_ATOMIC_LOAD_OP(F) \
F(I32AtomicLoad, uint32_t, uint32_t) \
F(I64AtomicLoad, uint64_t, uint64_t) \
Expand Down Expand Up @@ -588,13 +587,6 @@ class FunctionType;
F(MemoryAtomicWait32) \
F(MemoryAtomicWait64) \
F(AtomicFence)
#else // Extended Features
#define FOR_EACH_BYTECODE_ATOMIC_LOAD_OP(F)
#define FOR_EACH_BYTECODE_ATOMIC_STORE_OP(F)
#define FOR_EACH_BYTECODE_ATOMIC_RMW_OP(F)
#define FOR_EACH_BYTECODE_ATOMIC_RMW_CMPXCHG_OP(F)
#define FOR_EACH_BYTECODE_ATOMIC_OTHER(F)
#endif // Extended Features

#define FOR_EACH_BYTECODE(F) \
FOR_EACH_BYTECODE_OP(F) \
Expand Down Expand Up @@ -1740,7 +1732,6 @@ class SIMDReplaceLane : public ByteCode {
};


#if defined(ENABLE_EXTENDED_FEATURES)
class AtomicRmw : public ByteCode {
public:
AtomicRmw(Opcode opcode, uint32_t offset, ByteCodeStackOffset src0, ByteCodeStackOffset src1, ByteCodeStackOffset dst)
Expand Down Expand Up @@ -1857,7 +1848,6 @@ class AtomicFence : public ByteCode {
protected:
uint32_t m_offset;
};
#endif

#if !defined(NDEBUG)
#define DEFINE_RMW_BYTECODE_DUMP(name) \
Expand Down
2 changes: 0 additions & 2 deletions src/interpreter/Interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,6 @@ ByteCodeStackOffset* Interpreter::interpret(ExecutionState& state,
FOR_EACH_BYTECODE_ATOMIC_RMW_OP(ATOMIC_MEMORY_RMW_OPERATION)
FOR_EACH_BYTECODE_ATOMIC_RMW_CMPXCHG_OP(ATOMIC_MEMORY_RMW_CMPXCHG_OPERATION)

#if defined(ENABLE_EXTENDED_FEATURES)
DEFINE_OPCODE(MemoryAtomicWait32)
:
{
Expand Down Expand Up @@ -1084,7 +1083,6 @@ ByteCodeStackOffset* Interpreter::interpret(ExecutionState& state,
ADD_PROGRAM_COUNTER(AtomicFence);
NEXT_INSTRUCTION();
}
#endif

// FOR_EACH_BYTECODE_SIMD_ETC_OP
DEFINE_OPCODE(V128BitSelect)
Expand Down
2 changes: 0 additions & 2 deletions src/jit/Backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,6 @@ void JITCompiler::compileFunction(JITFunction* jitFunc, bool isExternal)
emitStackInit(m_compiler, item->asInstruction());
break;
}
#if defined(ENABLE_EXTENDED_FEATURES)
case Instruction::Atomic: {
emitAtomic(m_compiler, item->asInstruction());
break;
Expand All @@ -1264,7 +1263,6 @@ void JITCompiler::compileFunction(JITFunction* jitFunc, bool isExternal)
emitAtomicNotify(m_compiler, item->asInstruction());
break;
}
#endif /* ENABLE_EXTENDED_FEATURES */
default: {
switch (item->asInstruction()->opcode()) {
case ByteCode::SelectOpcode: {
Expand Down
8 changes: 0 additions & 8 deletions src/jit/ByteCodeParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ static bool isFloatGlobal(uint32_t globalIndex, Module* module)

#endif /* SLJIT_32BIT_ARCHITECTURE */

#if defined(ENABLE_EXTENDED_FEATURES)
#define OPERAND_TYPE_LIST_EXTENDED \
OL5(OTAtomicRmwI32, /* SSDTT */ I32, I32, I32 | TMP, PTR, I32 | S1) \
OL5(OTAtomicRmwI64, /* SSDTT */ I32, I64, I64 | TMP, PTR, I64 | S1) \
Expand All @@ -239,9 +238,6 @@ static bool isFloatGlobal(uint32_t globalIndex, Module* module)
OL6(OTAtomicWaitI32, /* SSSDTT */ I32, I32, I64, I32, PTR, I32 | S0) \
OL6(OTAtomicWaitI64, /* SSSDTT */ I32, I64, I64, I32, PTR, I64 | S0) \
OL5(OTAtomicNotify, /* SSDTT */ I32, I32, I32, PTR, I32 | S0)
#else /* !ENABLE_EXTENDED_FEATURES */
#define OPERAND_TYPE_LIST_EXTENDED
#endif /* ENABLE_EXTENDED_FEATURES */

#define OPERAND_TYPE_LIST_SIMD \
OL2(OTOp1V128, /* SD */ V128 | NOTMP, V128 | TMP | S0) \
Expand Down Expand Up @@ -1363,12 +1359,10 @@ static void compileFunction(JITCompiler* compiler)
instr->addInfo(Instruction::kIsCallback);
break;
}
#if defined(ENABLE_EXTENDED_FEATURES)
case ByteCode::AtomicFenceOpcode: {
group = Instruction::AtomicFence;
FALLTHROUGH;
}
#endif /* ENABLE_EXTENDED_FEATURES */
case ByteCode::UnreachableOpcode: {
compiler->append(byteCode, group, opcode, 0, 0);
break;
Expand Down Expand Up @@ -1843,7 +1837,6 @@ static void compileFunction(JITCompiler* compiler)
#endif /* SLJIT_CONFIG_X86 */
break;
}
#if defined(ENABLE_EXTENDED_FEATURES)
case ByteCode::I32AtomicLoadOpcode:
case ByteCode::I32AtomicLoad8UOpcode:
case ByteCode::I32AtomicLoad16UOpcode: {
Expand Down Expand Up @@ -2022,7 +2015,6 @@ static void compileFunction(JITCompiler* compiler)
operands[2] = STACK_OFFSET(memoryAtomicNotify->dstOffset());
break;
}
#endif /* ENABLE_EXTENDED_FEATURES */
default: {
ASSERT_NOT_REACHED();
break;
Expand Down
2 changes: 0 additions & 2 deletions src/jit/Compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,12 @@ class InstructionListItem {
ShiftSIMD,
// Special type for initializing values from the stack
StackInit,
#if defined(ENABLE_EXTENDED_FEATURES)
// Atomic memory operations (e.g. I32AtomicRmwAdd, I64AtomicRmw16OrU)
Atomic,
// Special types for thread synchronization operations
AtomicFence,
AtomicWait,
AtomicNotify,
#endif /* ENABLE_EXTENDED_FEATURES */
};

virtual ~InstructionListItem() {}
Expand Down
Loading

0 comments on commit 8fe33fa

Please sign in to comment.