Reviewers: danno, titzer, Weiliang,
Message:
hello, Daniel & Ben Titzer.
As discussed last month, we use one double register for X87 turbofan.
Currently
the pass rate of X87 turbo is 100%.
We did minimal change in register-configuration. Two APIs of DoubleRegister
structure will return
the allocatable number for Turbofan but only X87 platform will return
different
value.
Please Review it.
thanks.
Description:
Add API to configure double register number for Turbofan.
Two APIs are added to configure the Double register number for turbofan
when
setting
default Register configuration.
The reason is that currently on X87 platform we have to use different
Double
register
number for Turbofan when comparing with crankshaft. So we need another two
APIs in
DoubleRegister structure to provide different allocatable Double register
number.
It does not change the double register number of other platforms.
BUG=
Please review this at https://codereview.chromium.org/1164813007/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+69, -6 lines):
M src/arm/assembler-arm.h
M src/arm64/assembler-arm64.h
M src/compiler/register-configuration.cc
M src/ia32/assembler-ia32.h
M src/mips/assembler-mips.h
M src/mips64/assembler-mips64.h
M src/ppc/assembler-ppc.h
M src/x64/assembler-x64.h
M src/x87/assembler-x87.h
Index: src/arm/assembler-arm.h
diff --git a/src/arm/assembler-arm.h b/src/arm/assembler-arm.h
index
82d786fe512b2ba98844df9793ca89d3f361ef8b..7608600773b1cba15b8de53de52e269706aef5ea
100644
--- a/src/arm/assembler-arm.h
+++ b/src/arm/assembler-arm.h
@@ -223,6 +223,14 @@ struct DwVfpRegister {
// registers on ARM.
inline static int NumAllocatableAliasedRegisters();
+ static int NumAllocatableRegistersForTurbo() {
+ return kMaxNumAllocatableRegisters;
+ }
+
+ static int NumAllocatableAliasedRegistersForTurbo() {
+ return NumAllocatableAliasedRegisters();
+ }
+
inline static int ToAllocationIndex(DwVfpRegister reg);
static const char* AllocationIndexToString(int index);
inline static DwVfpRegister FromAllocationIndex(int index);
Index: src/arm64/assembler-arm64.h
diff --git a/src/arm64/assembler-arm64.h b/src/arm64/assembler-arm64.h
index
7346648a9b02aed4e8150d7359f7c8c5ce898be7..f7de2f8fbcf5d1518e203941f7e8b2f9976a57bb
100644
--- a/src/arm64/assembler-arm64.h
+++ b/src/arm64/assembler-arm64.h
@@ -282,6 +282,14 @@ struct FPRegister : public CPURegister {
return NumAllocatableRegisters();
}
+ static int NumAllocatableRegistersForTurbo() {
+ return kMaxNumAllocatableRegisters;
+ }
+
+ static int NumAllocatableAliasedRegistersForTurbo() {
+ return NumAllocatableAliasedRegisters();
+ }
+
// Return true if the register is one that crankshaft can allocate.
bool IsAllocatable() const {
return (Bit() & kAllocatableFPRegisters) != 0;
Index: src/compiler/register-configuration.cc
diff --git a/src/compiler/register-configuration.cc
b/src/compiler/register-configuration.cc
index
7257aca02f0f236cc6ab515bb57be85cd387276b..4216443e1495dcf94c43d65e99807b07816a4380
100644
--- a/src/compiler/register-configuration.cc
+++ b/src/compiler/register-configuration.cc
@@ -20,11 +20,12 @@
STATIC_ASSERT(RegisterConfiguration::kMaxDoubleRegisters >=
class ArchDefaultRegisterConfiguration : public RegisterConfiguration {
public:
ArchDefaultRegisterConfiguration()
- : RegisterConfiguration(Register::kMaxNumAllocatableRegisters,
- DoubleRegister::kMaxNumAllocatableRegisters,
-
DoubleRegister::NumAllocatableAliasedRegisters(),
- general_register_name_table_,
- double_register_name_table_) {
+ : RegisterConfiguration(
+ Register::kMaxNumAllocatableRegisters,
+ DoubleRegister::NumAllocatableRegistersForTurbo(),
+ DoubleRegister::NumAllocatableAliasedRegistersForTurbo(),
+ general_register_name_table_,
+ double_register_name_table_) {
DCHECK_EQ(Register::kMaxNumAllocatableRegisters,
Register::NumAllocatableRegisters());
for (int i = 0; i < Register::kMaxNumAllocatableRegisters; ++i) {
Index: src/ia32/assembler-ia32.h
diff --git a/src/ia32/assembler-ia32.h b/src/ia32/assembler-ia32.h
index
0d701916992cb865085daf5bcbe3802bd8979bf8..e02ee70ea58d8ef7090f88991fd65e676b7e0eba
100644
--- a/src/ia32/assembler-ia32.h
+++ b/src/ia32/assembler-ia32.h
@@ -156,6 +156,14 @@ struct XMMRegister {
return NumAllocatableRegisters();
}
+ static int NumAllocatableRegistersForTurbo() {
+ return kMaxNumAllocatableRegisters;
+ }
+
+ static int NumAllocatableAliasedRegistersForTurbo() {
+ return NumAllocatableAliasedRegisters();
+ }
+
static int ToAllocationIndex(XMMRegister reg) {
DCHECK(reg.code() != 0);
return reg.code() - 1;
Index: src/mips/assembler-mips.h
diff --git a/src/mips/assembler-mips.h b/src/mips/assembler-mips.h
index
c116c13bcddfc746f8c2473fa4ce98e3ea6dd0e4..f7efdfeeae46ff3a3215543ffbc6e67f28c0a253
100644
--- a/src/mips/assembler-mips.h
+++ b/src/mips/assembler-mips.h
@@ -228,6 +228,14 @@ struct FPURegister {
// TODO(turbofan): Proper support for float32.
inline static int NumAllocatableAliasedRegisters();
+ static int NumAllocatableRegistersForTurbo() {
+ return kMaxNumAllocatableRegisters;
+ }
+
+ static int NumAllocatableAliasedRegistersForTurbo() {
+ return NumAllocatableAliasedRegisters();
+ }
+
inline static int ToAllocationIndex(FPURegister reg);
static const char* AllocationIndexToString(int index);
Index: src/mips64/assembler-mips64.h
diff --git a/src/mips64/assembler-mips64.h b/src/mips64/assembler-mips64.h
index
9aabe1b3164518eaa78be7400b7ae081821d91eb..1d630044b601195ed36fc143a0d4b3a54ea80777
100644
--- a/src/mips64/assembler-mips64.h
+++ b/src/mips64/assembler-mips64.h
@@ -218,6 +218,14 @@ struct FPURegister {
// TODO(turbofan): Proper support for float32.
inline static int NumAllocatableAliasedRegisters();
+ static int NumAllocatableRegistersForTurbo() {
+ return kMaxNumAllocatableRegisters;
+ }
+
+ static int NumAllocatableAliasedRegistersForTurbo() {
+ return NumAllocatableAliasedRegisters();
+ }
+
inline static int ToAllocationIndex(FPURegister reg);
static const char* AllocationIndexToString(int index);
Index: src/ppc/assembler-ppc.h
diff --git a/src/ppc/assembler-ppc.h b/src/ppc/assembler-ppc.h
index
fb56852bb5b5c254d82662f910f0b1c5265f90dc..61fb4cad90ec7ddf3600f2d8d2357c912dcb39d8
100644
--- a/src/ppc/assembler-ppc.h
+++ b/src/ppc/assembler-ppc.h
@@ -318,6 +318,14 @@ struct DoubleRegister {
return NumAllocatableRegisters();
}
+ static int NumAllocatableRegistersForTurbo() {
+ return kMaxNumAllocatableRegisters;
+ }
+
+ static int NumAllocatableAliasedRegistersForTurbo() {
+ return NumAllocatableAliasedRegisters();
+ }
+
static int ToAllocationIndex(DoubleRegister reg) {
int code = reg.code();
int index = (code <= kAllocatableLowRangeEnd)
Index: src/x64/assembler-x64.h
diff --git a/src/x64/assembler-x64.h b/src/x64/assembler-x64.h
index
cb52541b5690ffbeb4e36ad282d7282a1429be57..3c3590465f8780b8b5f333baaae4e32fc69bb05e
100644
--- a/src/x64/assembler-x64.h
+++ b/src/x64/assembler-x64.h
@@ -208,6 +208,14 @@ struct XMMRegister {
return NumAllocatableRegisters();
}
+ static int NumAllocatableRegistersForTurbo() {
+ return kMaxNumAllocatableRegisters;
+ }
+
+ static int NumAllocatableAliasedRegistersForTurbo() {
+ return NumAllocatableAliasedRegisters();
+ }
+
static int ToAllocationIndex(XMMRegister reg) {
DCHECK(reg.code() != 0);
return reg.code() - 1;
Index: src/x87/assembler-x87.h
diff --git a/src/x87/assembler-x87.h b/src/x87/assembler-x87.h
index
ea05ab975f03c02eb37a195606d6c7c8ae46c12b..61faab6cb0e9a10a4ec4f4091744770314be8c71
100644
--- a/src/x87/assembler-x87.h
+++ b/src/x87/assembler-x87.h
@@ -151,12 +151,18 @@ struct X87Register {
return kMaxNumAllocatableRegisters;
}
-
// TODO(turbofan): Proper support for float32.
static int NumAllocatableAliasedRegisters() {
return NumAllocatableRegisters();
}
+ static int NumAllocatableRegistersForTurbo() {
+ return 1;
+ }
+
+ static int NumAllocatableAliasedRegistersForTurbo() {
+ return NumAllocatableRegistersForTurbo();
+ }
static int ToAllocationIndex(X87Register reg) {
return reg.code_;
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.