OSDN Git Service

Disallow assigning to an RValue.
authorNicolas Capens <capn@google.com>
Wed, 4 Feb 2015 05:16:13 +0000 (00:16 -0500)
committerNicolas Capens <capn@google.com>
Thu, 14 Jan 2016 02:47:12 +0000 (02:47 +0000)
Change-Id: I539fcaa5b7853ac618f3d27027d3357bc6e620ba
Reviewed-on: https://swiftshader-review.googlesource.com/1960
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
src/Reactor/Nucleus.cpp
src/Reactor/Nucleus.hpp

index 4305895..094481b 100644 (file)
@@ -3086,9 +3086,9 @@ namespace sw
        RValue<Short4> RoundShort4(RValue<Float4> cast)
        {
                RValue<Int4> v4i32 = x86::cvtps2dq(cast);
-               v4i32 = As<Int4>(x86::packssdw(v4i32, v4i32));
+               RValue<Short8> v8i16 = x86::packssdw(v4i32, v4i32);
 
-               return As<Short4>(Int2(v4i32));
+               return As<Short4>(Int2(As<Int4>(v8i16)));
        }
 
        RValue<Short4> Max(RValue<Short4> x, RValue<Short4> y)
index b134149..e84f57d 100644 (file)
@@ -363,6 +363,8 @@ namespace sw
                RValue(typename FloatLiteral<T>::type f);\r
                RValue(const Reference<T> &rhs);\r
 \r
+               RValue<T> &operator=(const RValue<T>&) = delete;\r
+\r
                llvm::Value *value;   // FIXME: Make private\r
        };\r
 \r