Commit bf151b82 by Antonio Maiorano

ReactorUnitTests: add unit tests for intrinsics

Bug: b/130459196 Change-Id: I19ecfaa6350654b0c4808739a4dd680d2e5506f1 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/38875 Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent e6ab4707
...@@ -4345,6 +4345,7 @@ namespace rr ...@@ -4345,6 +4345,7 @@ namespace rr
Int CToReactor<int32_t>::cast(int32_t v) { return type(v); } Int CToReactor<int32_t>::cast(int32_t v) { return type(v); }
UInt CToReactor<uint32_t>::cast(uint32_t v) { return type(v); } UInt CToReactor<uint32_t>::cast(uint32_t v) { return type(v); }
Float CToReactor<float>::cast(float v) { return type(v); } Float CToReactor<float>::cast(float v) { return type(v); }
Float4 CToReactor<float[4]>::cast(float v[4]) { return type(v[0], v[1], v[2], v[3]); }
// TODO: Long has no constructor that takes a uint64_t // TODO: Long has no constructor that takes a uint64_t
// Long CToReactor<uint64_t>::cast(uint64_t v) { return type(v); } // Long CToReactor<uint64_t>::cast(uint64_t v) { return type(v); }
......
...@@ -38,6 +38,7 @@ namespace rr ...@@ -38,6 +38,7 @@ namespace rr
class Long; class Long;
class Half; class Half;
class Float; class Float;
class Float4;
template<class T> class Pointer; template<class T> class Pointer;
template<class T> class LValue; template<class T> class LValue;
...@@ -83,6 +84,7 @@ namespace rr ...@@ -83,6 +84,7 @@ namespace rr
template<> struct CToReactor<int32_t> { using type = Int; static Int cast(int32_t); }; template<> struct CToReactor<int32_t> { using type = Int; static Int cast(int32_t); };
template<> struct CToReactor<uint32_t> { using type = UInt; static UInt cast(uint32_t); }; template<> struct CToReactor<uint32_t> { using type = UInt; static UInt cast(uint32_t); };
template<> struct CToReactor<float> { using type = Float; static Float cast(float); }; template<> struct CToReactor<float> { using type = Float; static Float cast(float); };
template<> struct CToReactor<float[4]> { using type = Float4; static Float4 cast(float[4]); };
// TODO: Long has no constructor that takes a uint64_t // TODO: Long has no constructor that takes a uint64_t
template<> struct CToReactor<uint64_t> { using type = Long; /* static Long cast(uint64_t); */ }; template<> struct CToReactor<uint64_t> { using type = Long; /* static Long cast(uint64_t); */ };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment