Bug 1225605: Remove non standard SIMD.Int{32x4,16x8,8x16}.bool; r=jolesen

--HG--
extra : rebase_source : 4a6aceabf70bfcab77c0d7e9ec6a768dec18e935
This commit is contained in:
Benjamin Bouvier 2015-11-17 21:09:21 +01:00
parent 21140fe66b
commit f31a605002
9 changed files with 6 additions and 137 deletions

View File

@ -163,9 +163,6 @@
V(selectBits, (SelectBits<Int8x16, Int8x16>), 3) \
V(store, (Store<Int8x16, 16>), 3)
#define INT8X16_BOOL_FUNCTION_LIST(V) \
V(bool, Bool<Int8x16>, 16)
#define INT8X16_SHUFFLE_FUNCTION_LIST(V) \
V(swizzle, Swizzle<Int8x16>, 17) \
V(shuffle, Shuffle<Int8x16>, 18)
@ -174,7 +171,6 @@
INT8X16_UNARY_FUNCTION_LIST(V) \
INT8X16_BINARY_FUNCTION_LIST(V) \
INT8X16_TERNARY_FUNCTION_LIST(V) \
INT8X16_BOOL_FUNCTION_LIST(V) \
INT8X16_SHUFFLE_FUNCTION_LIST(V)
#define INT16X8_UNARY_FUNCTION_LIST(V) \
@ -212,9 +208,6 @@
V(selectBits, (SelectBits<Int16x8, Int16x8>), 3) \
V(store, (Store<Int16x8, 8>), 3)
#define INT16X8_BOOL_FUNCTION_LIST(V) \
V(bool, Bool<Int16x8>, 8)
#define INT16X8_SHUFFLE_FUNCTION_LIST(V) \
V(swizzle, Swizzle<Int16x8>, 9) \
V(shuffle, Shuffle<Int16x8>, 10)
@ -223,7 +216,6 @@
INT16X8_UNARY_FUNCTION_LIST(V) \
INT16X8_BINARY_FUNCTION_LIST(V) \
INT16X8_TERNARY_FUNCTION_LIST(V) \
INT16X8_BOOL_FUNCTION_LIST(V) \
INT16X8_SHUFFLE_FUNCTION_LIST(V)
#define INT32X4_UNARY_FUNCTION_LIST(V) \
@ -269,9 +261,6 @@
V(store2, (Store<Int32x4, 2>), 3) \
V(store1, (Store<Int32x4, 1>), 3)
#define INT32X4_QUARTERNARY_FUNCTION_LIST(V) \
V(bool, Bool<Int32x4>, 4)
#define INT32X4_SHUFFLE_FUNCTION_LIST(V) \
V(swizzle, Swizzle<Int32x4>, 5) \
V(shuffle, Shuffle<Int32x4>, 6)
@ -280,7 +269,6 @@
INT32X4_UNARY_FUNCTION_LIST(V) \
INT32X4_BINARY_FUNCTION_LIST(V) \
INT32X4_TERNARY_FUNCTION_LIST(V) \
INT32X4_QUARTERNARY_FUNCTION_LIST(V) \
INT32X4_SHUFFLE_FUNCTION_LIST(V)
#define CONVERSION_INT32X4_SIMD_OP(_) \
@ -344,8 +332,6 @@
_(store2) \
_(store3) \
_(check)
#define ION_ONLY_INT32X4_SIMD_OP(_) \
_(bool)
#define FOREACH_COMMONX4_SIMD_OP(_) \
ION_COMMONX4_SIMD_OP(_) \
COMP_COMMONX4_TO_INT32X4_SIMD_OP(_)

View File

@ -1,15 +0,0 @@
load(libdir + 'simd.js');
setJitCompilerOption("ion.warmup.trigger", 50);
const T = -1, F = 0;
function f() {
for (var i = 0; i < 150; i++) {
assertEqX4(SIMD.Int32x4.bool(i + 1, true, 'hey', null), [T, T, T, F]);
assertEqX4(SIMD.Int32x4.bool(undefined, '', {}, objectEmulatingUndefined()), [F, F, T, F]);
assertEqX4(SIMD.Int32x4.bool(null, NaN, false, Infinity), [F, F, F, T]);
}
}
f();

View File

@ -5725,8 +5725,7 @@ GetTemplateObjectForNative(JSContext* cx, Native native, const CallArgs& args,
ION_COMMONX4_SIMD_OP(ADD_INT32X4_SIMD_OP_NAME_)
COMP_COMMONX4_TO_INT32X4_SIMD_OP(ADD_INT32X4_SIMD_OP_NAME_)
COMP_COMMONX4_TO_INT32X4_SIMD_OP(ADD_FLOAT32X4_SIMD_OP_NAME_)
FOREACH_INT32X4_SIMD_OP(ADD_INT32X4_SIMD_OP_NAME_)
ION_ONLY_INT32X4_SIMD_OP(ADD_INT32X4_SIMD_OP_NAME_))
FOREACH_INT32X4_SIMD_OP(ADD_INT32X4_SIMD_OP_NAME_))
{
Rooted<SimdTypeDescr*> descr(cx, &cx->global()->int32x4TypeDescr().as<SimdTypeDescr>());
res.set(cx->compartment()->jitCompartment()->getSimdTemplateObjectFor(cx, descr));

View File

@ -881,8 +881,6 @@ class IonBuilder
InliningStatus inlineSimdStore(CallInfo& callInfo, JSNative native, SimdTypeDescr::Type type,
unsigned numElems);
InliningStatus inlineSimdBool(CallInfo& callInfo, JSNative native, SimdTypeDescr::Type type);
// Utility intrinsics.
InliningStatus inlineIsCallable(CallInfo& callInfo);
InliningStatus inlineIsObject(CallInfo& callInfo);

View File

@ -3116,9 +3116,6 @@ IonBuilder::inlineSimdInt32x4(CallInfo& callInfo, JSNative native)
if (native == js::simd_int32x4_store3)
return inlineSimdStore(callInfo, native, SimdTypeDescr::Int32x4, 3);
if (native == js::simd_int32x4_bool)
return inlineSimdBool(callInfo, native, SimdTypeDescr::Int32x4);
return InliningStatus_NotInlined;
}
@ -3588,34 +3585,6 @@ IonBuilder::inlineSimdStore(CallInfo& callInfo, JSNative native, SimdTypeDescr::
return InliningStatus_Inlined;
}
IonBuilder::InliningStatus
IonBuilder::inlineSimdBool(CallInfo& callInfo, JSNative native, SimdTypeDescr::Type type)
{
InlineTypedObject* templateObj = nullptr;
if (!checkInlineSimd(callInfo, native, type, 4, &templateObj))
return InliningStatus_NotInlined;
MOZ_ASSERT(type == SimdTypeDescr::Int32x4, "at the moment, only int32x4.bool is inlined");
MInstruction* operands[4];
for (unsigned i = 0; i < 4; i++) {
operands[i] = MNot::New(alloc(), callInfo.getArg(i), constraints());
current->add(operands[i]);
}
// Inline int32x4.bool(x, y, z, w) as int32x4(!x - 1, !y - 1, !z - 1, !w - 1);
MSimdValueX4* vector = MSimdValueX4::New(alloc(), MIRType_Int32x4, operands[0], operands[1],
operands[2], operands[3]);
current->add(vector);
MSimdConstant* one = MSimdConstant::New(alloc(), SimdConstant::SplatX4(1), MIRType_Int32x4);
current->add(one);
MSimdBinaryArith* result = MSimdBinaryArith::New(alloc(), vector, one, MSimdBinaryArith::Op_sub,
MIRType_Int32x4);
return boxSimd(callInfo, result, templateObj);
}
#define ADD_NATIVE(native) const JSJitInfo JitInfo_##native { \
{ nullptr }, { uint16_t(InlinableNative::native) }, 0, JSJitInfo::InlinableNative };
INLINABLE_NATIVE_LIST(ADD_NATIVE)

View File

@ -1,17 +0,0 @@
// |reftest| skip-if(!this.hasOwnProperty("SIMD"))
var Int16x8 = SIMD.Int16x8;
/*
* Any copyright is dedicated to the Public Domain.
* https://creativecommons.org/publicdomain/zero/1.0/
*/
function test() {
var a = Int16x8.bool(true, false, true, false, true, true, false, false);
assertEqInt16x8(a, [-1, 0, -1, 0, -1, -1, 0, 0]);
if (typeof reportCompare === "function")
reportCompare(true, true);
}
test();

View File

@ -1,35 +0,0 @@
// |reftest| skip-if(!this.hasOwnProperty("SIMD"))
var Int32x4 = SIMD.Int32x4;
/*
* Any copyright is dedicated to the Public Domain.
* https://creativecommons.org/publicdomain/zero/1.0/
*/
function tryEmulateUndefined() {
if (typeof objectEmulatingUndefined !== 'undefined')
return objectEmulatingUndefined();
return undefined;
}
function test() {
assertEqX4(Int32x4.bool(true, false, true, false), [-1, 0, -1, 0]);
assertEqX4(Int32x4.bool(5, 0, 1, -2), [-1, 0, -1, -1]);
assertEqX4(Int32x4.bool(1.23, 13.37, 42.99999999, 0.000001), [-1, -1, -1, -1]);
assertEqX4(Int32x4.bool("string", "", "1", "0"), [-1, 0, -1, -1]);
assertEqX4(Int32x4.bool([], [1, 2, 3], SIMD.Int32x4(1, 2, 3, 4), function() { return 0; }), [-1, -1, -1, -1]);
assertEqX4(Int32x4.bool(undefined, null, {}, tryEmulateUndefined()), [0, 0, -1, 0]);
// Test missing arguments
assertEqX4(Int32x4.bool(), [0, 0, 0, 0]);
assertEqX4(Int32x4.bool(true), [-1, 0, 0, 0]);
assertEqX4(Int32x4.bool(true, true), [-1, -1, 0, 0]);
assertEqX4(Int32x4.bool(true, true, true), [-1, -1, -1, 0]);
assertEqX4(Int32x4.bool(true, true, true, true), [-1, -1, -1, -1]);
assertEqX4(Int32x4.bool(true, true, true, true, true), [-1, -1, -1, -1]);
if (typeof reportCompare === "function")
reportCompare(true, true);
}
test();

View File

@ -1,17 +0,0 @@
// |reftest| skip-if(!this.hasOwnProperty("SIMD"))
var Int8x16 = SIMD.Int8x16;
/*
* Any copyright is dedicated to the Public Domain.
* https://creativecommons.org/publicdomain/zero/1.0/
*/
function test() {
var a = Int8x16.bool(true, false, true, false, true, true, false, false, true, true, true, false, false, false, true, true);
assertEqInt8x16(a, [-1, 0, -1, 0, -1, -1, 0, 0, -1, -1, -1, 0, 0, 0, -1, -1]);
if (typeof reportCompare === "function")
reportCompare(true, true);
}
test();

View File

@ -13,13 +13,14 @@ var Int32x4 = SIMD.Int32x4;
function getMask(i, maskLength) {
var args = [];
for (var j = 0; j < maskLength; j++) args.push(!!((i >> j) & 1));
for (var j = 0; j < maskLength; j++)
args.push((!!((i >> j) & 1)) ? -1 : 0);
if (maskLength == 4)
return Int32x4.bool(...args);
return Int32x4(...args);
else if (maskLength == 8)
return Int16x8.bool(...args);
return Int16x8(...args);
else if (maskLength == 16)
return Int8x16.bool(...args);
return Int8x16(...args);
else
throw new Error("Invalid mask length.");
}