mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 966575 part 10 -- Remove uses of raw TypeRepr from SIMD r=sfink
This commit is contained in:
parent
91795bab2e
commit
0588f478ce
@ -46,8 +46,10 @@ extern const JSFunctionSpec Int32x4Methods[];
|
|||||||
return false; \
|
return false; \
|
||||||
} \
|
} \
|
||||||
TypedDatum &datum = args.thisv().toObject().as<TypedDatum>(); \
|
TypedDatum &datum = args.thisv().toObject().as<TypedDatum>(); \
|
||||||
TypeRepresentation *typeRepr = datum.typeRepresentation(); \
|
TypeDescr &descr = datum.typeDescr(); \
|
||||||
if (typeRepr->kind() != TypeDescr::X4 || typeRepr->asX4()->type() != Type32x4::type) { \
|
if (descr.kind() != TypeDescr::X4 || \
|
||||||
|
descr.as<X4TypeDescr>().type() != Type32x4::type) \
|
||||||
|
{ \
|
||||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_INCOMPATIBLE_PROTO, \
|
JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_INCOMPATIBLE_PROTO, \
|
||||||
X4TypeDescr::class_.name, laneNames[lane], \
|
X4TypeDescr::class_.name, laneNames[lane], \
|
||||||
InformalValueTypeName(args.thisv())); \
|
InformalValueTypeName(args.thisv())); \
|
||||||
@ -77,8 +79,10 @@ extern const JSFunctionSpec Int32x4Methods[];
|
|||||||
return false; \
|
return false; \
|
||||||
} \
|
} \
|
||||||
TypedDatum &datum = args.thisv().toObject().as<TypedDatum>(); \
|
TypedDatum &datum = args.thisv().toObject().as<TypedDatum>(); \
|
||||||
TypeRepresentation *typeRepr = datum.typeRepresentation(); \
|
TypeDescr &descr = datum.typeDescr(); \
|
||||||
if (typeRepr->kind() != TypeDescr::X4 || typeRepr->asX4()->type() != Type32x4::type) { \
|
if (descr.kind() != TypeDescr::X4 || \
|
||||||
|
descr.as<X4TypeDescr>().type() != Type32x4::type) \
|
||||||
|
{ \
|
||||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_INCOMPATIBLE_PROTO, \
|
JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_INCOMPATIBLE_PROTO, \
|
||||||
X4TypeDescr::class_.name, "signMask", \
|
X4TypeDescr::class_.name, "signMask", \
|
||||||
InformalValueTypeName(args.thisv())); \
|
InformalValueTypeName(args.thisv())); \
|
||||||
@ -243,13 +247,12 @@ X4TypeDescr::call(JSContext *cx, unsigned argc, Value *vp)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Rooted<X4TypeDescr*> typeObj(cx, &args.callee().as<X4TypeDescr>());
|
Rooted<X4TypeDescr*> descr(cx, &args.callee().as<X4TypeDescr>());
|
||||||
Rooted<TypedObject*> result(cx, TypedObject::createZeroed(cx, typeObj, 0));
|
Rooted<TypedObject*> result(cx, TypedObject::createZeroed(cx, descr, 0));
|
||||||
if (!result)
|
if (!result)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
X4TypeRepresentation *typeRepr = typeObj->typeRepresentation()->asX4();
|
switch (descr->type()) {
|
||||||
switch (typeRepr->type()) {
|
|
||||||
#define STORE_LANES(_constant, _type, _name) \
|
#define STORE_LANES(_constant, _type, _name) \
|
||||||
case _constant: \
|
case _constant: \
|
||||||
{ \
|
{ \
|
||||||
@ -367,10 +370,10 @@ static bool
|
|||||||
ObjectIsVector(JSObject &obj) {
|
ObjectIsVector(JSObject &obj) {
|
||||||
if (!obj.is<TypedDatum>())
|
if (!obj.is<TypedDatum>())
|
||||||
return false;
|
return false;
|
||||||
TypeRepresentation *typeRepr = obj.as<TypedDatum>().typeRepresentation();
|
TypeDescr &typeRepr = obj.as<TypedDatum>().typeDescr();
|
||||||
if (typeRepr->kind() != TypeDescr::X4)
|
if (typeRepr.kind() != TypeDescr::X4)
|
||||||
return false;
|
return false;
|
||||||
return typeRepr->asX4()->type() == V::type;
|
return typeRepr.as<X4TypeDescr>().type() == V::type;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename V>
|
template<typename V>
|
||||||
|
Loading…
Reference in New Issue
Block a user