Commit 7ec8ecce authored by bbudge's avatar bbudge Committed by Commit bot

Add Simd128Value code stubs.

LOG=N
BUG=v8:4124

Review URL: https://codereview.chromium.org/1706053002

Cr-Commit-Position: refs/heads/master@{#34951}
parent a4afba53
......@@ -240,6 +240,13 @@ void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(0, nullptr, nullptr);
}
#define SIMD128_ALLOC_DESC(TYPE, Type, type, lane_count, lane_type) \
void Allocate##Type##Descriptor::InitializePlatformSpecific( \
CallInterfaceDescriptorData* data) { \
data->InitializePlatformSpecific(0, nullptr, nullptr); \
}
SIMD128_TYPES(SIMD128_ALLOC_DESC)
#undef SIMD128_ALLOC_DESC
void AllocateInNewSpaceDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
......
......@@ -265,6 +265,13 @@ void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(0, nullptr, nullptr);
}
#define SIMD128_ALLOC_DESC(TYPE, Type, type, lane_count, lane_type) \
void Allocate##Type##Descriptor::InitializePlatformSpecific( \
CallInterfaceDescriptorData* data) { \
data->InitializePlatformSpecific(0, nullptr, nullptr); \
}
SIMD128_TYPES(SIMD128_ALLOC_DESC)
#undef SIMD128_ALLOC_DESC
void AllocateInNewSpaceDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
......
......@@ -420,6 +420,13 @@ Callable CodeFactory::AllocateMutableHeapNumber(Isolate* isolate) {
return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor());
}
#define SIMD128_ALLOC(TYPE, Type, type, lane_count, lane_type) \
Callable CodeFactory::Allocate##Type(Isolate* isolate) { \
Allocate##Type##Stub stub(isolate); \
return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); \
}
SIMD128_TYPES(SIMD128_ALLOC)
#undef SIMD128_ALLOC
// static
Callable CodeFactory::AllocateInNewSpace(Isolate* isolate) {
......
......@@ -115,6 +115,10 @@ class CodeFactory final {
static Callable AllocateHeapNumber(Isolate* isolate);
static Callable AllocateMutableHeapNumber(Isolate* isolate);
#define SIMD128_ALLOC(TYPE, Type, type, lane_count, lane_type) \
static Callable Allocate##Type(Isolate* isolate);
SIMD128_TYPES(SIMD128_ALLOC)
#undef SIMD128_ALLOC
static Callable AllocateInNewSpace(Isolate* isolate);
static Callable ArgumentAdaptor(Isolate* isolate);
......
......@@ -489,6 +489,22 @@ void AllocateMutableHeapNumberStub::GenerateAssembly(
assembler->Return(result);
}
#define SIMD128_GEN_ASM(TYPE, Type, type, lane_count, lane_type) \
void Allocate##Type##Stub::GenerateAssembly( \
compiler::CodeStubAssembler* assembler) const { \
compiler::Node* result = assembler->Allocate( \
Simd128Value::kSize, compiler::CodeStubAssembler::kNone); \
compiler::Node* map_offset = \
assembler->IntPtrConstant(HeapObject::kMapOffset - kHeapObjectTag); \
compiler::Node* map = assembler->IntPtrAdd(result, map_offset); \
assembler->StoreNoWriteBarrier( \
MachineRepresentation::kTagged, map, \
assembler->HeapConstant(isolate()->factory()->type##_map())); \
assembler->Return(result); \
}
SIMD128_TYPES(SIMD128_GEN_ASM)
#undef SIMD128_GEN_ASM
void StringLengthStub::GenerateAssembly(
compiler::CodeStubAssembler* assembler) const {
compiler::Node* value = assembler->Parameter(0);
......@@ -2551,6 +2567,14 @@ void AllocateMutableHeapNumberStub::InitializeDescriptor(
descriptor->Initialize();
}
#define SIMD128_INIT_DESC(TYPE, Type, type, lane_count, lane_type) \
void Allocate##Type##Stub::InitializeDescriptor( \
CodeStubDescriptor* descriptor) { \
descriptor->Initialize( \
Runtime::FunctionForId(Runtime::kCreate##Type)->entry); \
}
SIMD128_TYPES(SIMD128_INIT_DESC)
#undef SIMD128_INIT_DESC
void AllocateInNewSpaceStub::InitializeDescriptor(
CodeStubDescriptor* descriptor) {
......
......@@ -99,6 +99,16 @@ namespace internal {
/* TurboFanCodeStubs */ \
V(AllocateHeapNumber) \
V(AllocateMutableHeapNumber) \
V(AllocateFloat32x4) \
V(AllocateInt32x4) \
V(AllocateUint32x4) \
V(AllocateBool32x4) \
V(AllocateInt16x8) \
V(AllocateUint16x8) \
V(AllocateBool16x8) \
V(AllocateInt8x16) \
V(AllocateUint8x16) \
V(AllocateBool8x16) \
V(StringLength) \
V(LessThan) \
V(LessThanOrEqual) \
......@@ -2559,6 +2569,22 @@ class AllocateMutableHeapNumberStub : public TurboFanCodeStub {
DEFINE_CODE_STUB(AllocateMutableHeapNumber, TurboFanCodeStub);
};
#define SIMD128_ALLOC_STUB(TYPE, Type, type, lane_count, lane_type) \
class Allocate##Type##Stub : public TurboFanCodeStub { \
public: \
explicit Allocate##Type##Stub(Isolate* isolate) \
: TurboFanCodeStub(isolate) {} \
\
void InitializeDescriptor(CodeStubDescriptor* descriptor) override; \
void GenerateAssembly( \
compiler::CodeStubAssembler* assembler) const override; \
\
DEFINE_CALL_INTERFACE_DESCRIPTOR(Allocate##Type); \
DEFINE_CODE_STUB(Allocate##Type, TurboFanCodeStub); \
};
SIMD128_TYPES(SIMD128_ALLOC_STUB)
#undef SIMD128_ALLOC_STUB
class AllocateInNewSpaceStub final : public HydrogenCodeStub {
public:
explicit AllocateInNewSpaceStub(Isolate* isolate)
......
......@@ -244,6 +244,13 @@ void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(0, nullptr, nullptr);
}
#define SIMD128_ALLOC_DESC(TYPE, Type, type, lane_count, lane_type) \
void Allocate##Type##Descriptor::InitializePlatformSpecific( \
CallInterfaceDescriptorData* data) { \
data->InitializePlatformSpecific(0, nullptr, nullptr); \
}
SIMD128_TYPES(SIMD128_ALLOC_DESC)
#undef SIMD128_ALLOC_DESC
void AllocateInNewSpaceDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
......
......@@ -47,6 +47,16 @@ class PlatformInterfaceDescriptor;
V(TransitionElementsKind) \
V(AllocateHeapNumber) \
V(AllocateMutableHeapNumber) \
V(AllocateFloat32x4) \
V(AllocateInt32x4) \
V(AllocateUint32x4) \
V(AllocateBool32x4) \
V(AllocateInt16x8) \
V(AllocateUint16x8) \
V(AllocateBool16x8) \
V(AllocateInt8x16) \
V(AllocateUint8x16) \
V(AllocateBool8x16) \
V(AllocateInNewSpace) \
V(ArrayConstructorConstantArgCount) \
V(ArrayConstructor) \
......@@ -551,6 +561,13 @@ class AllocateHeapNumberDescriptor : public CallInterfaceDescriptor {
DECLARE_DESCRIPTOR(AllocateHeapNumberDescriptor, CallInterfaceDescriptor)
};
#define SIMD128_ALLOC_DESC(TYPE, Type, type, lane_count, lane_type) \
class Allocate##Type##Descriptor : public CallInterfaceDescriptor { \
public: \
DECLARE_DESCRIPTOR(Allocate##Type##Descriptor, CallInterfaceDescriptor) \
};
SIMD128_TYPES(SIMD128_ALLOC_DESC)
#undef SIMD128_ALLOC_DESC
class AllocateMutableHeapNumberDescriptor : public CallInterfaceDescriptor {
public:
......
......@@ -239,6 +239,13 @@ void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(0, nullptr, nullptr);
}
#define SIMD128_ALLOC_DESC(TYPE, Type, type, lane_count, lane_type) \
void Allocate##Type##Descriptor::InitializePlatformSpecific( \
CallInterfaceDescriptorData* data) { \
data->InitializePlatformSpecific(0, nullptr, nullptr); \
}
SIMD128_TYPES(SIMD128_ALLOC_DESC)
#undef SIMD128_ALLOC_DESC
void AllocateInNewSpaceDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
......
......@@ -239,6 +239,13 @@ void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(0, nullptr, nullptr);
}
#define SIMD128_ALLOC_DESC(TYPE, Type, type, lane_count, lane_type) \
void Allocate##Type##Descriptor::InitializePlatformSpecific( \
CallInterfaceDescriptorData* data) { \
data->InitializePlatformSpecific(0, nullptr, nullptr); \
}
SIMD128_TYPES(SIMD128_ALLOC_DESC)
#undef SIMD128_ALLOC_DESC
void AllocateInNewSpaceDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
......
......@@ -236,6 +236,13 @@ void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(0, nullptr, nullptr);
}
#define SIMD128_ALLOC_DESC(TYPE, Type, type, lane_count, lane_type) \
void Allocate##Type##Descriptor::InitializePlatformSpecific( \
CallInterfaceDescriptorData* data) { \
data->InitializePlatformSpecific(0, nullptr, nullptr); \
}
SIMD128_TYPES(SIMD128_ALLOC_DESC)
#undef SIMD128_ALLOC_DESC
void AllocateInNewSpaceDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
......
......@@ -235,6 +235,13 @@ void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(0, nullptr, nullptr);
}
#define SIMD128_ALLOC_DESC(TYPE, Type, type, lane_count, lane_type) \
void Allocate##Type##Descriptor::InitializePlatformSpecific( \
CallInterfaceDescriptorData* data) { \
data->InitializePlatformSpecific(0, nullptr, nullptr); \
}
SIMD128_TYPES(SIMD128_ALLOC_DESC)
#undef SIMD128_ALLOC_DESC
void AllocateInNewSpaceDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
......
......@@ -242,6 +242,13 @@ void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(0, nullptr, nullptr);
}
#define SIMD128_ALLOC_DESC(TYPE, Type, type, lane_count, lane_type) \
void Allocate##Type##Descriptor::InitializePlatformSpecific( \
CallInterfaceDescriptorData* data) { \
data->InitializePlatformSpecific(0, nullptr, nullptr); \
}
SIMD128_TYPES(SIMD128_ALLOC_DESC)
#undef SIMD128_ALLOC_DESC
void AllocateInNewSpaceDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment