Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Move SupportsSIMD128InCrankshaft along with SupportsCrankshaft. #24

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions src/arm/assembler-arm.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ class CpuFeatures : public AllStatic {

static bool SupportsCrankshaft() { return CpuFeatures::IsSupported(VFP3); }

static bool SupportsSIMD128InCrankshaft() {
// Not Implemented.
return false;
}

private:
static bool Check(CpuFeature f, unsigned set) {
return (set & flag2set(f)) != 0;
Expand Down Expand Up @@ -371,6 +376,34 @@ struct QwNeonRegister {
return r;
}

static int ToAllocationIndex(QwNeonRegister reg) {
ASSERT(reg.code() < kMaxNumRegisters);
return reg.code();
}

static const char* AllocationIndexToString(int index) {
ASSERT(index >= 0 && index < kMaxNumRegisters);
const char* const names[] = {
"q0",
"q1",
"q2",
"q3",
"q4",
"q5",
"q6",
"q7",
"q8",
"q9",
"q10",
"q11",
"q12",
"q13",
"q14",
"q15",
};
return names[index];
}

bool is_valid() const {
return (0 <= code_) && (code_ < kMaxNumRegisters);
}
Expand All @@ -391,6 +424,7 @@ struct QwNeonRegister {


typedef QwNeonRegister QuadRegister;
typedef QwNeonRegister SIMD128Register;


// Support for the VFP registers s0 to s31 (d0 to d15).
Expand Down
16 changes: 0 additions & 16 deletions src/arm/cpu-arm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,6 @@
namespace v8 {
namespace internal {

void CPU::SetUp() {
CpuFeatures::Probe(false);
}


bool CPU::SupportsCrankshaft() {
return CpuFeatures::IsSupported(VFP3);
}


bool CPU::SupportsSIMD128InCrankshaft() {
// Not Implemented.
return false;
}


void CPU::FlushICache(void* start, size_t size) {
// Nothing to do flushing no instructions.
if (size == 0) {
Expand Down
18 changes: 15 additions & 3 deletions src/arm/deoptimizer-arm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void Deoptimizer::SetPlatformCompiledStubRegisters(
}


void Deoptimizer::CopyDoubleRegisters(FrameDescription* output_frame) {
void Deoptimizer::CopySIMD128Registers(FrameDescription* output_frame) {
for (int i = 0; i < DwVfpRegister::kMaxNumRegisters; ++i) {
double double_value = input_->GetDoubleRegister(i);
output_frame->SetDoubleRegister(i, double_value);
Expand Down Expand Up @@ -211,7 +211,7 @@ void Deoptimizer::EntryGenerator::Generate() {

// Copy VFP registers to
// double_registers_[DoubleRegister::kMaxNumAllocatableRegisters]
int double_regs_offset = FrameDescription::double_registers_offset();
int double_regs_offset = FrameDescription::simd128_registers_offset();
for (int i = 0; i < DwVfpRegister::kMaxNumAllocatableRegisters; ++i) {
int dst_offset = i * kDoubleSize + double_regs_offset;
int src_offset = i * kDoubleSize + kNumberOfRegisters * kPointerSize;
Expand Down Expand Up @@ -285,7 +285,7 @@ void Deoptimizer::EntryGenerator::Generate() {
__ CheckFor32DRegs(ip);

__ ldr(r1, MemOperand(r0, Deoptimizer::input_offset()));
int src_offset = FrameDescription::double_registers_offset();
int src_offset = FrameDescription::simd128_registers_offset();
for (int i = 0; i < DwVfpRegister::kMaxNumRegisters; ++i) {
if (i == kDoubleRegZero.code()) continue;
if (i == kScratchDoubleReg.code()) continue;
Expand Down Expand Up @@ -357,6 +357,18 @@ void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) {
}


double FrameDescription::GetDoubleRegister(unsigned n) const {
ASSERT(n < 2 * ARRAY_SIZE(simd128_registers_));
return simd128_registers_[n / 2].d[n % 2];
}


void FrameDescription::SetDoubleRegister(unsigned n, double value) {
ASSERT(n < 2 * ARRAY_SIZE(simd128_registers_));
simd128_registers_[n / 2].d[n % 2] = value;
}


#undef __

} } // namespace v8::internal
6 changes: 0 additions & 6 deletions src/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,6 @@ class CPU V8_FINAL BASE_EMBEDDED {
// Returns the number of processors online.
static int NumberOfProcessorsOnline();

// Initializes the cpu architecture support. Called once at VM startup.
static void SetUp();

static bool SupportsCrankshaft();
static bool SupportsSIMD128InCrankshaft();

// Flush instruction cache.
static void FlushICache(void* start, size_t size);

Expand Down
Loading