Skip to content

Commit

Permalink
Implement x86 simd basics
Browse files Browse the repository at this point in the history
Signed-off-by: Zoltan Herczeg [email protected]
  • Loading branch information
Zoltan Herczeg committed Oct 18, 2023
1 parent 2a35ef8 commit 91e26ba
Show file tree
Hide file tree
Showing 3 changed files with 1,384 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/jit/Backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ struct CompileContext {
sljit_emit_op1(compiler, mov_op, (arg), (argw), (source_reg), 0); \
}

#if (defined SLJIT_CONFIG_ARM && SLJIT_CONFIG_ARM)
#if (defined SLJIT_CONFIG_ARM && SLJIT_CONFIG_ARM) || (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86)
#define HAS_SIMD

#if (defined SLJIT_CONFIG_ARM_32 && SLJIT_CONFIG_ARM_32)
Expand Down Expand Up @@ -370,7 +370,9 @@ static void emitStoreImmediateParams(sljit_compiler* compiler, Instruction* inst
#include "TableInl.h"
#include "TryCatchInl.h"

#if (defined SLJIT_CONFIG_ARM_64 && SLJIT_CONFIG_ARM_64)
#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86)
#include "SimdX86Inl.h"
#elif (defined SLJIT_CONFIG_ARM_64 && SLJIT_CONFIG_ARM_64)
#include "SimdArm64Inl.h"
#elif (defined SLJIT_CONFIG_ARM_32 && SLJIT_CONFIG_ARM_32)
#include "SimdArm32Inl.h"
Expand Down
5 changes: 3 additions & 2 deletions src/jit/SimdArm32Inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,11 @@ enum ExtendType : uint32_t {
using unaryCallbackFunction = std::add_pointer<void(void*, void*)>::type;
using binaryCallbackFunction = std::add_pointer<void(void*, void*, void*)>::type;

void setArgs(Operand* operand, JITArg& arg) {
void setArgs(Operand* operand, JITArg& arg)
{
if (operand->item != nullptr && operand->item->asInstruction()->opcode() == ByteCode::Const128Opcode) {
arg.arg = SLJIT_MEM0();
arg.argw = (sljit_sw)reinterpret_cast<Const128*>(operand->item->asInstruction()->byteCode())->value();
arg.argw = (sljit_sw) reinterpret_cast<Const128*>(operand->item->asInstruction()->byteCode())->value();
} else {
arg.set(operand);
}
Expand Down
Loading

0 comments on commit 91e26ba

Please sign in to comment.