Implement additional types. Bug swiftshader:6 Change-Id: I6443479e34b0819de45196c61a2e9fc0bf0e84d7 Reviewed-on: https://swiftshader-review.googlesource.com/7752 Reviewed-by: Nicolas Capens <capn@google.com> Tested-by: Nicolas Capens <capn@google.com> Reviewed-on: https://swiftshader-review.googlesource.com/8134 Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Reactor/SubzeroReactor.cpp b/src/Reactor/SubzeroReactor.cpp index 11ffaf2..67d5edb 100644 --- a/src/Reactor/SubzeroReactor.cpp +++ b/src/Reactor/SubzeroReactor.cpp
@@ -66,6 +66,7 @@ Type_v2i16 = Ice::IceType_v8i16 | EmulatedV2, Type_v8i8 = Ice::IceType_v16i8 | EmulatedV8, Type_v4i8 = Ice::IceType_v16i8 | EmulatedV4, + Type_v2f32 = Ice::IceType_v4f32 | EmulatedV2, }; class Value : public Ice::Variable {}; @@ -671,6 +672,7 @@ case Type_v2i32: case Type_v8i8: case Type_v4i16: + case Type_v2f32: { const Ice::Intrinsics::IntrinsicInfo intrinsic = {Ice::Intrinsics::LoadSubVector, Ice::Intrinsics::SideEffects_F, Ice::Intrinsics::ReturnsTwice_F, Ice::Intrinsics::MemoryWrite_F}; auto target = ::context->getConstantUndef(Ice::IceType_i32); @@ -715,6 +717,7 @@ case Type_v2i32: case Type_v8i8: case Type_v4i16: + case Type_v2f32: { const Ice::Intrinsics::IntrinsicInfo intrinsic = {Ice::Intrinsics::StoreSubVector, Ice::Intrinsics::SideEffects_T, Ice::Intrinsics::ReturnsTwice_F, Ice::Intrinsics::MemoryWrite_T}; auto target = ::context->getConstantUndef(Ice::IceType_i32); @@ -1154,6 +1157,7 @@ } break; case Type_v2i32: + case Type_v2f32: { const int initializer[4] = {(int)c[0], (int)c[1], (int)c[0], (int)c[1]}; static_assert(sizeof(initializer) == vectorSize, "!"); @@ -1285,7 +1289,7 @@ Type *Bool::getType() { - assert(false && "UNIMPLEMENTED"); return nullptr; + return T(Ice::IceType_i1); } Byte::Byte(Argument<Byte> argument) @@ -1800,7 +1804,7 @@ Type *SByte::getType() { - assert(false && "UNIMPLEMENTED"); return nullptr; + return T(Ice::IceType_i8); } Short::Short(Argument<Short> argument) @@ -2047,7 +2051,7 @@ Type *Short::getType() { - assert(false && "UNIMPLEMENTED"); return nullptr; + return T(Ice::IceType_i16); } UShort::UShort(Argument<UShort> argument) @@ -2301,7 +2305,7 @@ Type *UShort::getType() { - assert(false && "UNIMPLEMENTED"); return nullptr; + return T(Ice::IceType_i16); } Byte4::Byte4(RValue<Byte8> cast) @@ -2325,7 +2329,7 @@ Type *SByte4::getType() { - assert(false && "UNIMPLEMENTED"); return nullptr; + return T(Type_v4i8); } Byte8::Byte8() @@ -2751,7 +2755,7 @@ Type *SByte8::getType() { - assert(false && "UNIMPLEMENTED"); return nullptr; + return T(Type_v8i8); } Byte16::Byte16(RValue<Byte16> rhs) @@ -3489,7 +3493,7 @@ Type *Short8::getType() { - assert(false && "UNIMPLEMENTED"); return nullptr; + return T(Ice::IceType_v8i16); } UShort8::UShort8(unsigned short c0, unsigned short c1, unsigned short c2, unsigned short c3, unsigned short c4, unsigned short c5, unsigned short c6, unsigned short c7) @@ -3590,7 +3594,7 @@ Type *UShort8::getType() { - assert(false && "UNIMPLEMENTED"); return nullptr; + return T(Ice::IceType_v8i16); } Int::Int(Argument<Int> argument) @@ -4013,7 +4017,7 @@ Type *Long::getType() { - assert(false && "UNIMPLEMENTED"); return nullptr; + return T(Ice::IceType_i64); } Long1::Long1(const RValue<UInt> cast) @@ -4341,7 +4345,7 @@ Type *UInt::getType() { - assert(false && "UNIMPLEMENTED"); return nullptr; + return T(Ice::IceType_i32); } // Int2::Int2(RValue<Int> cast) @@ -4783,7 +4787,7 @@ Type *UInt2::getType() { - assert(false && "UNIMPLEMENTED"); return nullptr; + return T(Type_v2i32); } Int4::Int4(RValue<Byte4> cast) @@ -5429,7 +5433,7 @@ Type *UInt4::getType() { - assert(false && "UNIMPLEMENTED"); return nullptr; + return T(Ice::IceType_v4i32); } Float::Float(RValue<Int> cast) @@ -5635,7 +5639,7 @@ Type *Float2::getType() { - assert(false && "UNIMPLEMENTED"); return nullptr; + return T(Type_v2f32); } Float4::Float4(RValue<Byte4> cast)