зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1019831: SIMD x86-x64: LIR definition; r=sunfish
--HG-- extra : rebase_source : fd976b9bab4d47ea9987dfb79a29978774fef864
This commit is contained in:
Родитель
a351c40d5a
Коммит
88cbb21d3b
|
@ -388,7 +388,7 @@ class LDefinition
|
|||
// * Physical registers.
|
||||
LAllocation output_;
|
||||
|
||||
static const uint32_t TYPE_BITS = 3;
|
||||
static const uint32_t TYPE_BITS = 4;
|
||||
static const uint32_t TYPE_SHIFT = 0;
|
||||
static const uint32_t TYPE_MASK = (1 << TYPE_BITS) - 1;
|
||||
static const uint32_t POLICY_BITS = 2;
|
||||
|
@ -433,6 +433,7 @@ class LDefinition
|
|||
SLOTS, // Slots/elements pointer that may be moved by minor GCs (GPR).
|
||||
FLOAT32, // 32-bit floating-point value (FPU).
|
||||
DOUBLE, // 64-bit floating-point value (FPU).
|
||||
INT32X4, // SIMD data containing four 32-bit integers (FPU).
|
||||
#ifdef JS_NUNBOX32
|
||||
// A type virtual register must be followed by a payload virtual
|
||||
// register, as both will be tracked as a single gcthing.
|
||||
|
@ -446,6 +447,7 @@ class LDefinition
|
|||
void set(uint32_t index, Type type, Policy policy) {
|
||||
JS_STATIC_ASSERT(MAX_VIRTUAL_REGISTERS <= VREG_MASK);
|
||||
bits_ = (index << VREG_SHIFT) | (policy << POLICY_SHIFT) | (type << TYPE_SHIFT);
|
||||
JS_ASSERT_IF(!SupportsSimd, !isSimdType());
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -482,6 +484,9 @@ class LDefinition
|
|||
Type type() const {
|
||||
return (Type)((bits_ >> TYPE_SHIFT) & TYPE_MASK);
|
||||
}
|
||||
bool isSimdType() const {
|
||||
return type() == INT32X4;
|
||||
}
|
||||
bool isCompatibleReg(const AnyRegister &r) const {
|
||||
if (isFloatReg() && r.isFloat()) {
|
||||
#if defined(JS_CODEGEN_ARM)
|
||||
|
@ -505,7 +510,7 @@ class LDefinition
|
|||
}
|
||||
|
||||
bool isFloatReg() const {
|
||||
return type() == FLOAT32 || type() == DOUBLE;
|
||||
return type() == FLOAT32 || type() == DOUBLE || isSimdType();
|
||||
}
|
||||
uint32_t virtualRegister() const {
|
||||
return (bits_ >> VREG_SHIFT) & VREG_MASK;
|
||||
|
@ -569,6 +574,8 @@ class LDefinition
|
|||
return LDefinition::GENERAL;
|
||||
case MIRType_ForkJoinContext:
|
||||
return LDefinition::GENERAL;
|
||||
case MIRType_Int32x4:
|
||||
return LDefinition::INT32X4;
|
||||
default:
|
||||
MOZ_ASSUME_UNREACHABLE("unexpected type");
|
||||
}
|
||||
|
|
|
@ -143,6 +143,12 @@ static const uint32_t StackAlignment = 8;
|
|||
static const uint32_t CodeAlignment = 8;
|
||||
static const bool StackKeptAligned = true;
|
||||
|
||||
// This boolean indicates whether we support SIMD instructions flavoured for
|
||||
// this architecture or not. Rather than a method in the LIRGenerator, it is
|
||||
// here such that it is accessible from the entire codebase. Once full support
|
||||
// for SIMD is reached on all tier-1 platforms, this constant can be deleted.
|
||||
static const bool SupportsSimd = false;
|
||||
|
||||
static const Scale ScalePointer = TimesFour;
|
||||
|
||||
class Instruction;
|
||||
|
|
|
@ -155,6 +155,12 @@ static const uint32_t StackAlignment = 8;
|
|||
static const uint32_t CodeAlignment = 4;
|
||||
static const bool StackKeptAligned = true;
|
||||
|
||||
// This boolean indicates whether we support SIMD instructions flavoured for
|
||||
// this architecture or not. Rather than a method in the LIRGenerator, it is
|
||||
// here such that it is accessible from the entire codebase. Once full support
|
||||
// for SIMD is reached on all tier-1 platforms, this constant can be deleted.
|
||||
static const bool SupportsSimd = false;
|
||||
|
||||
static const Scale ScalePointer = TimesFour;
|
||||
|
||||
// MIPS instruction types
|
||||
|
|
|
@ -187,6 +187,12 @@ static const uint32_t StackAlignment = 16;
|
|||
static const bool StackKeptAligned = false;
|
||||
static const uint32_t CodeAlignment = 8;
|
||||
|
||||
// This boolean indicates whether we support SIMD instructions flavoured for
|
||||
// this architecture or not. Rather than a method in the LIRGenerator, it is
|
||||
// here such that it is accessible from the entire codebase. Once full support
|
||||
// for SIMD is reached on all tier-1 platforms, this constant can be deleted.
|
||||
static const bool SupportsSimd = true;
|
||||
|
||||
static const Scale ScalePointer = TimesEight;
|
||||
|
||||
} // namespace jit
|
||||
|
|
|
@ -115,6 +115,12 @@ static const uint32_t StackAlignment = 4;
|
|||
static const bool StackKeptAligned = false;
|
||||
static const uint32_t CodeAlignment = 8;
|
||||
|
||||
// This boolean indicates whether we support SIMD instructions flavoured for
|
||||
// this architecture or not. Rather than a method in the LIRGenerator, it is
|
||||
// here such that it is accessible from the entire codebase. Once full support
|
||||
// for SIMD is reached on all tier-1 platforms, this constant can be deleted.
|
||||
static const bool SupportsSimd = true;
|
||||
|
||||
struct ImmTag : public Imm32
|
||||
{
|
||||
ImmTag(JSValueTag mask)
|
||||
|
|
Загрузка…
Ссылка в новой задаче