It corresponds to a scalar MMX type, used mainly for vector shifts.
We no longer need these shifts, and they would have been non-trivial
to emulate with SSE2.
Change-Id: I77a94ff5a62e043b991d4d6fa9ddd436d450181d
Reviewed-on: https://swiftshader-review.googlesource.com/8249
Reviewed-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <capn@google.com>
return x86::psraw(lhs, rhs);
}
- RValue<Short4> operator<<(RValue<Short4> lhs, RValue<Long1> rhs)
- {
- // return RValue<Short4>(Nucleus::createShl(lhs.value, rhs.value));
-
- return x86::psllw(lhs, rhs);
- }
-
- RValue<Short4> operator>>(RValue<Short4> lhs, RValue<Long1> rhs)
- {
- // return RValue<Short4>(Nucleus::createAShr(lhs.value, rhs.value));
-
- return x86::psraw(lhs, rhs);
- }
-
RValue<Short4> operator+=(Short4 &lhs, RValue<Short4> rhs)
{
return lhs = lhs + rhs;
return lhs = lhs >> rhs;
}
- RValue<Short4> operator<<=(Short4 &lhs, RValue<Long1> rhs)
- {
- return lhs = lhs << rhs;
- }
-
- RValue<Short4> operator>>=(Short4 &lhs, RValue<Long1> rhs)
- {
- return lhs = lhs >> rhs;
- }
-
// RValue<Short4> operator+(RValue<Short4> val)
// {
// return val;
return x86::psrlw(lhs, rhs);
}
- RValue<UShort4> operator<<(RValue<UShort4> lhs, RValue<Long1> rhs)
- {
- // return RValue<Short4>(Nucleus::createShl(lhs.value, rhs.value));
-
- return As<UShort4>(x86::psllw(As<Short4>(lhs), rhs));
- }
-
- RValue<UShort4> operator>>(RValue<UShort4> lhs, RValue<Long1> rhs)
- {
- // return RValue<Short4>(Nucleus::createLShr(lhs.value, rhs.value));
-
- return x86::psrlw(lhs, rhs);
- }
-
RValue<UShort4> operator<<=(UShort4 &lhs, unsigned char rhs)
{
return lhs = lhs << rhs;
return lhs = lhs >> rhs;
}
- RValue<UShort4> operator<<=(UShort4 &lhs, RValue<Long1> rhs)
- {
- return lhs = lhs << rhs;
- }
-
- RValue<UShort4> operator>>=(UShort4 &lhs, RValue<Long1> rhs)
- {
- return lhs = lhs >> rhs;
- }
-
RValue<UShort4> operator~(RValue<UShort4> val)
{
if(CPUID::supportsMMX2())
return T(llvm::Type::getInt64Ty(*::context));
}
- Long1::Long1(const RValue<UInt> cast)
- {
- Value *undefCast = Nucleus::createInsertElement(V(UndefValue::get(VectorType::get(Int::getType(), 2))), cast.value, 0);
- Value *zeroCast = Nucleus::createInsertElement(undefCast, V(Nucleus::createConstantInt(0)), 1);
-
- storeValue(Nucleus::createBitCast(zeroCast, Long1::getType()));
- }
-
- Long1::Long1(RValue<Long1> rhs)
- {
- storeValue(rhs.value);
- }
-
- Type *Long1::getType()
- {
- if(CPUID::supportsMMX2())
- {
- return MMX::getType();
- }
- else
- {
- return T(VectorType::get(Long::getType(), 1));
- }
- }
-
UInt::UInt(Argument<UInt> argument)
{
storeValue(argument.value);
// movd mm0, lo
// movd mm1, hi
// punpckldq mm0, mm1
- storeValue(As<Int2>(UnpackLow(As<Int2>(Long1(RValue<UInt>(lo))), As<Int2>(Long1(RValue<UInt>(hi))))).value);
+
+ Value *loLong = Nucleus::createInsertElement(V(UndefValue::get(VectorType::get(Int::getType(), 2))), lo.value, 0);
+ loLong = Nucleus::createInsertElement(loLong, V(ConstantInt::get(Int::getType(), 0)), 1);
+ Value *hiLong = Nucleus::createInsertElement(V(UndefValue::get(VectorType::get(Int::getType(), 2))), hi.value, 0);
+ hiLong = Nucleus::createInsertElement(hiLong, V(ConstantInt::get(Int::getType(), 0)), 1);
+
+ storeValue(As<Int2>(UnpackLow(As<Int2>(loLong), As<Int2>(hiLong))).value);
}
else
{
return x86::psrad(lhs, rhs);
}
- RValue<Int2> operator<<(RValue<Int2> lhs, RValue<Long1> rhs)
- {
- // return RValue<Int2>(Nucleus::createShl(lhs.value, rhs.value));
-
- return x86::pslld(lhs, rhs);
- }
-
- RValue<Int2> operator>>(RValue<Int2> lhs, RValue<Long1> rhs)
- {
- // return RValue<Int2>(Nucleus::createAShr(lhs.value, rhs.value));
-
- return x86::psrad(lhs, rhs);
- }
-
RValue<Int2> operator+=(Int2 &lhs, RValue<Int2> rhs)
{
return lhs = lhs + rhs;
return lhs = lhs >> rhs;
}
- RValue<Int2> operator<<=(Int2 &lhs, RValue<Long1> rhs)
- {
- return lhs = lhs << rhs;
- }
-
- RValue<Int2> operator>>=(Int2 &lhs, RValue<Long1> rhs)
- {
- return lhs = lhs >> rhs;
- }
-
// RValue<Int2> operator+(RValue<Int2> val)
// {
// return val;
}
}
- RValue<Long1> UnpackLow(RValue<Int2> x, RValue<Int2> y)
+ RValue<Short4> UnpackLow(RValue<Int2> x, RValue<Int2> y)
{
if(CPUID::supportsMMX2())
{
int shuffle[2] = {0, 2};
Value *packed = Nucleus::createShuffleVector(x.value, y.value, shuffle);
- return RValue<Long1>(Nucleus::createBitCast(packed, Long1::getType()));
+ return As<Short4>(packed);
}
}
- RValue<Long1> UnpackHigh(RValue<Int2> x, RValue<Int2> y)
+ RValue<Short4> UnpackHigh(RValue<Int2> x, RValue<Int2> y)
{
if(CPUID::supportsMMX2())
{
int shuffle[2] = {1, 3};
Value *packed = Nucleus::createShuffleVector(x.value, y.value, shuffle);
- return RValue<Long1>(Nucleus::createBitCast(packed, Long1::getType()));
+ return As<Short4>(packed);
}
}
return x86::psrld(lhs, rhs);
}
- RValue<UInt2> operator<<(RValue<UInt2> lhs, RValue<Long1> rhs)
- {
- // return RValue<UInt2>(Nucleus::createShl(lhs.value, rhs.value));
-
- return As<UInt2>(x86::pslld(As<Int2>(lhs), rhs));
- }
-
- RValue<UInt2> operator>>(RValue<UInt2> lhs, RValue<Long1> rhs)
- {
- // return RValue<UInt2>(Nucleus::createLShr(lhs.value, rhs.value));
-
- return x86::psrld(lhs, rhs);
- }
-
RValue<UInt2> operator+=(UInt2 &lhs, RValue<UInt2> rhs)
{
return lhs = lhs + rhs;
return lhs = lhs >> rhs;
}
- RValue<UInt2> operator<<=(UInt2 &lhs, RValue<Long1> rhs)
- {
- return lhs = lhs << rhs;
- }
-
- RValue<UInt2> operator>>=(UInt2 &lhs, RValue<Long1> rhs)
- {
- return lhs = lhs >> rhs;
- }
-
// RValue<UInt2> operator+(RValue<UInt2> val)
// {
// return val;
return RValue<Int>(V(::builder->CreateCall2(pextrw, As<MMX>(x).value, V(Nucleus::createConstantInt(i)))));
}
- RValue<Long1> punpckldq(RValue<Int2> x, RValue<Int2> y)
+ RValue<Short4> punpckldq(RValue<Int2> x, RValue<Int2> y)
{
llvm::Function *punpckldq = Intrinsic::getDeclaration(::module, Intrinsic::x86_mmx_punpckldq);
- return As<Long1>(V(::builder->CreateCall2(punpckldq, As<MMX>(x).value, As<MMX>(y).value)));
+ return As<Short4>(V(::builder->CreateCall2(punpckldq, As<MMX>(x).value, As<MMX>(y).value)));
}
- RValue<Long1> punpckhdq(RValue<Int2> x, RValue<Int2> y)
+ RValue<Short4> punpckhdq(RValue<Int2> x, RValue<Int2> y)
{
llvm::Function *punpckhdq = Intrinsic::getDeclaration(::module, Intrinsic::x86_mmx_punpckhdq);
- return As<Long1>(V(::builder->CreateCall2(punpckhdq, As<MMX>(x).value, As<MMX>(y).value)));
+ return As<Short4>(V(::builder->CreateCall2(punpckhdq, As<MMX>(x).value, As<MMX>(y).value)));
}
RValue<Short4> punpcklbw(RValue<Byte8> x, RValue<Byte8> y)
}
}
- RValue<UShort4> psrlw(RValue<UShort4> x, RValue<Long1> y)
- {
- llvm::Function *psrlw = Intrinsic::getDeclaration(::module, Intrinsic::x86_mmx_psrl_w);
-
- return As<UShort4>(V(::builder->CreateCall2(psrlw, As<MMX>(x).value, As<MMX>(y).value)));
- }
-
- RValue<Short4> psraw(RValue<Short4> x, RValue<Long1> y)
- {
- llvm::Function *psraw = Intrinsic::getDeclaration(::module, Intrinsic::x86_mmx_psra_w);
-
- return As<Short4>(V(::builder->CreateCall2(psraw, As<MMX>(x).value, As<MMX>(y).value)));
- }
-
- RValue<Short4> psllw(RValue<Short4> x, RValue<Long1> y)
- {
- llvm::Function *psllw = Intrinsic::getDeclaration(::module, Intrinsic::x86_mmx_psll_w);
-
- return As<Short4>(V(::builder->CreateCall2(psllw, As<MMX>(x).value, As<MMX>(y).value)));
- }
-
- RValue<Int2> pslld(RValue<Int2> x, RValue<Long1> y)
- {
- llvm::Function *pslld = Intrinsic::getDeclaration(::module, Intrinsic::x86_mmx_psll_d);
-
- return As<Int2>(V(::builder->CreateCall2(pslld, As<MMX>(x).value, As<MMX>(y).value)));
- }
-
- RValue<UInt2> psrld(RValue<UInt2> x, RValue<Long1> y)
- {
- llvm::Function *psrld = Intrinsic::getDeclaration(::module, Intrinsic::x86_mmx_psrl_d);
-
- return As<UInt2>(V(::builder->CreateCall2(psrld, As<MMX>(x).value, As<MMX>(y).value)));
- }
-
- RValue<Int2> psrad(RValue<Int2> x, RValue<Long1> y)
- {
- llvm::Function *psrld = Intrinsic::getDeclaration(::module, Intrinsic::x86_mmx_psra_d);
-
- return As<Int2>(V(::builder->CreateCall2(psrld, As<MMX>(x).value, As<MMX>(y).value)));
- }
-
RValue<Int4> pmaxsd(RValue<Int4> x, RValue<Int4> y)
{
llvm::Function *pmaxsd = Intrinsic::getDeclaration(::module, Intrinsic::x86_sse41_pmaxsd);
class Int4;
class UInt4;
class Long;
- class Long1;
class Float;
class Float2;
class Float4;
RValue<Short4> operator^(RValue<Short4> lhs, RValue<Short4> rhs);
RValue<Short4> operator<<(RValue<Short4> lhs, unsigned char rhs);
RValue<Short4> operator>>(RValue<Short4> lhs, unsigned char rhs);
- RValue<Short4> operator<<(RValue<Short4> lhs, RValue<Long1> rhs);
- RValue<Short4> operator>>(RValue<Short4> lhs, RValue<Long1> rhs);
RValue<Short4> operator+=(Short4 &lhs, RValue<Short4> rhs);
RValue<Short4> operator-=(Short4 &lhs, RValue<Short4> rhs);
RValue<Short4> operator*=(Short4 &lhs, RValue<Short4> rhs);
RValue<Short4> operator^=(Short4 &lhs, RValue<Short4> rhs);
RValue<Short4> operator<<=(Short4 &lhs, unsigned char rhs);
RValue<Short4> operator>>=(Short4 &lhs, unsigned char rhs);
- RValue<Short4> operator<<=(Short4 &lhs, RValue<Long1> rhs);
- RValue<Short4> operator>>=(Short4 &lhs, RValue<Long1> rhs);
// RValue<Short4> operator+(RValue<Short4> val);
RValue<Short4> operator-(RValue<Short4> val);
RValue<Short4> operator~(RValue<Short4> val);
RValue<UShort4> operator^(RValue<UShort4> lhs, RValue<UShort4> rhs);
RValue<UShort4> operator<<(RValue<UShort4> lhs, unsigned char rhs);
RValue<UShort4> operator>>(RValue<UShort4> lhs, unsigned char rhs);
- RValue<UShort4> operator<<(RValue<UShort4> lhs, RValue<Long1> rhs);
- RValue<UShort4> operator>>(RValue<UShort4> lhs, RValue<Long1> rhs);
// RValue<UShort4> operator+=(UShort4 &lhs, RValue<UShort4> rhs);
// RValue<UShort4> operator-=(UShort4 &lhs, RValue<UShort4> rhs);
// RValue<UShort4> operator*=(UShort4 &lhs, RValue<UShort4> rhs);
// RValue<UShort4> operator^=(UShort4 &lhs, RValue<UShort4> rhs);
RValue<UShort4> operator<<=(UShort4 &lhs, unsigned char rhs);
RValue<UShort4> operator>>=(UShort4 &lhs, unsigned char rhs);
- RValue<UShort4> operator<<=(UShort4 &lhs, RValue<Long1> rhs);
- RValue<UShort4> operator>>=(UShort4 &lhs, RValue<Long1> rhs);
// RValue<UShort4> operator+(RValue<UShort4> val);
// RValue<UShort4> operator-(RValue<UShort4> val);
RValue<UShort4> operator~(RValue<UShort4> val);
// RValue<Long> RoundLong(RValue<Float> cast);
RValue<Long> AddAtomic( RValue<Pointer<Long>> x, RValue<Long> y);
- class Long1 : public LValue<Long1>
- {
- public:
- // Long1(Argument<Long1> argument);
-
- // explicit Long1(RValue<Short> cast);
- // explicit Long1(RValue<UShort> cast);
- // explicit Long1(RValue<Int> cast);
- explicit Long1(RValue<UInt> cast);
- // explicit Long1(RValue<Float> cast);
-
- // Long1();
- // Long1(qword x);
- Long1(RValue<Long1> rhs);
- // Long1(RValue<ULong1> rhs);
- // Long1(const Long1 &rhs);
- // Long1(const Reference<Long1> &rhs);
- // Long1(const ULong1 &rhs);
- // Long1(const Reference<ULong1> &rhs);
-
- // RValue<Long1> operator=(qword rhs);
- // RValue<Long1> operator=(RValue<Long1> rhs);
- // RValue<Long1> operator=(RValue<ULong1> rhs);
- // RValue<Long1> operator=(const Long1 &rhs);
- // RValue<Long1> operator=(const Reference<Long1> &rhs);
- // RValue<Long1> operator=(const ULong1 &rhs);
- // RValue<Long1> operator=(const Reference<ULong1> &rhs);
-
- static Type *getType();
- };
-
-// RValue<Long1> operator+(RValue<Long1> lhs, RValue<Long1> rhs);
-// RValue<Long1> operator-(RValue<Long1> lhs, RValue<Long1> rhs);
-// RValue<Long1> operator*(RValue<Long1> lhs, RValue<Long1> rhs);
-// RValue<Long1> operator/(RValue<Long1> lhs, RValue<Long1> rhs);
-// RValue<Long1> operator%(RValue<Long1> lhs, RValue<Long1> rhs);
-// RValue<Long1> operator&(RValue<Long1> lhs, RValue<Long1> rhs);
-// RValue<Long1> operator|(RValue<Long1> lhs, RValue<Long1> rhs);
-// RValue<Long1> operator^(RValue<Long1> lhs, RValue<Long1> rhs);
-// RValue<Long1> operator<<(RValue<Long1> lhs, RValue<Long1> rhs);
-// RValue<Long1> operator>>(RValue<Long1> lhs, RValue<Long1> rhs);
-// RValue<Long1> operator+=(Long1 &lhs, RValue<Long1> rhs);
-// RValue<Long1> operator-=(Long1 &lhs, RValue<Long1> rhs);
-// RValue<Long1> operator*=(Long1 &lhs, RValue<Long1> rhs);
-// RValue<Long1> operator/=(Long1 &lhs, RValue<Long1> rhs);
-// RValue<Long1> operator%=(Long1 &lhs, RValue<Long1> rhs);
-// RValue<Long1> operator&=(Long1 &lhs, RValue<Long1> rhs);
-// RValue<Long1> operator|=(Long1 &lhs, RValue<Long1> rhs);
-// RValue<Long1> operator^=(Long1 &lhs, RValue<Long1> rhs);
-// RValue<Long1> operator<<=(Long1 &lhs, RValue<Long1> rhs);
-// RValue<Long1> operator>>=(Long1 &lhs, RValue<Long1> rhs);
-// RValue<Long1> operator+(RValue<Long1> val);
-// RValue<Long1> operator-(RValue<Long1> val);
-// RValue<Long1> operator~(RValue<Long1> val);
-// RValue<Long1> operator++(Long1 &val, int); // Post-increment
-// const Long1 &operator++(Long1 &val); // Pre-increment
-// RValue<Long1> operator--(Long1 &val, int); // Post-decrement
-// const Long1 &operator--(Long1 &val); // Pre-decrement
-// RValue<Bool> operator<(RValue<Long1> lhs, RValue<Long1> rhs);
-// RValue<Bool> operator<=(RValue<Long1> lhs, RValue<Long1> rhs);
-// RValue<Bool> operator>(RValue<Long1> lhs, RValue<Long1> rhs);
-// RValue<Bool> operator>=(RValue<Long1> lhs, RValue<Long1> rhs);
-// RValue<Bool> operator!=(RValue<Long1> lhs, RValue<Long1> rhs);
-// RValue<Bool> operator==(RValue<Long1> lhs, RValue<Long1> rhs);
-
-// RValue<Long1> RoundLong1(RValue<Float> cast);
-
class UInt : public LValue<UInt>
{
public:
RValue<Int2> operator^(RValue<Int2> lhs, RValue<Int2> rhs);
RValue<Int2> operator<<(RValue<Int2> lhs, unsigned char rhs);
RValue<Int2> operator>>(RValue<Int2> lhs, unsigned char rhs);
- RValue<Int2> operator<<(RValue<Int2> lhs, RValue<Long1> rhs);
- RValue<Int2> operator>>(RValue<Int2> lhs, RValue<Long1> rhs);
RValue<Int2> operator+=(Int2 &lhs, RValue<Int2> rhs);
RValue<Int2> operator-=(Int2 &lhs, RValue<Int2> rhs);
// RValue<Int2> operator*=(Int2 &lhs, RValue<Int2> rhs);
RValue<Int2> operator^=(Int2 &lhs, RValue<Int2> rhs);
RValue<Int2> operator<<=(Int2 &lhs, unsigned char rhs);
RValue<Int2> operator>>=(Int2 &lhs, unsigned char rhs);
- RValue<Int2> operator<<=(Int2 &lhs, RValue<Long1> rhs);
- RValue<Int2> operator>>=(Int2 &lhs, RValue<Long1> rhs);
// RValue<Int2> operator+(RValue<Int2> val);
// RValue<Int2> operator-(RValue<Int2> val);
RValue<Int2> operator~(RValue<Int2> val);
// RValue<Bool> operator==(RValue<Int2> lhs, RValue<Int2> rhs);
// RValue<Int2> RoundInt(RValue<Float4> cast);
- RValue<Long1> UnpackLow(RValue<Int2> x, RValue<Int2> y);
- RValue<Long1> UnpackHigh(RValue<Int2> x, RValue<Int2> y);
+ RValue<Short4> UnpackLow(RValue<Int2> x, RValue<Int2> y);
+ RValue<Short4> UnpackHigh(RValue<Int2> x, RValue<Int2> y);
RValue<Int> Extract(RValue<Int2> val, int i);
RValue<Int2> Insert(RValue<Int2> val, RValue<Int> element, int i);
RValue<UInt2> operator^(RValue<UInt2> lhs, RValue<UInt2> rhs);
RValue<UInt2> operator<<(RValue<UInt2> lhs, unsigned char rhs);
RValue<UInt2> operator>>(RValue<UInt2> lhs, unsigned char rhs);
- RValue<UInt2> operator<<(RValue<UInt2> lhs, RValue<Long1> rhs);
- RValue<UInt2> operator>>(RValue<UInt2> lhs, RValue<Long1> rhs);
RValue<UInt2> operator+=(UInt2 &lhs, RValue<UInt2> rhs);
RValue<UInt2> operator-=(UInt2 &lhs, RValue<UInt2> rhs);
// RValue<UInt2> operator*=(UInt2 &lhs, RValue<UInt2> rhs);
RValue<UInt2> operator^=(UInt2 &lhs, RValue<UInt2> rhs);
RValue<UInt2> operator<<=(UInt2 &lhs, unsigned char rhs);
RValue<UInt2> operator>>=(UInt2 &lhs, unsigned char rhs);
- RValue<UInt2> operator<<=(UInt2 &lhs, RValue<Long1> rhs);
- RValue<UInt2> operator>>=(UInt2 &lhs, RValue<Long1> rhs);
// RValue<UInt2> operator+(RValue<UInt2> val);
// RValue<UInt2> operator-(RValue<UInt2> val);
RValue<UInt2> operator~(RValue<UInt2> val);
return RValue<Short4>(Nucleus::createAShr(lhs.value, C(::context->getConstantInt32(rhs))));
}
- RValue<Short4> operator<<(RValue<Short4> lhs, RValue<Long1> rhs)
- {
- // return RValue<Short4>(Nucleus::createShl(lhs.value, rhs.value));
-
- assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr));
- }
-
- RValue<Short4> operator>>(RValue<Short4> lhs, RValue<Long1> rhs)
- {
- // return RValue<Short4>(Nucleus::createAShr(lhs.value, rhs.value));
-
- assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr));
- }
-
RValue<Short4> operator+=(Short4 &lhs, RValue<Short4> rhs)
{
return lhs = lhs + rhs;
return lhs = lhs >> rhs;
}
- RValue<Short4> operator<<=(Short4 &lhs, RValue<Long1> rhs)
- {
- return lhs = lhs << rhs;
- }
-
- RValue<Short4> operator>>=(Short4 &lhs, RValue<Long1> rhs)
- {
- return lhs = lhs >> rhs;
- }
-
// RValue<Short4> operator+(RValue<Short4> val)
// {
// return val;
return RValue<UShort4>(Nucleus::createLShr(lhs.value, C(::context->getConstantInt32(rhs))));
}
- RValue<UShort4> operator<<(RValue<UShort4> lhs, RValue<Long1> rhs)
- {
- assert(false && "UNIMPLEMENTED"); return RValue<UShort4>(V(nullptr));
- }
-
- RValue<UShort4> operator>>(RValue<UShort4> lhs, RValue<Long1> rhs)
- {
- assert(false && "UNIMPLEMENTED"); return RValue<UShort4>(V(nullptr));
- }
-
RValue<UShort4> operator<<=(UShort4 &lhs, unsigned char rhs)
{
return lhs = lhs << rhs;
return lhs = lhs >> rhs;
}
- RValue<UShort4> operator<<=(UShort4 &lhs, RValue<Long1> rhs)
- {
- return lhs = lhs << rhs;
- }
-
- RValue<UShort4> operator>>=(UShort4 &lhs, RValue<Long1> rhs)
- {
- return lhs = lhs >> rhs;
- }
-
RValue<UShort4> operator~(RValue<UShort4> val)
{
return RValue<UShort4>(Nucleus::createNot(val.value));
return T(Ice::IceType_i64);
}
- Long1::Long1(const RValue<UInt> cast)
- {
- assert(false && "UNIMPLEMENTED");
- }
-
- Long1::Long1(RValue<Long1> rhs)
- {
- storeValue(rhs.value);
- }
-
- Type *Long1::getType()
- {
- assert(false && "UNIMPLEMENTED"); return nullptr;
- }
-
UInt::UInt(Argument<UInt> argument)
{
storeValue(argument.value);
return RValue<Int2>(Nucleus::createAShr(lhs.value, C(::context->getConstantInt32(rhs))));
}
- RValue<Int2> operator<<(RValue<Int2> lhs, RValue<Long1> rhs)
- {
- assert(false && "UNIMPLEMENTED"); return RValue<Int2>(V(nullptr));
- }
-
- RValue<Int2> operator>>(RValue<Int2> lhs, RValue<Long1> rhs)
- {
- assert(false && "UNIMPLEMENTED"); return RValue<Int2>(V(nullptr));
- }
-
RValue<Int2> operator+=(Int2 &lhs, RValue<Int2> rhs)
{
return lhs = lhs + rhs;
return lhs = lhs >> rhs;
}
- RValue<Int2> operator<<=(Int2 &lhs, RValue<Long1> rhs)
- {
- return lhs = lhs << rhs;
- }
-
- RValue<Int2> operator>>=(Int2 &lhs, RValue<Long1> rhs)
- {
- return lhs = lhs >> rhs;
- }
-
// RValue<Int2> operator+(RValue<Int2> val)
// {
// return val;
return RValue<Int2>(Nucleus::createNot(val.value));
}
- RValue<Long1> UnpackLow(RValue<Int2> x, RValue<Int2> y)
+ RValue<Short4> UnpackLow(RValue<Int2> x, RValue<Int2> y)
{
- assert(false && "UNIMPLEMENTED"); return RValue<Long1>(V(nullptr));
+ assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr));
}
- RValue<Long1> UnpackHigh(RValue<Int2> x, RValue<Int2> y)
+ RValue<Short4> UnpackHigh(RValue<Int2> x, RValue<Int2> y)
{
- assert(false && "UNIMPLEMENTED"); return RValue<Long1>(V(nullptr));
+ assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr));
}
RValue<Int> Extract(RValue<Int2> val, int i)
return RValue<UInt2>(Nucleus::createLShr(lhs.value, C(::context->getConstantInt32(rhs))));
}
- RValue<UInt2> operator<<(RValue<UInt2> lhs, RValue<Long1> rhs)
- {
- assert(false && "UNIMPLEMENTED"); return RValue<UInt2>(V(nullptr));
- }
-
- RValue<UInt2> operator>>(RValue<UInt2> lhs, RValue<Long1> rhs)
- {
- assert(false && "UNIMPLEMENTED"); return RValue<UInt2>(V(nullptr));
- }
-
RValue<UInt2> operator+=(UInt2 &lhs, RValue<UInt2> rhs)
{
return lhs = lhs + rhs;
return lhs = lhs >> rhs;
}
- RValue<UInt2> operator<<=(UInt2 &lhs, RValue<Long1> rhs)
- {
- return lhs = lhs << rhs;
- }
-
- RValue<UInt2> operator>>=(UInt2 &lhs, RValue<Long1> rhs)
- {
- return lhs = lhs >> rhs;
- }
-
// RValue<UInt2> operator+(RValue<UInt2> val)
// {
// return val;
RValue<Int2> punpckhwd(RValue<Short4> x, RValue<Short4> y);
RValue<Short4> pinsrw(RValue<Short4> x, RValue<Int> y, unsigned int i);
RValue<Int> pextrw(RValue<Short4> x, unsigned int i);
- RValue<Long1> punpckldq(RValue<Int2> x, RValue<Int2> y);
- RValue<Long1> punpckhdq(RValue<Int2> x, RValue<Int2> y);
+ RValue<Short4> punpckldq(RValue<Int2> x, RValue<Int2> y);
+ RValue<Short4> punpckhdq(RValue<Int2> x, RValue<Int2> y);
RValue<Short4> punpcklbw(RValue<Byte8> x, RValue<Byte8> y);
RValue<Short4> punpckhbw(RValue<Byte8> x, RValue<Byte8> y);
RValue<Byte8> paddb(RValue<Byte8> x, RValue<Byte8> y);
RValue<UInt2> psrld(RValue<UInt2> x, unsigned char y);
RValue<UInt4> psrld(RValue<UInt4> x, unsigned char y);
- RValue<UShort4> psrlw(RValue<UShort4> x, RValue<Long1> y);
- RValue<Short4> psraw(RValue<Short4> x, RValue<Long1> y);
- RValue<Short4> psllw(RValue<Short4> x, RValue<Long1> y);
- RValue<Int2> pslld(RValue<Int2> x, RValue<Long1> y);
- RValue<UInt2> psrld(RValue<UInt2> x, RValue<Long1> y);
- RValue<Int2> psrad(RValue<Int2> x, RValue<Long1> y);
-
RValue<Int4> pmaxsd(RValue<Int4> x, RValue<Int4> y);
RValue<Int4> pminsd(RValue<Int4> x, RValue<Int4> y);
RValue<UInt4> pmaxud(RValue<UInt4> x, RValue<UInt4> y);
c.z = *Pointer<Short4>(buffer[f2] + 4 * index[2]);
c.z = As<Short4>(UnpackLow(c.z, *Pointer<Short4>(buffer[f3] + 4 * index[3])));
c.y = c.x;
- c.x = As<Short4>(UnpackLow(As<Int2>(c.x), As<Int2>(c.z)));
- c.y = As<Short4>(UnpackHigh(As<Int2>(c.y), As<Int2>(c.z)));
+ c.x = UnpackLow(As<Int2>(c.x), As<Int2>(c.z));
+ c.y = UnpackHigh(As<Int2>(c.y), As<Int2>(c.z));
break;
case 1:
c.x = Insert(c.x, *Pointer<Short>(buffer[f0] + 2 * index[0]), 0);
Int2 tmp2 = UnpackLow(row0, row1);
Int2 tmp3 = UnpackLow(row2, row3);
- row0 = As<Short4>(UnpackLow(tmp2, tmp3));
- row1 = As<Short4>(UnpackHigh(tmp2, tmp3));
- row2 = As<Short4>(UnpackLow(tmp0, tmp1));
- row3 = As<Short4>(UnpackHigh(tmp0, tmp1));
+ row0 = UnpackLow(tmp2, tmp3);
+ row1 = UnpackHigh(tmp2, tmp3);
+ row2 = UnpackLow(tmp0, tmp1);
+ row3 = UnpackHigh(tmp0, tmp1);
}
void transpose4x4(Float4 &row0, Float4 &row1, Float4 &row2, Float4 &row3)