Commit 5f77c5e5 by Nicolas Capens Committed by Nicolas Capens

Add type-safe LValue<T> load and store methods

These methods operate on RValue<T> types so they're safer than 'loadValue()' and 'storeValue()'. They also enable overloading the latter in subsequent changes. Bug: b/155302798 Change-Id: I30903fc70e353dfd668873122ad7d8f74e857420 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/44669 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com>
parent 67cdce99
...@@ -180,42 +180,32 @@ Bool::Bool(bool x) ...@@ -180,42 +180,32 @@ Bool::Bool(bool x)
Bool::Bool(RValue<Bool> rhs) Bool::Bool(RValue<Bool> rhs)
{ {
storeValue(rhs.value); store(rhs);
} }
Bool::Bool(const Bool &rhs) Bool::Bool(const Bool &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
Bool::Bool(const Reference<Bool> &rhs) Bool::Bool(const Reference<Bool> &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
RValue<Bool> Bool::operator=(RValue<Bool> rhs) RValue<Bool> Bool::operator=(RValue<Bool> rhs)
{ {
storeValue(rhs.value); return store(rhs);
return rhs;
} }
RValue<Bool> Bool::operator=(const Bool &rhs) RValue<Bool> Bool::operator=(const Bool &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Bool>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Bool>(value);
} }
RValue<Bool> Bool::operator=(const Reference<Bool> &rhs) RValue<Bool> Bool::operator=(const Reference<Bool> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Bool>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Bool>(value);
} }
RValue<Bool> operator!(RValue<Bool> val) RValue<Bool> operator!(RValue<Bool> val)
...@@ -281,42 +271,32 @@ Byte::Byte(unsigned char x) ...@@ -281,42 +271,32 @@ Byte::Byte(unsigned char x)
Byte::Byte(RValue<Byte> rhs) Byte::Byte(RValue<Byte> rhs)
{ {
storeValue(rhs.value); store(rhs);
} }
Byte::Byte(const Byte &rhs) Byte::Byte(const Byte &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
Byte::Byte(const Reference<Byte> &rhs) Byte::Byte(const Reference<Byte> &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
RValue<Byte> Byte::operator=(RValue<Byte> rhs) RValue<Byte> Byte::operator=(RValue<Byte> rhs)
{ {
storeValue(rhs.value); return store(rhs);
return rhs;
} }
RValue<Byte> Byte::operator=(const Byte &rhs) RValue<Byte> Byte::operator=(const Byte &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Byte>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Byte>(value);
} }
RValue<Byte> Byte::operator=(const Reference<Byte> &rhs) RValue<Byte> Byte::operator=(const Reference<Byte> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Byte>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Byte>(value);
} }
RValue<Byte> operator+(RValue<Byte> lhs, RValue<Byte> rhs) RValue<Byte> operator+(RValue<Byte> lhs, RValue<Byte> rhs)
...@@ -526,42 +506,32 @@ SByte::SByte(signed char x) ...@@ -526,42 +506,32 @@ SByte::SByte(signed char x)
SByte::SByte(RValue<SByte> rhs) SByte::SByte(RValue<SByte> rhs)
{ {
storeValue(rhs.value); store(rhs);
} }
SByte::SByte(const SByte &rhs) SByte::SByte(const SByte &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
SByte::SByte(const Reference<SByte> &rhs) SByte::SByte(const Reference<SByte> &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
RValue<SByte> SByte::operator=(RValue<SByte> rhs) RValue<SByte> SByte::operator=(RValue<SByte> rhs)
{ {
storeValue(rhs.value); return store(rhs);
return rhs;
} }
RValue<SByte> SByte::operator=(const SByte &rhs) RValue<SByte> SByte::operator=(const SByte &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<SByte>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<SByte>(value);
} }
RValue<SByte> SByte::operator=(const Reference<SByte> &rhs) RValue<SByte> SByte::operator=(const Reference<SByte> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<SByte>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<SByte>(value);
} }
RValue<SByte> operator+(RValue<SByte> lhs, RValue<SByte> rhs) RValue<SByte> operator+(RValue<SByte> lhs, RValue<SByte> rhs)
...@@ -764,42 +734,32 @@ Short::Short(short x) ...@@ -764,42 +734,32 @@ Short::Short(short x)
Short::Short(RValue<Short> rhs) Short::Short(RValue<Short> rhs)
{ {
storeValue(rhs.value); store(rhs);
} }
Short::Short(const Short &rhs) Short::Short(const Short &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
Short::Short(const Reference<Short> &rhs) Short::Short(const Reference<Short> &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
RValue<Short> Short::operator=(RValue<Short> rhs) RValue<Short> Short::operator=(RValue<Short> rhs)
{ {
storeValue(rhs.value); return store(rhs);
return rhs;
} }
RValue<Short> Short::operator=(const Short &rhs) RValue<Short> Short::operator=(const Short &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Short>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Short>(value);
} }
RValue<Short> Short::operator=(const Reference<Short> &rhs) RValue<Short> Short::operator=(const Reference<Short> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Short>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Short>(value);
} }
RValue<Short> operator+(RValue<Short> lhs, RValue<Short> rhs) RValue<Short> operator+(RValue<Short> lhs, RValue<Short> rhs)
...@@ -1009,42 +969,32 @@ UShort::UShort(unsigned short x) ...@@ -1009,42 +969,32 @@ UShort::UShort(unsigned short x)
UShort::UShort(RValue<UShort> rhs) UShort::UShort(RValue<UShort> rhs)
{ {
storeValue(rhs.value); store(rhs);
} }
UShort::UShort(const UShort &rhs) UShort::UShort(const UShort &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
UShort::UShort(const Reference<UShort> &rhs) UShort::UShort(const Reference<UShort> &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
RValue<UShort> UShort::operator=(RValue<UShort> rhs) RValue<UShort> UShort::operator=(RValue<UShort> rhs)
{ {
storeValue(rhs.value); return store(rhs);
return rhs;
} }
RValue<UShort> UShort::operator=(const UShort &rhs) RValue<UShort> UShort::operator=(const UShort &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<UShort>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<UShort>(value);
} }
RValue<UShort> UShort::operator=(const Reference<UShort> &rhs) RValue<UShort> UShort::operator=(const Reference<UShort> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<UShort>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<UShort>(value);
} }
RValue<UShort> operator+(RValue<UShort> lhs, RValue<UShort> rhs) RValue<UShort> operator+(RValue<UShort> lhs, RValue<UShort> rhs)
...@@ -1259,34 +1209,27 @@ Byte4::Byte4(RValue<Int4> cast) ...@@ -1259,34 +1209,27 @@ Byte4::Byte4(RValue<Int4> cast)
Byte4::Byte4(RValue<Byte4> rhs) Byte4::Byte4(RValue<Byte4> rhs)
{ {
storeValue(rhs.value); store(rhs);
} }
Byte4::Byte4(const Byte4 &rhs) Byte4::Byte4(const Byte4 &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
Byte4::Byte4(const Reference<Byte4> &rhs) Byte4::Byte4(const Reference<Byte4> &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
RValue<Byte4> Byte4::operator=(RValue<Byte4> rhs) RValue<Byte4> Byte4::operator=(RValue<Byte4> rhs)
{ {
storeValue(rhs.value); return store(rhs);
return rhs;
} }
RValue<Byte4> Byte4::operator=(const Byte4 &rhs) RValue<Byte4> Byte4::operator=(const Byte4 &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Byte4>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Byte4>(value);
} }
Byte8::Byte8(uint8_t x0, uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, uint8_t x5, uint8_t x6, uint8_t x7) Byte8::Byte8(uint8_t x0, uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, uint8_t x5, uint8_t x6, uint8_t x7)
...@@ -1297,42 +1240,32 @@ Byte8::Byte8(uint8_t x0, uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, uint8_t ...@@ -1297,42 +1240,32 @@ Byte8::Byte8(uint8_t x0, uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, uint8_t
Byte8::Byte8(RValue<Byte8> rhs) Byte8::Byte8(RValue<Byte8> rhs)
{ {
storeValue(rhs.value); store(rhs);
} }
Byte8::Byte8(const Byte8 &rhs) Byte8::Byte8(const Byte8 &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
Byte8::Byte8(const Reference<Byte8> &rhs) Byte8::Byte8(const Reference<Byte8> &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
RValue<Byte8> Byte8::operator=(RValue<Byte8> rhs) RValue<Byte8> Byte8::operator=(RValue<Byte8> rhs)
{ {
storeValue(rhs.value); return store(rhs);
return rhs;
} }
RValue<Byte8> Byte8::operator=(const Byte8 &rhs) RValue<Byte8> Byte8::operator=(const Byte8 &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Byte8>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Byte8>(value);
} }
RValue<Byte8> Byte8::operator=(const Reference<Byte8> &rhs) RValue<Byte8> Byte8::operator=(const Reference<Byte8> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Byte8>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Byte8>(value);
} }
RValue<Byte8> operator+(RValue<Byte8> lhs, RValue<Byte8> rhs) RValue<Byte8> operator+(RValue<Byte8> lhs, RValue<Byte8> rhs)
...@@ -1513,42 +1446,32 @@ SByte8::SByte8(uint8_t x0, uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, uint8 ...@@ -1513,42 +1446,32 @@ SByte8::SByte8(uint8_t x0, uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, uint8
SByte8::SByte8(RValue<SByte8> rhs) SByte8::SByte8(RValue<SByte8> rhs)
{ {
storeValue(rhs.value); store(rhs);
} }
SByte8::SByte8(const SByte8 &rhs) SByte8::SByte8(const SByte8 &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
SByte8::SByte8(const Reference<SByte8> &rhs) SByte8::SByte8(const Reference<SByte8> &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
RValue<SByte8> SByte8::operator=(RValue<SByte8> rhs) RValue<SByte8> SByte8::operator=(RValue<SByte8> rhs)
{ {
storeValue(rhs.value); return store(rhs);
return rhs;
} }
RValue<SByte8> SByte8::operator=(const SByte8 &rhs) RValue<SByte8> SByte8::operator=(const SByte8 &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<SByte8>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<SByte8>(value);
} }
RValue<SByte8> SByte8::operator=(const Reference<SByte8> &rhs) RValue<SByte8> SByte8::operator=(const Reference<SByte8> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<SByte8>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<SByte8>(value);
} }
RValue<SByte8> operator+(RValue<SByte8> lhs, RValue<SByte8> rhs) RValue<SByte8> operator+(RValue<SByte8> lhs, RValue<SByte8> rhs)
...@@ -1683,42 +1606,32 @@ RValue<Short4> UnpackHigh(RValue<SByte8> x, RValue<SByte8> y) ...@@ -1683,42 +1606,32 @@ RValue<Short4> UnpackHigh(RValue<SByte8> x, RValue<SByte8> y)
Byte16::Byte16(RValue<Byte16> rhs) Byte16::Byte16(RValue<Byte16> rhs)
{ {
storeValue(rhs.value); store(rhs);
} }
Byte16::Byte16(const Byte16 &rhs) Byte16::Byte16(const Byte16 &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
Byte16::Byte16(const Reference<Byte16> &rhs) Byte16::Byte16(const Reference<Byte16> &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
RValue<Byte16> Byte16::operator=(RValue<Byte16> rhs) RValue<Byte16> Byte16::operator=(RValue<Byte16> rhs)
{ {
storeValue(rhs.value); return store(rhs);
return rhs;
} }
RValue<Byte16> Byte16::operator=(const Byte16 &rhs) RValue<Byte16> Byte16::operator=(const Byte16 &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Byte16>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Byte16>(value);
} }
RValue<Byte16> Byte16::operator=(const Reference<Byte16> &rhs) RValue<Byte16> Byte16::operator=(const Reference<Byte16> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Byte16>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Byte16>(value);
} }
RValue<Byte16> Swizzle(RValue<Byte16> x, uint64_t select) RValue<Byte16> Swizzle(RValue<Byte16> x, uint64_t select)
...@@ -1783,19 +1696,17 @@ Short4::Short4(short x, short y, short z, short w) ...@@ -1783,19 +1696,17 @@ Short4::Short4(short x, short y, short z, short w)
Short4::Short4(RValue<Short4> rhs) Short4::Short4(RValue<Short4> rhs)
{ {
storeValue(rhs.value); store(rhs);
} }
Short4::Short4(const Short4 &rhs) Short4::Short4(const Short4 &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
Short4::Short4(const Reference<Short4> &rhs) Short4::Short4(const Reference<Short4> &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
Short4::Short4(RValue<UShort4> rhs) Short4::Short4(RValue<UShort4> rhs)
...@@ -1815,48 +1726,32 @@ Short4::Short4(const Reference<UShort4> &rhs) ...@@ -1815,48 +1726,32 @@ Short4::Short4(const Reference<UShort4> &rhs)
RValue<Short4> Short4::operator=(RValue<Short4> rhs) RValue<Short4> Short4::operator=(RValue<Short4> rhs)
{ {
storeValue(rhs.value); return store(rhs);
return rhs;
} }
RValue<Short4> Short4::operator=(const Short4 &rhs) RValue<Short4> Short4::operator=(const Short4 &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Short4>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Short4>(value);
} }
RValue<Short4> Short4::operator=(const Reference<Short4> &rhs) RValue<Short4> Short4::operator=(const Reference<Short4> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Short4>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Short4>(value);
} }
RValue<Short4> Short4::operator=(RValue<UShort4> rhs) RValue<Short4> Short4::operator=(RValue<UShort4> rhs)
{ {
storeValue(rhs.value); return RValue<Short4>(storeValue(rhs.value));
return RValue<Short4>(rhs);
} }
RValue<Short4> Short4::operator=(const UShort4 &rhs) RValue<Short4> Short4::operator=(const UShort4 &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Short4>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Short4>(value);
} }
RValue<Short4> Short4::operator=(const Reference<UShort4> &rhs) RValue<Short4> Short4::operator=(const Reference<UShort4> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Short4>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Short4>(value);
} }
RValue<Short4> operator+(RValue<Short4> lhs, RValue<Short4> rhs) RValue<Short4> operator+(RValue<Short4> lhs, RValue<Short4> rhs)
...@@ -2031,19 +1926,17 @@ UShort4::UShort4(unsigned short x, unsigned short y, unsigned short z, unsigned ...@@ -2031,19 +1926,17 @@ UShort4::UShort4(unsigned short x, unsigned short y, unsigned short z, unsigned
UShort4::UShort4(RValue<UShort4> rhs) UShort4::UShort4(RValue<UShort4> rhs)
{ {
storeValue(rhs.value); store(rhs);
} }
UShort4::UShort4(const UShort4 &rhs) UShort4::UShort4(const UShort4 &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
UShort4::UShort4(const Reference<UShort4> &rhs) UShort4::UShort4(const Reference<UShort4> &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
UShort4::UShort4(RValue<Short4> rhs) UShort4::UShort4(RValue<Short4> rhs)
...@@ -2053,60 +1946,42 @@ UShort4::UShort4(RValue<Short4> rhs) ...@@ -2053,60 +1946,42 @@ UShort4::UShort4(RValue<Short4> rhs)
UShort4::UShort4(const Short4 &rhs) UShort4::UShort4(const Short4 &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
UShort4::UShort4(const Reference<Short4> &rhs) UShort4::UShort4(const Reference<Short4> &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
RValue<UShort4> UShort4::operator=(RValue<UShort4> rhs) RValue<UShort4> UShort4::operator=(RValue<UShort4> rhs)
{ {
storeValue(rhs.value); return store(rhs);
return rhs;
} }
RValue<UShort4> UShort4::operator=(const UShort4 &rhs) RValue<UShort4> UShort4::operator=(const UShort4 &rhs)
{ {
Value *value = rhs.loadValue(); return store(rhs.load());
storeValue(value);
return RValue<UShort4>(value);
} }
RValue<UShort4> UShort4::operator=(const Reference<UShort4> &rhs) RValue<UShort4> UShort4::operator=(const Reference<UShort4> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<UShort4>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<UShort4>(value);
} }
RValue<UShort4> UShort4::operator=(RValue<Short4> rhs) RValue<UShort4> UShort4::operator=(RValue<Short4> rhs)
{ {
storeValue(rhs.value); return RValue<UShort4>(storeValue(rhs.value));
return RValue<UShort4>(rhs);
} }
RValue<UShort4> UShort4::operator=(const Short4 &rhs) RValue<UShort4> UShort4::operator=(const Short4 &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<UShort4>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<UShort4>(value);
} }
RValue<UShort4> UShort4::operator=(const Reference<Short4> &rhs) RValue<UShort4> UShort4::operator=(const Reference<Short4> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<UShort4>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<UShort4>(value);
} }
RValue<UShort4> operator+(RValue<UShort4> lhs, RValue<UShort4> rhs) RValue<UShort4> operator+(RValue<UShort4> lhs, RValue<UShort4> rhs)
...@@ -2168,13 +2043,12 @@ Short8::Short8(short c0, short c1, short c2, short c3, short c4, short c5, short ...@@ -2168,13 +2043,12 @@ Short8::Short8(short c0, short c1, short c2, short c3, short c4, short c5, short
Short8::Short8(RValue<Short8> rhs) Short8::Short8(RValue<Short8> rhs)
{ {
storeValue(rhs.value); store(rhs);
} }
Short8::Short8(const Reference<Short8> &rhs) Short8::Short8(const Reference<Short8> &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
Short8::Short8(RValue<Short4> lo, RValue<Short4> hi) Short8::Short8(RValue<Short4> lo, RValue<Short4> hi)
...@@ -2187,25 +2061,17 @@ Short8::Short8(RValue<Short4> lo, RValue<Short4> hi) ...@@ -2187,25 +2061,17 @@ Short8::Short8(RValue<Short4> lo, RValue<Short4> hi)
RValue<Short8> Short8::operator=(RValue<Short8> rhs) RValue<Short8> Short8::operator=(RValue<Short8> rhs)
{ {
storeValue(rhs.value); return store(rhs);
return rhs;
} }
RValue<Short8> Short8::operator=(const Short8 &rhs) RValue<Short8> Short8::operator=(const Short8 &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Short8>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Short8>(value);
} }
RValue<Short8> Short8::operator=(const Reference<Short8> &rhs) RValue<Short8> Short8::operator=(const Reference<Short8> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Short8>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Short8>(value);
} }
RValue<Short8> operator+(RValue<Short8> lhs, RValue<Short8> rhs) RValue<Short8> operator+(RValue<Short8> lhs, RValue<Short8> rhs)
...@@ -2239,13 +2105,12 @@ UShort8::UShort8(unsigned short c0, unsigned short c1, unsigned short c2, unsign ...@@ -2239,13 +2105,12 @@ UShort8::UShort8(unsigned short c0, unsigned short c1, unsigned short c2, unsign
UShort8::UShort8(RValue<UShort8> rhs) UShort8::UShort8(RValue<UShort8> rhs)
{ {
storeValue(rhs.value); store(rhs);
} }
UShort8::UShort8(const Reference<UShort8> &rhs) UShort8::UShort8(const Reference<UShort8> &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
UShort8::UShort8(RValue<UShort4> lo, RValue<UShort4> hi) UShort8::UShort8(RValue<UShort4> lo, RValue<UShort4> hi)
...@@ -2258,25 +2123,17 @@ UShort8::UShort8(RValue<UShort4> lo, RValue<UShort4> hi) ...@@ -2258,25 +2123,17 @@ UShort8::UShort8(RValue<UShort4> lo, RValue<UShort4> hi)
RValue<UShort8> UShort8::operator=(RValue<UShort8> rhs) RValue<UShort8> UShort8::operator=(RValue<UShort8> rhs)
{ {
storeValue(rhs.value); return store(rhs);
return rhs;
} }
RValue<UShort8> UShort8::operator=(const UShort8 &rhs) RValue<UShort8> UShort8::operator=(const UShort8 &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<UShort8>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<UShort8>(value);
} }
RValue<UShort8> UShort8::operator=(const Reference<UShort8> &rhs) RValue<UShort8> UShort8::operator=(const Reference<UShort8> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<UShort8>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<UShort8>(value);
} }
RValue<UShort8> operator&(RValue<UShort8> lhs, RValue<UShort8> rhs) RValue<UShort8> operator&(RValue<UShort8> lhs, RValue<UShort8> rhs)
...@@ -2379,7 +2236,7 @@ Int::Int(int x) ...@@ -2379,7 +2236,7 @@ Int::Int(int x)
Int::Int(RValue<Int> rhs) Int::Int(RValue<Int> rhs)
{ {
storeValue(rhs.value); store(rhs);
} }
Int::Int(RValue<UInt> rhs) Int::Int(RValue<UInt> rhs)
...@@ -2389,26 +2246,22 @@ Int::Int(RValue<UInt> rhs) ...@@ -2389,26 +2246,22 @@ Int::Int(RValue<UInt> rhs)
Int::Int(const Int &rhs) Int::Int(const Int &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
Int::Int(const Reference<Int> &rhs) Int::Int(const Reference<Int> &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
Int::Int(const UInt &rhs) Int::Int(const UInt &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
Int::Int(const Reference<UInt> &rhs) Int::Int(const Reference<UInt> &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
RValue<Int> Int::operator=(int rhs) RValue<Int> Int::operator=(int rhs)
...@@ -2418,9 +2271,7 @@ RValue<Int> Int::operator=(int rhs) ...@@ -2418,9 +2271,7 @@ RValue<Int> Int::operator=(int rhs)
RValue<Int> Int::operator=(RValue<Int> rhs) RValue<Int> Int::operator=(RValue<Int> rhs)
{ {
storeValue(rhs.value); return store(rhs);
return rhs;
} }
RValue<Int> Int::operator=(RValue<UInt> rhs) RValue<Int> Int::operator=(RValue<UInt> rhs)
...@@ -2432,34 +2283,22 @@ RValue<Int> Int::operator=(RValue<UInt> rhs) ...@@ -2432,34 +2283,22 @@ RValue<Int> Int::operator=(RValue<UInt> rhs)
RValue<Int> Int::operator=(const Int &rhs) RValue<Int> Int::operator=(const Int &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Int>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Int>(value);
} }
RValue<Int> Int::operator=(const Reference<Int> &rhs) RValue<Int> Int::operator=(const Reference<Int> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Int>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Int>(value);
} }
RValue<Int> Int::operator=(const UInt &rhs) RValue<Int> Int::operator=(const UInt &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Int>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Int>(value);
} }
RValue<Int> Int::operator=(const Reference<UInt> &rhs) RValue<Int> Int::operator=(const Reference<UInt> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Int>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Int>(value);
} }
RValue<Int> operator+(RValue<Int> lhs, RValue<Int> rhs) RValue<Int> operator+(RValue<Int> lhs, RValue<Int> rhs)
...@@ -2638,7 +2477,7 @@ Long::Long(RValue<UInt> cast) ...@@ -2638,7 +2477,7 @@ Long::Long(RValue<UInt> cast)
Long::Long(RValue<Long> rhs) Long::Long(RValue<Long> rhs)
{ {
storeValue(rhs.value); store(rhs);
} }
RValue<Long> Long::operator=(int64_t rhs) RValue<Long> Long::operator=(int64_t rhs)
...@@ -2648,25 +2487,17 @@ RValue<Long> Long::operator=(int64_t rhs) ...@@ -2648,25 +2487,17 @@ RValue<Long> Long::operator=(int64_t rhs)
RValue<Long> Long::operator=(RValue<Long> rhs) RValue<Long> Long::operator=(RValue<Long> rhs)
{ {
storeValue(rhs.value); return store(rhs);
return rhs;
} }
RValue<Long> Long::operator=(const Long &rhs) RValue<Long> Long::operator=(const Long &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Long>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Long>(value);
} }
RValue<Long> Long::operator=(const Reference<Long> &rhs) RValue<Long> Long::operator=(const Reference<Long> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Long>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Long>(value);
} }
RValue<Long> operator+(RValue<Long> lhs, RValue<Long> rhs) RValue<Long> operator+(RValue<Long> lhs, RValue<Long> rhs)
...@@ -2770,7 +2601,7 @@ UInt::UInt(unsigned int x) ...@@ -2770,7 +2601,7 @@ UInt::UInt(unsigned int x)
UInt::UInt(RValue<UInt> rhs) UInt::UInt(RValue<UInt> rhs)
{ {
storeValue(rhs.value); store(rhs);
} }
UInt::UInt(RValue<Int> rhs) UInt::UInt(RValue<Int> rhs)
...@@ -2780,26 +2611,22 @@ UInt::UInt(RValue<Int> rhs) ...@@ -2780,26 +2611,22 @@ UInt::UInt(RValue<Int> rhs)
UInt::UInt(const UInt &rhs) UInt::UInt(const UInt &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
UInt::UInt(const Reference<UInt> &rhs) UInt::UInt(const Reference<UInt> &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
UInt::UInt(const Int &rhs) UInt::UInt(const Int &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
UInt::UInt(const Reference<Int> &rhs) UInt::UInt(const Reference<Int> &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
RValue<UInt> UInt::operator=(unsigned int rhs) RValue<UInt> UInt::operator=(unsigned int rhs)
...@@ -2809,9 +2636,7 @@ RValue<UInt> UInt::operator=(unsigned int rhs) ...@@ -2809,9 +2636,7 @@ RValue<UInt> UInt::operator=(unsigned int rhs)
RValue<UInt> UInt::operator=(RValue<UInt> rhs) RValue<UInt> UInt::operator=(RValue<UInt> rhs)
{ {
storeValue(rhs.value); return store(rhs);
return rhs;
} }
RValue<UInt> UInt::operator=(RValue<Int> rhs) RValue<UInt> UInt::operator=(RValue<Int> rhs)
...@@ -2823,34 +2648,22 @@ RValue<UInt> UInt::operator=(RValue<Int> rhs) ...@@ -2823,34 +2648,22 @@ RValue<UInt> UInt::operator=(RValue<Int> rhs)
RValue<UInt> UInt::operator=(const UInt &rhs) RValue<UInt> UInt::operator=(const UInt &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<UInt>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<UInt>(value);
} }
RValue<UInt> UInt::operator=(const Reference<UInt> &rhs) RValue<UInt> UInt::operator=(const Reference<UInt> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<UInt>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<UInt>(value);
} }
RValue<UInt> UInt::operator=(const Int &rhs) RValue<UInt> UInt::operator=(const Int &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<UInt>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<UInt>(value);
} }
RValue<UInt> UInt::operator=(const Reference<Int> &rhs) RValue<UInt> UInt::operator=(const Reference<Int> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<UInt>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<UInt>(value);
} }
RValue<UInt> operator+(RValue<UInt> lhs, RValue<UInt> rhs) RValue<UInt> operator+(RValue<UInt> lhs, RValue<UInt> rhs)
...@@ -3026,19 +2839,17 @@ Int2::Int2(int x, int y) ...@@ -3026,19 +2839,17 @@ Int2::Int2(int x, int y)
Int2::Int2(RValue<Int2> rhs) Int2::Int2(RValue<Int2> rhs)
{ {
storeValue(rhs.value); store(rhs);
} }
Int2::Int2(const Int2 &rhs) Int2::Int2(const Int2 &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
Int2::Int2(const Reference<Int2> &rhs) Int2::Int2(const Reference<Int2> &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
Int2::Int2(RValue<Int> lo, RValue<Int> hi) Int2::Int2(RValue<Int> lo, RValue<Int> hi)
...@@ -3051,25 +2862,17 @@ Int2::Int2(RValue<Int> lo, RValue<Int> hi) ...@@ -3051,25 +2862,17 @@ Int2::Int2(RValue<Int> lo, RValue<Int> hi)
RValue<Int2> Int2::operator=(RValue<Int2> rhs) RValue<Int2> Int2::operator=(RValue<Int2> rhs)
{ {
storeValue(rhs.value); return store(rhs);
return rhs;
} }
RValue<Int2> Int2::operator=(const Int2 &rhs) RValue<Int2> Int2::operator=(const Int2 &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Int2>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Int2>(value);
} }
RValue<Int2> Int2::operator=(const Reference<Int2> &rhs) RValue<Int2> Int2::operator=(const Reference<Int2> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Int2>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Int2>(value);
} }
RValue<Int2> operator+(RValue<Int2> lhs, RValue<Int2> rhs) RValue<Int2> operator+(RValue<Int2> lhs, RValue<Int2> rhs)
...@@ -3210,42 +3013,32 @@ UInt2::UInt2(unsigned int x, unsigned int y) ...@@ -3210,42 +3013,32 @@ UInt2::UInt2(unsigned int x, unsigned int y)
UInt2::UInt2(RValue<UInt2> rhs) UInt2::UInt2(RValue<UInt2> rhs)
{ {
storeValue(rhs.value); store(rhs);
} }
UInt2::UInt2(const UInt2 &rhs) UInt2::UInt2(const UInt2 &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
UInt2::UInt2(const Reference<UInt2> &rhs) UInt2::UInt2(const Reference<UInt2> &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
RValue<UInt2> UInt2::operator=(RValue<UInt2> rhs) RValue<UInt2> UInt2::operator=(RValue<UInt2> rhs)
{ {
storeValue(rhs.value); return store(rhs);
return rhs;
} }
RValue<UInt2> UInt2::operator=(const UInt2 &rhs) RValue<UInt2> UInt2::operator=(const UInt2 &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<UInt2>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<UInt2>(value);
} }
RValue<UInt2> UInt2::operator=(const Reference<UInt2> &rhs) RValue<UInt2> UInt2::operator=(const Reference<UInt2> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<UInt2>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<UInt2>(value);
} }
RValue<UInt2> operator+(RValue<UInt2> lhs, RValue<UInt2> rhs) RValue<UInt2> operator+(RValue<UInt2> lhs, RValue<UInt2> rhs)
...@@ -3409,21 +3202,19 @@ void Int4::constant(int x, int y, int z, int w) ...@@ -3409,21 +3202,19 @@ void Int4::constant(int x, int y, int z, int w)
Int4::Int4(RValue<Int4> rhs) Int4::Int4(RValue<Int4> rhs)
: XYZW(this) : XYZW(this)
{ {
storeValue(rhs.value); store(rhs);
} }
Int4::Int4(const Int4 &rhs) Int4::Int4(const Int4 &rhs)
: XYZW(this) : XYZW(this)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
Int4::Int4(const Reference<Int4> &rhs) Int4::Int4(const Reference<Int4> &rhs)
: XYZW(this) : XYZW(this)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
Int4::Int4(RValue<UInt4> rhs) Int4::Int4(RValue<UInt4> rhs)
...@@ -3435,15 +3226,13 @@ Int4::Int4(RValue<UInt4> rhs) ...@@ -3435,15 +3226,13 @@ Int4::Int4(RValue<UInt4> rhs)
Int4::Int4(const UInt4 &rhs) Int4::Int4(const UInt4 &rhs)
: XYZW(this) : XYZW(this)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
Int4::Int4(const Reference<UInt4> &rhs) Int4::Int4(const Reference<UInt4> &rhs)
: XYZW(this) : XYZW(this)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
Int4::Int4(RValue<Int2> lo, RValue<Int2> hi) Int4::Int4(RValue<Int2> lo, RValue<Int2> hi)
...@@ -3469,25 +3258,17 @@ Int4::Int4(const Reference<Int> &rhs) ...@@ -3469,25 +3258,17 @@ Int4::Int4(const Reference<Int> &rhs)
RValue<Int4> Int4::operator=(RValue<Int4> rhs) RValue<Int4> Int4::operator=(RValue<Int4> rhs)
{ {
storeValue(rhs.value); return store(rhs);
return rhs;
} }
RValue<Int4> Int4::operator=(const Int4 &rhs) RValue<Int4> Int4::operator=(const Int4 &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Int4>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Int4>(value);
} }
RValue<Int4> Int4::operator=(const Reference<Int4> &rhs) RValue<Int4> Int4::operator=(const Reference<Int4> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Int4>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Int4>(value);
} }
RValue<Int4> operator+(RValue<Int4> lhs, RValue<Int4> rhs) RValue<Int4> operator+(RValue<Int4> lhs, RValue<Int4> rhs)
...@@ -3663,21 +3444,19 @@ void UInt4::constant(int x, int y, int z, int w) ...@@ -3663,21 +3444,19 @@ void UInt4::constant(int x, int y, int z, int w)
UInt4::UInt4(RValue<UInt4> rhs) UInt4::UInt4(RValue<UInt4> rhs)
: XYZW(this) : XYZW(this)
{ {
storeValue(rhs.value); store(rhs);
} }
UInt4::UInt4(const UInt4 &rhs) UInt4::UInt4(const UInt4 &rhs)
: XYZW(this) : XYZW(this)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
UInt4::UInt4(const Reference<UInt4> &rhs) UInt4::UInt4(const Reference<UInt4> &rhs)
: XYZW(this) : XYZW(this)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
UInt4::UInt4(RValue<Int4> rhs) UInt4::UInt4(RValue<Int4> rhs)
...@@ -3689,15 +3468,13 @@ UInt4::UInt4(RValue<Int4> rhs) ...@@ -3689,15 +3468,13 @@ UInt4::UInt4(RValue<Int4> rhs)
UInt4::UInt4(const Int4 &rhs) UInt4::UInt4(const Int4 &rhs)
: XYZW(this) : XYZW(this)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
UInt4::UInt4(const Reference<Int4> &rhs) UInt4::UInt4(const Reference<Int4> &rhs)
: XYZW(this) : XYZW(this)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
UInt4::UInt4(RValue<UInt2> lo, RValue<UInt2> hi) UInt4::UInt4(RValue<UInt2> lo, RValue<UInt2> hi)
...@@ -3723,25 +3500,17 @@ UInt4::UInt4(const Reference<UInt> &rhs) ...@@ -3723,25 +3500,17 @@ UInt4::UInt4(const Reference<UInt> &rhs)
RValue<UInt4> UInt4::operator=(RValue<UInt4> rhs) RValue<UInt4> UInt4::operator=(RValue<UInt4> rhs)
{ {
storeValue(rhs.value); return store(rhs);
return rhs;
} }
RValue<UInt4> UInt4::operator=(const UInt4 &rhs) RValue<UInt4> UInt4::operator=(const UInt4 &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<UInt4>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<UInt4>(value);
} }
RValue<UInt4> UInt4::operator=(const Reference<UInt4> &rhs) RValue<UInt4> UInt4::operator=(const Reference<UInt4> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<UInt4>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<UInt4>(value);
} }
RValue<UInt4> operator+(RValue<UInt4> lhs, RValue<UInt4> rhs) RValue<UInt4> operator+(RValue<UInt4> lhs, RValue<UInt4> rhs)
...@@ -3992,19 +3761,17 @@ Float Float::infinity() ...@@ -3992,19 +3761,17 @@ Float Float::infinity()
Float::Float(RValue<Float> rhs) Float::Float(RValue<Float> rhs)
{ {
storeValue(rhs.value); store(rhs);
} }
Float::Float(const Float &rhs) Float::Float(const Float &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
Float::Float(const Reference<Float> &rhs) Float::Float(const Reference<Float> &rhs)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
Float::Float(Argument<Float> argument) Float::Float(Argument<Float> argument)
...@@ -4014,25 +3781,17 @@ Float::Float(Argument<Float> argument) ...@@ -4014,25 +3781,17 @@ Float::Float(Argument<Float> argument)
RValue<Float> Float::operator=(RValue<Float> rhs) RValue<Float> Float::operator=(RValue<Float> rhs)
{ {
storeValue(rhs.value); return store(rhs);
return rhs;
} }
RValue<Float> Float::operator=(const Float &rhs) RValue<Float> Float::operator=(const Float &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Float>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Float>(value);
} }
RValue<Float> Float::operator=(const Reference<Float> &rhs) RValue<Float> Float::operator=(const Reference<Float> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Float>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Float>(value);
} }
RValue<Float> operator+(RValue<Float> lhs, RValue<Float> rhs) RValue<Float> operator+(RValue<Float> lhs, RValue<Float> rhs)
...@@ -4236,21 +3995,19 @@ void Float4::constant(float x, float y, float z, float w) ...@@ -4236,21 +3995,19 @@ void Float4::constant(float x, float y, float z, float w)
Float4::Float4(RValue<Float4> rhs) Float4::Float4(RValue<Float4> rhs)
: XYZW(this) : XYZW(this)
{ {
storeValue(rhs.value); store(rhs);
} }
Float4::Float4(const Float4 &rhs) Float4::Float4(const Float4 &rhs)
: XYZW(this) : XYZW(this)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
Float4::Float4(const Reference<Float4> &rhs) Float4::Float4(const Reference<Float4> &rhs)
: XYZW(this) : XYZW(this)
{ {
Value *value = rhs.loadValue(); storeValue(rhs.loadValue());
storeValue(value);
} }
Float4::Float4(const Float &rhs) Float4::Float4(const Float &rhs)
...@@ -4272,25 +4029,17 @@ RValue<Float4> Float4::operator=(float x) ...@@ -4272,25 +4029,17 @@ RValue<Float4> Float4::operator=(float x)
RValue<Float4> Float4::operator=(RValue<Float4> rhs) RValue<Float4> Float4::operator=(RValue<Float4> rhs)
{ {
storeValue(rhs.value); return store(rhs);
return rhs;
} }
RValue<Float4> Float4::operator=(const Float4 &rhs) RValue<Float4> Float4::operator=(const Float4 &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Float4>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Float4>(value);
} }
RValue<Float4> Float4::operator=(const Reference<Float4> &rhs) RValue<Float4> Float4::operator=(const Reference<Float4> &rhs)
{ {
Value *value = rhs.loadValue(); return RValue<Float4>(storeValue(rhs.loadValue()));
storeValue(value);
return RValue<Float4>(value);
} }
RValue<Float4> Float4::operator=(RValue<Float> rhs) RValue<Float4> Float4::operator=(RValue<Float> rhs)
......
...@@ -145,6 +145,18 @@ public: ...@@ -145,6 +145,18 @@ public:
RValue<Pointer<T>> operator&(); RValue<Pointer<T>> operator&();
RValue<T> load() const
{
return RValue<T>(Variable::loadValue());
}
RValue<T> store(RValue<T> rvalue) const
{
Variable::storeValue(rvalue.value);
return rvalue;
}
Type *getType() const override Type *getType() const override
{ {
return T::type(); return T::type();
......
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