Deprecate the Long1 type.
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>
diff --git a/src/Reactor/LLVMReactor.cpp b/src/Reactor/LLVMReactor.cpp
index 95fe59c..efcd874 100644
--- a/src/Reactor/LLVMReactor.cpp
+++ b/src/Reactor/LLVMReactor.cpp
@@ -2879,20 +2879,6 @@
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;
@@ -2943,16 +2929,6 @@
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;
@@ -3353,20 +3329,6 @@
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;
@@ -3377,16 +3339,6 @@
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())
@@ -4086,31 +4038,6 @@
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);
@@ -4521,7 +4448,13 @@
// 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
{
@@ -4644,20 +4577,6 @@
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;
@@ -4708,16 +4627,6 @@
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;
@@ -4740,7 +4649,7 @@
}
}
- RValue<Long1> UnpackLow(RValue<Int2> x, RValue<Int2> y)
+ RValue<Short4> UnpackLow(RValue<Int2> x, RValue<Int2> y)
{
if(CPUID::supportsMMX2())
{
@@ -4751,11 +4660,11 @@
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())
{
@@ -4766,7 +4675,7 @@
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);
}
}
@@ -4958,20 +4867,6 @@
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;
@@ -5022,16 +4917,6 @@
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;
@@ -7097,18 +6982,18 @@
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)
@@ -7384,48 +7269,6 @@
}
}
- 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);
diff --git a/src/Reactor/Reactor.hpp b/src/Reactor/Reactor.hpp
index f75fa8b..2ed164b 100644
--- a/src/Reactor/Reactor.hpp
+++ b/src/Reactor/Reactor.hpp
@@ -48,7 +48,6 @@
class Int4;
class UInt4;
class Long;
- class Long1;
class Float;
class Float2;
class Float4;
@@ -765,8 +764,6 @@
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);
@@ -777,8 +774,6 @@
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);
@@ -845,8 +840,6 @@
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);
@@ -857,8 +850,6 @@
// 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);
@@ -1128,73 +1119,6 @@
// 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:
@@ -1294,8 +1218,6 @@
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);
@@ -1306,8 +1228,6 @@
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);
@@ -1323,8 +1243,8 @@
// 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);
@@ -1354,8 +1274,6 @@
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);
@@ -1366,8 +1284,6 @@
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);
diff --git a/src/Reactor/SubzeroReactor.cpp b/src/Reactor/SubzeroReactor.cpp
index 154967b..973180c 100644
--- a/src/Reactor/SubzeroReactor.cpp
+++ b/src/Reactor/SubzeroReactor.cpp
@@ -3113,20 +3113,6 @@
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;
@@ -3177,16 +3163,6 @@
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;
@@ -3533,16 +3509,6 @@
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;
@@ -3553,16 +3519,6 @@
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));
@@ -4253,21 +4209,6 @@
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);
@@ -4723,16 +4664,6 @@
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;
@@ -4783,16 +4714,6 @@
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;
@@ -4808,14 +4729,14 @@
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)
@@ -4942,16 +4863,6 @@
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;
@@ -5002,16 +4913,6 @@
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;
diff --git a/src/Reactor/x86.hpp b/src/Reactor/x86.hpp
index a0b8ac7..5c08167 100644
--- a/src/Reactor/x86.hpp
+++ b/src/Reactor/x86.hpp
@@ -86,8 +86,8 @@
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);
@@ -125,13 +125,6 @@
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);
diff --git a/src/Shader/SamplerCore.cpp b/src/Shader/SamplerCore.cpp
index d33acc3..67b0f05 100644
--- a/src/Shader/SamplerCore.cpp
+++ b/src/Shader/SamplerCore.cpp
@@ -1908,8 +1908,8 @@
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);
diff --git a/src/Shader/ShaderCore.cpp b/src/Shader/ShaderCore.cpp
index 727ea71..be1ca2e 100644
--- a/src/Shader/ShaderCore.cpp
+++ b/src/Shader/ShaderCore.cpp
@@ -425,10 +425,10 @@
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)