Bug 1136226 - Test loads, stores, and bitcasts. r=sunfish

Add a new asm.js test later which exercises all the possible bitcast operations
as well as all possible load and store operations, except the partial ones.
This commit prepares for that test case.

Add new Scalar::I8x16, I16x8 enumerators.

Remove the fromUintXXX opcodes from the *_ASMJS macros. This avoids gerating
unwanted wasm opcodes. Include the relevant unsigned bit-casts explicitly where
needed.
This commit is contained in:
Jakob Stoklund Olesen 2016-05-31 09:00:20 -07:00
Родитель e0fb4b123e
Коммит 2810a22e4a
22 изменённых файлов: 200 добавлений и 20 удалений

Просмотреть файл

@ -2706,7 +2706,7 @@ SimdToExpr(SimdType type, SimdOperation op)
switch (type) {
case SimdType::Uint8x16:
// Handle the special unsigned opcodes, then fall through to Int8x16.
switch(op) {
switch (op) {
case SimdOperation::Fn_addSaturate: return Expr::I8x16addSaturateU;
case SimdOperation::Fn_subSaturate: return Expr::I8x16subSaturateU;
case SimdOperation::Fn_extractLane: return Expr::I8x16extractLaneU;
@ -2721,7 +2721,12 @@ SimdToExpr(SimdType type, SimdOperation op)
MOZ_FALLTHROUGH;
case SimdType::Int8x16:
// Bitcasts Uint8x16 <--> Int8x16 become noops.
if (op == SimdOperation::Fn_fromUint8x16Bits) return Expr::Limit;
switch (op) {
case SimdOperation::Fn_fromUint8x16Bits: return Expr::Limit;
case SimdOperation::Fn_fromUint16x8Bits: return Expr::I8x16fromInt16x8Bits;
case SimdOperation::Fn_fromUint32x4Bits: return Expr::I8x16fromInt32x4Bits;
default: break;
}
ENUMERATE(I8x16, FORALL_INT8X16_ASMJS_OP, I8x16CASE)
break;
@ -2742,7 +2747,12 @@ SimdToExpr(SimdType type, SimdOperation op)
MOZ_FALLTHROUGH;
case SimdType::Int16x8:
// Bitcasts Uint16x8 <--> Int16x8 become noops.
if (op == SimdOperation::Fn_fromUint16x8Bits) return Expr::Limit;
switch (op) {
case SimdOperation::Fn_fromUint8x16Bits: return Expr::I16x8fromInt8x16Bits;
case SimdOperation::Fn_fromUint16x8Bits: return Expr::Limit;
case SimdOperation::Fn_fromUint32x4Bits: return Expr::I16x8fromInt32x4Bits;
default: break;
}
ENUMERATE(I16x8, FORALL_INT16X8_ASMJS_OP, I16x8CASE)
break;
@ -2761,11 +2771,22 @@ SimdToExpr(SimdType type, SimdOperation op)
MOZ_FALLTHROUGH;
case SimdType::Int32x4:
// Bitcasts Uint32x4 <--> Int32x4 become noops.
if (op == SimdOperation::Fn_fromUint32x4Bits) return Expr::Limit;
switch (op) {
case SimdOperation::Fn_fromUint8x16Bits: return Expr::I32x4fromInt8x16Bits;
case SimdOperation::Fn_fromUint16x8Bits: return Expr::I32x4fromInt16x8Bits;
case SimdOperation::Fn_fromUint32x4Bits: return Expr::Limit;
default: break;
}
ENUMERATE(I32x4, FORALL_INT32X4_ASMJS_OP, I32x4CASE)
break;
case SimdType::Float32x4:
switch (op) {
case SimdOperation::Fn_fromUint8x16Bits: return Expr::F32x4fromInt8x16Bits;
case SimdOperation::Fn_fromUint16x8Bits: return Expr::F32x4fromInt16x8Bits;
case SimdOperation::Fn_fromUint32x4Bits: return Expr::F32x4fromInt32x4Bits;
default: break;
}
ENUMERATE(F32x4, FORALL_FLOAT32X4_ASMJS_OP, F32x4CASE)
break;
@ -3387,6 +3408,8 @@ IsSimdValidOperationType(SimdType type, SimdOperation op)
case SimdType::Int32x4:
switch (op) {
case SimdOperation::Constructor:
case SimdOperation::Fn_fromUint8x16Bits:
case SimdOperation::Fn_fromUint16x8Bits:
case SimdOperation::Fn_fromUint32x4Bits:
FORALL_INT32X4_ASMJS_OP(CASE) return true;
default: return false;
@ -3395,6 +3418,8 @@ IsSimdValidOperationType(SimdType type, SimdOperation op)
case SimdType::Uint32x4:
switch (op) {
case SimdOperation::Constructor:
case SimdOperation::Fn_fromUint8x16Bits:
case SimdOperation::Fn_fromUint16x8Bits:
case SimdOperation::Fn_fromInt32x4Bits:
FORALL_INT32X4_ASMJS_OP(CASE) return true;
default: return false;
@ -3403,6 +3428,9 @@ IsSimdValidOperationType(SimdType type, SimdOperation op)
case SimdType::Float32x4:
switch (op) {
case SimdOperation::Constructor:
case SimdOperation::Fn_fromUint8x16Bits:
case SimdOperation::Fn_fromUint16x8Bits:
case SimdOperation::Fn_fromUint32x4Bits:
FORALL_FLOAT32X4_ASMJS_OP(CASE) return true;
default: return false;
}
@ -7542,19 +7570,25 @@ ValidateSimdOperation(JSContext* cx, const AsmJSGlobal& global, HandleValue glob
switch (global.simdOperation()) {
FORALL_INT8X16_ASMJS_OP(SET_NATIVE_INT8X16)
SET_NATIVE_INT8X16(fromUint8x16Bits)
SET_NATIVE_INT8X16(fromUint16x8Bits)
SET_NATIVE_INT8X16(fromUint32x4Bits)
default: MOZ_CRASH("shouldn't have been validated in the first place");
}
break;
case SimdType::Int16x8:
switch (global.simdOperation()) {
FORALL_INT16X8_ASMJS_OP(SET_NATIVE_INT16X8)
SET_NATIVE_INT16X8(fromUint8x16Bits)
SET_NATIVE_INT16X8(fromUint16x8Bits)
SET_NATIVE_INT16X8(fromUint32x4Bits)
default: MOZ_CRASH("shouldn't have been validated in the first place");
}
break;
case SimdType::Int32x4:
switch (global.simdOperation()) {
FORALL_INT32X4_ASMJS_OP(SET_NATIVE_INT32X4)
SET_NATIVE_INT32X4(fromUint8x16Bits)
SET_NATIVE_INT32X4(fromUint16x8Bits)
SET_NATIVE_INT32X4(fromUint32x4Bits)
default: MOZ_CRASH("shouldn't have been validated in the first place");
}
@ -7563,19 +7597,25 @@ ValidateSimdOperation(JSContext* cx, const AsmJSGlobal& global, HandleValue glob
switch (global.simdOperation()) {
FORALL_INT8X16_ASMJS_OP(SET_NATIVE_UINT8X16)
SET_NATIVE_UINT8X16(fromInt8x16Bits)
SET_NATIVE_UINT8X16(fromUint16x8Bits)
SET_NATIVE_UINT8X16(fromUint32x4Bits)
default: MOZ_CRASH("shouldn't have been validated in the first place");
}
break;
case SimdType::Uint16x8:
switch (global.simdOperation()) {
FORALL_INT16X8_ASMJS_OP(SET_NATIVE_UINT16X8)
SET_NATIVE_UINT16X8(fromUint8x16Bits)
SET_NATIVE_UINT16X8(fromInt16x8Bits)
SET_NATIVE_UINT16X8(fromUint32x4Bits)
default: MOZ_CRASH("shouldn't have been validated in the first place");
}
break;
case SimdType::Uint32x4:
switch (global.simdOperation()) {
FORALL_INT32X4_ASMJS_OP(SET_NATIVE_UINT32X4)
SET_NATIVE_UINT32X4(fromUint8x16Bits)
SET_NATIVE_UINT32X4(fromUint16x8Bits)
SET_NATIVE_UINT32X4(fromInt32x4Bits)
default: MOZ_CRASH("shouldn't have been validated in the first place");
}
@ -7583,6 +7623,9 @@ ValidateSimdOperation(JSContext* cx, const AsmJSGlobal& global, HandleValue glob
case SimdType::Float32x4:
switch (global.simdOperation()) {
FORALL_FLOAT32X4_ASMJS_OP(SET_NATIVE_FLOAT32X4)
SET_NATIVE_FLOAT32X4(fromUint8x16Bits)
SET_NATIVE_FLOAT32X4(fromUint16x8Bits)
SET_NATIVE_FLOAT32X4(fromUint32x4Bits)
default: MOZ_CRASH("shouldn't have been validated in the first place");
}
break;

Просмотреть файл

@ -267,8 +267,17 @@ wasm::Classify(Expr expr)
case Expr::F32x4fromInt32x4:
case Expr::F32x4fromUint32x4:
case Expr::I32x4fromFloat32x4Bits:
case Expr::I32x4fromInt8x16Bits:
case Expr::I32x4fromInt16x8Bits:
case Expr::I16x8fromInt8x16Bits:
case Expr::I16x8fromInt32x4Bits:
case Expr::I16x8fromFloat32x4Bits:
case Expr::I8x16fromInt16x8Bits:
case Expr::I8x16fromInt32x4Bits:
case Expr::I8x16fromFloat32x4Bits:
case Expr::F32x4fromInt8x16Bits:
case Expr::F32x4fromInt16x8Bits:
case Expr::F32x4fromInt32x4Bits:
case Expr::F32x4fromUint32x4Bits:
return ExprKind::Conversion;
case Expr::I32Load8S:
case Expr::I32Load8U:

Просмотреть файл

@ -2538,6 +2538,8 @@ static inline Scalar::Type
SimdExprTypeToViewType(ValType type, unsigned* defaultNumElems)
{
switch (type) {
case ValType::I8x16: *defaultNumElems = 16; return Scalar::Int8x16;
case ValType::I16x8: *defaultNumElems = 8; return Scalar::Int16x8;
case ValType::I32x4: *defaultNumElems = 4; return Scalar::Int32x4;
case ValType::F32x4: *defaultNumElems = 4; return Scalar::Float32x4;
default: break;
@ -2822,15 +2824,17 @@ EmitSimdOp(FunctionCompiler& f, ValType type, SimdOperation op, SimdSign sign)
return EmitSimdConvert(f, ValType::I32x4, type, SimdSign::Signed);
case SimdOperation::Fn_fromUint32x4:
return EmitSimdConvert(f, ValType::I32x4, type, SimdSign::Unsigned);
case SimdOperation::Fn_fromInt8x16Bits:
case SimdOperation::Fn_fromUint8x16Bits:
return EmitSimdBitcast(f, ValType::I8x16, type);
case SimdOperation::Fn_fromUint16x8Bits:
case SimdOperation::Fn_fromInt16x8Bits:
return EmitSimdBitcast(f, ValType::I16x8, type);
case SimdOperation::Fn_fromInt32x4Bits:
case SimdOperation::Fn_fromUint32x4Bits:
return EmitSimdBitcast(f, ValType::I32x4, type);
case SimdOperation::Fn_fromFloat32x4Bits:
case SimdOperation::Fn_fromInt8x16Bits:
return EmitSimdBitcast(f, ValType::F32x4, type);
case SimdOperation::Fn_fromInt16x8Bits:
case SimdOperation::Fn_fromUint8x16Bits:
case SimdOperation::Fn_fromUint16x8Bits:
case SimdOperation::Fn_fromFloat64x2Bits:
MOZ_CRASH("NYI");
}

Просмотреть файл

@ -746,14 +746,20 @@
// this list is shared between Int8x16 and Uint8x16.
#define FORALL_INT8X16_ASMJS_OP(_) \
FORALL_INT_SIMD_OP(_) \
FOREACH_SMINT_SIMD_BINOP(_)
FOREACH_SMINT_SIMD_BINOP(_) \
_(fromInt16x8Bits) \
_(fromInt32x4Bits) \
_(fromFloat32x4Bits)
// All operations on Int16x8 or Uint16x8 in the asm.js world.
// Note: this does not include conversions and casts to/from Uint16x8 because
// this list is shared between Int16x8 and Uint16x8.
#define FORALL_INT16X8_ASMJS_OP(_) \
FORALL_INT_SIMD_OP(_) \
FOREACH_SMINT_SIMD_BINOP(_)
FOREACH_SMINT_SIMD_BINOP(_) \
_(fromInt8x16Bits) \
_(fromInt32x4Bits) \
_(fromFloat32x4Bits)
// All operations on Int32x4 or Uint32x4 in the asm.js world.
// Note: this does not include conversions and casts to/from Uint32x4 because
@ -761,6 +767,8 @@
#define FORALL_INT32X4_ASMJS_OP(_) \
FORALL_INT_SIMD_OP(_) \
FOREACH_MEMORY_X4_SIMD_OP(_) \
_(fromInt8x16Bits) \
_(fromInt16x8Bits) \
_(fromFloat32x4) \
_(fromFloat32x4Bits)
@ -768,10 +776,11 @@
#define FORALL_FLOAT32X4_ASMJS_OP(_) \
FORALL_FLOAT_SIMD_OP(_) \
FOREACH_MEMORY_X4_SIMD_OP(_) \
_(fromInt32x4) \
_(fromInt8x16Bits) \
_(fromInt16x8Bits) \
_(fromInt32x4Bits) \
_(fromUint32x4) \
_(fromUint32x4Bits)
_(fromInt32x4) \
_(fromUint32x4)
namespace js {

Просмотреть файл

@ -254,6 +254,8 @@ ScalarTypeDescr::typeName(Type type)
JS_FOR_EACH_SCALAR_TYPE_REPR(NUMERIC_TYPE_TO_STRING)
#undef NUMERIC_TYPE_TO_STRING
case Scalar::Float32x4:
case Scalar::Int8x16:
case Scalar::Int16x8:
case Scalar::Int32x4:
case Scalar::MaxTypedArrayViewType:
MOZ_CRASH();
@ -292,6 +294,8 @@ ScalarTypeDescr::call(JSContext* cx, unsigned argc, Value* vp)
JS_FOR_EACH_SCALAR_TYPE_REPR(SCALARTYPE_CALL)
#undef SCALARTYPE_CALL
case Scalar::Float32x4:
case Scalar::Int8x16:
case Scalar::Int16x8:
case Scalar::Int32x4:
case Scalar::MaxTypedArrayViewType:
MOZ_CRASH();

Просмотреть файл

@ -250,6 +250,10 @@ class ScalarTypeDescr : public SimpleTypeDescr
"TypedObjectConstants.h must be consistent with Scalar::Type");
static_assert(Scalar::Float32x4 == JS_SCALARTYPEREPR_FLOAT32X4,
"TypedObjectConstants.h must be consistent with Scalar::Type");
static_assert(Scalar::Int8x16 == JS_SCALARTYPEREPR_INT8X16,
"TypedObjectConstants.h must be consistent with Scalar::Type");
static_assert(Scalar::Int16x8 == JS_SCALARTYPEREPR_INT16X8,
"TypedObjectConstants.h must be consistent with Scalar::Type");
static_assert(Scalar::Int32x4 == JS_SCALARTYPEREPR_INT32X4,
"TypedObjectConstants.h must be consistent with Scalar::Type");

Просмотреть файл

@ -90,7 +90,9 @@
#define JS_SCALARTYPEREPR_FLOAT64 7
#define JS_SCALARTYPEREPR_UINT8_CLAMPED 8
#define JS_SCALARTYPEREPR_FLOAT32X4 10
#define JS_SCALARTYPEREPR_INT32X4 11
#define JS_SCALARTYPEREPR_INT8X16 11
#define JS_SCALARTYPEREPR_INT16X8 12
#define JS_SCALARTYPEREPR_INT32X4 13
// These constants are for use exclusively in JS code. In C++ code,
// prefer ReferenceTypeRepresentation::TYPE_ANY etc, which allows

Просмотреть файл

@ -705,6 +705,10 @@ ScalarTypeToMIRType(Scalar::Type type)
return MIRType::Double;
case Scalar::Float32x4:
return MIRType::Float32x4;
case Scalar::Int8x16:
return MIRType::Int8x16;
case Scalar::Int16x8:
return MIRType::Int16x8;
case Scalar::Int32x4:
return MIRType::Int32x4;
case Scalar::MaxTypedArrayViewType:
@ -730,6 +734,10 @@ ScalarTypeToLength(Scalar::Type type)
case Scalar::Float32x4:
case Scalar::Int32x4:
return 4;
case Scalar::Int16x8:
return 8;
case Scalar::Int8x16:
return 16;
case Scalar::MaxTypedArrayViewType:
break;
}

Просмотреть файл

@ -3441,6 +3441,8 @@ LIRGenerator::visitStoreUnboxedScalar(MStoreUnboxedScalar* ins)
if (ins->isSimdWrite()) {
MOZ_ASSERT_IF(ins->writeType() == Scalar::Float32x4, ins->value()->type() == MIRType::Float32x4);
MOZ_ASSERT_IF(ins->writeType() == Scalar::Int8x16, ins->value()->type() == MIRType::Int8x16);
MOZ_ASSERT_IF(ins->writeType() == Scalar::Int16x8, ins->value()->type() == MIRType::Int16x8);
MOZ_ASSERT_IF(ins->writeType() == Scalar::Int32x4, ins->value()->type() == MIRType::Int32x4);
} else if (ins->isFloatWrite()) {
MOZ_ASSERT_IF(ins->writeType() == Scalar::Float32, ins->value()->type() == MIRType::Float32);

Просмотреть файл

@ -3812,6 +3812,10 @@ SimdTypeToArrayElementType(SimdType type)
{
switch (type) {
case SimdType::Float32x4: return Scalar::Float32x4;
case SimdType::Int8x16:
case SimdType::Uint8x16: return Scalar::Int8x16;
case SimdType::Int16x8:
case SimdType::Uint16x8: return Scalar::Int16x8;
case SimdType::Int32x4:
case SimdType::Uint32x4: return Scalar::Int32x4;
default: MOZ_CRASH("unexpected simd type");

Просмотреть файл

@ -274,6 +274,14 @@ StoreToTypedFloatArray(MacroAssembler& masm, int arrayType, const S& value, cons
default: MOZ_CRASH("unexpected number of elements in simd write");
}
break;
case Scalar::Int8x16:
MOZ_ASSERT(numElems == 16, "unexpected partial store");
masm.storeUnalignedSimd128Int(value, dest);
break;
case Scalar::Int16x8:
MOZ_ASSERT(numElems == 8, "unexpected partial store");
masm.storeUnalignedSimd128Int(value, dest);
break;
default:
MOZ_CRASH("Invalid typed array type");
}
@ -370,6 +378,14 @@ MacroAssembler::loadFromTypedArray(Scalar::Type arrayType, const T& src, AnyRegi
default: MOZ_CRASH("unexpected number of elements in SIMD load");
}
break;
case Scalar::Int8x16:
MOZ_ASSERT(numElems == 16, "unexpected partial load");
loadUnalignedSimd128Int(src, dest.fpu());
break;
case Scalar::Int16x8:
MOZ_ASSERT(numElems == 8, "unexpected partial load");
loadUnalignedSimd128Int(src, dest.fpu());
break;
default:
MOZ_CRASH("Invalid typed array type");
}

Просмотреть файл

@ -1756,6 +1756,8 @@ GetTypedArrayRange(TempAllocator& alloc, Scalar::Type type)
case Scalar::Float32:
case Scalar::Float64:
case Scalar::Float32x4:
case Scalar::Int8x16:
case Scalar::Int16x8:
case Scalar::Int32x4:
case Scalar::MaxTypedArrayViewType:
break;

Просмотреть файл

@ -338,6 +338,8 @@ CodeGeneratorShared::verifyHeapAccessDisassembly(uint32_t begin, uint32_t end, b
case Scalar::Float32:
case Scalar::Float64:
case Scalar::Float32x4:
case Scalar::Int8x16:
case Scalar::Int16x8:
case Scalar::Int32x4:
op = OtherOperand(ToFloatRegister(alloc).encoding());
break;

Просмотреть файл

@ -598,6 +598,14 @@ CodeGeneratorX64::loadSimd(Scalar::Type type, unsigned numElems, const Operand&
}
break;
}
case Scalar::Int8x16:
MOZ_ASSERT(numElems = 16, "unexpected partial load");
masm.loadUnalignedSimd128Int(srcAddr, out);
break;
case Scalar::Int16x8:
MOZ_ASSERT(numElems = 8, "unexpected partial load");
masm.loadUnalignedSimd128Int(srcAddr, out);
break;
case Scalar::Int8:
case Scalar::Uint8:
case Scalar::Int16:
@ -698,6 +706,8 @@ CodeGeneratorX64::visitAsmJSLoadHeap(LAsmJSLoadHeap* ins)
case Scalar::Float32: masm.loadFloat32(srcAddr, ToFloatRegister(out)); break;
case Scalar::Float64: masm.loadDouble(srcAddr, ToFloatRegister(out)); break;
case Scalar::Float32x4:
case Scalar::Int8x16:
case Scalar::Int16x8:
case Scalar::Int32x4: MOZ_CRASH("SIMD loads should be handled in emitSimdLoad");
case Scalar::Uint8Clamped:
case Scalar::MaxTypedArrayViewType:
@ -744,6 +754,14 @@ CodeGeneratorX64::storeSimd(Scalar::Type type, unsigned numElems, FloatRegister
}
break;
}
case Scalar::Int8x16:
MOZ_ASSERT(numElems == 16, "unexpected partial store");
masm.storeUnalignedSimd128Int(in, dstAddr);
break;
case Scalar::Int16x8:
MOZ_ASSERT(numElems == 8, "unexpected partial store");
masm.storeUnalignedSimd128Int(in, dstAddr);
break;
case Scalar::Int8:
case Scalar::Uint8:
case Scalar::Int16:
@ -845,6 +863,8 @@ CodeGeneratorX64::visitAsmJSStoreHeap(LAsmJSStoreHeap* ins)
case Scalar::Float32:
case Scalar::Float64:
case Scalar::Float32x4:
case Scalar::Int8x16:
case Scalar::Int16x8:
case Scalar::Int32x4:
case Scalar::Uint8Clamped:
case Scalar::MaxTypedArrayViewType:
@ -871,6 +891,8 @@ CodeGeneratorX64::visitAsmJSStoreHeap(LAsmJSStoreHeap* ins)
masm.storeUncanonicalizedDouble(ToFloatRegister(value), dstAddr);
break;
case Scalar::Float32x4:
case Scalar::Int8x16:
case Scalar::Int16x8:
case Scalar::Int32x4:
MOZ_CRASH("SIMD stores must be handled in emitSimdStore");
case Scalar::Uint8Clamped:

Просмотреть файл

@ -195,6 +195,8 @@ LIRGeneratorX64::visitAsmJSStoreHeap(MAsmJSStoreHeap* ins)
case Scalar::Float32:
case Scalar::Float64:
case Scalar::Float32x4:
case Scalar::Int8x16:
case Scalar::Int16x8:
case Scalar::Int32x4:
lir = new(alloc()) LAsmJSStoreHeap(baseAlloc, useRegisterAtStart(ins->value()));
break;

Просмотреть файл

@ -375,6 +375,8 @@ CodeGeneratorX86Shared::visitOutOfLineLoadTypedArrayOutOfBounds(OutOfLineLoadTyp
{
switch (ool->viewType()) {
case Scalar::Float32x4:
case Scalar::Int8x16:
case Scalar::Int16x8:
case Scalar::Int32x4:
case Scalar::MaxTypedArrayViewType:
MOZ_CRASH("unexpected array type");

Просмотреть файл

@ -270,6 +270,8 @@ CodeGeneratorX86::load(Scalar::Type accessType, const Operand& srcAddr, const LD
case Scalar::Float32: masm.vmovssWithPatch(srcAddr, ToFloatRegister(out)); break;
case Scalar::Float64: masm.vmovsdWithPatch(srcAddr, ToFloatRegister(out)); break;
case Scalar::Float32x4:
case Scalar::Int8x16:
case Scalar::Int16x8:
case Scalar::Int32x4: MOZ_CRASH("SIMD load should be handled in their own function");
case Scalar::MaxTypedArrayViewType: MOZ_CRASH("unexpected type");
}
@ -370,6 +372,14 @@ CodeGeneratorX86::loadSimd(Scalar::Type type, unsigned numElems, const Operand&
}
break;
}
case Scalar::Int8x16:
MOZ_ASSERT(numElems == 16, "unexpected partial load");
masm.vmovdquWithPatch(srcAddr, out);
break;
case Scalar::Int16x8:
MOZ_ASSERT(numElems == 8, "unexpected partial load");
masm.vmovdquWithPatch(srcAddr, out);
break;
case Scalar::Int8:
case Scalar::Uint8:
case Scalar::Int16:
@ -496,6 +506,8 @@ CodeGeneratorX86::store(Scalar::Type accessType, const LAllocation* value, const
break;
case Scalar::Float32x4:
case Scalar::Int8x16:
case Scalar::Int16x8:
case Scalar::Int32x4:
MOZ_CRASH("SIMD stores should be handled in emitSimdStore");
@ -558,6 +570,14 @@ CodeGeneratorX86::storeSimd(Scalar::Type type, unsigned numElems, FloatRegister
}
break;
}
case Scalar::Int8x16:
MOZ_ASSERT(numElems == 16, "unexpected partial store");
masm.vmovdquWithPatch(in, dstAddr);
break;
case Scalar::Int16x8:
MOZ_ASSERT(numElems == 8, "unexpected partial store");
masm.vmovdquWithPatch(in, dstAddr);
break;
case Scalar::Int8:
case Scalar::Uint8:
case Scalar::Int16:

Просмотреть файл

@ -239,11 +239,14 @@ LIRGeneratorX86::visitAsmJSStoreHeap(MAsmJSStoreHeap* ins)
case Scalar::Int16: case Scalar::Uint16:
case Scalar::Int32: case Scalar::Uint32:
case Scalar::Float32: case Scalar::Float64:
case Scalar::Float32x4: case Scalar::Int32x4:
// For now, don't allow constant values. The immediate operand
// affects instruction layout which affects patching.
lir = new(alloc()) LAsmJSStoreHeap(baseAlloc, useRegisterAtStart(ins->value()));
break;
case Scalar::Float32x4:
case Scalar::Int8x16:
case Scalar::Int16x8:
case Scalar::Int32x4:
// For now, don't allow constant values. The immediate operand
// affects instruction layout which affects patching.
lir = new (alloc()) LAsmJSStoreHeap(baseAlloc, useRegisterAtStart(ins->value()));
break;
case Scalar::Uint8Clamped:
case Scalar::MaxTypedArrayViewType:
MOZ_CRASH("unexpected array type");

Просмотреть файл

@ -1522,6 +1522,8 @@ enum Type {
MaxTypedArrayViewType,
Float32x4,
Int8x16,
Int16x8,
Int32x4
};
@ -1542,6 +1544,8 @@ byteSize(Type atype)
return 4;
case Float64:
return 8;
case Int8x16:
case Int16x8:
case Int32x4:
case Float32x4:
return 16;
@ -1556,6 +1560,8 @@ isSignedIntType(Type atype) {
case Int8:
case Int16:
case Int32:
case Int8x16:
case Int16x8:
case Int32x4:
return true;
case Uint8:
@ -1584,6 +1590,8 @@ isSimdType(Type atype) {
case Float32:
case Float64:
return false;
case Int8x16:
case Int16x8:
case Int32x4:
case Float32x4:
return true;
@ -1596,6 +1604,10 @@ isSimdType(Type atype) {
static inline size_t
scalarByteSize(Type atype) {
switch (atype) {
case Int8x16:
return 1;
case Int16x8:
return 2;
case Int32x4:
case Float32x4:
return 4;

Просмотреть файл

@ -886,6 +886,8 @@ class TypedArrayMethods
return ElementSpecific<Uint8ClampedArrayType, SharedOps>::setFromTypedArray(cx, target, source, offset);
return ElementSpecific<Uint8ClampedArrayType, UnsharedOps>::setFromTypedArray(cx, target, source, offset);
case Scalar::Float32x4:
case Scalar::Int8x16:
case Scalar::Int16x8:
case Scalar::Int32x4:
case Scalar::MaxTypedArrayViewType:
break;
@ -940,6 +942,8 @@ class TypedArrayMethods
return ElementSpecific<Uint8ClampedArrayType, SharedOps>::setFromNonTypedArray(cx, target, source, len, offset);
return ElementSpecific<Uint8ClampedArrayType, UnsharedOps>::setFromNonTypedArray(cx, target, source, len, offset);
case Scalar::Float32x4:
case Scalar::Int8x16:
case Scalar::Int16x8:
case Scalar::Int32x4:
case Scalar::MaxTypedArrayViewType:
break;

Просмотреть файл

@ -2032,6 +2032,8 @@ TypedArrayObject::getElement(uint32_t index)
case Scalar::Uint8Clamped:
return Uint8ClampedArray::getIndexValue(this, index);
case Scalar::Float32x4:
case Scalar::Int8x16:
case Scalar::Int16x8:
case Scalar::Int32x4:
case Scalar::MaxTypedArrayViewType:
break;
@ -2074,6 +2076,8 @@ TypedArrayObject::setElement(TypedArrayObject& obj, uint32_t index, double d)
Float64Array::setIndexValue(obj, index, d);
return;
case Scalar::Float32x4:
case Scalar::Int8x16:
case Scalar::Int16x8:
case Scalar::Int32x4:
case Scalar::MaxTypedArrayViewType:
break;

Просмотреть файл

@ -353,6 +353,8 @@ TypedArrayShift(Scalar::Type viewType)
case Scalar::Float64:
return 3;
case Scalar::Float32x4:
case Scalar::Int8x16:
case Scalar::Int16x8:
case Scalar::Int32x4:
return 4;
default:;