Refactor Byte4 unpacking.
Change-Id: I82f8215ce4366e0795ce249b4d8f6c8e391af96c
Reviewed-on: https://swiftshader-review.googlesource.com/8568
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
diff --git a/src/Reactor/LLVMReactor.cpp b/src/Reactor/LLVMReactor.cpp
index e6b4b94..d3da778 100644
--- a/src/Reactor/LLVMReactor.cpp
+++ b/src/Reactor/LLVMReactor.cpp
@@ -2141,6 +2141,14 @@
return UnpackLow(RValue<Byte8>(byte8), RValue<Byte8>(byte8));
}
+ RValue<Short4> Unpack(RValue<Byte4> x, RValue<Byte4> y)
+ {
+ Value *xx = Nucleus::createInsertElement(V(UndefValue::get(VectorType::get(Int::getType(), 2))), x.value, 0);
+ Value *yy = Nucleus::createInsertElement(V(UndefValue::get(VectorType::get(Int::getType(), 2))), y.value, 0);
+
+ return UnpackLow(As<Byte8>(xx), As<Byte8>(yy));
+ }
+
RValue<Short4> UnpackLow(RValue<Byte8> x, RValue<Byte8> y)
{
if(CPUID::supportsMMX2())