зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1023404: Implement SIMD types helpers; r=sunfish
This commit is contained in:
Родитель
9de8117656
Коммит
2228ebf96d
|
@ -412,6 +412,41 @@ IsNullOrUndefined(MIRType type)
|
|||
return type == MIRType_Null || type == MIRType_Undefined;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
IsSimdType(MIRType type)
|
||||
{
|
||||
return type == MIRType_Int32x4 || type == MIRType_Float32x4;
|
||||
};
|
||||
|
||||
// Returns the number of vector elements (hereby called "length") for a given
|
||||
// SIMD kind. It is the Y part of the name "Foo x Y".
|
||||
static inline unsigned
|
||||
SimdTypeToLength(MIRType type)
|
||||
{
|
||||
JS_ASSERT(IsSimdType(type));
|
||||
switch (type) {
|
||||
case MIRType_Int32x4:
|
||||
case MIRType_Float32x4:
|
||||
return 4;
|
||||
default: break;
|
||||
}
|
||||
MOZ_ASSUME_UNREACHABLE("unexpected SIMD kind");
|
||||
}
|
||||
|
||||
static inline MIRType
|
||||
SimdTypeToScalarType(MIRType type)
|
||||
{
|
||||
JS_ASSERT(IsSimdType(type));
|
||||
switch (type) {
|
||||
case MIRType_Int32x4:
|
||||
return MIRType_Int32;
|
||||
case MIRType_Float32x4:
|
||||
return MIRType_Float32;
|
||||
default: break;
|
||||
}
|
||||
MOZ_ASSUME_UNREACHABLE("unexpected SIMD kind");
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
// Track the pipeline of opcodes which has produced a snapshot.
|
||||
|
|
Загрузка…
Ссылка в новой задаче