diff --git a/projects/hip/CMakeLists.txt b/projects/hip/CMakeLists.txt index 0a8c22ff54..537764548f 100644 --- a/projects/hip/CMakeLists.txt +++ b/projects/hip/CMakeLists.txt @@ -195,7 +195,6 @@ if(HIP_PLATFORM STREQUAL "hcc") set(SOURCE_FILES_DEVICE src/device_util.cpp src/hip_ldg.cpp - src/hip_fp16.cpp src/device_functions.cpp) execute_process(COMMAND ${HCC_HOME}/bin/hcc-config --ldflags OUTPUT_VARIABLE HCC_LD_FLAGS) @@ -239,7 +238,7 @@ endif() # Install hip_hcc if platform is hcc if(HIP_PLATFORM STREQUAL "hcc") install(TARGETS hip_hcc_static hip_hcc hip_device DESTINATION lib) - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/hip_hc.ll ${CMAKE_CURRENT_SOURCE_DIR}/src/hip_hc_gfx803.ll DESTINATION lib) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/hip_hc.ll DESTINATION lib) # Install .hipInfo install(FILES ${PROJECT_BINARY_DIR}/.hipInfo DESTINATION lib) diff --git a/projects/hip/bin/hipcc b/projects/hip/bin/hipcc index 7fafc30053..96d34a1546 100755 --- a/projects/hip/bin/hipcc +++ b/projects/hip/bin/hipcc @@ -492,7 +492,6 @@ if($HIP_PLATFORM eq "hcc" or $HIP_PLATFORM eq "clang"){ $HIPCXXFLAGS .= $GPU_ARCH_ARG;; } $HIPCXXFLAGS .= " -D__HIP_ARCH_GFX803__=1 "; - $ENV{HCC_EXTRA_LIBRARIES_GFX803}="$HIP_PATH/lib/hip_hc_gfx803.ll\n"; } if ($target_gfx900 eq 1) { $GPU_ARCH_ARG = $GPU_ARCH_OPT . "gfx900"; @@ -501,12 +500,10 @@ if($HIP_PLATFORM eq "hcc" or $HIP_PLATFORM eq "clang"){ $HIPCXXFLAGS .= $GPU_ARCH_ARG;; } $HIPCXXFLAGS .= " -D__HIP_ARCH_GFX900__=1 "; - $ENV{HCC_EXTRA_LIBRARIES_GFX900}="$HIP_PATH/lib/hip_hc_gfx803.ll\n"; } if ($target_gfx906 eq 1) { $HIPLDFLAGS .= " --amdgpu-target=gfx906"; $HIPCXXFLAGS .= " -D__HIP_ARCH_GFX906__=1 "; - $ENV{HCC_EXTRA_LIBRARIES_GFX906}="$HIP_PATH/lib/hip_hc_gfx803.ll\n"; } } diff --git a/projects/hip/include/hip/hcc_detail/hip_fp16.h b/projects/hip/include/hip/hcc_detail/hip_fp16.h index fe8414ca87..8657bc30a3 100644 --- a/projects/hip/include/hip/hcc_detail/hip_fp16.h +++ b/projects/hip/include/hip/hcc_detail/hip_fp16.h @@ -20,420 +20,1617 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef HIP_INCLUDE_HIP_HCC_DETAIL_HIP_FP16_H -#define HIP_INCLUDE_HIP_HCC_DETAIL_HIP_FP16_H - -#include "hip/hcc_detail/hip_vector_types.h" -#if (__clang_major__ > 3) -typedef __fp16 __half; -typedef __fp16 __half1 __attribute__((ext_vector_type(1))); -typedef __fp16 __half2 __attribute__((ext_vector_type(2))); -typedef __fp16 half; - -/* -Half Arithmetic Functions -*/ -__device__ __half __hadd(const __half a, const __half b); -__device__ __half __hadd_sat(__half a, __half b); -__device__ __half __hfma(__half a, __half b, __half c); -__device__ __half __hfma_sat(__half a, __half b, __half c); -__device__ __half __hmul(__half a, __half b); -__device__ __half __hmul_sat(__half a, __half b); -__device__ __half __hneg(__half a); -__device__ __half __hsub(__half a, __half b); -__device__ __half __hsub_sat(__half a, __half b); -__device__ __half hdiv(__half a, __half b); - -/* -Half2 Arithmetic Functions -*/ - -__device__ static __half2 __hadd2(__half2 a, __half2 b); -__device__ static __half2 __hadd2_sat(__half2 a, __half2 b); -__device__ static __half2 __hfma2(__half2 a, __half2 b, __half2 c); -__device__ static __half2 __hfma2_sat(__half2 a, __half2 b, __half2 c); -__device__ static __half2 __hmul2(__half2 a, __half2 b); -__device__ static __half2 __hmul2_sat(__half2 a, __half2 b); -__device__ static __half2 __hsub2(__half2 a, __half2 b); -__device__ static __half2 __hneg2(__half2 a); -__device__ static __half2 __hsub2_sat(__half2 a, __half2 b); -__device__ static __half2 h2div(__half2 a, __half2 b); - -/* -Half Comparision Functions -*/ - -__device__ bool __heq(__half a, __half b); -__device__ bool __hge(__half a, __half b); -__device__ bool __hgt(__half a, __half b); -__device__ bool __hisinf(__half a); -__device__ bool __hisnan(__half a); -__device__ bool __hle(__half a, __half b); -__device__ bool __hlt(__half a, __half b); -__device__ bool __hne(__half a, __half b); - -/* -Half2 Comparision Functions -*/ - -__device__ bool __hbeq2(__half2 a, __half2 b); -__device__ bool __hbge2(__half2 a, __half2 b); -__device__ bool __hbgt2(__half2 a, __half2 b); -__device__ bool __hble2(__half2 a, __half2 b); -__device__ bool __hblt2(__half2 a, __half2 b); -__device__ bool __hbne2(__half2 a, __half2 b); -__device__ __half2 __heq2(__half2 a, __half2 b); -__device__ __half2 __hge2(__half2 a, __half2 b); -__device__ __half2 __hgt2(__half2 a, __half2 b); -__device__ __half2 __hisnan2(__half2 a); -__device__ __half2 __hle2(__half2 a, __half2 b); -__device__ __half2 __hlt2(__half2 a, __half2 b); -__device__ __half2 __hne2(__half2 a, __half2 b); - -/* -Half Math Functions -*/ - -__device__ static __half hceil(const __half h); -__device__ static __half hcos(const __half h); -__device__ static __half hexp(const __half h); -__device__ static __half hexp10(const __half h); -__device__ static __half hexp2(const __half h); -__device__ static __half hfloor(const __half h); -__device__ static __half hlog(const __half h); -__device__ static __half hlog10(const __half h); -__device__ static __half hlog2(const __half h); -//__device__ static __half hrcp(const __half h); -__device__ static __half hrint(const __half h); -__device__ static __half hsin(const __half h); -__device__ static __half hsqrt(const __half a); -__device__ static __half htrunc(const __half a); - -/* -Half2 Math Functions -*/ - -__device__ static __half2 h2ceil(const __half2 h); -__device__ static __half2 h2exp(const __half2 h); -__device__ static __half2 h2exp10(const __half2 h); -__device__ static __half2 h2exp2(const __half2 h); -__device__ static __half2 h2floor(const __half2 h); -__device__ static __half2 h2log(const __half2 h); -__device__ static __half2 h2log10(const __half2 h); -__device__ static __half2 h2log2(const __half2 h); -__device__ static __half2 h2rcp(const __half2 h); -__device__ static __half2 h2rsqrt(const __half2 h); -__device__ static __half2 h2sin(const __half2 h); -__device__ static __half2 h2sqrt(const __half2 h); - -/* -Half Conversion And Data Movement -*/ - -__device__ __half2 __float22half2_rn(const float2 a); -__device__ __half __float2half(const float a); -__device__ __half2 __float2half2_rn(const float a); -__device__ __half __float2half_rd(const float a); -__device__ __half __float2half_rn(const float a); -__device__ __half __float2half_ru(const float a); -__device__ __half __float2half_rz(const float a); -__device__ __half2 __floats2half2_rn(const float a, const float b); -__device__ float2 __half22float2(const __half2 a); -__device__ float __half2float(const __half a); -__device__ __half2 half2half2(const __half a); -__device__ int __half2int_rd(__half h); -__device__ int __half2int_rn(__half h); -__device__ int __half2int_ru(__half h); -__device__ int __half2int_rz(__half h); -__device__ long long int __half2ll_rd(__half h); -__device__ long long int __half2ll_rn(__half h); -__device__ long long int __half2ll_ru(__half h); -__device__ long long int __half2ll_rz(__half h); -__device__ short __half2short_rd(__half h); -__device__ short __half2short_rn(__half h); -__device__ short __half2short_ru(__half h); -__device__ short __half2short_rz(__half h); -__device__ unsigned int __half2uint_rd(__half h); -__device__ unsigned int __half2uint_rn(__half h); -__device__ unsigned int __half2uint_ru(__half h); -__device__ unsigned int __half2uint_rz(__half h); -__device__ unsigned long long int __half2ull_rd(__half h); -__device__ unsigned long long int __half2ull_rn(__half h); -__device__ unsigned long long int __half2ull_ru(__half h); -__device__ unsigned long long int __half2ull_rz(__half h); -__device__ unsigned short int __half2ushort_rd(__half h); -__device__ unsigned short int __half2ushort_rn(__half h); -__device__ unsigned short int __half2ushort_ru(__half h); -__device__ unsigned short int __half2ushort_rz(__half h); -__device__ short int __half_as_short(const __half h); -__device__ unsigned short int __half_as_ushort(const __half h); -__device__ __half2 __halves2half2(const __half a, const __half b); -__device__ float __high2float(const __half2 a); -__device__ __half __high2half(const __half2 a); -__device__ __half2 __high2half2(const __half2 a); -__device__ __half2 __highs2half2(const __half2 a, const __half2 b); -__device__ __half __int2half_rd(int i); -__device__ __half __int2half_rn(int i); -__device__ __half __int2half_ru(int i); -__device__ __half __int2half_rz(int i); -__device__ __half __ll2half_rd(long long int i); -__device__ __half __ll2half_rn(long long int i); -__device__ __half __ll2half_ru(long long int i); -__device__ __half __ll2half_rz(long long int i); -__device__ float __low2float(const __half2 a); - -__device__ __half __low2half(const __half2 a); -__device__ __half2 __low2half2(const __half2 a, const __half2 b); -__device__ __half2 __low2half2(const __half2 a); -__device__ __half2 __lowhigh2highlow(const __half2 a); -__device__ __half2 __lows2half2(const __half2 a, const __half2 b); -__device__ __half __short2half_rd(short int i); -__device__ __half __short2half_rn(short int i); -__device__ __half __short2half_ru(short int i); -__device__ __half __short2half_rz(short int i); -__device__ __half __uint2half_rd(unsigned int i); -__device__ __half __uint2half_rn(unsigned int i); -__device__ __half __uint2half_ru(unsigned int i); -__device__ __half __uint2half_rz(unsigned int i); -__device__ __half __ull2half_rd(unsigned long long int i); -__device__ __half __ull2half_rn(unsigned long long int i); -__device__ __half __ull2half_ru(unsigned long long int i); -__device__ __half __ull2half_rz(unsigned long long int i); -__device__ __half __ushort2half_rd(unsigned short int i); -__device__ __half __ushort2half_rn(unsigned short int i); -__device__ __half __ushort2half_ru(unsigned short int i); -__device__ __half __ushort2half_rz(unsigned short int i); -__device__ __half __ushort_as_half(const unsigned short int i); - -extern "C" __half2 __hip_hc_ir_hadd2_int(__half2, __half2); -extern "C" __half2 __hip_hc_ir_hfma2_int(__half2, __half2, __half2); -extern "C" __half2 __hip_hc_ir_hmul2_int(__half2, __half2); -extern "C" __half2 __hip_hc_ir_hsub2_int(__half2, __half2); - -extern "C" __half __hip_hc_ir_hceil_half(__half) __asm("llvm.ceil.f16"); -extern "C" __half __hip_hc_ir_hcos_half(__half) __asm("llvm.cos.f16"); -extern "C" __half __hip_hc_ir_hexp2_half(__half) __asm("llvm.exp2.f16"); -extern "C" __half __hip_hc_ir_hfloor_half(__half) __asm("llvm.floor.f16"); -extern "C" __half __hip_hc_ir_hlog2_half(__half) __asm("llvm.log2.f16"); -extern "C" __half __hip_hc_ir_hrcp_half(__half) __asm("llvm.amdgcn.rcp.f16"); -extern "C" __half __hip_hc_ir_hrint_half(__half) __asm("llvm.rint.f16"); -extern "C" __half __hip_hc_ir_hrsqrt_half(__half) __asm("llvm.sqrt.f16"); -extern "C" __half __hip_hc_ir_hsin_half(__half) __asm("llvm.sin.f16"); -extern "C" __half __hip_hc_ir_hsqrt_half(__half) __asm("llvm.sqrt.f16"); -extern "C" __half __hip_hc_ir_htrunc_half(__half) __asm("llvm.trunc.f16"); - -extern "C" __half2 __hip_hc_ir_h2ceil_int(__half2); -extern "C" __half2 __hip_hc_ir_h2cos_int(__half2); -extern "C" __half2 __hip_hc_ir_h2exp2_int(__half2); -extern "C" __half2 __hip_hc_ir_h2floor_int(__half2); -extern "C" __half2 __hip_hc_ir_h2log2_int(__half2); -extern "C" __half2 __hip_hc_ir_h2rcp_int(__half2); -extern "C" __half2 __hip_hc_ir_h2rsqrt_int(__half2); -extern "C" __half2 __hip_hc_ir_h2sin_int(__half2); -extern "C" __half2 __hip_hc_ir_h2sqrt_int(__half2); -extern "C" __half2 __hip_hc_ir_h2trunc_int(__half2); - -/* - Half2 Arithmetic Functions -*/ - -__device__ static inline __half2 __hadd2(__half2 a, __half2 b) { - __half2 c; - c.xy = __hip_hc_ir_hadd2_int(a.xy, b.xy); - return c; -} - -__device__ static inline __half2 __hadd2_sat(__half2 a, __half2 b) { - __half2 c; - c.xy = __hip_hc_ir_hadd2_int(a.xy, b.xy); - return c; -} - -__device__ static inline __half2 __hfma2(__half2 a, __half2 b, __half2 c) { - __half2 d; - d.xy = __hip_hc_ir_hfma2_int(a.xy, b.xy, c.xy); - return d; -} - -__device__ static inline __half2 __hfma2_sat(__half2 a, __half2 b, __half2 c) { - __half2 d; - d.xy = __hip_hc_ir_hfma2_int(a.xy, b.xy, c.xy); - return d; -} - -__device__ static inline __half2 __hmul2(__half2 a, __half2 b) { - __half2 c; - c.xy = __hip_hc_ir_hmul2_int(a.xy, b.xy); - return c; -} - -__device__ static inline __half2 __hmul2_sat(__half2 a, __half2 b) { - __half2 c; - c.xy = __hip_hc_ir_hmul2_int(a.xy, b.xy); - return c; -} - -__device__ static inline __half2 __hsub2(__half2 a, __half2 b) { - __half2 c; - c.xy = __hip_hc_ir_hsub2_int(a.xy, b.xy); - return c; -} - -__device__ static inline __half2 __hneg2(__half2 a) { - __half2 c; - c.x = -a.x; - c.y = -a.y; - return c; -} - -__device__ static inline __half2 __hsub2_sat(__half2 a, __half2 b) { - __half2 c; - c.xy = __hip_hc_ir_hsub2_int(a.xy, b.xy); - return c; -} - -__device__ static inline __half2 h2div(__half2 a, __half2 b) { - __half2 c; - c.x = a.x / b.x; - c.y = a.y / b.y; - return c; -} - - -__device__ static inline __half hceil(const __half h) { return __hip_hc_ir_hceil_half(h); } - -__device__ static inline __half hcos(const __half h) { return __hip_hc_ir_hcos_half(h); } - -__device__ static inline __half hexp(const __half h) { - return __hip_hc_ir_hexp2_half(__hmul(h, 1.442694)); -} - -__device__ static inline __half hexp10(const __half h) { - return __hip_hc_ir_hexp2_half(__hmul(h, 3.3219281)); -} - -__device__ static inline __half hexp2(const __half h) { return __hip_hc_ir_hexp2_half(h); } - -__device__ static inline __half hfloor(const __half h) { return __hip_hc_ir_hfloor_half(h); } - -__device__ static inline __half hlog(const __half h) { - return __hmul(__hip_hc_ir_hlog2_half(h), 0.693147); -} - -__device__ static inline __half hlog10(const __half h) { - return __hmul(__hip_hc_ir_hlog2_half(h), 0.301029); -} - -__device__ static inline __half hlog2(const __half h) { return __hip_hc_ir_hlog2_half(h); } -/* -__device__ static inline __half hrcp(const __half h) { - return __hip_hc_ir_hrcp_half(h); -} -*/ -__device__ static inline __half hrint(const __half h) { return __hip_hc_ir_hrint_half(h); } - -__device__ static inline __half hrsqrt(const __half h) { return __hip_hc_ir_hrsqrt_half(h); } - -__device__ static inline __half hsin(const __half h) { return __hip_hc_ir_hsin_half(h); } - -__device__ static inline __half hsqrt(const __half a) { return __hip_hc_ir_hsqrt_half(a); } - -__device__ static inline __half htrunc(const __half a) { return __hip_hc_ir_htrunc_half(a); } - -/* -Half2 Math Operations -*/ - -__device__ static inline __half2 h2ceil(const __half2 h) { - __half2 a; - a.xy = __hip_hc_ir_h2ceil_int(h.xy); - return a; -} - -__device__ static inline __half2 h2cos(const __half2 h) { - __half2 a; - a.xy = __hip_hc_ir_h2cos_int(h.xy); - return a; -} - -__device__ static inline __half2 h2exp(const __half2 h) { - __half2 factor; - factor.x = 1.442694; - factor.y = 1.442694; - factor.xy = __hip_hc_ir_h2exp2_int(__hip_hc_ir_hmul2_int(h.xy, factor.xy)); - return factor; -} - -__device__ static inline __half2 h2exp10(const __half2 h) { - __half2 factor; - factor.x = 3.3219281; - factor.y = 3.3219281; - factor.xy = __hip_hc_ir_h2exp2_int(__hip_hc_ir_hmul2_int(h.xy, factor.xy)); - return factor; -} - -__device__ static inline __half2 h2exp2(const __half2 h) { - __half2 a; - a.xy = __hip_hc_ir_h2exp2_int(h.xy); - return a; -} - -__device__ static inline __half2 h2floor(const __half2 h) { - __half2 a; - a.xy = __hip_hc_ir_h2floor_int(h.xy); - return a; -} - -__device__ static inline __half2 h2log(const __half2 h) { - __half2 factor; - factor.x = 0.693147; - factor.y = 0.693147; - factor.xy = __hip_hc_ir_hmul2_int(__hip_hc_ir_h2log2_int(h.xy), factor.xy); - return factor; -} - -__device__ static inline __half2 h2log10(const __half2 h) { - __half2 factor; - factor.x = 0.301029; - factor.y = 0.301029; - factor.xy = __hip_hc_ir_hmul2_int(__hip_hc_ir_h2log2_int(h.xy), factor.xy); - return factor; -} -__device__ static inline __half2 h2log2(const __half2 h) { - __half2 a; - a.xy = __hip_hc_ir_h2log2_int(h.xy); - return a; -} - -__device__ static inline __half2 h2rcp(const __half2 h) { - __half2 a; - a.xy = __hip_hc_ir_h2rcp_int(h.xy); - return a; -} - -__device__ static inline __half2 h2rsqrt(const __half2 h) { - __half2 a; - a.xy = __hip_hc_ir_h2rsqrt_int(h.xy); - return a; -} - -__device__ static inline __half2 h2sin(const __half2 h) { - __half2 a; - a.xy = __hip_hc_ir_h2sin_int(h.xy); - return a; -} - -__device__ static inline __half2 h2sqrt(const __half2 h) { - __half2 a; - a.xy = __hip_hc_ir_h2sqrt_int(h.xy); - return a; -} - -__device__ static inline __half2 h2trunc(const __half2 h) { - __half2 a; - a.xy = __hip_hc_ir_h2trunc_int(h.xy); - return a; -} -#endif // clang_major > 3 +#pragma once +#include +#if defined(__cplusplus) + #include + #include + #include #endif + +#if defined(__clang__) && (__clang_major__ > 3) + typedef _Float16 _Float16_2 __attribute__((ext_vector_type(2))); + + struct __half_raw { + union { + static_assert(sizeof(_Float16) == sizeof(unsigned short), ""); + + _Float16 data; + unsigned short x; + }; + }; + + struct __half2_raw { + union { + static_assert(sizeof(_Float16_2) == sizeof(unsigned short[2]), ""); + + _Float16_2 data; + struct { + unsigned short x; + unsigned short y; + }; + }; + }; + + #if defined(__cplusplus) + #include "hip_fp16_math_fwd.h" + #include "hip_vector_types.h" + #include "host_defines.h" + + namespace std + { + template<> struct is_floating_point<_Float16> : std::true_type {}; + } + + template + using Enable_if_t = typename std::enable_if::type; + + // BEGIN STRUCT __HALF + struct __half { + protected: + union { + static_assert(sizeof(_Float16) == sizeof(unsigned short), ""); + + _Float16 data; + unsigned short __x; + }; + public: + // CREATORS + __host__ __device__ + __half() = default; + __host__ __device__ + __half(const __half_raw& x) : data{x.data} {} + #if !defined(__HIP_NO_HALF_CONVERSIONS__) + __host__ __device__ + __half(decltype(data) x) : data{x} {} + template< + typename T, + Enable_if_t{}>* = nullptr> + __host__ __device__ + __half(T x) : data{static_cast<_Float16>(x)} {} + #endif + __host__ __device__ + __half(const __half&) = default; + __host__ __device__ + __half(__half&&) = default; + __host__ __device__ + ~__half() = default; + + // CREATORS - DEVICE ONLY + #if !defined(__HIP_NO_HALF_CONVERSIONS__) + template< + typename T, Enable_if_t{}>* = nullptr> + __device__ + __half(T x) : data{static_cast<_Float16>(x)} {} + #endif + + // MANIPULATORS + __host__ __device__ + __half& operator=(const __half&) = default; + __host__ __device__ + __half& operator=(__half&&) = default; + __host__ __device__ + __half& operator=(const __half_raw& x) + { + data = x.data; + return *this; + } + __host__ __device__ + volatile __half& operator=(const __half_raw& x) volatile + { + data = x.data; + return *this; + } + volatile __half& operator=(const volatile __half_raw& x) volatile + { + data = x.data; + return *this; + } + __half& operator=(__half_raw&& x) + { + data = x.data; + return *this; + } + volatile __half& operator=(__half_raw&& x) volatile + { + data = x.data; + return *this; + } + volatile __half& operator=(volatile __half_raw&& x) volatile + { + data = x.data; + return *this; + } + #if !defined(__HIP_NO_HALF_CONVERSIONS__) + template< + typename T, + Enable_if_t{}>* = nullptr> + __host__ __device__ + __half& operator=(T x) + { + data = static_cast<_Float16>(x); + return *this; + } + #endif + + // MANIPULATORS - DEVICE ONLY + #if !defined(__HIP_NO_HALF_CONVERSIONS__) + template< + typename T, Enable_if_t{}>* = nullptr> + __device__ + __half& operator=(T x) + { + data = static_cast<_Float16>(x); + return *this; + } + #endif + + #if !defined(__HIP_NO_HALF_OPERATORS__) + __device__ + __half& operator+=(const __half& x) + { + data += x.data; + return *this; + } + __device__ + __half& operator-=(const __half& x) + { + data -= x.data; + return *this; + } + __device__ + __half& operator*=(const __half& x) + { + data *= x.data; + return *this; + } + __device__ + __half& operator/=(const __half& x) + { + data /= x.data; + return *this; + } + __device__ + __half& operator++() { ++data; return *this; } + __device__ + __half operator++(int) + { + __half tmp{*this}; + ++*this; + return tmp; + } + __device__ + __half& operator--() { --data; return *this; } + __device__ + __half operator--(int) + { + __half tmp{*this}; + --*this; + return tmp; + } + #endif + + // ACCESSORS + #if !defined(__HIP_NO_HALF_CONVERSIONS__) + template< + typename T, + Enable_if_t< + std::is_floating_point{} && + !std::is_same{}>* = nullptr> + operator T() const { return data; } + #endif + __host__ __device__ + operator __half_raw() const { return __half_raw{data}; } + __host__ __device__ + operator volatile __half_raw() const volatile + { + return __half_raw{data}; + } + + // ACCESSORS - DEVICE ONLY + #if !defined(__HIP_NO_HALF_CONVERSIONS__) + template< + typename T, Enable_if_t{}>* = nullptr> + __device__ + operator T() const { return data; } + #endif + + #if !defined(__HIP_NO_HALF_OPERATORS__) + __device__ + __half operator+() const { return *this; } + __device__ + __half operator-() const + { + __half tmp{*this}; + tmp.data = -tmp.data; + return tmp; + } + #endif + + // FRIENDS + #if !defined(__HIP_NO_HALF_OPERATORS__) + friend + inline + __device__ + __half operator+(const __half& x, const __half& y) + { + return __half{x} += y; + } + friend + inline + __device__ + __half operator-(const __half& x, const __half& y) + { + return __half{x} -= y; + } + friend + inline + __device__ + __half operator*(const __half& x, const __half& y) + { + return __half{x} *= y; + } + friend + inline + __device__ + __half operator/(const __half& x, const __half& y) + { + return __half{x} /= y; + } + friend + inline + __device__ + bool operator==(const __half& x, const __half& y) + { + return x.data == y.data; + } + friend + inline + __device__ + bool operator!=(const __half& x, const __half& y) + { + return !(x == y); + } + friend + inline + __device__ + bool operator<(const __half& x, const __half& y) + { + return x.data < y.data; + } + friend + inline + __device__ + bool operator>(const __half& x, const __half& y) + { + return y.data < x.data; + } + friend + inline + __device__ + bool operator<=(const __half& x, const __half& y) + { + return !(y < x); + } + friend + inline + __device__ + bool operator>=(const __half& x, const __half& y) + { + return !(x < y); + } + #endif // !defined(__HIP_NO_HALF_OPERATORS__) + }; + // END STRUCT __HALF + + // BEGIN STRUCT __HALF2 + struct __half2 { + protected: + union { + static_assert( + sizeof(_Float16_2) == sizeof(unsigned short[2]), ""); + + _Float16_2 data; + struct { + unsigned short x; + unsigned short y; + }; + }; + public: + // CREATORS + __host__ __device__ + __half2() = default; + __host__ __device__ + __half2(const __half2_raw& x) : data{x.data} {} + __host__ __device__ + __half2(decltype(data) x) : data{x} {} + __host__ __device__ + __half2(const __half& x, const __half& y) + : + data{ + static_cast<__half_raw>(x).data, + static_cast<__half_raw>(y).data} + {} + __host__ __device__ + __half2(const __half2&) = default; + __host__ __device__ + __half2(__half2&&) = default; + __host__ __device__ + ~__half2() = default; + + // MANIPULATORS + __host__ __device__ + __half2& operator=(const __half2&) = default; + __host__ __device__ + __half2& operator=(__half2&&) = default; + __host__ __device__ + __half2& operator=(const __half2_raw& x) + { + data = x.data; + return *this; + } + + // MANIPULATORS - DEVICE ONLY + #if !defined(__HIP_NO_HALF_OPERATORS__) + __device__ + __half2& operator+=(const __half2& x) + { + data += x.data; + return *this; + } + __device__ + __half2& operator-=(const __half2& x) + { + data -= x.data; + return *this; + } + __device__ + __half2& operator*=(const __half2& x) + { + data *= x.data; + return *this; + } + __device__ + __half2& operator/=(const __half2& x) + { + data /= x.data; + return *this; + } + __device__ + __half2& operator++() { return *this += _Float16_2{1, 1}; } + __device__ + __half2 operator++(int) + { + __half2 tmp{*this}; + ++*this; + return tmp; + } + __device__ + __half2& operator--() { return *this -= _Float16_2{1, 1}; } + __device__ + __half2 operator--(int) + { + __half2 tmp{*this}; + --*this; + return tmp; + } + #endif + + // ACCESSORS + __host__ __device__ + operator decltype(data)() const { return data; } + __host__ __device__ + operator __half2_raw() const { return __half2_raw{data}; } + + // ACCESSORS - DEVICE ONLY + #if !defined(__HIP_NO_HALF_OPERATORS__) + __device__ + __half2 operator+() const { return *this; } + __device__ + __half2 operator-() const + { + __half2 tmp{*this}; + tmp.data = -tmp.data; + return tmp; + } + #endif + + // FRIENDS + #if !defined(__HIP_NO_HALF_OPERATORS__) + friend + inline + __device__ + __half2 operator+(const __half2& x, const __half2& y) + { + return __half2{x} += y; + } + friend + inline + __device__ + __half2 operator-(const __half2& x, const __half2& y) + { + return __half2{x} -= y; + } + friend + inline + __device__ + __half2 operator*(const __half2& x, const __half2& y) + { + return __half2{x} *= y; + } + friend + inline + __device__ + __half2 operator/(const __half2& x, const __half2& y) + { + return __half2{x} /= y; + } + friend + inline + __device__ + bool operator==(const __half2& x, const __half2& y) + { + auto r = x.data == y.data; + return r.x != 0 && r.y != 0; + } + friend + inline + __device__ + bool operator!=(const __half2& x, const __half2& y) + { + return !(x == y); + } + friend + inline + __device__ + bool operator<(const __half2& x, const __half2& y) + { + auto r = x.data < y.data; + return r.x != 0 && r.y != 0; + } + friend + inline + __device__ + bool operator>(const __half2& x, const __half2& y) + { + return y < x; + } + friend + inline + __device__ + bool operator<=(const __half2& x, const __half2& y) + { + return !(y < x); + } + friend + inline + __device__ + bool operator>=(const __half2& x, const __half2& y) + { + return !(x < y); + } + #endif // !defined(__HIP_NO_HALF_OPERATORS__) + }; + // END STRUCT __HALF2 + + namespace + { + inline + __host__ __device__ + __half2 make_half2(__half x, __half y) + { + return __half2{x, y}; + } + + inline + __device__ + __half __low2half(__half2 x) + { + return __half{__half_raw{static_cast<__half2_raw>(x).data.x}}; + } + + inline + __device__ + __half __high2half(__half2 x) + { + return __half{__half_raw{static_cast<__half2_raw>(x).data.y}}; + } + + inline + __device__ + __half2 __half2half2(__half x) + { + return __half2{x, x}; + } + + inline + __device__ + __half2 __halves2half2(__half x, __half y) + { + return __half2{x, y}; + } + + inline + __device__ + __half2 __low2half2(__half2 x) + { + return __half2{ + _Float16_2{ + static_cast<__half2_raw>(x).data.x, + static_cast<__half2_raw>(x).data.x}}; + } + + inline + __device__ + __half2 __high2half2(__half2 x) + { + return __half2_raw{ + _Float16_2{ + static_cast<__half2_raw>(x).data.y, + static_cast<__half2_raw>(x).data.y}}; + } + + inline + __device__ + __half2 __lows2half2(__half2 x, __half2 y) + { + return __half2_raw{ + _Float16_2{ + static_cast<__half2_raw>(x).data.x, + static_cast<__half2_raw>(y).data.x}}; + } + + inline + __device__ + __half2 __highs2half2(__half2 x, __half2 y) + { + return __half2_raw{ + _Float16_2{ + static_cast<__half2_raw>(x).data.y, + static_cast<__half2_raw>(y).data.y}}; + } + + inline + __device__ + __half2 __lowhigh2highlow(__half2 x) + { + return __half2_raw{ + _Float16_2{ + static_cast<__half2_raw>(x).data.y, + static_cast<__half2_raw>(x).data.x}}; + } + + // Bitcasts + inline + __device__ + short __half_as_short(__half x) + { + return static_cast<__half_raw>(x).x; + } + + inline + __device__ + unsigned short __half_as_ushort(__half x) + { + return static_cast<__half_raw>(x).x; + } + + inline + __device__ + __half __short_as_half(short x) + { + __half_raw r; r.x = x; + return r; + } + + inline + __device__ + __half __ushort_as_half(unsigned short x) + { + __half_raw r; r.x = x; + return r; + } + + // TODO: rounding behaviour is not correct. + // float -> half | half2 + inline + __device__ + __half __float2half(float x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + inline + __device__ + __half __float2half_rn(float x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + inline + __device__ + __half __float2half_rz(float x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + inline + __device__ + __half __float2half_rd(float x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + inline + __device__ + __half __float2half_ru(float x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + inline + __device__ + __half2 __float2half2_rn(float x) + { + return __half2_raw{ + _Float16_2{ + static_cast<_Float16>(x), static_cast<_Float16>(x)}}; + } + inline + __device__ + __half2 __floats2half2_rn(float x, float y) + { + return __half2_raw{_Float16_2{ + static_cast<_Float16>(x), static_cast<_Float16>(y)}}; + } + inline + __device__ + __half2 __float22half2_rn(float2 x) + { + return __floats2half2_rn(x.x, x.y); + } + + // half | half2 -> float + inline + __device__ + float __half2float(__half x) + { + return static_cast<__half_raw>(x).data; + } + inline + __device__ + float __low2float(__half2 x) + { + return static_cast<__half2_raw>(x).data.x; + } + inline + __device__ + float __high2float(__half2 x) + { + return static_cast<__half2_raw>(x).data.y; + } + inline + __device__ + float2 __half22float2(__half2 x) + { + return make_float2( + static_cast<__half2_raw>(x).data.x, + static_cast<__half2_raw>(x).data.y); + } + + // half -> int + inline + __device__ + int __half2int_rn(__half x) + { + return static_cast<__half_raw>(x).data; + } + inline + __device__ + int __half2int_rz(__half x) + { + return static_cast<__half_raw>(x).data; + } + inline + __device__ + int __half2int_rd(__half x) + { + return static_cast<__half_raw>(x).data; + } + inline + __device__ + int __half2int_ru(__half x) + { + return static_cast<__half_raw>(x).data; + } + + // int -> half + inline + __device__ + __half __int2half_rn(int x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + inline + __device__ + __half __int2half_rz(int x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + inline + __device__ + __half __int2half_rd(int x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + inline + __device__ + __half __int2half_ru(int x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + + // half -> short + inline + __device__ + short __half2short_rn(__half x) + { + return static_cast<__half_raw>(x).data; + } + inline + __device__ + short __half2short_rz(__half x) + { + return static_cast<__half_raw>(x).data; + } + inline + __device__ + short __half2short_rd(__half x) + { + return static_cast<__half_raw>(x).data; + } + inline + __device__ + short __half2short_ru(__half x) + { + return static_cast<__half_raw>(x).data; + } + + // short -> half + inline + __device__ + __half __short2half_rn(short x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + inline + __device__ + __half __short2half_rz(short x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + inline + __device__ + __half __short2half_rd(short x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + inline + __device__ + __half __short2half_ru(short x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + + // half -> long long + inline + __device__ + long long __half2ll_rn(__half x) + { + return static_cast<__half_raw>(x).data; + } + inline + __device__ + long long __half2ll_rz(__half x) + { + return static_cast<__half_raw>(x).data; + } + inline + __device__ + long long __half2ll_rd(__half x) + { + return static_cast<__half_raw>(x).data; + } + inline + __device__ + long long __half2ll_ru(__half x) + { + return static_cast<__half_raw>(x).data; + } + + // long long -> half + inline + __device__ + __half __ll2half_rn(long long x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + inline + __device__ + __half __ll2half_rz(long long x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + inline + __device__ + __half __ll2half_rd(long long x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + inline + __device__ + __half __ll2half_ru(long long x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + + // half -> unsigned int + inline + __device__ + unsigned int __half2uint_rn(__half x) + { + return static_cast<__half_raw>(x).data; + } + inline + __device__ + unsigned int __half2uint_rz(__half x) + { + return static_cast<__half_raw>(x).data; + } + inline + __device__ + unsigned int __half2uint_rd(__half x) + { + return static_cast<__half_raw>(x).data; + } + inline + __device__ + unsigned int __half2uint_ru(__half x) + { + return static_cast<__half_raw>(x).data; + } + + // unsigned int -> half + inline + __device__ + __half __uint2half_rn(unsigned int x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + inline + __device__ + __half __uint2half_rz(unsigned int x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + inline + __device__ + __half __uint2half_rd(unsigned int x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + inline + __device__ + __half __uint2half_ru(unsigned int x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + + // half -> unsigned short + inline + __device__ + unsigned short __half2ushort_rn(__half x) + { + return static_cast<__half_raw>(x).data; + } + inline + __device__ + unsigned short __half2ushort_rz(__half x) + { + return static_cast<__half_raw>(x).data; + } + inline + __device__ + unsigned short __half2ushort_rd(__half x) + { + return static_cast<__half_raw>(x).data; + } + inline + __device__ + unsigned short __half2ushort_ru(__half x) + { + return static_cast<__half_raw>(x).data; + } + + // unsigned short -> half + inline + __device__ + __half __ushort2half_rn(unsigned short x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + inline + __device__ + __half __ushort2half_rz(unsigned short x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + inline + __device__ + __half __ushort2half_rd(unsigned short x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + inline + __device__ + __half __ushort2half_ru(unsigned short x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + + // half -> unsigned long long + inline + __device__ + unsigned long long __half2ull_rn(__half x) + { + return static_cast<__half_raw>(x).data; + } + inline + __device__ + unsigned long long __half2ull_rz(__half x) + { + return static_cast<__half_raw>(x).data; + } + inline + __device__ + unsigned long long __half2ull_rd(__half x) + { + return static_cast<__half_raw>(x).data; + } + inline + __device__ + unsigned long long __half2ull_ru(__half x) + { + return static_cast<__half_raw>(x).data; + } + + // unsigned long long -> half + inline + __device__ + __half __ull2half_rn(unsigned long long x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + inline + __device__ + __half __ull2half_rz(unsigned long long x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + inline + __device__ + __half __ull2half_rd(unsigned long long x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + inline + __device__ + __half __ull2half_ru(unsigned long long x) + { + return __half_raw{static_cast<_Float16>(x)}; + } + + // Load primitives + inline + __device__ + __half __ldg(const __half* ptr) { return *ptr; } + inline + __device__ + __half __ldcg(const __half* ptr) { return *ptr; } + inline + __device__ + __half __ldca(const __half* ptr) { return *ptr; } + inline + __device__ + __half __ldcs(const __half* ptr) { return *ptr; } + + inline + __device__ + __half2 __ldg(const __half2* ptr) { return *ptr; } + inline + __device__ + __half2 __ldcg(const __half2* ptr) { return *ptr; } + inline + __device__ + __half2 __ldca(const __half2* ptr) { return *ptr; } + inline + __device__ + __half2 __ldcs(const __half2* ptr) { return *ptr; } + + // Relations + inline + __device__ + bool __heq(__half x, __half y) + { + return static_cast<__half_raw>(x).data == + static_cast<__half_raw>(y).data; + } + inline + __device__ + bool __hne(__half x, __half y) + { + return static_cast<__half_raw>(x).data != + static_cast<__half_raw>(y).data; + } + inline + __device__ + bool __hle(__half x, __half y) + { + return static_cast<__half_raw>(x).data <= + static_cast<__half_raw>(y).data; + } + inline + __device__ + bool __hge(__half x, __half y) + { + return static_cast<__half_raw>(x).data >= + static_cast<__half_raw>(y).data; + } + inline + __device__ + bool __hlt(__half x, __half y) + { + return static_cast<__half_raw>(x).data < + static_cast<__half_raw>(y).data; + } + inline + __device__ + bool __hgt(__half x, __half y) + { + return static_cast<__half_raw>(x).data > + static_cast<__half_raw>(y).data; + } + inline + __device__ + bool __hequ(__half x, __half y) { return __heq(x, y); } + inline + __device__ + bool __hneu(__half x, __half y) { return __hne(x, y); } + inline + __device__ + bool __hleu(__half x, __half y) { return __hle(x, y); } + inline + __device__ + bool __hgeu(__half x, __half y) { return __hge(x, y); } + inline + __device__ + bool __hltu(__half x, __half y) { return __hlt(x, y); } + inline + __device__ + bool __hgtu(__half x, __half y) { return __hgt(x, y); } + + inline + __device__ + __half2 __heq2(__half2 x, __half2 y) + { + auto r = static_cast<__half2_raw>(x).data == + static_cast<__half2_raw>(y).data; + return __half2_raw{_Float16_2{ + static_cast<_Float16>(r.x), static_cast<_Float16>(r.y)}}; + } + inline + __device__ + __half2 __hne2(__half2 x, __half2 y) + { + auto r = static_cast<__half2_raw>(x).data != + static_cast<__half2_raw>(y).data; + return __half2_raw{_Float16_2{ + static_cast<_Float16>(r.x), static_cast<_Float16>(r.y)}}; + } + inline + __device__ + __half2 __hle2(__half2 x, __half2 y) + { + auto r = static_cast<__half2_raw>(x).data <= + static_cast<__half2_raw>(y).data; + return __half2_raw{_Float16_2{ + static_cast<_Float16>(r.x), static_cast<_Float16>(r.y)}}; + } + inline + __device__ + __half2 __hge2(__half2 x, __half2 y) + { + auto r = static_cast<__half2_raw>(x).data >= + static_cast<__half2_raw>(y).data; + return __half2_raw{_Float16_2{ + static_cast<_Float16>(r.x), static_cast<_Float16>(r.y)}}; + } + inline + __device__ + __half2 __hlt2(__half2 x, __half2 y) + { + auto r = static_cast<__half2_raw>(x).data < + static_cast<__half2_raw>(y).data; + return __half2_raw{_Float16_2{ + static_cast<_Float16>(r.x), static_cast<_Float16>(r.y)}}; + } + inline + __device__ + __half2 __hgt2(__half2 x, __half2 y) + { + auto r = static_cast<__half2_raw>(x).data > + static_cast<__half2_raw>(y).data; + return __half2_raw{_Float16_2{ + static_cast<_Float16>(r.x), static_cast<_Float16>(r.y)}}; + } + inline + __device__ + __half2 __hequ2(__half2 x, __half2 y) { return __heq2(x, y); } + inline + __device__ + __half2 __hneu2(__half2 x, __half2 y) { return __hne2(x, y); } + inline + __device__ + __half2 __hleu2(__half2 x, __half2 y) { return __hle2(x, y); } + inline + __device__ + __half2 __hgeu2(__half2 x, __half2 y) { return __hge2(x, y); } + inline + __device__ + __half2 __hltu2(__half2 x, __half2 y) { return __hlt2(x, y); } + inline + __device__ + __half2 __hgtu2(__half2 x, __half2 y) { return __hgt2(x, y); } + + inline + __device__ + bool __hbeq2(__half2 x, __half2 y) + { + auto r = static_cast<__half2_raw>(__heq2(x, y)); + return r.data.x != 0 && r.data.y != 0; + } + inline + __device__ + bool __hbne2(__half2 x, __half2 y) + { + auto r = static_cast<__half2_raw>(__hne2(x, y)); + return r.data.x != 0 && r.data.y != 0; + } + inline + __device__ + bool __hble2(__half2 x, __half2 y) + { + auto r = static_cast<__half2_raw>(__hle2(x, y)); + return r.data.x != 0 && r.data.y != 0; + } + inline + __device__ + bool __hbge2(__half2 x, __half2 y) + { + auto r = static_cast<__half2_raw>(__hge2(x, y)); + return r.data.x != 0 && r.data.y != 0; + } + inline + __device__ + bool __hblt2(__half2 x, __half2 y) + { + auto r = static_cast<__half2_raw>(__hlt2(x, y)); + return r.data.x != 0 && r.data.y != 0; + } + inline + __device__ + bool __hbgt2(__half2 x, __half2 y) + { + auto r = static_cast<__half2_raw>(__hgt2(x, y)); + return r.data.x != 0 && r.data.y != 0; + } + inline + __device__ + bool __hbequ2(__half2 x, __half2 y) { return __hbeq2(x, y); } + inline + __device__ + bool __hbneu2(__half2 x, __half2 y) { return __hbne2(x, y); } + inline + __device__ + bool __hbleu2(__half2 x, __half2 y) { return __hble2(x, y); } + inline + __device__ + bool __hbgeu2(__half2 x, __half2 y) { return __hbge2(x, y); } + inline + __device__ + bool __hbltu2(__half2 x, __half2 y) { return __hblt2(x, y); } + inline + __device__ + bool __hbgtu2(__half2 x, __half2 y) { return __hbgt2(x, y); } + + // Arithmetic + inline + __device__ + __half __clamp_01(__half x) + { + auto r = static_cast<__half_raw>(x); + + if (__hlt(x, __half_raw{0})) return __half_raw{0}; + if (__hlt(__half_raw{1}, x)) return __half_raw{1}; + return r; + } + + inline + __device__ + __half __hadd(__half x, __half y) + { + return __half_raw{ + static_cast<__half_raw>(x).data + + static_cast<__half_raw>(y).data}; + } + inline + __device__ + __half __hsub(__half x, __half y) + { + return __half_raw{ + static_cast<__half_raw>(x).data - + static_cast<__half_raw>(y).data}; + } + inline + __device__ + __half __hmul(__half x, __half y) + { + return __half_raw{ + static_cast<__half_raw>(x).data * + static_cast<__half_raw>(y).data}; + } + inline + __device__ + __half __hadd_sat(__half x, __half y) + { + return __clamp_01(__hadd(x, y)); + } + inline + __device__ + __half __hsub_sat(__half x, __half y) + { + return __clamp_01(__hsub(x, y)); + } + inline + __device__ + __half __hmul_sat(__half x, __half y) + { + return __clamp_01(__hmul(x, y)); + } + inline + __device__ + __half __hfma(__half x, __half y, __half z) + { + return __half_raw{__ocml_fma_f16( + static_cast<__half_raw>(x).data, + static_cast<__half_raw>(y).data, + static_cast<__half_raw>(z).data)}; + } + inline + __device__ + __half __hfma_sat(__half x, __half y, __half z) + { + return __clamp_01(__hfma(x, y, z)); + } + inline + __device__ + __half __hdiv(__half x, __half y) + { + return __half_raw{ + static_cast<__half_raw>(x).data / + static_cast<__half_raw>(y).data}; + } + + inline + __device__ + __half2 __hadd2(__half2 x, __half2 y) + { + return __half2_raw{ + static_cast<__half2_raw>(x).data + + static_cast<__half2_raw>(y).data}; + } + inline + __device__ + __half2 __hsub2(__half2 x, __half2 y) + { + return __half2_raw{ + static_cast<__half2_raw>(x).data - + static_cast<__half2_raw>(y).data}; + } + inline + __device__ + __half2 __hmul2(__half2 x, __half2 y) + { + return __half2_raw{ + static_cast<__half2_raw>(x).data * + static_cast<__half2_raw>(y).data}; + } + inline + __device__ + __half2 __hadd2_sat(__half2 x, __half2 y) + { + auto r = static_cast<__half2_raw>(__hadd2(x, y)); + return __half2{ + __clamp_01(__half_raw{r.data.x}), + __clamp_01(__half_raw{r.data.y})}; + } + inline + __device__ + __half2 __hsub2_sat(__half2 x, __half2 y) + { + auto r = static_cast<__half2_raw>(__hsub2(x, y)); + return __half2{ + __clamp_01(__half_raw{r.data.x}), + __clamp_01(__half_raw{r.data.y})}; + } + inline + __device__ + __half2 __hmul2_sat(__half2 x, __half2 y) + { + auto r = static_cast<__half2_raw>(__hmul2(x, y)); + return __half2{ + __clamp_01(__half_raw{r.data.x}), + __clamp_01(__half_raw{r.data.y})}; + } + inline + __device__ + __half2 __hfma2(__half2 x, __half2 y, __half2 z) + { + return __half2_raw{__ocml_fma_2f16(x, y, z)}; + } + inline + __device__ + __half2 __hfma2_sat(__half2 x, __half2 y, __half2 z) + { + auto r = static_cast<__half2_raw>(__hfma2(x, y, z)); + return __half2{ + __clamp_01(__half_raw{r.data.x}), + __clamp_01(__half_raw{r.data.y})}; + } + inline + __device__ + __half2 __h2div(__half2 x, __half2 y) + { + return __half2_raw{ + static_cast<__half2_raw>(x).data / + static_cast<__half2_raw>(y).data}; + } + + // Math functions + inline + __device__ + __half htrunc(__half x) + { + return __half_raw{ + __ocml_trunc_f16(static_cast<__half_raw>(x).data)}; + } + inline + __device__ + __half hceil(__half x) + { + return __half_raw{ + __ocml_ceil_f16(static_cast<__half_raw>(x).data)}; + } + inline + __device__ + __half hfloor(__half x) + { + return __half_raw{ + __ocml_floor_f16(static_cast<__half_raw>(x).data)}; + } + inline + __device__ + __half hrint(__half x) + { + return __half_raw{ + __ocml_rint_f16(static_cast<__half_raw>(x).data)}; + } + inline + __device__ + __half hsin(__half x) + { + return __half_raw{ + __ocml_sin_f16(static_cast<__half_raw>(x).data)}; + } + inline + __device__ + __half hcos(__half x) + { + return __half_raw{ + __ocml_cos_f16(static_cast<__half_raw>(x).data)}; + } + inline + __device__ + __half hexp(__half x) + { + return __half_raw{ + __ocml_exp_f16(static_cast<__half_raw>(x).data)}; + } + inline + __device__ + __half hexp2(__half x) + { + return __half_raw{ + __ocml_exp2_f16(static_cast<__half_raw>(x).data)}; + } + inline + __device__ + __half hexp10(__half x) + { + return __half_raw{ + __ocml_exp10_f16(static_cast<__half_raw>(x).data)}; + } + inline + __device__ + __half hlog2(__half x) + { + return __half_raw{ + __ocml_log2_f16(static_cast<__half_raw>(x).data)}; + } + inline + __device__ + __half hlog(__half x) + { + return __half_raw{ + __ocml_log_f16(static_cast<__half_raw>(x).data)}; + } + inline + __device__ + __half hlog10(__half x) + { + return __half_raw{ + __ocml_log10_f16(static_cast<__half_raw>(x).data)}; + } + inline + __device__ + __half hrcp(__half x) + { + return __half_raw{ + __llvm_amdgcn_rcp_f16(static_cast<__half_raw>(x).data)}; + } + inline + __device__ + __half hrsqrt(__half x) + { + return __half_raw{ + __ocml_rsqrt_f16(static_cast<__half_raw>(x).data)}; + } + inline + __device__ + __half hsqrt(__half x) + { + return __half_raw{ + __ocml_sqrt_f16(static_cast<__half_raw>(x).data)}; + } + inline + __device__ + bool __hisinf(__half x) + { + return __ocml_isinf_f16(static_cast<__half_raw>(x).data); + } + inline + __device__ + bool __hisnan(__half x) + { + return __ocml_isnan_f16(static_cast<__half_raw>(x).data); + } + inline + __device__ + __half __hneg(__half x) + { + return __half_raw{-static_cast<__half_raw>(x).data}; + } + + inline + __device__ + __half2 h2trunc(__half2 x) + { + return __half2_raw{__ocml_trunc_2f16(x)}; + } + inline + __device__ + __half2 h2ceil(__half2 x) + { + return __half2_raw{__ocml_ceil_2f16(x)}; + } + inline + __device__ + __half2 h2floor(__half2 x) + { + return __half2_raw{__ocml_floor_2f16(x)}; + } + inline + __device__ + __half2 h2rint(__half2 x) + { + return __half2_raw{__ocml_rint_2f16(x)}; + } + inline + __device__ + __half2 h2sin(__half2 x) + { + return __half2_raw{__ocml_sin_2f16(x)}; + } + inline + __device__ + __half2 h2cos(__half2 x) + { + return __half2_raw{__ocml_cos_2f16(x)}; + } + inline + __device__ + __half2 h2exp(__half2 x) + { + return __half2_raw{__ocml_exp_2f16(x)}; + } + inline + __device__ + __half2 h2exp2(__half2 x) + { + return __half2_raw{__ocml_exp2_2f16(x)}; + } + inline + __device__ + __half2 h2exp10(__half2 x) + { + return __half2_raw{__ocml_exp10_2f16(x)}; + } + inline + __device__ + __half2 h2log2(__half2 x) + { + return __half2_raw{__ocml_log2_2f16(x)}; + } + inline + __device__ + __half2 h2log(__half2 x) { return __ocml_log_2f16(x); } + inline + __device__ + __half2 h2log10(__half2 x) { return __ocml_log10_2f16(x); } + inline + __device__ + __half2 h2rcp(__half2 x) { return __llvm_amdgcn_rcp_2f16(x); } + inline + __device__ + __half2 h2rsqrt(__half2 x) { return __ocml_rsqrt_2f16(x); } + inline + __device__ + __half2 h2sqrt(__half2 x) { return __ocml_sqrt_2f16(x); } + inline + __device__ + __half2 __hisinf2(__half2 x) + { + auto r = __ocml_isinf_2f16(x); + return __half2_raw{_Float16_2{ + static_cast<_Float16>(r.x), static_cast<_Float16>(r.y)}}; + } + inline + __device__ + __half2 __hisnan2(__half2 x) + { + auto r = __ocml_isnan_2f16(x); + return __half2_raw{_Float16_2{ + static_cast<_Float16>(r.x), static_cast<_Float16>(r.y)}}; + } + inline + __device__ + __half2 __hneg2(__half2 x) + { + return __half2_raw{-static_cast<__half2_raw>(x).data}; + } + } // Anonymous namespace. + + #if !defined(HIP_NO_HALF) + using half = __half; + using half2 = __half2; + #endif + #endif // defined(__cplusplus) +#elif defined(__GNUC__) + #include "hip_fp16_gcc.h" +#endif // !defined(__clang__) && defined(__GNUC__) \ No newline at end of file diff --git a/projects/hip/include/hip/hcc_detail/hip_fp16_gcc.h b/projects/hip/include/hip/hcc_detail/hip_fp16_gcc.h new file mode 100644 index 0000000000..9b31f9e3ce --- /dev/null +++ b/projects/hip/include/hip/hcc_detail/hip_fp16_gcc.h @@ -0,0 +1,257 @@ +#pragma once + +#if defined(__cplusplus) + #include +#endif + +struct __half_raw { + unsigned short x; +}; + +struct __half2_raw { + unsigned short x; + unsigned short y; +}; + +#if defined(__cplusplus) + struct __half; + + __half __float2half(float); + float __half2float(__half); + + // BEGIN STRUCT __HALF + struct __half { + protected: + unsigned short __x; + public: + // CREATORS + __half() = default; + __half(const __half_raw& x) : __x{x.x} {} + #if !defined(__HIP_NO_HALF_CONVERSIONS__) + __half(float x) : __x{__float2half(x).__x} {} + __half(double x) : __x{__float2half(x).__x} {} + #endif + __half(const __half&) = default; + __half(__half&&) = default; + ~__half() = default; + + // MANIPULATORS + __half& operator=(const __half&) = default; + __half& operator=(__half&&) = default; + __half& operator=(const __half_raw& x) { __x = x.x; return *this; } + #if !defined(__HIP_NO_HALF_CONVERSIONS__) + __half& operator=(float x) + { + __x = __float2half(x).__x; + return *this; + } + __half& operator=(double x) + { + return *this = static_cast(x); + } + #endif + + // ACCESSORS + operator float() const { return __half2float(*this); } + operator __half_raw() const { return __half_raw{__x}; } + }; + // END STRUCT __HALF + + // BEGIN STRUCT __HALF2 + struct __half2 { + protected: + __half x; + __half y; + public: + // CREATORS + __half2() = default; + __half2(const __half2_raw& ix) + : + x{reinterpret_cast(ix.x)}, + y{reinterpret_cast(ix.y)} + {} + __half2(const __half& ix, const __half& iy) : x{ix}, y{iy} {} + __half2(const __half2&) = default; + __half2(__half2&&) = default; + ~__half2() = default; + + // MANIPULATORS + __half2& operator=(const __half2&) = default; + __half2& operator=(__half2&&) = default; + __half2& operator=(const __half2_raw& ix) + { + x = reinterpret_cast(ix.x); + y = reinterpret_cast(ix.y); + return *this; + } + + // ACCESSORS + operator __half2_raw() const + { + return __half2_raw{ + reinterpret_cast(x), + reinterpret_cast(y)}; + } + }; + // END STRUCT __HALF2 + + namespace + { + inline + unsigned short __internal_float2half( + float flt, unsigned int& sgn, unsigned int& rem) + { + unsigned int x{}; + std::memcpy(&x, &flt, sizeof(flt)); + + unsigned int u = (x & 0x7fffffffU); + sgn = ((x >> 16) & 0x8000U); + + // NaN/+Inf/-Inf + if (u >= 0x7f800000U) { + rem = 0; + return static_cast( + (u == 0x7f800000U) ? (sgn | 0x7c00U) : 0x7fffU); + } + // Overflows + if (u > 0x477fefffU) { + rem = 0x80000000U; + return static_cast(sgn | 0x7bffU); + } + // Normal numbers + if (u >= 0x38800000U) { + rem = u << 19; + u -= 0x38000000U; + return static_cast(sgn | (u >> 13)); + } + // +0/-0 + if (u < 0x33000001U) { + rem = u; + return static_cast(sgn); + } + // Denormal numbers + unsigned int exponent = u >> 23; + unsigned int mantissa = (u & 0x7fffffU); + unsigned int shift = 0x7eU - exponent; + mantissa |= 0x800000U; + rem = mantissa << (32 - shift); + return static_cast(sgn | (mantissa >> shift)); + } + + inline + __half __float2half(float x) + { + __half_raw r; + unsigned int sgn{}; + unsigned int rem{}; + r.x = __internal_float2half(x, sgn, rem); + if (rem > 0x80000000U || (rem == 0x80000000U && (r.x & 0x1))) ++r.x; + + return r; + } + + inline + __half __float2half_rn(float x) { return __float2half(x); } + + inline + __half __float2half_rz(float x) + { + __half_raw r; + unsigned int sgn{}; + unsigned int rem{}; + r.x = __internal_float2half(x, sgn, rem); + + return r; + } + + inline + __half __float2half_rd(float x) + { + __half_raw r; + unsigned int sgn{}; + unsigned int rem{}; + r.x = __internal_float2half(x, sgn, rem); + if (rem && sgn) ++r.x; + + return r; + } + + inline + __half __float2half_ru(float x) + { + __half_raw r; + unsigned int sgn{}; + unsigned int rem{}; + r.x = __internal_float2half(x, sgn, rem); + if (rem && !sgn) ++r.x; + + return r; + } + + inline + __half2 __float2half2_rn(float x) + { + return __half2{__float2half_rn(x), __float2half_rn(x)}; + } + + inline + __half2 __floats2half2_rn(float x, float y) + { + return __half2{__float2half_rn(x), __float2half_rn(y)}; + } + + inline + float __internal_half2float(unsigned short x) + { + unsigned int sign = ((x >> 15) & 1); + unsigned int exponent = ((x >> 10) & 0x1f); + unsigned int mantissa = ((x & 0x3ff) << 13); + + if (exponent == 0x1fU) { /* NaN or Inf */ + mantissa = (mantissa ? (sign = 0, 0x7fffffU) : 0); + exponent = 0xffU; + } else if (!exponent) { /* Denorm or Zero */ + if (mantissa) { + unsigned int msb; + exponent = 0x71U; + do { + msb = (mantissa & 0x400000U); + mantissa <<= 1; /* normalize */ + --exponent; + } while (!msb); + mantissa &= 0x7fffffU; /* 1.mantissa is implicit */ + } + } else { + exponent += 0x70U; + } + unsigned int u = ((sign << 31) | (exponent << 23) | mantissa); + float f; + memcpy(&f, &u, sizeof(u)); + + return f; + } + + inline + float __half2float(__half x) + { + return __internal_half2float(static_cast<__half_raw>(x).x); + } + + inline + float __low2float(__half2 x) + { + return __internal_half2float(static_cast<__half2_raw>(x).x); + } + + inline + float __high2float(__half2 x) + { + return __internal_half2float(static_cast<__half2_raw>(x).y); + } + } // Anonymous namespace. + + #if !defined(HIP_NO_HALF) + using half = __half; + using half2 = __half2; + #endif +#endif // defined(__cplusplus) diff --git a/projects/hip/include/hip/hcc_detail/hip_fp16_math_fwd.h b/projects/hip/include/hip/hcc_detail/hip_fp16_math_fwd.h new file mode 100644 index 0000000000..81f9fe4761 --- /dev/null +++ b/projects/hip/include/hip/hcc_detail/hip_fp16_math_fwd.h @@ -0,0 +1,76 @@ +/* +Copyright (c) 2015 - present Advanced Micro Devices, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +#pragma once + +// /* +// Half Math Functions +// */ + +extern "C" +{ + __attribute__((const)) _Float16 __ocml_ceil_f16(_Float16); + _Float16 __ocml_cos_f16(_Float16); + __attribute__((pure)) _Float16 __ocml_exp_f16(_Float16); + __attribute__((pure)) _Float16 __ocml_exp10_f16(_Float16); + __attribute__((pure)) _Float16 __ocml_exp2_f16(_Float16); + __attribute__((const)) _Float16 __ocml_floor_f16(_Float16); + __attribute__((const)) + _Float16 __ocml_fma_f16(_Float16, _Float16, _Float16); + __attribute__((const)) int __ocml_isinf_f16(_Float16); + __attribute__((const)) int __ocml_isnan_f16(_Float16); + __attribute__((pure)) _Float16 __ocml_log_f16(_Float16); + __attribute__((pure)) _Float16 __ocml_log10_f16(_Float16); + __attribute__((pure)) _Float16 __ocml_log2_f16(_Float16); + __attribute__((const)) _Float16 __llvm_amdgcn_rcp_f16(_Float16); + __attribute__((const)) _Float16 __ocml_rint_f16(_Float16); + __attribute__((const)) _Float16 __ocml_rsqrt_f16(_Float16); + _Float16 __ocml_sin_f16(_Float16); + __attribute__((const)) _Float16 __ocml_sqrt_f16(_Float16); + __attribute__((const)) _Float16 __ocml_trunc_f16(_Float16); + + typedef _Float16 __2f16 __attribute__((ext_vector_type(2))); + typedef short __2i16 __attribute__((ext_vector_type(2))); + + __attribute__((const)) __2f16 __ocml_ceil_2f16(__2f16); + __2f16 __ocml_cos_2f16(__2f16); + __attribute__((pure)) __2f16 __ocml_exp_2f16(__2f16); + __attribute__((pure)) __2f16 __ocml_exp10_2f16(__2f16); + __attribute__((pure)) __2f16 __ocml_exp2_2f16(__2f16); + __attribute__((const)) __2f16 __ocml_floor_2f16(__2f16); + __attribute__((const)) __2f16 __ocml_fma_2f16(__2f16, __2f16, __2f16); + __attribute__((const)) __2i16 __ocml_isinf_2f16(__2f16); + __attribute__((const)) __2i16 __ocml_isnan_2f16(__2f16); + __attribute__((pure)) __2f16 __ocml_log_2f16(__2f16); + __attribute__((pure)) __2f16 __ocml_log10_2f16(__2f16); + __attribute__((pure)) __2f16 __ocml_log2_2f16(__2f16); + inline + __2f16 __llvm_amdgcn_rcp_2f16(__2f16 x) // Not currently exposed by ROCDL. + { + return __2f16{__llvm_amdgcn_rcp_f16(x.x), __llvm_amdgcn_rcp_f16(x.y)}; + } + __attribute__((const)) __2f16 __ocml_rint_2f16(__2f16); + __attribute__((const)) __2f16 __ocml_rsqrt_2f16(__2f16); + __2f16 __ocml_sin_2f16(__2f16); + __attribute__((const)) __2f16 __ocml_sqrt_2f16(__2f16); + __attribute__((const)) __2f16 __ocml_trunc_2f16(__2f16); +} \ No newline at end of file diff --git a/projects/hip/include/hip/hcc_detail/hip_vector_types.h b/projects/hip/include/hip/hcc_detail/hip_vector_types.h index 7cd250e257..59b9c247e3 100644 --- a/projects/hip/include/hip/hcc_detail/hip_vector_types.h +++ b/projects/hip/include/hip/hcc_detail/hip_vector_types.h @@ -34,1132 +34,99 @@ THE SOFTWARE. #include "hip/hcc_detail/host_defines.h" -#define MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(type) \ - __device__ __host__ type() {} \ - __device__ __host__ type(const type& val) : x(val.x) {} \ - __device__ __host__ ~type() {} - -#define MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(type) \ - __device__ __host__ type() {} \ - __device__ __host__ type(const type& val) : x(val.x), y(val.y) {} \ - __device__ __host__ ~type() {} - -#define MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(type) \ - __device__ __host__ type() {} \ - __device__ __host__ type(const type& val) : x(val.x), y(val.y), z(val.z) {} \ - __device__ __host__ ~type() {} - -#define MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(type) \ - __device__ __host__ type() {} \ - __device__ __host__ type(const type& val) : x(val.x), y(val.y), z(val.z), w(val.w) {} \ - __device__ __host__ ~type() {} - -#define MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(type, type1) \ - __device__ __host__ type(type1 val) : x(val) {} - -#define MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(type, type1) \ - __device__ __host__ type(type1 val) : x(val), y(val) {} \ - __device__ __host__ type(type1 val1, type1 val2) : x(val1), y(val2) {} - -#define MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(type, type1) \ - __device__ __host__ type(type1 val) : x(val), y(val), z(val) {} \ - __device__ __host__ type(type1 val1, type1 val2, type1 val3) : x(val1), y(val2), z(val3) {} - -#define MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(type, type1) \ - __device__ __host__ type(type1 val) : x(val), y(val), z(val), w(val) {} \ - __device__ __host__ type(type1 val1, type1 val2, type1 val3, type1 val4) \ - : x(val1), y(val2), z(val3), w(val4) {} - -struct uchar1 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(uchar1) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uchar1, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uchar1, signed char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uchar1, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uchar1, signed short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uchar1, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uchar1, signed int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uchar1, float) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uchar1, double) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uchar1, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uchar1, signed long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uchar1, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uchar1, signed long long) - +#if defined(__clang__) + #define __NATIVE_VECTOR__(n, ...) __attribute__((ext_vector_type(n))) +#elif defined(__GNUC__) // N.B.: GCC does not support .xyzw syntax. + #define __ROUND_UP_TO_NEXT_POT__(x) \ + (1 << (31 - __builtin_clz(x) + (x > (1 << (31 - __builtin_clz(x)))))) + #define __NATIVE_VECTOR__(n, T) \ + __attribute__((vector_size(__ROUND_UP_TO_NEXT_POT__(n) * sizeof(T)))) #endif - unsigned char x; -} __attribute__((aligned(1))); - -struct uchar2 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(uchar2) - - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uchar2, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uchar2, signed char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uchar2, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uchar2, signed short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uchar2, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uchar2, signed int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uchar2, float) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uchar2, double) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uchar2, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uchar2, signed long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uchar2, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uchar2, signed long long) -#endif - union { - struct { - unsigned char x, y; - }; - unsigned short a; - }; -} __attribute__((aligned(2))); - -struct uchar3 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(uchar3) - - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uchar3, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uchar3, signed char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uchar3, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uchar3, signed short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uchar3, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uchar3, signed int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uchar3, float) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uchar3, double) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uchar3, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uchar3, signed long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uchar3, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uchar3, signed long long) -#endif - unsigned char x, y, z; -}; - -struct uchar4 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(uchar4) - - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uchar4, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uchar4, signed char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uchar4, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uchar4, signed short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uchar4, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uchar4, signed int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uchar4, float) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uchar4, double) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uchar4, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uchar4, signed long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uchar4, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uchar4, signed long long) -#endif - union { - struct { - unsigned char x, y, z, w; - }; - unsigned int a; - }; -} __attribute__((aligned(4))); - - -struct char1 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(char1) - - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(char1, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(char1, signed char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(char1, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(char1, signed short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(char1, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(char1, signed int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(char1, float) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(char1, double) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(char1, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(char1, signed long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(char1, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(char1, signed long long) -#endif - signed char x; -} __attribute__((aligned(1))); - -struct char2 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(char2) - - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(char2, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(char2, signed char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(char2, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(char2, signed short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(char2, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(char2, signed int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(char2, float) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(char2, double) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(char2, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(char2, signed long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(char2, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(char2, signed long long) -#endif - union { - struct { - signed char x, y; - }; - unsigned short a; - }; -} __attribute__((aligned(2))); - -struct char3 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(char3) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(char3, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(char3, signed char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(char3, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(char3, signed short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(char3, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(char3, signed int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(char3, float) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(char3, double) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(char3, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(char3, signed long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(char3, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(char3, signed long long) -#endif - signed char x, y, z; -}; - -struct char4 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(char4) - - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(char4, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(char4, signed char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(char4, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(char4, signed short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(char4, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(char4, signed int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(char4, float) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(char4, double) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(char4, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(char4, signed long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(char4, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(char4, signed long long) -#endif - union { - struct { - signed char x, y, z, w; - }; - unsigned int a; - }; -} __attribute__((aligned(4))); - - -struct ushort1 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(ushort1) - - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ushort1, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ushort1, signed char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ushort1, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ushort1, signed short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ushort1, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ushort1, signed int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ushort1, float) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ushort1, double) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ushort1, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ushort1, signed long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ushort1, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ushort1, signed long long) -#endif - unsigned short x; -} __attribute__((aligned(2))); - -struct ushort2 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(ushort2) - - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ushort2, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ushort2, signed char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ushort2, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ushort2, signed short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ushort2, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ushort2, signed int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ushort2, float) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ushort2, double) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ushort2, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ushort2, signed long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ushort2, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ushort2, signed long long) -#endif - union { - struct { - unsigned short x, y; - }; - unsigned int a; - }; -} __attribute__((aligned(4))); - -struct ushort3 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(ushort3) - - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ushort3, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ushort3, signed char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ushort3, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ushort3, signed short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ushort3, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ushort3, signed int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ushort3, float) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ushort3, double) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ushort3, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ushort3, signed long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ushort3, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ushort3, signed long long) -#endif - unsigned short x, y, z; -}; - -struct ushort4 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(ushort4) - - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ushort4, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ushort4, signed char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ushort4, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ushort4, signed short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ushort4, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ushort4, signed int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ushort4, float) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ushort4, double) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ushort4, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ushort4, signed long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ushort4, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ushort4, signed long long) -#endif - union { - struct { - unsigned short x, y, z, w; - }; - unsigned int a, b; - }; -} __attribute__((aligned(8))); - -struct short1 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(short1) - - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(short1, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(short1, signed char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(short1, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(short1, signed short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(short1, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(short1, signed int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(short1, float) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(short1, double) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(short1, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(short1, signed long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(short1, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(short1, signed long long) -#endif - signed short x; -} __attribute__((aligned(2))); - -struct short2 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(short2) - - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(short2, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(short2, signed char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(short2, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(short2, signed short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(short2, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(short2, signed int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(short2, float) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(short2, double) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(short2, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(short2, signed long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(short2, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(short2, signed long long) -#endif - union { - struct { - signed short x, y; - }; - unsigned int a; - }; - -} __attribute__((aligned(4))); - -struct short3 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(short3) - - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(short3, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(short3, signed char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(short3, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(short3, signed short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(short3, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(short3, signed int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(short3, float) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(short3, double) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(short3, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(short3, signed long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(short3, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(short3, signed long long) -#endif - signed short x, y, z; -}; - -struct short4 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(short4) - - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(short4, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(short4, signed char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(short4, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(short4, signed short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(short4, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(short4, signed int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(short4, float) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(short4, double) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(short4, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(short4, signed long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(short4, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(short4, signed long long) -#endif - union { - struct { - signed short x, y, z, w; - }; - unsigned int a, b; - }; -} __attribute__((aligned(8))); - - -struct uint1 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(uint1) - - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uint1, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uint1, signed char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uint1, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uint1, signed short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uint1, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uint1, signed int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uint1, float) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uint1, double) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uint1, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uint1, signed long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uint1, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uint1, signed long long) -#endif - unsigned int x; -} __attribute__((aligned(4))); - -struct uint2 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(uint2) - - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uint2, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uint2, signed char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uint2, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uint2, signed short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uint2, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uint2, signed int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uint2, float) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uint2, double) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uint2, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uint2, signed long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uint2, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uint2, signed long long) -#endif - unsigned int x, y; -} __attribute__((aligned(8))); - -struct uint3 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(uint3) - - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uint3, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uint3, signed char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uint3, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uint3, signed short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uint3, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uint3, signed int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uint3, float) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uint3, double) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uint3, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uint3, signed long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uint3, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uint3, signed long long) -#endif - unsigned int x, y, z; -}; - -struct uint4 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(uint4) - - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uint4, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uint4, signed char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uint4, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uint4, signed short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uint4, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uint4, signed int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uint4, float) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uint4, double) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uint4, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uint4, signed long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uint4, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uint4, signed long long) -#endif - unsigned int x, y, z, w; -} __attribute__((aligned(16))); - -struct int1 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(int1) - - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(int1, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(int1, signed char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(int1, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(int1, signed short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(int1, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(int1, signed int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(int1, float) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(int1, double) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(int1, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(int1, signed long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(int1, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(int1, signed long long) -#endif - signed int x; -} __attribute__((aligned(4))); - -struct int2 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(int2) - - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(int2, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(int2, signed char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(int2, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(int2, signed short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(int2, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(int2, signed int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(int2, float) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(int2, double) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(int2, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(int2, signed long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(int2, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(int2, signed long long) -#endif - signed int x, y; -} __attribute__((aligned(8))); - -struct int3 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(int3) - - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(int3, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(int3, signed char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(int3, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(int3, signed short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(int3, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(int3, signed int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(int3, float) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(int3, double) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(int3, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(int3, signed long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(int3, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(int3, signed long long) -#endif - signed int x, y, z; -}; - -struct int4 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(int4) - - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(int4, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(int4, signed char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(int4, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(int4, signed short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(int4, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(int4, signed int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(int4, float) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(int4, double) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(int4, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(int4, signed long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(int4, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(int4, signed long long) -#endif - signed int x, y, z, w; -} __attribute__((aligned(16))); - - -struct float1 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(float1) - - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(float1, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(float1, signed char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(float1, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(float1, signed short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(float1, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(float1, signed int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(float1, float) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(float1, double) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(float1, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(float1, signed long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(float1, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(float1, signed long long) -#endif - float x; -} __attribute__((aligned(4))); - -struct float2 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(float2) - - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(float2, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(float2, signed char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(float2, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(float2, signed short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(float2, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(float2, signed int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(float2, float) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(float2, double) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(float2, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(float2, signed long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(float2, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(float2, signed long long) -#endif - float x, y; -} __attribute__((aligned(8))); - -struct float3 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(float3) - - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(float3, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(float3, signed char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(float3, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(float3, signed short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(float3, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(float3, signed int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(float3, float) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(float3, double) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(float3, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(float3, signed long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(float3, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(float3, signed long long) -#endif - float x, y, z; -}; - -struct float4 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(float4) - - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(float4, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(float4, signed char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(float4, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(float4, signed short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(float4, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(float4, signed int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(float4, float) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(float4, double) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(float4, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(float4, signed long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(float4, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(float4, signed long long) -#endif - float x, y, z, w; -} __attribute__((aligned(16))); - - -struct double1 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(double1) - - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(double1, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(double1, signed char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(double1, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(double1, signed short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(double1, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(double1, signed int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(double1, float) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(double1, double) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(double1, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(double1, signed long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(double1, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(double1, signed long long) -#endif - double x; -} __attribute__((aligned(8))); - -struct double2 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(double2) - - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(double2, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(double2, signed char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(double2, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(double2, signed short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(double2, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(double2, signed int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(double2, float) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(double2, double) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(double2, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(double2, signed long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(double2, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(double2, signed long long) -#endif - double x, y; -} __attribute__((aligned(16))); - -struct double3 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(double3) - - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(double3, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(double3, signed char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(double3, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(double3, signed short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(double3, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(double3, signed int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(double3, float) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(double3, double) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(double3, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(double3, signed long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(double3, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(double3, signed long long) -#endif - double x, y, z; -}; - -struct double4 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(double4) - - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(double4, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(double4, signed char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(double4, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(double4, signed short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(double4, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(double4, signed int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(double4, float) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(double4, double) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(double4, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(double4, signed long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(double4, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(double4, signed long long) -#endif - double x, y, z, w; -} __attribute__((aligned(32))); - - -struct ulong1 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(ulong1) - - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulong1, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulong1, signed char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulong1, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulong1, signed short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulong1, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulong1, signed int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulong1, float) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulong1, double) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulong1, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulong1, signed long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulong1, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulong1, signed long long) -#endif - unsigned long x; -} __attribute__((aligned(8))); - -struct ulong2 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(ulong2) - - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulong2, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulong2, signed char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulong2, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulong2, signed short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulong2, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulong2, signed int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulong2, float) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulong2, double) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulong2, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulong2, signed long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulong2, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulong2, signed long long) -#endif - unsigned long x, y; -} __attribute__((aligned(16))); - -struct ulong3 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(ulong3) - - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulong3, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulong3, signed char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulong3, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulong3, signed short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulong3, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulong3, signed int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulong3, float) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulong3, double) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulong3, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulong3, signed long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulong3, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulong3, signed long long) -#endif - unsigned long x, y, z; -}; - -struct ulong4 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(ulong4) - - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulong4, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulong4, signed char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulong4, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulong4, signed short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulong4, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulong4, signed int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulong4, float) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulong4, double) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulong4, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulong4, signed long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulong4, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulong4, signed long long) -#endif - unsigned long x, y, z, w; -} __attribute__((aligned(32))); - - -struct long1 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(long1) - - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(long1, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(long1, signed char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(long1, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(long1, signed short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(long1, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(long1, signed int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(long1, float) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(long1, double) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(long1, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(long1, signed long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(long1, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(long1, signed long long) -#endif - signed long x; -} __attribute__((aligned(8))); - -struct long2 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(long2) - - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(long2, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(long2, signed char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(long2, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(long2, signed short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(long2, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(long2, signed int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(long2, float) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(long2, double) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(long2, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(long2, signed long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(long2, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(long2, signed long long) -#endif - signed long x, y; -} __attribute__((aligned(16))); - -struct long3 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(long3) - - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(long3, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(long3, signed char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(long3, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(long3, signed short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(long3, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(long3, signed int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(long3, float) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(long3, double) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(long3, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(long3, signed long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(long3, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(long3, signed long long) -#endif - signed long x, y, z; -}; - -struct long4 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(long4) - - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(long4, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(long4, signed char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(long4, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(long4, signed short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(long4, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(long4, signed int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(long4, float) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(long4, double) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(long4, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(long4, signed long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(long4, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(long4, signed long long) -#endif - signed long x, y, z, w; -} __attribute__((aligned(32))); - - -struct ulonglong1 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(ulonglong1) - - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulonglong1, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulonglong1, signed char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulonglong1, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulonglong1, signed short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulonglong1, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulonglong1, signed int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulonglong1, float) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulonglong1, double) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulonglong1, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulonglong1, signed long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulonglong1, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulonglong1, signed long long) -#endif - unsigned long long x; -} __attribute__((aligned(8))); - -struct ulonglong2 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(ulonglong2) - - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulonglong2, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulonglong2, signed char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulonglong2, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulonglong2, signed short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulonglong2, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulonglong2, signed int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulonglong2, float) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulonglong2, double) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulonglong2, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulonglong2, signed long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulonglong2, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulonglong2, signed long long) -#endif - unsigned long long x, y; -} __attribute__((aligned(16))); - -struct ulonglong3 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(ulonglong3) - - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulonglong3, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulonglong3, signed char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulonglong3, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulonglong3, signed short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulonglong3, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulonglong3, signed int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulonglong3, float) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulonglong3, double) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulonglong3, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulonglong3, signed long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulonglong3, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulonglong3, signed long long) -#endif - unsigned long long x, y, z; -}; - -struct ulonglong4 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(ulonglong4) - - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulonglong4, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulonglong4, signed char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulonglong4, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulonglong4, signed short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulonglong4, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulonglong4, signed int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulonglong4, float) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulonglong4, double) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulonglong4, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulonglong4, signed long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulonglong4, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulonglong4, signed long long) -#endif - unsigned long long x, y, z, w; -} __attribute__((aligned(32))); - - -struct longlong1 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(longlong1) - - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(longlong1, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(longlong1, signed char) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(longlong1, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(longlong1, signed short) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(longlong1, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(longlong1, signed int) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(longlong1, float) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(longlong1, double) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(longlong1, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(longlong1, signed long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(longlong1, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(longlong1, signed long long) -#endif - signed long long x; -} __attribute__((aligned(8))); - -struct longlong2 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(longlong2) - - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(longlong2, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(longlong2, signed char) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(longlong2, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(longlong2, signed short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(longlong2, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(longlong2, signed int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(longlong2, float) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(longlong2, double) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(longlong2, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(longlong2, signed long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(longlong2, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(longlong2, signed long long) -#endif - signed long long x, y; -} __attribute__((aligned(16))); - -struct longlong3 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(longlong3) - - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(longlong3, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(longlong3, signed char) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(longlong3, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(longlong3, signed short) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(longlong3, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(longlong3, signed int) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(longlong3, float) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(longlong3, double) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(longlong3, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(longlong3, signed long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(longlong3, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(longlong3, signed long long) -#endif - signed long long x, y, z; -}; - -struct longlong4 { -#ifdef __cplusplus - public: - MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(longlong4) - - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(longlong4, unsigned char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(longlong4, signed char) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(longlong4, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(longlong4, signed short) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(longlong4, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(longlong4, signed int) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(longlong4, float) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(longlong4, double) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(longlong4, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(longlong4, signed long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(longlong4, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(longlong4, signed long long) -#endif - signed long x, y, z, w; -} __attribute__((aligned(32))); - -#define DECLOP_MAKE_ONE_COMPONENT(comp, type) \ - __device__ __host__ static inline struct type make_##type(comp x) { \ - struct type ret; \ - ret.x = x; \ - return ret; \ - } - -#define DECLOP_MAKE_TWO_COMPONENT(comp, type) \ - __device__ __host__ static inline struct type make_##type(comp x, comp y) { \ - struct type ret; \ - ret.x = x; \ - ret.y = y; \ - return ret; \ - } - -#define DECLOP_MAKE_THREE_COMPONENT(comp, type) \ - __device__ __host__ static inline struct type make_##type(comp x, comp y, comp z) { \ - struct type ret; \ - ret.x = x; \ - ret.y = y; \ - ret.z = z; \ - return ret; \ - } - -#define DECLOP_MAKE_FOUR_COMPONENT(comp, type) \ - __device__ __host__ static inline struct type make_##type(comp x, comp y, comp z, comp w) { \ - struct type ret; \ - ret.x = x; \ - ret.y = y; \ - ret.z = z; \ - ret.w = w; \ - return ret; \ +typedef unsigned char uchar1 __NATIVE_VECTOR__(1, unsigned char); +typedef unsigned char uchar2 __NATIVE_VECTOR__(2, unsigned char); +typedef unsigned char uchar3 __NATIVE_VECTOR__(3, unsigned char); +typedef unsigned char uchar4 __NATIVE_VECTOR__(4, unsigned char); + +typedef char char1 __NATIVE_VECTOR__(1, char); +typedef char char2 __NATIVE_VECTOR__(2, char); +typedef char char3 __NATIVE_VECTOR__(3, char); +typedef char char4 __NATIVE_VECTOR__(4, char); + +typedef unsigned short ushort1 __NATIVE_VECTOR__(1, unsigned short); +typedef unsigned short ushort2 __NATIVE_VECTOR__(2, unsigned short); +typedef unsigned short ushort3 __NATIVE_VECTOR__(3, unsigned short); +typedef unsigned short ushort4 __NATIVE_VECTOR__(4, unsigned short); + +typedef short short1 __NATIVE_VECTOR__(1, short); +typedef short short2 __NATIVE_VECTOR__(2, short); +typedef short short3 __NATIVE_VECTOR__(3, short); +typedef short short4 __NATIVE_VECTOR__(4, short); + +typedef unsigned int uint1 __NATIVE_VECTOR__(1, unsigned int); +typedef unsigned int uint2 __NATIVE_VECTOR__(2, unsigned int); +typedef unsigned int uint3 __NATIVE_VECTOR__(3, unsigned int); +typedef unsigned int uint4 __NATIVE_VECTOR__(4, unsigned int); + +typedef int int1 __NATIVE_VECTOR__(1, int); +typedef int int2 __NATIVE_VECTOR__(2, int); +typedef int int3 __NATIVE_VECTOR__(3, int); +typedef int int4 __NATIVE_VECTOR__(4, int); + +typedef unsigned long ulong1 __NATIVE_VECTOR__(1, unsigned long); +typedef unsigned long ulong2 __NATIVE_VECTOR__(2, unsigned long); +typedef unsigned long ulong3 __NATIVE_VECTOR__(3, unsigned long); +typedef unsigned long ulong4 __NATIVE_VECTOR__(4, unsigned long); + +typedef long long1 __NATIVE_VECTOR__(1, long); +typedef long long2 __NATIVE_VECTOR__(2, long); +typedef long long3 __NATIVE_VECTOR__(3, long); +typedef long long4 __NATIVE_VECTOR__(4, long); + +typedef unsigned long long ulonglong1 __NATIVE_VECTOR__(1, unsigned long long); +typedef unsigned long long ulonglong2 __NATIVE_VECTOR__(2, unsigned long long); +typedef unsigned long long ulonglong3 __NATIVE_VECTOR__(3, unsigned long long); +typedef unsigned long long ulonglong4 __NATIVE_VECTOR__(4, unsigned long long); + +typedef long long longlong1 __NATIVE_VECTOR__(1, long long); +typedef long long longlong2 __NATIVE_VECTOR__(2, long long); +typedef long long longlong3 __NATIVE_VECTOR__(3, long long); +typedef long long longlong4 __NATIVE_VECTOR__(4, long long); + +typedef float float1 __NATIVE_VECTOR__(1, float); +typedef float float2 __NATIVE_VECTOR__(2, float); +typedef float float3 __NATIVE_VECTOR__(3, float); +typedef float float4 __NATIVE_VECTOR__(4, float); + +typedef double double1 __NATIVE_VECTOR__(1, double); +typedef double double2 __NATIVE_VECTOR__(2, double); +typedef double double3 __NATIVE_VECTOR__(3, double); +typedef double double4 __NATIVE_VECTOR__(4, double); + +#define DECLOP_MAKE_ONE_COMPONENT(comp, type) \ + __device__ __host__ \ + static \ + inline \ + type make_##type(comp x) { return type{x}; } + +#define DECLOP_MAKE_TWO_COMPONENT(comp, type) \ + __device__ __host__ \ + static \ + inline \ + type make_##type(comp x, comp y) { return type{x, y}; } + +#define DECLOP_MAKE_THREE_COMPONENT(comp, type) \ + __device__ __host__ \ + static \ + inline \ + type make_##type(comp x, comp y, comp z) { return type{x, y, z}; } + +#define DECLOP_MAKE_FOUR_COMPONENT(comp, type) \ + __device__ __host__ \ + static \ + inline \ + type make_##type(comp x, comp y, comp z, comp w) { \ + return type{x, y, z, w}; \ } DECLOP_MAKE_ONE_COMPONENT(unsigned char, uchar1); @@ -1222,2894 +189,4 @@ DECLOP_MAKE_TWO_COMPONENT(signed long, longlong2); DECLOP_MAKE_THREE_COMPONENT(signed long, longlong3); DECLOP_MAKE_FOUR_COMPONENT(signed long, longlong4); - -#if __cplusplus - -#define DECLOP_1VAR_2IN_1OUT(type, op) \ - __device__ __host__ static inline type operator op(const type& lhs, const type& rhs) { \ - type ret; \ - ret.x = lhs.x op rhs.x; \ - return ret; \ - } - -#define DECLOP_1VAR_SCALE_PRODUCT(type, type1) \ - __device__ __host__ static inline type operator*(const type& lhs, type1 rhs) { \ - type ret; \ - ret.x = lhs.x * rhs; \ - return ret; \ - } \ - \ - __device__ __host__ static inline type operator*(type1 lhs, const type& rhs) { \ - type ret; \ - ret.x = lhs * rhs.x; \ - return ret; \ - } - -#define DECLOP_1VAR_ASSIGN(type, op) \ - __device__ __host__ static inline type& operator op(type& lhs, const type& rhs) { \ - lhs.x op rhs.x; \ - return lhs; \ - } - -#define DECLOP_1VAR_PREOP(type, op) \ - __device__ __host__ static inline type& operator op(type& val) { \ - op val.x; \ - return val; \ - } - -#define DECLOP_1VAR_POSTOP(type, op) \ - __device__ __host__ static inline type operator op(type& val, int) { \ - type ret; \ - ret.x = val.x; \ - val.x op; \ - return ret; \ - } - -#define DECLOP_1VAR_COMP(type, op) \ - __device__ __host__ static inline bool operator op(type& lhs, type& rhs) { \ - return lhs.x op rhs.x; \ - } \ - __device__ __host__ static inline bool operator op(const type& lhs, type& rhs) { \ - return lhs.x op rhs.x; \ - } \ - __device__ __host__ static inline bool operator op(type& lhs, const type& rhs) { \ - return lhs.x op rhs.x; \ - } \ - __device__ __host__ static inline bool operator op(const type& lhs, const type& rhs) { \ - return lhs.x op rhs.x; \ - } - -#define DECLOP_1VAR_1IN_1OUT(type, op) \ - __device__ __host__ static inline type operator op(type& rhs) { \ - type ret; \ - ret.x = op rhs.x; \ - return ret; \ - } - -#define DECLOP_1VAR_1IN_BOOLOUT(type, op) \ - __device__ __host__ static inline bool operator op(type& rhs) { return op rhs.x; } - -/* - Two Element Access -*/ - -#define DECLOP_2VAR_2IN_1OUT(type, op) \ - __device__ __host__ static inline type operator op(const type& lhs, const type& rhs) { \ - type ret; \ - ret.x = lhs.x op rhs.x; \ - ret.y = lhs.y op rhs.y; \ - return ret; \ - } - -#define DECLOP_2VAR_SCALE_PRODUCT(type, type1) \ - __device__ __host__ static inline type operator*(const type& lhs, type1 rhs) { \ - type ret; \ - ret.x = lhs.x * rhs; \ - ret.y = lhs.y * rhs; \ - return ret; \ - } \ - \ - __device__ __host__ static inline type operator*(type1 lhs, const type& rhs) { \ - type ret; \ - ret.x = lhs * rhs.x; \ - ret.y = lhs * rhs.y; \ - return ret; \ - } - -#define DECLOP_2VAR_ASSIGN(type, op) \ - __device__ __host__ static inline type& operator op(type& lhs, const type& rhs) { \ - lhs.x op rhs.x; \ - lhs.y op rhs.y; \ - return lhs; \ - } - -#define DECLOP_2VAR_PREOP(type, op) \ - __device__ __host__ static inline type& operator op(type& val) { \ - op val.x; \ - op val.y; \ - return val; \ - } - -#define DECLOP_2VAR_POSTOP(type, op) \ - __device__ __host__ static inline type operator op(type& val, int) { \ - type ret; \ - ret.x = val.x; \ - ret.y = val.y; \ - val.x op; \ - val.y op; \ - return ret; \ - } - -#define DECLOP_2VAR_COMP(type, op) \ - __device__ __host__ static inline bool operator op(type& lhs, type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y); \ - } \ - __device__ __host__ static inline bool operator op(const type& lhs, type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y); \ - } \ - __device__ __host__ static inline bool operator op(type& lhs, const type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y); \ - } \ - __device__ __host__ static inline bool operator op(const type& lhs, const type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y); \ - } - -#define DECLOP_2VAR_1IN_1OUT(type, op) \ - __device__ __host__ static inline type operator op(type& rhs) { \ - type ret; \ - ret.x = op rhs.x; \ - ret.y = op rhs.y; \ - return ret; \ - } - -#define DECLOP_2VAR_1IN_BOOLOUT(type, op) \ - __device__ __host__ static inline bool operator op(type& rhs) { \ - return (op rhs.x) && (op rhs.y); \ - } - - -/* - Three Element Access -*/ - -#define DECLOP_3VAR_2IN_1OUT(type, op) \ - __device__ __host__ static inline type operator op(const type& lhs, const type& rhs) { \ - type ret; \ - ret.x = lhs.x op rhs.x; \ - ret.y = lhs.y op rhs.y; \ - ret.z = lhs.z op rhs.z; \ - return ret; \ - } - -#define DECLOP_3VAR_SCALE_PRODUCT(type, type1) \ - __device__ __host__ static inline type operator*(const type& lhs, type1 rhs) { \ - type ret; \ - ret.x = lhs.x * rhs; \ - ret.y = lhs.y * rhs; \ - ret.z = lhs.z * rhs; \ - return ret; \ - } \ - \ - __device__ __host__ static inline type operator*(type1 lhs, const type& rhs) { \ - type ret; \ - ret.x = lhs * rhs.x; \ - ret.y = lhs * rhs.y; \ - ret.z = lhs * rhs.z; \ - return ret; \ - } - -#define DECLOP_3VAR_ASSIGN(type, op) \ - __device__ __host__ static inline type& operator op(type& lhs, const type& rhs) { \ - lhs.x op rhs.x; \ - lhs.y op rhs.y; \ - lhs.z op rhs.z; \ - return lhs; \ - } - -#define DECLOP_3VAR_PREOP(type, op) \ - __device__ __host__ static inline type& operator op(type& val) { \ - op val.x; \ - op val.y; \ - op val.z; \ - return val; \ - } - -#define DECLOP_3VAR_POSTOP(type, op) \ - __device__ __host__ static inline type operator op(type& val, int) { \ - type ret; \ - ret.x = val.x; \ - ret.y = val.y; \ - ret.z = val.z; \ - val.x op; \ - val.y op; \ - val.z op; \ - return ret; \ - } - -#define DECLOP_3VAR_COMP(type, op) \ - __device__ __host__ static inline bool operator op(type& lhs, type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z); \ - } \ - __device__ __host__ static inline bool operator op(const type& lhs, type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z); \ - } \ - __device__ __host__ static inline bool operator op(type& lhs, const type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z); \ - } \ - __device__ __host__ static inline bool operator op(const type& lhs, const type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z); \ - } - -#define DECLOP_3VAR_1IN_1OUT(type, op) \ - __device__ __host__ static inline type operator op(type& rhs) { \ - type ret; \ - ret.x = op rhs.x; \ - ret.y = op rhs.y; \ - ret.z = op rhs.z; \ - return ret; \ - } - -#define DECLOP_3VAR_1IN_BOOLOUT(type, op) \ - __device__ __host__ static inline bool operator op(type& rhs) { \ - return (op rhs.x) && (op rhs.y) && (op rhs.z); \ - } - - -/* - Four Element Access -*/ - -#define DECLOP_4VAR_2IN_1OUT(type, op) \ - __device__ __host__ static inline type operator op(const type& lhs, const type& rhs) { \ - type ret; \ - ret.x = lhs.x op rhs.x; \ - ret.y = lhs.y op rhs.y; \ - ret.z = lhs.z op rhs.z; \ - ret.w = lhs.w op rhs.w; \ - return ret; \ - } - -#define DECLOP_4VAR_SCALE_PRODUCT(type, type1) \ - __device__ __host__ static inline type operator*(const type& lhs, type1 rhs) { \ - type ret; \ - ret.x = lhs.x * rhs; \ - ret.y = lhs.y * rhs; \ - ret.z = lhs.z * rhs; \ - ret.w = lhs.w * rhs; \ - return ret; \ - } \ - \ - __device__ __host__ static inline type operator*(type1 lhs, const type& rhs) { \ - type ret; \ - ret.x = lhs * rhs.x; \ - ret.y = lhs * rhs.y; \ - ret.z = lhs * rhs.z; \ - ret.w = lhs * rhs.w; \ - return ret; \ - } - -#define DECLOP_4VAR_ASSIGN(type, op) \ - __device__ __host__ static inline type& operator op(type& lhs, const type& rhs) { \ - lhs.x op rhs.x; \ - lhs.y op rhs.y; \ - lhs.z op rhs.z; \ - lhs.w op rhs.w; \ - return lhs; \ - } - -#define DECLOP_4VAR_PREOP(type, op) \ - __device__ __host__ static inline type& operator op(type& val) { \ - op val.x; \ - op val.y; \ - op val.z; \ - op val.w; \ - return val; \ - } - -#define DECLOP_4VAR_POSTOP(type, op) \ - __device__ __host__ static inline type operator op(type& val, int) { \ - type ret; \ - ret.x = val.x; \ - ret.y = val.y; \ - ret.z = val.z; \ - ret.w = val.w; \ - val.x op; \ - val.y op; \ - val.z op; \ - val.w op; \ - return ret; \ - } - -#define DECLOP_4VAR_COMP(type, op) \ - __device__ __host__ static inline bool operator op(type& lhs, type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z) && (lhs.w op rhs.w); \ - } \ - __device__ __host__ static inline bool operator op(const type& lhs, type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z) && (lhs.w op rhs.w); \ - } \ - __device__ __host__ static inline bool operator op(type& lhs, const type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z) && (lhs.w op rhs.w); \ - } \ - __device__ __host__ static inline bool operator op(const type& lhs, const type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z) && (lhs.w op rhs.w); \ - } - -#define DECLOP_4VAR_1IN_1OUT(type, op) \ - __device__ __host__ static inline type operator op(type& rhs) { \ - type ret; \ - ret.x = op rhs.x; \ - ret.y = op rhs.y; \ - ret.z = op rhs.z; \ - ret.w = op rhs.w; \ - return ret; \ - } - -#define DECLOP_4VAR_1IN_BOOLOUT(type, op) \ - __device__ __host__ static inline bool operator op(type& rhs) { \ - return (op rhs.x) && (op rhs.y) && (op rhs.z) && (op rhs.w); \ - } - - -/* -Overloading operators -*/ - -// UNSIGNED CHAR1 - -DECLOP_1VAR_2IN_1OUT(uchar1, +) -DECLOP_1VAR_2IN_1OUT(uchar1, -) -DECLOP_1VAR_2IN_1OUT(uchar1, *) -DECLOP_1VAR_2IN_1OUT(uchar1, /) -DECLOP_1VAR_2IN_1OUT(uchar1, %) -DECLOP_1VAR_2IN_1OUT(uchar1, &) -DECLOP_1VAR_2IN_1OUT(uchar1, |) -DECLOP_1VAR_2IN_1OUT(uchar1, ^) -DECLOP_1VAR_2IN_1OUT(uchar1, <<) -DECLOP_1VAR_2IN_1OUT(uchar1, >>) - - -DECLOP_1VAR_ASSIGN(uchar1, +=) -DECLOP_1VAR_ASSIGN(uchar1, -=) -DECLOP_1VAR_ASSIGN(uchar1, *=) -DECLOP_1VAR_ASSIGN(uchar1, /=) -DECLOP_1VAR_ASSIGN(uchar1, %=) -DECLOP_1VAR_ASSIGN(uchar1, &=) -DECLOP_1VAR_ASSIGN(uchar1, |=) -DECLOP_1VAR_ASSIGN(uchar1, ^=) -DECLOP_1VAR_ASSIGN(uchar1, <<=) -DECLOP_1VAR_ASSIGN(uchar1, >>=) - -DECLOP_1VAR_PREOP(uchar1, ++) -DECLOP_1VAR_PREOP(uchar1, --) - -DECLOP_1VAR_POSTOP(uchar1, ++) -DECLOP_1VAR_POSTOP(uchar1, --) - -DECLOP_1VAR_COMP(uchar1, ==) -DECLOP_1VAR_COMP(uchar1, !=) -DECLOP_1VAR_COMP(uchar1, <) -DECLOP_1VAR_COMP(uchar1, >) -DECLOP_1VAR_COMP(uchar1, <=) -DECLOP_1VAR_COMP(uchar1, >=) - -DECLOP_1VAR_COMP(uchar1, &&) -DECLOP_1VAR_COMP(uchar1, ||) - -DECLOP_1VAR_1IN_1OUT(uchar1, ~) -DECLOP_1VAR_1IN_BOOLOUT(uchar1, !) - -DECLOP_1VAR_SCALE_PRODUCT(uchar1, unsigned char) -DECLOP_1VAR_SCALE_PRODUCT(uchar1, signed char) -DECLOP_1VAR_SCALE_PRODUCT(uchar1, unsigned short) -DECLOP_1VAR_SCALE_PRODUCT(uchar1, signed short) -DECLOP_1VAR_SCALE_PRODUCT(uchar1, unsigned int) -DECLOP_1VAR_SCALE_PRODUCT(uchar1, signed int) -DECLOP_1VAR_SCALE_PRODUCT(uchar1, float) -DECLOP_1VAR_SCALE_PRODUCT(uchar1, unsigned long) -DECLOP_1VAR_SCALE_PRODUCT(uchar1, signed long) -DECLOP_1VAR_SCALE_PRODUCT(uchar1, double) -DECLOP_1VAR_SCALE_PRODUCT(uchar1, unsigned long long) -DECLOP_1VAR_SCALE_PRODUCT(uchar1, signed long long) - -// UNSIGNED CHAR2 - -DECLOP_2VAR_2IN_1OUT(uchar2, +) -DECLOP_2VAR_2IN_1OUT(uchar2, -) -DECLOP_2VAR_2IN_1OUT(uchar2, *) -DECLOP_2VAR_2IN_1OUT(uchar2, /) -DECLOP_2VAR_2IN_1OUT(uchar2, %) -DECLOP_2VAR_2IN_1OUT(uchar2, &) -DECLOP_2VAR_2IN_1OUT(uchar2, |) -DECLOP_2VAR_2IN_1OUT(uchar2, ^) -DECLOP_2VAR_2IN_1OUT(uchar2, <<) -DECLOP_2VAR_2IN_1OUT(uchar2, >>) - -DECLOP_2VAR_ASSIGN(uchar2, +=) -DECLOP_2VAR_ASSIGN(uchar2, -=) -DECLOP_2VAR_ASSIGN(uchar2, *=) -DECLOP_2VAR_ASSIGN(uchar2, /=) -DECLOP_2VAR_ASSIGN(uchar2, %=) -DECLOP_2VAR_ASSIGN(uchar2, &=) -DECLOP_2VAR_ASSIGN(uchar2, |=) -DECLOP_2VAR_ASSIGN(uchar2, ^=) -DECLOP_2VAR_ASSIGN(uchar2, <<=) -DECLOP_2VAR_ASSIGN(uchar2, >>=) - -DECLOP_2VAR_PREOP(uchar2, ++) -DECLOP_2VAR_PREOP(uchar2, --) - -DECLOP_2VAR_POSTOP(uchar2, ++) -DECLOP_2VAR_POSTOP(uchar2, --) - -DECLOP_2VAR_COMP(uchar2, ==) -DECLOP_2VAR_COMP(uchar2, !=) -DECLOP_2VAR_COMP(uchar2, <) -DECLOP_2VAR_COMP(uchar2, >) -DECLOP_2VAR_COMP(uchar2, <=) -DECLOP_2VAR_COMP(uchar2, >=) - -DECLOP_2VAR_COMP(uchar2, &&) -DECLOP_2VAR_COMP(uchar2, ||) - -DECLOP_2VAR_1IN_1OUT(uchar2, ~) -DECLOP_2VAR_1IN_BOOLOUT(uchar2, !) - -DECLOP_2VAR_SCALE_PRODUCT(uchar2, unsigned char) -DECLOP_2VAR_SCALE_PRODUCT(uchar2, signed char) -DECLOP_2VAR_SCALE_PRODUCT(uchar2, unsigned short) -DECLOP_2VAR_SCALE_PRODUCT(uchar2, signed short) -DECLOP_2VAR_SCALE_PRODUCT(uchar2, unsigned int) -DECLOP_2VAR_SCALE_PRODUCT(uchar2, signed int) -DECLOP_2VAR_SCALE_PRODUCT(uchar2, float) -DECLOP_2VAR_SCALE_PRODUCT(uchar2, unsigned long) -DECLOP_2VAR_SCALE_PRODUCT(uchar2, signed long) -DECLOP_2VAR_SCALE_PRODUCT(uchar2, double) -DECLOP_2VAR_SCALE_PRODUCT(uchar2, unsigned long long) -DECLOP_2VAR_SCALE_PRODUCT(uchar2, signed long long) - -// UNSIGNED CHAR3 - -DECLOP_3VAR_2IN_1OUT(uchar3, +) -DECLOP_3VAR_2IN_1OUT(uchar3, -) -DECLOP_3VAR_2IN_1OUT(uchar3, *) -DECLOP_3VAR_2IN_1OUT(uchar3, /) -DECLOP_3VAR_2IN_1OUT(uchar3, %) -DECLOP_3VAR_2IN_1OUT(uchar3, &) -DECLOP_3VAR_2IN_1OUT(uchar3, |) -DECLOP_3VAR_2IN_1OUT(uchar3, ^) -DECLOP_3VAR_2IN_1OUT(uchar3, <<) -DECLOP_3VAR_2IN_1OUT(uchar3, >>) - -DECLOP_3VAR_ASSIGN(uchar3, +=) -DECLOP_3VAR_ASSIGN(uchar3, -=) -DECLOP_3VAR_ASSIGN(uchar3, *=) -DECLOP_3VAR_ASSIGN(uchar3, /=) -DECLOP_3VAR_ASSIGN(uchar3, %=) -DECLOP_3VAR_ASSIGN(uchar3, &=) -DECLOP_3VAR_ASSIGN(uchar3, |=) -DECLOP_3VAR_ASSIGN(uchar3, ^=) -DECLOP_3VAR_ASSIGN(uchar3, <<=) -DECLOP_3VAR_ASSIGN(uchar3, >>=) - -DECLOP_3VAR_PREOP(uchar3, ++) -DECLOP_3VAR_PREOP(uchar3, --) - -DECLOP_3VAR_POSTOP(uchar3, ++) -DECLOP_3VAR_POSTOP(uchar3, --) - -DECLOP_3VAR_COMP(uchar3, ==) -DECLOP_3VAR_COMP(uchar3, !=) -DECLOP_3VAR_COMP(uchar3, <) -DECLOP_3VAR_COMP(uchar3, >) -DECLOP_3VAR_COMP(uchar3, <=) -DECLOP_3VAR_COMP(uchar3, >=) - -DECLOP_3VAR_COMP(uchar3, &&) -DECLOP_3VAR_COMP(uchar3, ||) - -DECLOP_3VAR_1IN_1OUT(uchar3, ~) -DECLOP_3VAR_1IN_BOOLOUT(uchar3, !) - -DECLOP_3VAR_SCALE_PRODUCT(uchar3, unsigned char) -DECLOP_3VAR_SCALE_PRODUCT(uchar3, signed char) -DECLOP_3VAR_SCALE_PRODUCT(uchar3, unsigned short) -DECLOP_3VAR_SCALE_PRODUCT(uchar3, signed short) -DECLOP_3VAR_SCALE_PRODUCT(uchar3, unsigned int) -DECLOP_3VAR_SCALE_PRODUCT(uchar3, signed int) -DECLOP_3VAR_SCALE_PRODUCT(uchar3, float) -DECLOP_3VAR_SCALE_PRODUCT(uchar3, unsigned long) -DECLOP_3VAR_SCALE_PRODUCT(uchar3, signed long) -DECLOP_3VAR_SCALE_PRODUCT(uchar3, double) -DECLOP_3VAR_SCALE_PRODUCT(uchar3, unsigned long long) -DECLOP_3VAR_SCALE_PRODUCT(uchar3, signed long long) - -// UNSIGNED CHAR4 - -DECLOP_4VAR_2IN_1OUT(uchar4, +) -DECLOP_4VAR_2IN_1OUT(uchar4, -) -DECLOP_4VAR_2IN_1OUT(uchar4, *) -DECLOP_4VAR_2IN_1OUT(uchar4, /) -DECLOP_4VAR_2IN_1OUT(uchar4, %) -DECLOP_4VAR_2IN_1OUT(uchar4, &) -DECLOP_4VAR_2IN_1OUT(uchar4, |) -DECLOP_4VAR_2IN_1OUT(uchar4, ^) -DECLOP_4VAR_2IN_1OUT(uchar4, <<) -DECLOP_4VAR_2IN_1OUT(uchar4, >>) - -DECLOP_4VAR_ASSIGN(uchar4, +=) -DECLOP_4VAR_ASSIGN(uchar4, -=) -DECLOP_4VAR_ASSIGN(uchar4, *=) -DECLOP_4VAR_ASSIGN(uchar4, /=) -DECLOP_4VAR_ASSIGN(uchar4, %=) -DECLOP_4VAR_ASSIGN(uchar4, &=) -DECLOP_4VAR_ASSIGN(uchar4, |=) -DECLOP_4VAR_ASSIGN(uchar4, ^=) -DECLOP_4VAR_ASSIGN(uchar4, <<=) -DECLOP_4VAR_ASSIGN(uchar4, >>=) - -DECLOP_4VAR_PREOP(uchar4, ++) -DECLOP_4VAR_PREOP(uchar4, --) - -DECLOP_4VAR_POSTOP(uchar4, ++) -DECLOP_4VAR_POSTOP(uchar4, --) - -DECLOP_4VAR_COMP(uchar4, ==) -DECLOP_4VAR_COMP(uchar4, !=) -DECLOP_4VAR_COMP(uchar4, <) -DECLOP_4VAR_COMP(uchar4, >) -DECLOP_4VAR_COMP(uchar4, <=) -DECLOP_4VAR_COMP(uchar4, >=) - -DECLOP_4VAR_COMP(uchar4, &&) -DECLOP_4VAR_COMP(uchar4, ||) - -DECLOP_4VAR_1IN_1OUT(uchar4, ~) -DECLOP_4VAR_1IN_BOOLOUT(uchar4, !) - -DECLOP_4VAR_SCALE_PRODUCT(uchar4, unsigned char) -DECLOP_4VAR_SCALE_PRODUCT(uchar4, signed char) -DECLOP_4VAR_SCALE_PRODUCT(uchar4, unsigned short) -DECLOP_4VAR_SCALE_PRODUCT(uchar4, signed short) -DECLOP_4VAR_SCALE_PRODUCT(uchar4, unsigned int) -DECLOP_4VAR_SCALE_PRODUCT(uchar4, signed int) -DECLOP_4VAR_SCALE_PRODUCT(uchar4, float) -DECLOP_4VAR_SCALE_PRODUCT(uchar4, unsigned long) -DECLOP_4VAR_SCALE_PRODUCT(uchar4, signed long) -DECLOP_4VAR_SCALE_PRODUCT(uchar4, double) -DECLOP_4VAR_SCALE_PRODUCT(uchar4, unsigned long long) -DECLOP_4VAR_SCALE_PRODUCT(uchar4, signed long long) - -// SIGNED CHAR1 - -DECLOP_1VAR_2IN_1OUT(char1, +) -DECLOP_1VAR_2IN_1OUT(char1, -) -DECLOP_1VAR_2IN_1OUT(char1, *) -DECLOP_1VAR_2IN_1OUT(char1, /) -DECLOP_1VAR_2IN_1OUT(char1, %) -DECLOP_1VAR_2IN_1OUT(char1, &) -DECLOP_1VAR_2IN_1OUT(char1, |) -DECLOP_1VAR_2IN_1OUT(char1, ^) -DECLOP_1VAR_2IN_1OUT(char1, <<) -DECLOP_1VAR_2IN_1OUT(char1, >>) - - -DECLOP_1VAR_ASSIGN(char1, +=) -DECLOP_1VAR_ASSIGN(char1, -=) -DECLOP_1VAR_ASSIGN(char1, *=) -DECLOP_1VAR_ASSIGN(char1, /=) -DECLOP_1VAR_ASSIGN(char1, %=) -DECLOP_1VAR_ASSIGN(char1, &=) -DECLOP_1VAR_ASSIGN(char1, |=) -DECLOP_1VAR_ASSIGN(char1, ^=) -DECLOP_1VAR_ASSIGN(char1, <<=) -DECLOP_1VAR_ASSIGN(char1, >>=) - -DECLOP_1VAR_PREOP(char1, ++) -DECLOP_1VAR_PREOP(char1, --) - -DECLOP_1VAR_POSTOP(char1, ++) -DECLOP_1VAR_POSTOP(char1, --) - -DECLOP_1VAR_COMP(char1, ==) -DECLOP_1VAR_COMP(char1, !=) -DECLOP_1VAR_COMP(char1, <) -DECLOP_1VAR_COMP(char1, >) -DECLOP_1VAR_COMP(char1, <=) -DECLOP_1VAR_COMP(char1, >=) - -DECLOP_1VAR_COMP(char1, &&) -DECLOP_1VAR_COMP(char1, ||) - -DECLOP_1VAR_1IN_1OUT(char1, ~) -DECLOP_1VAR_1IN_BOOLOUT(char1, !) - -DECLOP_1VAR_SCALE_PRODUCT(char1, unsigned char) -DECLOP_1VAR_SCALE_PRODUCT(char1, signed char) -DECLOP_1VAR_SCALE_PRODUCT(char1, unsigned short) -DECLOP_1VAR_SCALE_PRODUCT(char1, signed short) -DECLOP_1VAR_SCALE_PRODUCT(char1, unsigned int) -DECLOP_1VAR_SCALE_PRODUCT(char1, signed int) -DECLOP_1VAR_SCALE_PRODUCT(char1, float) -DECLOP_1VAR_SCALE_PRODUCT(char1, unsigned long) -DECLOP_1VAR_SCALE_PRODUCT(char1, signed long) -DECLOP_1VAR_SCALE_PRODUCT(char1, double) -DECLOP_1VAR_SCALE_PRODUCT(char1, unsigned long long) -DECLOP_1VAR_SCALE_PRODUCT(char1, signed long long) - -// SIGNED CHAR2 - -DECLOP_2VAR_2IN_1OUT(char2, +) -DECLOP_2VAR_2IN_1OUT(char2, -) -DECLOP_2VAR_2IN_1OUT(char2, *) -DECLOP_2VAR_2IN_1OUT(char2, /) -DECLOP_2VAR_2IN_1OUT(char2, %) -DECLOP_2VAR_2IN_1OUT(char2, &) -DECLOP_2VAR_2IN_1OUT(char2, |) -DECLOP_2VAR_2IN_1OUT(char2, ^) -DECLOP_2VAR_2IN_1OUT(char2, <<) -DECLOP_2VAR_2IN_1OUT(char2, >>) - -DECLOP_2VAR_ASSIGN(char2, +=) -DECLOP_2VAR_ASSIGN(char2, -=) -DECLOP_2VAR_ASSIGN(char2, *=) -DECLOP_2VAR_ASSIGN(char2, /=) -DECLOP_2VAR_ASSIGN(char2, %=) -DECLOP_2VAR_ASSIGN(char2, &=) -DECLOP_2VAR_ASSIGN(char2, |=) -DECLOP_2VAR_ASSIGN(char2, ^=) -DECLOP_2VAR_ASSIGN(char2, <<=) -DECLOP_2VAR_ASSIGN(char2, >>=) - -DECLOP_2VAR_PREOP(char2, ++) -DECLOP_2VAR_PREOP(char2, --) - -DECLOP_2VAR_POSTOP(char2, ++) -DECLOP_2VAR_POSTOP(char2, --) - -DECLOP_2VAR_COMP(char2, ==) -DECLOP_2VAR_COMP(char2, !=) -DECLOP_2VAR_COMP(char2, <) -DECLOP_2VAR_COMP(char2, >) -DECLOP_2VAR_COMP(char2, <=) -DECLOP_2VAR_COMP(char2, >=) - -DECLOP_2VAR_COMP(char2, &&) -DECLOP_2VAR_COMP(char2, ||) - -DECLOP_2VAR_1IN_1OUT(char2, ~) -DECLOP_2VAR_1IN_BOOLOUT(char2, !) - -DECLOP_2VAR_SCALE_PRODUCT(char2, unsigned char) -DECLOP_2VAR_SCALE_PRODUCT(char2, signed char) -DECLOP_2VAR_SCALE_PRODUCT(char2, unsigned short) -DECLOP_2VAR_SCALE_PRODUCT(char2, signed short) -DECLOP_2VAR_SCALE_PRODUCT(char2, unsigned int) -DECLOP_2VAR_SCALE_PRODUCT(char2, signed int) -DECLOP_2VAR_SCALE_PRODUCT(char2, float) -DECLOP_2VAR_SCALE_PRODUCT(char2, unsigned long) -DECLOP_2VAR_SCALE_PRODUCT(char2, signed long) -DECLOP_2VAR_SCALE_PRODUCT(char2, double) -DECLOP_2VAR_SCALE_PRODUCT(char2, unsigned long long) -DECLOP_2VAR_SCALE_PRODUCT(char2, signed long long) - -// SIGNED CHAR3 - -DECLOP_3VAR_2IN_1OUT(char3, +) -DECLOP_3VAR_2IN_1OUT(char3, -) -DECLOP_3VAR_2IN_1OUT(char3, *) -DECLOP_3VAR_2IN_1OUT(char3, /) -DECLOP_3VAR_2IN_1OUT(char3, %) -DECLOP_3VAR_2IN_1OUT(char3, &) -DECLOP_3VAR_2IN_1OUT(char3, |) -DECLOP_3VAR_2IN_1OUT(char3, ^) -DECLOP_3VAR_2IN_1OUT(char3, <<) -DECLOP_3VAR_2IN_1OUT(char3, >>) - -DECLOP_3VAR_ASSIGN(char3, +=) -DECLOP_3VAR_ASSIGN(char3, -=) -DECLOP_3VAR_ASSIGN(char3, *=) -DECLOP_3VAR_ASSIGN(char3, /=) -DECLOP_3VAR_ASSIGN(char3, %=) -DECLOP_3VAR_ASSIGN(char3, &=) -DECLOP_3VAR_ASSIGN(char3, |=) -DECLOP_3VAR_ASSIGN(char3, ^=) -DECLOP_3VAR_ASSIGN(char3, <<=) -DECLOP_3VAR_ASSIGN(char3, >>=) - -DECLOP_3VAR_PREOP(char3, ++) -DECLOP_3VAR_PREOP(char3, --) - -DECLOP_3VAR_POSTOP(char3, ++) -DECLOP_3VAR_POSTOP(char3, --) - -DECLOP_3VAR_COMP(char3, ==) -DECLOP_3VAR_COMP(char3, !=) -DECLOP_3VAR_COMP(char3, <) -DECLOP_3VAR_COMP(char3, >) -DECLOP_3VAR_COMP(char3, <=) -DECLOP_3VAR_COMP(char3, >=) - -DECLOP_3VAR_COMP(char3, &&) -DECLOP_3VAR_COMP(char3, ||) - -DECLOP_3VAR_1IN_1OUT(char3, ~) -DECLOP_3VAR_1IN_BOOLOUT(char3, !) - -DECLOP_3VAR_SCALE_PRODUCT(char3, unsigned char) -DECLOP_3VAR_SCALE_PRODUCT(char3, signed char) -DECLOP_3VAR_SCALE_PRODUCT(char3, unsigned short) -DECLOP_3VAR_SCALE_PRODUCT(char3, signed short) -DECLOP_3VAR_SCALE_PRODUCT(char3, unsigned int) -DECLOP_3VAR_SCALE_PRODUCT(char3, signed int) -DECLOP_3VAR_SCALE_PRODUCT(char3, float) -DECLOP_3VAR_SCALE_PRODUCT(char3, unsigned long) -DECLOP_3VAR_SCALE_PRODUCT(char3, signed long) -DECLOP_3VAR_SCALE_PRODUCT(char3, double) -DECLOP_3VAR_SCALE_PRODUCT(char3, unsigned long long) -DECLOP_3VAR_SCALE_PRODUCT(char3, signed long long) - -// SIGNED CHAR4 - -DECLOP_4VAR_2IN_1OUT(char4, +) -DECLOP_4VAR_2IN_1OUT(char4, -) -DECLOP_4VAR_2IN_1OUT(char4, *) -DECLOP_4VAR_2IN_1OUT(char4, /) -DECLOP_4VAR_2IN_1OUT(char4, %) -DECLOP_4VAR_2IN_1OUT(char4, &) -DECLOP_4VAR_2IN_1OUT(char4, |) -DECLOP_4VAR_2IN_1OUT(char4, ^) -DECLOP_4VAR_2IN_1OUT(char4, <<) -DECLOP_4VAR_2IN_1OUT(char4, >>) - -DECLOP_4VAR_ASSIGN(char4, +=) -DECLOP_4VAR_ASSIGN(char4, -=) -DECLOP_4VAR_ASSIGN(char4, *=) -DECLOP_4VAR_ASSIGN(char4, /=) -DECLOP_4VAR_ASSIGN(char4, %=) -DECLOP_4VAR_ASSIGN(char4, &=) -DECLOP_4VAR_ASSIGN(char4, |=) -DECLOP_4VAR_ASSIGN(char4, ^=) -DECLOP_4VAR_ASSIGN(char4, <<=) -DECLOP_4VAR_ASSIGN(char4, >>=) - -DECLOP_4VAR_PREOP(char4, ++) -DECLOP_4VAR_PREOP(char4, --) - -DECLOP_4VAR_POSTOP(char4, ++) -DECLOP_4VAR_POSTOP(char4, --) - -DECLOP_4VAR_COMP(char4, ==) -DECLOP_4VAR_COMP(char4, !=) -DECLOP_4VAR_COMP(char4, <) -DECLOP_4VAR_COMP(char4, >) -DECLOP_4VAR_COMP(char4, <=) -DECLOP_4VAR_COMP(char4, >=) - -DECLOP_4VAR_COMP(char4, &&) -DECLOP_4VAR_COMP(char4, ||) - -DECLOP_4VAR_1IN_1OUT(char4, ~) -DECLOP_4VAR_1IN_BOOLOUT(char4, !) - -DECLOP_4VAR_SCALE_PRODUCT(char4, unsigned char) -DECLOP_4VAR_SCALE_PRODUCT(char4, signed char) -DECLOP_4VAR_SCALE_PRODUCT(char4, unsigned short) -DECLOP_4VAR_SCALE_PRODUCT(char4, signed short) -DECLOP_4VAR_SCALE_PRODUCT(char4, unsigned int) -DECLOP_4VAR_SCALE_PRODUCT(char4, signed int) -DECLOP_4VAR_SCALE_PRODUCT(char4, float) -DECLOP_4VAR_SCALE_PRODUCT(char4, unsigned long) -DECLOP_4VAR_SCALE_PRODUCT(char4, signed long) -DECLOP_4VAR_SCALE_PRODUCT(char4, double) -DECLOP_4VAR_SCALE_PRODUCT(char4, unsigned long long) -DECLOP_4VAR_SCALE_PRODUCT(char4, signed long long) - -// UNSIGNED SHORT1 - -DECLOP_1VAR_2IN_1OUT(ushort1, +) -DECLOP_1VAR_2IN_1OUT(ushort1, -) -DECLOP_1VAR_2IN_1OUT(ushort1, *) -DECLOP_1VAR_2IN_1OUT(ushort1, /) -DECLOP_1VAR_2IN_1OUT(ushort1, %) -DECLOP_1VAR_2IN_1OUT(ushort1, &) -DECLOP_1VAR_2IN_1OUT(ushort1, |) -DECLOP_1VAR_2IN_1OUT(ushort1, ^) -DECLOP_1VAR_2IN_1OUT(ushort1, <<) -DECLOP_1VAR_2IN_1OUT(ushort1, >>) - - -DECLOP_1VAR_ASSIGN(ushort1, +=) -DECLOP_1VAR_ASSIGN(ushort1, -=) -DECLOP_1VAR_ASSIGN(ushort1, *=) -DECLOP_1VAR_ASSIGN(ushort1, /=) -DECLOP_1VAR_ASSIGN(ushort1, %=) -DECLOP_1VAR_ASSIGN(ushort1, &=) -DECLOP_1VAR_ASSIGN(ushort1, |=) -DECLOP_1VAR_ASSIGN(ushort1, ^=) -DECLOP_1VAR_ASSIGN(ushort1, <<=) -DECLOP_1VAR_ASSIGN(ushort1, >>=) - -DECLOP_1VAR_PREOP(ushort1, ++) -DECLOP_1VAR_PREOP(ushort1, --) - -DECLOP_1VAR_POSTOP(ushort1, ++) -DECLOP_1VAR_POSTOP(ushort1, --) - -DECLOP_1VAR_COMP(ushort1, ==) -DECLOP_1VAR_COMP(ushort1, !=) -DECLOP_1VAR_COMP(ushort1, <) -DECLOP_1VAR_COMP(ushort1, >) -DECLOP_1VAR_COMP(ushort1, <=) -DECLOP_1VAR_COMP(ushort1, >=) - -DECLOP_1VAR_COMP(ushort1, &&) -DECLOP_1VAR_COMP(ushort1, ||) - -DECLOP_1VAR_1IN_1OUT(ushort1, ~) -DECLOP_1VAR_1IN_BOOLOUT(ushort1, !) - -DECLOP_1VAR_SCALE_PRODUCT(ushort1, unsigned char) -DECLOP_1VAR_SCALE_PRODUCT(ushort1, signed char) -DECLOP_1VAR_SCALE_PRODUCT(ushort1, unsigned short) -DECLOP_1VAR_SCALE_PRODUCT(ushort1, signed short) -DECLOP_1VAR_SCALE_PRODUCT(ushort1, unsigned int) -DECLOP_1VAR_SCALE_PRODUCT(ushort1, signed int) -DECLOP_1VAR_SCALE_PRODUCT(ushort1, float) -DECLOP_1VAR_SCALE_PRODUCT(ushort1, unsigned long) -DECLOP_1VAR_SCALE_PRODUCT(ushort1, signed long) -DECLOP_1VAR_SCALE_PRODUCT(ushort1, double) -DECLOP_1VAR_SCALE_PRODUCT(ushort1, unsigned long long) -DECLOP_1VAR_SCALE_PRODUCT(ushort1, signed long long) - -// UNSIGNED SHORT2 - -DECLOP_2VAR_2IN_1OUT(ushort2, +) -DECLOP_2VAR_2IN_1OUT(ushort2, -) -DECLOP_2VAR_2IN_1OUT(ushort2, *) -DECLOP_2VAR_2IN_1OUT(ushort2, /) -DECLOP_2VAR_2IN_1OUT(ushort2, %) -DECLOP_2VAR_2IN_1OUT(ushort2, &) -DECLOP_2VAR_2IN_1OUT(ushort2, |) -DECLOP_2VAR_2IN_1OUT(ushort2, ^) -DECLOP_2VAR_2IN_1OUT(ushort2, <<) -DECLOP_2VAR_2IN_1OUT(ushort2, >>) - -DECLOP_2VAR_ASSIGN(ushort2, +=) -DECLOP_2VAR_ASSIGN(ushort2, -=) -DECLOP_2VAR_ASSIGN(ushort2, *=) -DECLOP_2VAR_ASSIGN(ushort2, /=) -DECLOP_2VAR_ASSIGN(ushort2, %=) -DECLOP_2VAR_ASSIGN(ushort2, &=) -DECLOP_2VAR_ASSIGN(ushort2, |=) -DECLOP_2VAR_ASSIGN(ushort2, ^=) -DECLOP_2VAR_ASSIGN(ushort2, <<=) -DECLOP_2VAR_ASSIGN(ushort2, >>=) - -DECLOP_2VAR_PREOP(ushort2, ++) -DECLOP_2VAR_PREOP(ushort2, --) - -DECLOP_2VAR_POSTOP(ushort2, ++) -DECLOP_2VAR_POSTOP(ushort2, --) - -DECLOP_2VAR_COMP(ushort2, ==) -DECLOP_2VAR_COMP(ushort2, !=) -DECLOP_2VAR_COMP(ushort2, <) -DECLOP_2VAR_COMP(ushort2, >) -DECLOP_2VAR_COMP(ushort2, <=) -DECLOP_2VAR_COMP(ushort2, >=) - -DECLOP_2VAR_COMP(ushort2, &&) -DECLOP_2VAR_COMP(ushort2, ||) - -DECLOP_2VAR_1IN_1OUT(ushort2, ~) -DECLOP_2VAR_1IN_BOOLOUT(ushort2, !) - -DECLOP_2VAR_SCALE_PRODUCT(ushort2, unsigned char) -DECLOP_2VAR_SCALE_PRODUCT(ushort2, signed char) -DECLOP_2VAR_SCALE_PRODUCT(ushort2, unsigned short) -DECLOP_2VAR_SCALE_PRODUCT(ushort2, signed short) -DECLOP_2VAR_SCALE_PRODUCT(ushort2, unsigned int) -DECLOP_2VAR_SCALE_PRODUCT(ushort2, signed int) -DECLOP_2VAR_SCALE_PRODUCT(ushort2, float) -DECLOP_2VAR_SCALE_PRODUCT(ushort2, unsigned long) -DECLOP_2VAR_SCALE_PRODUCT(ushort2, signed long) -DECLOP_2VAR_SCALE_PRODUCT(ushort2, double) -DECLOP_2VAR_SCALE_PRODUCT(ushort2, unsigned long long) -DECLOP_2VAR_SCALE_PRODUCT(ushort2, signed long long) - -// UNSIGNED SHORT3 - -DECLOP_3VAR_2IN_1OUT(ushort3, +) -DECLOP_3VAR_2IN_1OUT(ushort3, -) -DECLOP_3VAR_2IN_1OUT(ushort3, *) -DECLOP_3VAR_2IN_1OUT(ushort3, /) -DECLOP_3VAR_2IN_1OUT(ushort3, %) -DECLOP_3VAR_2IN_1OUT(ushort3, &) -DECLOP_3VAR_2IN_1OUT(ushort3, |) -DECLOP_3VAR_2IN_1OUT(ushort3, ^) -DECLOP_3VAR_2IN_1OUT(ushort3, <<) -DECLOP_3VAR_2IN_1OUT(ushort3, >>) - -DECLOP_3VAR_ASSIGN(ushort3, +=) -DECLOP_3VAR_ASSIGN(ushort3, -=) -DECLOP_3VAR_ASSIGN(ushort3, *=) -DECLOP_3VAR_ASSIGN(ushort3, /=) -DECLOP_3VAR_ASSIGN(ushort3, %=) -DECLOP_3VAR_ASSIGN(ushort3, &=) -DECLOP_3VAR_ASSIGN(ushort3, |=) -DECLOP_3VAR_ASSIGN(ushort3, ^=) -DECLOP_3VAR_ASSIGN(ushort3, <<=) -DECLOP_3VAR_ASSIGN(ushort3, >>=) - -DECLOP_3VAR_PREOP(ushort3, ++) -DECLOP_3VAR_PREOP(ushort3, --) - -DECLOP_3VAR_POSTOP(ushort3, ++) -DECLOP_3VAR_POSTOP(ushort3, --) - -DECLOP_3VAR_COMP(ushort3, ==) -DECLOP_3VAR_COMP(ushort3, !=) -DECLOP_3VAR_COMP(ushort3, <) -DECLOP_3VAR_COMP(ushort3, >) -DECLOP_3VAR_COMP(ushort3, <=) -DECLOP_3VAR_COMP(ushort3, >=) - -DECLOP_3VAR_COMP(ushort3, &&) -DECLOP_3VAR_COMP(ushort3, ||) - -DECLOP_3VAR_1IN_1OUT(ushort3, ~) -DECLOP_3VAR_1IN_BOOLOUT(ushort3, !) - -DECLOP_3VAR_SCALE_PRODUCT(ushort3, unsigned char) -DECLOP_3VAR_SCALE_PRODUCT(ushort3, signed char) -DECLOP_3VAR_SCALE_PRODUCT(ushort3, unsigned short) -DECLOP_3VAR_SCALE_PRODUCT(ushort3, signed short) -DECLOP_3VAR_SCALE_PRODUCT(ushort3, unsigned int) -DECLOP_3VAR_SCALE_PRODUCT(ushort3, signed int) -DECLOP_3VAR_SCALE_PRODUCT(ushort3, float) -DECLOP_3VAR_SCALE_PRODUCT(ushort3, unsigned long) -DECLOP_3VAR_SCALE_PRODUCT(ushort3, signed long) -DECLOP_3VAR_SCALE_PRODUCT(ushort3, double) -DECLOP_3VAR_SCALE_PRODUCT(ushort3, unsigned long long) -DECLOP_3VAR_SCALE_PRODUCT(ushort3, signed long long) - -// UNSIGNED SHORT4 - -DECLOP_4VAR_2IN_1OUT(ushort4, +) -DECLOP_4VAR_2IN_1OUT(ushort4, -) -DECLOP_4VAR_2IN_1OUT(ushort4, *) -DECLOP_4VAR_2IN_1OUT(ushort4, /) -DECLOP_4VAR_2IN_1OUT(ushort4, %) -DECLOP_4VAR_2IN_1OUT(ushort4, &) -DECLOP_4VAR_2IN_1OUT(ushort4, |) -DECLOP_4VAR_2IN_1OUT(ushort4, ^) -DECLOP_4VAR_2IN_1OUT(ushort4, <<) -DECLOP_4VAR_2IN_1OUT(ushort4, >>) - -DECLOP_4VAR_ASSIGN(ushort4, +=) -DECLOP_4VAR_ASSIGN(ushort4, -=) -DECLOP_4VAR_ASSIGN(ushort4, *=) -DECLOP_4VAR_ASSIGN(ushort4, /=) -DECLOP_4VAR_ASSIGN(ushort4, %=) -DECLOP_4VAR_ASSIGN(ushort4, &=) -DECLOP_4VAR_ASSIGN(ushort4, |=) -DECLOP_4VAR_ASSIGN(ushort4, ^=) -DECLOP_4VAR_ASSIGN(ushort4, <<=) -DECLOP_4VAR_ASSIGN(ushort4, >>=) - -DECLOP_4VAR_PREOP(ushort4, ++) -DECLOP_4VAR_PREOP(ushort4, --) - -DECLOP_4VAR_POSTOP(ushort4, ++) -DECLOP_4VAR_POSTOP(ushort4, --) - -DECLOP_4VAR_COMP(ushort4, ==) -DECLOP_4VAR_COMP(ushort4, !=) -DECLOP_4VAR_COMP(ushort4, <) -DECLOP_4VAR_COMP(ushort4, >) -DECLOP_4VAR_COMP(ushort4, <=) -DECLOP_4VAR_COMP(ushort4, >=) - -DECLOP_4VAR_COMP(ushort4, &&) -DECLOP_4VAR_COMP(ushort4, ||) - -DECLOP_4VAR_1IN_1OUT(ushort4, ~) -DECLOP_4VAR_1IN_BOOLOUT(ushort4, !) - -DECLOP_4VAR_SCALE_PRODUCT(ushort4, unsigned char) -DECLOP_4VAR_SCALE_PRODUCT(ushort4, signed char) -DECLOP_4VAR_SCALE_PRODUCT(ushort4, unsigned short) -DECLOP_4VAR_SCALE_PRODUCT(ushort4, signed short) -DECLOP_4VAR_SCALE_PRODUCT(ushort4, unsigned int) -DECLOP_4VAR_SCALE_PRODUCT(ushort4, signed int) -DECLOP_4VAR_SCALE_PRODUCT(ushort4, float) -DECLOP_4VAR_SCALE_PRODUCT(ushort4, unsigned long) -DECLOP_4VAR_SCALE_PRODUCT(ushort4, signed long) -DECLOP_4VAR_SCALE_PRODUCT(ushort4, double) -DECLOP_4VAR_SCALE_PRODUCT(ushort4, unsigned long long) -DECLOP_4VAR_SCALE_PRODUCT(ushort4, signed long long) - -// SIGNED SHORT1 - -DECLOP_1VAR_2IN_1OUT(short1, +) -DECLOP_1VAR_2IN_1OUT(short1, -) -DECLOP_1VAR_2IN_1OUT(short1, *) -DECLOP_1VAR_2IN_1OUT(short1, /) -DECLOP_1VAR_2IN_1OUT(short1, %) -DECLOP_1VAR_2IN_1OUT(short1, &) -DECLOP_1VAR_2IN_1OUT(short1, |) -DECLOP_1VAR_2IN_1OUT(short1, ^) -DECLOP_1VAR_2IN_1OUT(short1, <<) -DECLOP_1VAR_2IN_1OUT(short1, >>) - - -DECLOP_1VAR_ASSIGN(short1, +=) -DECLOP_1VAR_ASSIGN(short1, -=) -DECLOP_1VAR_ASSIGN(short1, *=) -DECLOP_1VAR_ASSIGN(short1, /=) -DECLOP_1VAR_ASSIGN(short1, %=) -DECLOP_1VAR_ASSIGN(short1, &=) -DECLOP_1VAR_ASSIGN(short1, |=) -DECLOP_1VAR_ASSIGN(short1, ^=) -DECLOP_1VAR_ASSIGN(short1, <<=) -DECLOP_1VAR_ASSIGN(short1, >>=) - -DECLOP_1VAR_PREOP(short1, ++) -DECLOP_1VAR_PREOP(short1, --) - -DECLOP_1VAR_POSTOP(short1, ++) -DECLOP_1VAR_POSTOP(short1, --) - -DECLOP_1VAR_COMP(short1, ==) -DECLOP_1VAR_COMP(short1, !=) -DECLOP_1VAR_COMP(short1, <) -DECLOP_1VAR_COMP(short1, >) -DECLOP_1VAR_COMP(short1, <=) -DECLOP_1VAR_COMP(short1, >=) - -DECLOP_1VAR_COMP(short1, &&) -DECLOP_1VAR_COMP(short1, ||) - -DECLOP_1VAR_1IN_1OUT(short1, ~) -DECLOP_1VAR_1IN_BOOLOUT(short1, !) - -DECLOP_1VAR_SCALE_PRODUCT(short1, unsigned char) -DECLOP_1VAR_SCALE_PRODUCT(short1, signed char) -DECLOP_1VAR_SCALE_PRODUCT(short1, unsigned short) -DECLOP_1VAR_SCALE_PRODUCT(short1, signed short) -DECLOP_1VAR_SCALE_PRODUCT(short1, unsigned int) -DECLOP_1VAR_SCALE_PRODUCT(short1, signed int) -DECLOP_1VAR_SCALE_PRODUCT(short1, float) -DECLOP_1VAR_SCALE_PRODUCT(short1, unsigned long) -DECLOP_1VAR_SCALE_PRODUCT(short1, signed long) -DECLOP_1VAR_SCALE_PRODUCT(short1, double) -DECLOP_1VAR_SCALE_PRODUCT(short1, unsigned long long) -DECLOP_1VAR_SCALE_PRODUCT(short1, signed long long) - -// SIGNED SHORT2 - -DECLOP_2VAR_2IN_1OUT(short2, +) -DECLOP_2VAR_2IN_1OUT(short2, -) -DECLOP_2VAR_2IN_1OUT(short2, *) -DECLOP_2VAR_2IN_1OUT(short2, /) -DECLOP_2VAR_2IN_1OUT(short2, %) -DECLOP_2VAR_2IN_1OUT(short2, &) -DECLOP_2VAR_2IN_1OUT(short2, |) -DECLOP_2VAR_2IN_1OUT(short2, ^) -DECLOP_2VAR_2IN_1OUT(short2, <<) -DECLOP_2VAR_2IN_1OUT(short2, >>) - -DECLOP_2VAR_ASSIGN(short2, +=) -DECLOP_2VAR_ASSIGN(short2, -=) -DECLOP_2VAR_ASSIGN(short2, *=) -DECLOP_2VAR_ASSIGN(short2, /=) -DECLOP_2VAR_ASSIGN(short2, %=) -DECLOP_2VAR_ASSIGN(short2, &=) -DECLOP_2VAR_ASSIGN(short2, |=) -DECLOP_2VAR_ASSIGN(short2, ^=) -DECLOP_2VAR_ASSIGN(short2, <<=) -DECLOP_2VAR_ASSIGN(short2, >>=) - -DECLOP_2VAR_PREOP(short2, ++) -DECLOP_2VAR_PREOP(short2, --) - -DECLOP_2VAR_POSTOP(short2, ++) -DECLOP_2VAR_POSTOP(short2, --) - -DECLOP_2VAR_COMP(short2, ==) -DECLOP_2VAR_COMP(short2, !=) -DECLOP_2VAR_COMP(short2, <) -DECLOP_2VAR_COMP(short2, >) -DECLOP_2VAR_COMP(short2, <=) -DECLOP_2VAR_COMP(short2, >=) - -DECLOP_2VAR_COMP(short2, &&) -DECLOP_2VAR_COMP(short2, ||) - -DECLOP_2VAR_1IN_1OUT(short2, ~) -DECLOP_2VAR_1IN_BOOLOUT(short2, !) - -DECLOP_2VAR_SCALE_PRODUCT(short2, unsigned char) -DECLOP_2VAR_SCALE_PRODUCT(short2, signed char) -DECLOP_2VAR_SCALE_PRODUCT(short2, unsigned short) -DECLOP_2VAR_SCALE_PRODUCT(short2, signed short) -DECLOP_2VAR_SCALE_PRODUCT(short2, unsigned int) -DECLOP_2VAR_SCALE_PRODUCT(short2, signed int) -DECLOP_2VAR_SCALE_PRODUCT(short2, float) -DECLOP_2VAR_SCALE_PRODUCT(short2, unsigned long) -DECLOP_2VAR_SCALE_PRODUCT(short2, signed long) -DECLOP_2VAR_SCALE_PRODUCT(short2, double) -DECLOP_2VAR_SCALE_PRODUCT(short2, unsigned long long) -DECLOP_2VAR_SCALE_PRODUCT(short2, signed long long) - -// SIGNED SHORT3 - -DECLOP_3VAR_2IN_1OUT(short3, +) -DECLOP_3VAR_2IN_1OUT(short3, -) -DECLOP_3VAR_2IN_1OUT(short3, *) -DECLOP_3VAR_2IN_1OUT(short3, /) -DECLOP_3VAR_2IN_1OUT(short3, %) -DECLOP_3VAR_2IN_1OUT(short3, &) -DECLOP_3VAR_2IN_1OUT(short3, |) -DECLOP_3VAR_2IN_1OUT(short3, ^) -DECLOP_3VAR_2IN_1OUT(short3, <<) -DECLOP_3VAR_2IN_1OUT(short3, >>) - -DECLOP_3VAR_ASSIGN(short3, +=) -DECLOP_3VAR_ASSIGN(short3, -=) -DECLOP_3VAR_ASSIGN(short3, *=) -DECLOP_3VAR_ASSIGN(short3, /=) -DECLOP_3VAR_ASSIGN(short3, %=) -DECLOP_3VAR_ASSIGN(short3, &=) -DECLOP_3VAR_ASSIGN(short3, |=) -DECLOP_3VAR_ASSIGN(short3, ^=) -DECLOP_3VAR_ASSIGN(short3, <<=) -DECLOP_3VAR_ASSIGN(short3, >>=) - -DECLOP_3VAR_PREOP(short3, ++) -DECLOP_3VAR_PREOP(short3, --) - -DECLOP_3VAR_POSTOP(short3, ++) -DECLOP_3VAR_POSTOP(short3, --) - -DECLOP_3VAR_COMP(short3, ==) -DECLOP_3VAR_COMP(short3, !=) -DECLOP_3VAR_COMP(short3, <) -DECLOP_3VAR_COMP(short3, >) -DECLOP_3VAR_COMP(short3, <=) -DECLOP_3VAR_COMP(short3, >=) - -DECLOP_3VAR_COMP(short3, &&) -DECLOP_3VAR_COMP(short3, ||) - -DECLOP_3VAR_1IN_1OUT(short3, ~) -DECLOP_3VAR_1IN_BOOLOUT(short3, !) - -DECLOP_3VAR_SCALE_PRODUCT(short3, unsigned char) -DECLOP_3VAR_SCALE_PRODUCT(short3, signed char) -DECLOP_3VAR_SCALE_PRODUCT(short3, unsigned short) -DECLOP_3VAR_SCALE_PRODUCT(short3, signed short) -DECLOP_3VAR_SCALE_PRODUCT(short3, unsigned int) -DECLOP_3VAR_SCALE_PRODUCT(short3, signed int) -DECLOP_3VAR_SCALE_PRODUCT(short3, float) -DECLOP_3VAR_SCALE_PRODUCT(short3, unsigned long) -DECLOP_3VAR_SCALE_PRODUCT(short3, signed long) -DECLOP_3VAR_SCALE_PRODUCT(short3, double) -DECLOP_3VAR_SCALE_PRODUCT(short3, unsigned long long) -DECLOP_3VAR_SCALE_PRODUCT(short3, signed long long) - -// SIGNED SHORT4 - -DECLOP_4VAR_2IN_1OUT(short4, +) -DECLOP_4VAR_2IN_1OUT(short4, -) -DECLOP_4VAR_2IN_1OUT(short4, *) -DECLOP_4VAR_2IN_1OUT(short4, /) -DECLOP_4VAR_2IN_1OUT(short4, %) -DECLOP_4VAR_2IN_1OUT(short4, &) -DECLOP_4VAR_2IN_1OUT(short4, |) -DECLOP_4VAR_2IN_1OUT(short4, ^) -DECLOP_4VAR_2IN_1OUT(short4, <<) -DECLOP_4VAR_2IN_1OUT(short4, >>) - -DECLOP_4VAR_ASSIGN(short4, +=) -DECLOP_4VAR_ASSIGN(short4, -=) -DECLOP_4VAR_ASSIGN(short4, *=) -DECLOP_4VAR_ASSIGN(short4, /=) -DECLOP_4VAR_ASSIGN(short4, %=) -DECLOP_4VAR_ASSIGN(short4, &=) -DECLOP_4VAR_ASSIGN(short4, |=) -DECLOP_4VAR_ASSIGN(short4, ^=) -DECLOP_4VAR_ASSIGN(short4, <<=) -DECLOP_4VAR_ASSIGN(short4, >>=) - -DECLOP_4VAR_PREOP(short4, ++) -DECLOP_4VAR_PREOP(short4, --) - -DECLOP_4VAR_POSTOP(short4, ++) -DECLOP_4VAR_POSTOP(short4, --) - -DECLOP_4VAR_COMP(short4, ==) -DECLOP_4VAR_COMP(short4, !=) -DECLOP_4VAR_COMP(short4, <) -DECLOP_4VAR_COMP(short4, >) -DECLOP_4VAR_COMP(short4, <=) -DECLOP_4VAR_COMP(short4, >=) - -DECLOP_4VAR_COMP(short4, &&) -DECLOP_4VAR_COMP(short4, ||) - -DECLOP_4VAR_1IN_1OUT(short4, ~) -DECLOP_4VAR_1IN_BOOLOUT(short4, !) - -DECLOP_4VAR_SCALE_PRODUCT(short4, unsigned char) -DECLOP_4VAR_SCALE_PRODUCT(short4, signed char) -DECLOP_4VAR_SCALE_PRODUCT(short4, unsigned short) -DECLOP_4VAR_SCALE_PRODUCT(short4, signed short) -DECLOP_4VAR_SCALE_PRODUCT(short4, unsigned int) -DECLOP_4VAR_SCALE_PRODUCT(short4, signed int) -DECLOP_4VAR_SCALE_PRODUCT(short4, float) -DECLOP_4VAR_SCALE_PRODUCT(short4, unsigned long) -DECLOP_4VAR_SCALE_PRODUCT(short4, signed long) -DECLOP_4VAR_SCALE_PRODUCT(short4, double) -DECLOP_4VAR_SCALE_PRODUCT(short4, unsigned long long) -DECLOP_4VAR_SCALE_PRODUCT(short4, signed long long) - -// UNSIGNED INT1 - -DECLOP_1VAR_2IN_1OUT(uint1, +) -DECLOP_1VAR_2IN_1OUT(uint1, -) -DECLOP_1VAR_2IN_1OUT(uint1, *) -DECLOP_1VAR_2IN_1OUT(uint1, /) -DECLOP_1VAR_2IN_1OUT(uint1, %) -DECLOP_1VAR_2IN_1OUT(uint1, &) -DECLOP_1VAR_2IN_1OUT(uint1, |) -DECLOP_1VAR_2IN_1OUT(uint1, ^) -DECLOP_1VAR_2IN_1OUT(uint1, <<) -DECLOP_1VAR_2IN_1OUT(uint1, >>) - - -DECLOP_1VAR_ASSIGN(uint1, +=) -DECLOP_1VAR_ASSIGN(uint1, -=) -DECLOP_1VAR_ASSIGN(uint1, *=) -DECLOP_1VAR_ASSIGN(uint1, /=) -DECLOP_1VAR_ASSIGN(uint1, %=) -DECLOP_1VAR_ASSIGN(uint1, &=) -DECLOP_1VAR_ASSIGN(uint1, |=) -DECLOP_1VAR_ASSIGN(uint1, ^=) -DECLOP_1VAR_ASSIGN(uint1, <<=) -DECLOP_1VAR_ASSIGN(uint1, >>=) - -DECLOP_1VAR_PREOP(uint1, ++) -DECLOP_1VAR_PREOP(uint1, --) - -DECLOP_1VAR_POSTOP(uint1, ++) -DECLOP_1VAR_POSTOP(uint1, --) - -DECLOP_1VAR_COMP(uint1, ==) -DECLOP_1VAR_COMP(uint1, !=) -DECLOP_1VAR_COMP(uint1, <) -DECLOP_1VAR_COMP(uint1, >) -DECLOP_1VAR_COMP(uint1, <=) -DECLOP_1VAR_COMP(uint1, >=) - -DECLOP_1VAR_COMP(uint1, &&) -DECLOP_1VAR_COMP(uint1, ||) - -DECLOP_1VAR_1IN_1OUT(uint1, ~) -DECLOP_1VAR_1IN_BOOLOUT(uint1, !) - -DECLOP_1VAR_SCALE_PRODUCT(uint1, unsigned char) -DECLOP_1VAR_SCALE_PRODUCT(uint1, signed char) -DECLOP_1VAR_SCALE_PRODUCT(uint1, unsigned short) -DECLOP_1VAR_SCALE_PRODUCT(uint1, signed short) -DECLOP_1VAR_SCALE_PRODUCT(uint1, unsigned int) -DECLOP_1VAR_SCALE_PRODUCT(uint1, signed int) -DECLOP_1VAR_SCALE_PRODUCT(uint1, float) -DECLOP_1VAR_SCALE_PRODUCT(uint1, unsigned long) -DECLOP_1VAR_SCALE_PRODUCT(uint1, signed long) -DECLOP_1VAR_SCALE_PRODUCT(uint1, double) -DECLOP_1VAR_SCALE_PRODUCT(uint1, unsigned long long) -DECLOP_1VAR_SCALE_PRODUCT(uint1, signed long long) - -// UNSIGNED INT2 - -DECLOP_2VAR_2IN_1OUT(uint2, +) -DECLOP_2VAR_2IN_1OUT(uint2, -) -DECLOP_2VAR_2IN_1OUT(uint2, *) -DECLOP_2VAR_2IN_1OUT(uint2, /) -DECLOP_2VAR_2IN_1OUT(uint2, %) -DECLOP_2VAR_2IN_1OUT(uint2, &) -DECLOP_2VAR_2IN_1OUT(uint2, |) -DECLOP_2VAR_2IN_1OUT(uint2, ^) -DECLOP_2VAR_2IN_1OUT(uint2, <<) -DECLOP_2VAR_2IN_1OUT(uint2, >>) - -DECLOP_2VAR_ASSIGN(uint2, +=) -DECLOP_2VAR_ASSIGN(uint2, -=) -DECLOP_2VAR_ASSIGN(uint2, *=) -DECLOP_2VAR_ASSIGN(uint2, /=) -DECLOP_2VAR_ASSIGN(uint2, %=) -DECLOP_2VAR_ASSIGN(uint2, &=) -DECLOP_2VAR_ASSIGN(uint2, |=) -DECLOP_2VAR_ASSIGN(uint2, ^=) -DECLOP_2VAR_ASSIGN(uint2, <<=) -DECLOP_2VAR_ASSIGN(uint2, >>=) - -DECLOP_2VAR_PREOP(uint2, ++) -DECLOP_2VAR_PREOP(uint2, --) - -DECLOP_2VAR_POSTOP(uint2, ++) -DECLOP_2VAR_POSTOP(uint2, --) - -DECLOP_2VAR_COMP(uint2, ==) -DECLOP_2VAR_COMP(uint2, !=) -DECLOP_2VAR_COMP(uint2, <) -DECLOP_2VAR_COMP(uint2, >) -DECLOP_2VAR_COMP(uint2, <=) -DECLOP_2VAR_COMP(uint2, >=) - -DECLOP_2VAR_COMP(uint2, &&) -DECLOP_2VAR_COMP(uint2, ||) - -DECLOP_2VAR_1IN_1OUT(uint2, ~) -DECLOP_2VAR_1IN_BOOLOUT(uint2, !) - -DECLOP_2VAR_SCALE_PRODUCT(uint2, unsigned char) -DECLOP_2VAR_SCALE_PRODUCT(uint2, signed char) -DECLOP_2VAR_SCALE_PRODUCT(uint2, unsigned short) -DECLOP_2VAR_SCALE_PRODUCT(uint2, signed short) -DECLOP_2VAR_SCALE_PRODUCT(uint2, unsigned int) -DECLOP_2VAR_SCALE_PRODUCT(uint2, signed int) -DECLOP_2VAR_SCALE_PRODUCT(uint2, float) -DECLOP_2VAR_SCALE_PRODUCT(uint2, unsigned long) -DECLOP_2VAR_SCALE_PRODUCT(uint2, signed long) -DECLOP_2VAR_SCALE_PRODUCT(uint2, double) -DECLOP_2VAR_SCALE_PRODUCT(uint2, unsigned long long) -DECLOP_2VAR_SCALE_PRODUCT(uint2, signed long long) - -// UNSIGNED INT3 - -DECLOP_3VAR_2IN_1OUT(uint3, +) -DECLOP_3VAR_2IN_1OUT(uint3, -) -DECLOP_3VAR_2IN_1OUT(uint3, *) -DECLOP_3VAR_2IN_1OUT(uint3, /) -DECLOP_3VAR_2IN_1OUT(uint3, %) -DECLOP_3VAR_2IN_1OUT(uint3, &) -DECLOP_3VAR_2IN_1OUT(uint3, |) -DECLOP_3VAR_2IN_1OUT(uint3, ^) -DECLOP_3VAR_2IN_1OUT(uint3, <<) -DECLOP_3VAR_2IN_1OUT(uint3, >>) - -DECLOP_3VAR_ASSIGN(uint3, +=) -DECLOP_3VAR_ASSIGN(uint3, -=) -DECLOP_3VAR_ASSIGN(uint3, *=) -DECLOP_3VAR_ASSIGN(uint3, /=) -DECLOP_3VAR_ASSIGN(uint3, %=) -DECLOP_3VAR_ASSIGN(uint3, &=) -DECLOP_3VAR_ASSIGN(uint3, |=) -DECLOP_3VAR_ASSIGN(uint3, ^=) -DECLOP_3VAR_ASSIGN(uint3, <<=) -DECLOP_3VAR_ASSIGN(uint3, >>=) - -DECLOP_3VAR_PREOP(uint3, ++) -DECLOP_3VAR_PREOP(uint3, --) - -DECLOP_3VAR_POSTOP(uint3, ++) -DECLOP_3VAR_POSTOP(uint3, --) - -DECLOP_3VAR_COMP(uint3, ==) -DECLOP_3VAR_COMP(uint3, !=) -DECLOP_3VAR_COMP(uint3, <) -DECLOP_3VAR_COMP(uint3, >) -DECLOP_3VAR_COMP(uint3, <=) -DECLOP_3VAR_COMP(uint3, >=) - -DECLOP_3VAR_COMP(uint3, &&) -DECLOP_3VAR_COMP(uint3, ||) - -DECLOP_3VAR_1IN_1OUT(uint3, ~) -DECLOP_3VAR_1IN_BOOLOUT(uint3, !) - -DECLOP_3VAR_SCALE_PRODUCT(uint3, unsigned char) -DECLOP_3VAR_SCALE_PRODUCT(uint3, signed char) -DECLOP_3VAR_SCALE_PRODUCT(uint3, unsigned short) -DECLOP_3VAR_SCALE_PRODUCT(uint3, signed short) -DECLOP_3VAR_SCALE_PRODUCT(uint3, unsigned int) -DECLOP_3VAR_SCALE_PRODUCT(uint3, signed int) -DECLOP_3VAR_SCALE_PRODUCT(uint3, float) -DECLOP_3VAR_SCALE_PRODUCT(uint3, unsigned long) -DECLOP_3VAR_SCALE_PRODUCT(uint3, signed long) -DECLOP_3VAR_SCALE_PRODUCT(uint3, double) -DECLOP_3VAR_SCALE_PRODUCT(uint3, unsigned long long) -DECLOP_3VAR_SCALE_PRODUCT(uint3, signed long long) - -// UNSIGNED INT4 - -DECLOP_4VAR_2IN_1OUT(uint4, +) -DECLOP_4VAR_2IN_1OUT(uint4, -) -DECLOP_4VAR_2IN_1OUT(uint4, *) -DECLOP_4VAR_2IN_1OUT(uint4, /) -DECLOP_4VAR_2IN_1OUT(uint4, %) -DECLOP_4VAR_2IN_1OUT(uint4, &) -DECLOP_4VAR_2IN_1OUT(uint4, |) -DECLOP_4VAR_2IN_1OUT(uint4, ^) -DECLOP_4VAR_2IN_1OUT(uint4, <<) -DECLOP_4VAR_2IN_1OUT(uint4, >>) - -DECLOP_4VAR_ASSIGN(uint4, +=) -DECLOP_4VAR_ASSIGN(uint4, -=) -DECLOP_4VAR_ASSIGN(uint4, *=) -DECLOP_4VAR_ASSIGN(uint4, /=) -DECLOP_4VAR_ASSIGN(uint4, %=) -DECLOP_4VAR_ASSIGN(uint4, &=) -DECLOP_4VAR_ASSIGN(uint4, |=) -DECLOP_4VAR_ASSIGN(uint4, ^=) -DECLOP_4VAR_ASSIGN(uint4, <<=) -DECLOP_4VAR_ASSIGN(uint4, >>=) - -DECLOP_4VAR_PREOP(uint4, ++) -DECLOP_4VAR_PREOP(uint4, --) - -DECLOP_4VAR_POSTOP(uint4, ++) -DECLOP_4VAR_POSTOP(uint4, --) - -DECLOP_4VAR_COMP(uint4, ==) -DECLOP_4VAR_COMP(uint4, !=) -DECLOP_4VAR_COMP(uint4, <) -DECLOP_4VAR_COMP(uint4, >) -DECLOP_4VAR_COMP(uint4, <=) -DECLOP_4VAR_COMP(uint4, >=) - -DECLOP_4VAR_COMP(uint4, &&) -DECLOP_4VAR_COMP(uint4, ||) - -DECLOP_4VAR_1IN_1OUT(uint4, ~) -DECLOP_4VAR_1IN_BOOLOUT(uint4, !) - -DECLOP_4VAR_SCALE_PRODUCT(uint4, unsigned char) -DECLOP_4VAR_SCALE_PRODUCT(uint4, signed char) -DECLOP_4VAR_SCALE_PRODUCT(uint4, unsigned short) -DECLOP_4VAR_SCALE_PRODUCT(uint4, signed short) -DECLOP_4VAR_SCALE_PRODUCT(uint4, unsigned int) -DECLOP_4VAR_SCALE_PRODUCT(uint4, signed int) -DECLOP_4VAR_SCALE_PRODUCT(uint4, float) -DECLOP_4VAR_SCALE_PRODUCT(uint4, unsigned long) -DECLOP_4VAR_SCALE_PRODUCT(uint4, signed long) -DECLOP_4VAR_SCALE_PRODUCT(uint4, double) -DECLOP_4VAR_SCALE_PRODUCT(uint4, unsigned long long) -DECLOP_4VAR_SCALE_PRODUCT(uint4, signed long long) - -// SIGNED INT1 - -DECLOP_1VAR_2IN_1OUT(int1, +) -DECLOP_1VAR_2IN_1OUT(int1, -) -DECLOP_1VAR_2IN_1OUT(int1, *) -DECLOP_1VAR_2IN_1OUT(int1, /) -DECLOP_1VAR_2IN_1OUT(int1, %) -DECLOP_1VAR_2IN_1OUT(int1, &) -DECLOP_1VAR_2IN_1OUT(int1, |) -DECLOP_1VAR_2IN_1OUT(int1, ^) -DECLOP_1VAR_2IN_1OUT(int1, <<) -DECLOP_1VAR_2IN_1OUT(int1, >>) - - -DECLOP_1VAR_ASSIGN(int1, +=) -DECLOP_1VAR_ASSIGN(int1, -=) -DECLOP_1VAR_ASSIGN(int1, *=) -DECLOP_1VAR_ASSIGN(int1, /=) -DECLOP_1VAR_ASSIGN(int1, %=) -DECLOP_1VAR_ASSIGN(int1, &=) -DECLOP_1VAR_ASSIGN(int1, |=) -DECLOP_1VAR_ASSIGN(int1, ^=) -DECLOP_1VAR_ASSIGN(int1, <<=) -DECLOP_1VAR_ASSIGN(int1, >>=) - -DECLOP_1VAR_PREOP(int1, ++) -DECLOP_1VAR_PREOP(int1, --) - -DECLOP_1VAR_POSTOP(int1, ++) -DECLOP_1VAR_POSTOP(int1, --) - -DECLOP_1VAR_COMP(int1, ==) -DECLOP_1VAR_COMP(int1, !=) -DECLOP_1VAR_COMP(int1, <) -DECLOP_1VAR_COMP(int1, >) -DECLOP_1VAR_COMP(int1, <=) -DECLOP_1VAR_COMP(int1, >=) - -DECLOP_1VAR_COMP(int1, &&) -DECLOP_1VAR_COMP(int1, ||) - -DECLOP_1VAR_1IN_1OUT(int1, ~) -DECLOP_1VAR_1IN_BOOLOUT(int1, !) - -DECLOP_1VAR_SCALE_PRODUCT(int1, unsigned char) -DECLOP_1VAR_SCALE_PRODUCT(int1, signed char) -DECLOP_1VAR_SCALE_PRODUCT(int1, unsigned short) -DECLOP_1VAR_SCALE_PRODUCT(int1, signed short) -DECLOP_1VAR_SCALE_PRODUCT(int1, unsigned int) -DECLOP_1VAR_SCALE_PRODUCT(int1, signed int) -DECLOP_1VAR_SCALE_PRODUCT(int1, float) -DECLOP_1VAR_SCALE_PRODUCT(int1, unsigned long) -DECLOP_1VAR_SCALE_PRODUCT(int1, signed long) -DECLOP_1VAR_SCALE_PRODUCT(int1, double) -DECLOP_1VAR_SCALE_PRODUCT(int1, unsigned long long) -DECLOP_1VAR_SCALE_PRODUCT(int1, signed long long) - -// SIGNED INT2 - -DECLOP_2VAR_2IN_1OUT(int2, +) -DECLOP_2VAR_2IN_1OUT(int2, -) -DECLOP_2VAR_2IN_1OUT(int2, *) -DECLOP_2VAR_2IN_1OUT(int2, /) -DECLOP_2VAR_2IN_1OUT(int2, %) -DECLOP_2VAR_2IN_1OUT(int2, &) -DECLOP_2VAR_2IN_1OUT(int2, |) -DECLOP_2VAR_2IN_1OUT(int2, ^) -DECLOP_2VAR_2IN_1OUT(int2, <<) -DECLOP_2VAR_2IN_1OUT(int2, >>) - -DECLOP_2VAR_ASSIGN(int2, +=) -DECLOP_2VAR_ASSIGN(int2, -=) -DECLOP_2VAR_ASSIGN(int2, *=) -DECLOP_2VAR_ASSIGN(int2, /=) -DECLOP_2VAR_ASSIGN(int2, %=) -DECLOP_2VAR_ASSIGN(int2, &=) -DECLOP_2VAR_ASSIGN(int2, |=) -DECLOP_2VAR_ASSIGN(int2, ^=) -DECLOP_2VAR_ASSIGN(int2, <<=) -DECLOP_2VAR_ASSIGN(int2, >>=) - -DECLOP_2VAR_PREOP(int2, ++) -DECLOP_2VAR_PREOP(int2, --) - -DECLOP_2VAR_POSTOP(int2, ++) -DECLOP_2VAR_POSTOP(int2, --) - -DECLOP_2VAR_COMP(int2, ==) -DECLOP_2VAR_COMP(int2, !=) -DECLOP_2VAR_COMP(int2, <) -DECLOP_2VAR_COMP(int2, >) -DECLOP_2VAR_COMP(int2, <=) -DECLOP_2VAR_COMP(int2, >=) - -DECLOP_2VAR_COMP(int2, &&) -DECLOP_2VAR_COMP(int2, ||) - -DECLOP_2VAR_1IN_1OUT(int2, ~) -DECLOP_2VAR_1IN_BOOLOUT(int2, !) - -DECLOP_2VAR_SCALE_PRODUCT(int2, unsigned char) -DECLOP_2VAR_SCALE_PRODUCT(int2, signed char) -DECLOP_2VAR_SCALE_PRODUCT(int2, unsigned short) -DECLOP_2VAR_SCALE_PRODUCT(int2, signed short) -DECLOP_2VAR_SCALE_PRODUCT(int2, unsigned int) -DECLOP_2VAR_SCALE_PRODUCT(int2, signed int) -DECLOP_2VAR_SCALE_PRODUCT(int2, float) -DECLOP_2VAR_SCALE_PRODUCT(int2, unsigned long) -DECLOP_2VAR_SCALE_PRODUCT(int2, signed long) -DECLOP_2VAR_SCALE_PRODUCT(int2, double) -DECLOP_2VAR_SCALE_PRODUCT(int2, unsigned long long) -DECLOP_2VAR_SCALE_PRODUCT(int2, signed long long) - -// SIGNED INT3 - -DECLOP_3VAR_2IN_1OUT(int3, +) -DECLOP_3VAR_2IN_1OUT(int3, -) -DECLOP_3VAR_2IN_1OUT(int3, *) -DECLOP_3VAR_2IN_1OUT(int3, /) -DECLOP_3VAR_2IN_1OUT(int3, %) -DECLOP_3VAR_2IN_1OUT(int3, &) -DECLOP_3VAR_2IN_1OUT(int3, |) -DECLOP_3VAR_2IN_1OUT(int3, ^) -DECLOP_3VAR_2IN_1OUT(int3, <<) -DECLOP_3VAR_2IN_1OUT(int3, >>) - -DECLOP_3VAR_ASSIGN(int3, +=) -DECLOP_3VAR_ASSIGN(int3, -=) -DECLOP_3VAR_ASSIGN(int3, *=) -DECLOP_3VAR_ASSIGN(int3, /=) -DECLOP_3VAR_ASSIGN(int3, %=) -DECLOP_3VAR_ASSIGN(int3, &=) -DECLOP_3VAR_ASSIGN(int3, |=) -DECLOP_3VAR_ASSIGN(int3, ^=) -DECLOP_3VAR_ASSIGN(int3, <<=) -DECLOP_3VAR_ASSIGN(int3, >>=) - -DECLOP_3VAR_PREOP(int3, ++) -DECLOP_3VAR_PREOP(int3, --) - -DECLOP_3VAR_POSTOP(int3, ++) -DECLOP_3VAR_POSTOP(int3, --) - -DECLOP_3VAR_COMP(int3, ==) -DECLOP_3VAR_COMP(int3, !=) -DECLOP_3VAR_COMP(int3, <) -DECLOP_3VAR_COMP(int3, >) -DECLOP_3VAR_COMP(int3, <=) -DECLOP_3VAR_COMP(int3, >=) - -DECLOP_3VAR_COMP(int3, &&) -DECLOP_3VAR_COMP(int3, ||) - -DECLOP_3VAR_1IN_1OUT(int3, ~) -DECLOP_3VAR_1IN_BOOLOUT(int3, !) - -DECLOP_3VAR_SCALE_PRODUCT(int3, unsigned char) -DECLOP_3VAR_SCALE_PRODUCT(int3, signed char) -DECLOP_3VAR_SCALE_PRODUCT(int3, unsigned short) -DECLOP_3VAR_SCALE_PRODUCT(int3, signed short) -DECLOP_3VAR_SCALE_PRODUCT(int3, unsigned int) -DECLOP_3VAR_SCALE_PRODUCT(int3, signed int) -DECLOP_3VAR_SCALE_PRODUCT(int3, float) -DECLOP_3VAR_SCALE_PRODUCT(int3, unsigned long) -DECLOP_3VAR_SCALE_PRODUCT(int3, signed long) -DECLOP_3VAR_SCALE_PRODUCT(int3, double) -DECLOP_3VAR_SCALE_PRODUCT(int3, unsigned long long) -DECLOP_3VAR_SCALE_PRODUCT(int3, signed long long) - -// SIGNED INT4 - -DECLOP_4VAR_2IN_1OUT(int4, +) -DECLOP_4VAR_2IN_1OUT(int4, -) -DECLOP_4VAR_2IN_1OUT(int4, *) -DECLOP_4VAR_2IN_1OUT(int4, /) -DECLOP_4VAR_2IN_1OUT(int4, %) -DECLOP_4VAR_2IN_1OUT(int4, &) -DECLOP_4VAR_2IN_1OUT(int4, |) -DECLOP_4VAR_2IN_1OUT(int4, ^) -DECLOP_4VAR_2IN_1OUT(int4, <<) -DECLOP_4VAR_2IN_1OUT(int4, >>) - -DECLOP_4VAR_ASSIGN(int4, +=) -DECLOP_4VAR_ASSIGN(int4, -=) -DECLOP_4VAR_ASSIGN(int4, *=) -DECLOP_4VAR_ASSIGN(int4, /=) -DECLOP_4VAR_ASSIGN(int4, %=) -DECLOP_4VAR_ASSIGN(int4, &=) -DECLOP_4VAR_ASSIGN(int4, |=) -DECLOP_4VAR_ASSIGN(int4, ^=) -DECLOP_4VAR_ASSIGN(int4, <<=) -DECLOP_4VAR_ASSIGN(int4, >>=) - -DECLOP_4VAR_PREOP(int4, ++) -DECLOP_4VAR_PREOP(int4, --) - -DECLOP_4VAR_POSTOP(int4, ++) -DECLOP_4VAR_POSTOP(int4, --) - -DECLOP_4VAR_COMP(int4, ==) -DECLOP_4VAR_COMP(int4, !=) -DECLOP_4VAR_COMP(int4, <) -DECLOP_4VAR_COMP(int4, >) -DECLOP_4VAR_COMP(int4, <=) -DECLOP_4VAR_COMP(int4, >=) - -DECLOP_4VAR_COMP(int4, &&) -DECLOP_4VAR_COMP(int4, ||) - -DECLOP_4VAR_1IN_1OUT(int4, ~) -DECLOP_4VAR_1IN_BOOLOUT(int4, !) - -DECLOP_4VAR_SCALE_PRODUCT(int4, unsigned char) -DECLOP_4VAR_SCALE_PRODUCT(int4, signed char) -DECLOP_4VAR_SCALE_PRODUCT(int4, unsigned short) -DECLOP_4VAR_SCALE_PRODUCT(int4, signed short) -DECLOP_4VAR_SCALE_PRODUCT(int4, unsigned int) -DECLOP_4VAR_SCALE_PRODUCT(int4, signed int) -DECLOP_4VAR_SCALE_PRODUCT(int4, float) -DECLOP_4VAR_SCALE_PRODUCT(int4, unsigned long) -DECLOP_4VAR_SCALE_PRODUCT(int4, signed long) -DECLOP_4VAR_SCALE_PRODUCT(int4, double) -DECLOP_4VAR_SCALE_PRODUCT(int4, unsigned long long) -DECLOP_4VAR_SCALE_PRODUCT(int4, signed long long) - -// FLOAT1 - -DECLOP_1VAR_2IN_1OUT(float1, +) -DECLOP_1VAR_2IN_1OUT(float1, -) -DECLOP_1VAR_2IN_1OUT(float1, *) -DECLOP_1VAR_2IN_1OUT(float1, /) - -DECLOP_1VAR_ASSIGN(float1, +=) -DECLOP_1VAR_ASSIGN(float1, -=) -DECLOP_1VAR_ASSIGN(float1, *=) -DECLOP_1VAR_ASSIGN(float1, /=) - -DECLOP_1VAR_PREOP(float1, ++) -DECLOP_1VAR_PREOP(float1, --) - -DECLOP_1VAR_POSTOP(float1, ++) -DECLOP_1VAR_POSTOP(float1, --) - -DECLOP_1VAR_COMP(float1, ==) -DECLOP_1VAR_COMP(float1, !=) -DECLOP_1VAR_COMP(float1, <) -DECLOP_1VAR_COMP(float1, >) -DECLOP_1VAR_COMP(float1, <=) -DECLOP_1VAR_COMP(float1, >=) - -DECLOP_1VAR_SCALE_PRODUCT(float1, unsigned char) -DECLOP_1VAR_SCALE_PRODUCT(float1, signed char) -DECLOP_1VAR_SCALE_PRODUCT(float1, unsigned short) -DECLOP_1VAR_SCALE_PRODUCT(float1, signed short) -DECLOP_1VAR_SCALE_PRODUCT(float1, unsigned int) -DECLOP_1VAR_SCALE_PRODUCT(float1, signed int) -DECLOP_1VAR_SCALE_PRODUCT(float1, float) -DECLOP_1VAR_SCALE_PRODUCT(float1, unsigned long) -DECLOP_1VAR_SCALE_PRODUCT(float1, signed long) -DECLOP_1VAR_SCALE_PRODUCT(float1, double) -DECLOP_1VAR_SCALE_PRODUCT(float1, unsigned long long) -DECLOP_1VAR_SCALE_PRODUCT(float1, signed long long) - -// FLOAT2 - -DECLOP_2VAR_2IN_1OUT(float2, +) -DECLOP_2VAR_2IN_1OUT(float2, -) -DECLOP_2VAR_2IN_1OUT(float2, *) -DECLOP_2VAR_2IN_1OUT(float2, /) - -DECLOP_2VAR_ASSIGN(float2, +=) -DECLOP_2VAR_ASSIGN(float2, -=) -DECLOP_2VAR_ASSIGN(float2, *=) -DECLOP_2VAR_ASSIGN(float2, /=) - -DECLOP_2VAR_PREOP(float2, ++) -DECLOP_2VAR_PREOP(float2, --) - -DECLOP_2VAR_POSTOP(float2, ++) -DECLOP_2VAR_POSTOP(float2, --) - -DECLOP_2VAR_COMP(float2, ==) -DECLOP_2VAR_COMP(float2, !=) -DECLOP_2VAR_COMP(float2, <) -DECLOP_2VAR_COMP(float2, >) -DECLOP_2VAR_COMP(float2, <=) -DECLOP_2VAR_COMP(float2, >=) - -DECLOP_2VAR_SCALE_PRODUCT(float2, unsigned char) -DECLOP_2VAR_SCALE_PRODUCT(float2, signed char) -DECLOP_2VAR_SCALE_PRODUCT(float2, unsigned short) -DECLOP_2VAR_SCALE_PRODUCT(float2, signed short) -DECLOP_2VAR_SCALE_PRODUCT(float2, unsigned int) -DECLOP_2VAR_SCALE_PRODUCT(float2, signed int) -DECLOP_2VAR_SCALE_PRODUCT(float2, float) -DECLOP_2VAR_SCALE_PRODUCT(float2, unsigned long) -DECLOP_2VAR_SCALE_PRODUCT(float2, signed long) -DECLOP_2VAR_SCALE_PRODUCT(float2, double) -DECLOP_2VAR_SCALE_PRODUCT(float2, unsigned long long) -DECLOP_2VAR_SCALE_PRODUCT(float2, signed long long) - -// FLOAT3 - -DECLOP_3VAR_2IN_1OUT(float3, +) -DECLOP_3VAR_2IN_1OUT(float3, -) -DECLOP_3VAR_2IN_1OUT(float3, *) -DECLOP_3VAR_2IN_1OUT(float3, /) - -DECLOP_3VAR_ASSIGN(float3, +=) -DECLOP_3VAR_ASSIGN(float3, -=) -DECLOP_3VAR_ASSIGN(float3, *=) -DECLOP_3VAR_ASSIGN(float3, /=) - -DECLOP_3VAR_PREOP(float3, ++) -DECLOP_3VAR_PREOP(float3, --) - -DECLOP_3VAR_POSTOP(float3, ++) -DECLOP_3VAR_POSTOP(float3, --) - -DECLOP_3VAR_COMP(float3, ==) -DECLOP_3VAR_COMP(float3, !=) -DECLOP_3VAR_COMP(float3, <) -DECLOP_3VAR_COMP(float3, >) -DECLOP_3VAR_COMP(float3, <=) -DECLOP_3VAR_COMP(float3, >=) - -DECLOP_3VAR_SCALE_PRODUCT(float3, unsigned char) -DECLOP_3VAR_SCALE_PRODUCT(float3, signed char) -DECLOP_3VAR_SCALE_PRODUCT(float3, unsigned short) -DECLOP_3VAR_SCALE_PRODUCT(float3, signed short) -DECLOP_3VAR_SCALE_PRODUCT(float3, unsigned int) -DECLOP_3VAR_SCALE_PRODUCT(float3, signed int) -DECLOP_3VAR_SCALE_PRODUCT(float3, float) -DECLOP_3VAR_SCALE_PRODUCT(float3, unsigned long) -DECLOP_3VAR_SCALE_PRODUCT(float3, signed long) -DECLOP_3VAR_SCALE_PRODUCT(float3, double) -DECLOP_3VAR_SCALE_PRODUCT(float3, unsigned long long) -DECLOP_3VAR_SCALE_PRODUCT(float3, signed long long) - -// FLOAT4 - -DECLOP_4VAR_2IN_1OUT(float4, +) -DECLOP_4VAR_2IN_1OUT(float4, -) -DECLOP_4VAR_2IN_1OUT(float4, *) -DECLOP_4VAR_2IN_1OUT(float4, /) - -DECLOP_4VAR_ASSIGN(float4, +=) -DECLOP_4VAR_ASSIGN(float4, -=) -DECLOP_4VAR_ASSIGN(float4, *=) -DECLOP_4VAR_ASSIGN(float4, /=) - -DECLOP_4VAR_PREOP(float4, ++) -DECLOP_4VAR_PREOP(float4, --) - -DECLOP_4VAR_POSTOP(float4, ++) -DECLOP_4VAR_POSTOP(float4, --) - -DECLOP_4VAR_COMP(float4, ==) -DECLOP_4VAR_COMP(float4, !=) -DECLOP_4VAR_COMP(float4, <) -DECLOP_4VAR_COMP(float4, >) -DECLOP_4VAR_COMP(float4, <=) -DECLOP_4VAR_COMP(float4, >=) - -DECLOP_4VAR_SCALE_PRODUCT(float4, unsigned char) -DECLOP_4VAR_SCALE_PRODUCT(float4, signed char) -DECLOP_4VAR_SCALE_PRODUCT(float4, unsigned short) -DECLOP_4VAR_SCALE_PRODUCT(float4, signed short) -DECLOP_4VAR_SCALE_PRODUCT(float4, unsigned int) -DECLOP_4VAR_SCALE_PRODUCT(float4, signed int) -DECLOP_4VAR_SCALE_PRODUCT(float4, float) -DECLOP_4VAR_SCALE_PRODUCT(float4, unsigned long) -DECLOP_4VAR_SCALE_PRODUCT(float4, signed long) -DECLOP_4VAR_SCALE_PRODUCT(float4, double) -DECLOP_4VAR_SCALE_PRODUCT(float4, unsigned long long) -DECLOP_4VAR_SCALE_PRODUCT(float4, signed long long) - -// DOUBLE1 - -DECLOP_1VAR_2IN_1OUT(double1, +) -DECLOP_1VAR_2IN_1OUT(double1, -) -DECLOP_1VAR_2IN_1OUT(double1, *) -DECLOP_1VAR_2IN_1OUT(double1, /) - -DECLOP_1VAR_ASSIGN(double1, +=) -DECLOP_1VAR_ASSIGN(double1, -=) -DECLOP_1VAR_ASSIGN(double1, *=) -DECLOP_1VAR_ASSIGN(double1, /=) - -DECLOP_1VAR_PREOP(double1, ++) -DECLOP_1VAR_PREOP(double1, --) - -DECLOP_1VAR_POSTOP(double1, ++) -DECLOP_1VAR_POSTOP(double1, --) - -DECLOP_1VAR_COMP(double1, ==) -DECLOP_1VAR_COMP(double1, !=) -DECLOP_1VAR_COMP(double1, <) -DECLOP_1VAR_COMP(double1, >) -DECLOP_1VAR_COMP(double1, <=) -DECLOP_1VAR_COMP(double1, >=) - -DECLOP_1VAR_SCALE_PRODUCT(double1, unsigned char) -DECLOP_1VAR_SCALE_PRODUCT(double1, signed char) -DECLOP_1VAR_SCALE_PRODUCT(double1, unsigned short) -DECLOP_1VAR_SCALE_PRODUCT(double1, signed short) -DECLOP_1VAR_SCALE_PRODUCT(double1, unsigned int) -DECLOP_1VAR_SCALE_PRODUCT(double1, signed int) -DECLOP_1VAR_SCALE_PRODUCT(double1, float) -DECLOP_1VAR_SCALE_PRODUCT(double1, unsigned long) -DECLOP_1VAR_SCALE_PRODUCT(double1, signed long) -DECLOP_1VAR_SCALE_PRODUCT(double1, double) -DECLOP_1VAR_SCALE_PRODUCT(double1, unsigned long long) -DECLOP_1VAR_SCALE_PRODUCT(double1, signed long long) - -// DOUBLE2 - -DECLOP_2VAR_2IN_1OUT(double2, +) -DECLOP_2VAR_2IN_1OUT(double2, -) -DECLOP_2VAR_2IN_1OUT(double2, *) -DECLOP_2VAR_2IN_1OUT(double2, /) - -DECLOP_2VAR_ASSIGN(double2, +=) -DECLOP_2VAR_ASSIGN(double2, -=) -DECLOP_2VAR_ASSIGN(double2, *=) -DECLOP_2VAR_ASSIGN(double2, /=) - -DECLOP_2VAR_PREOP(double2, ++) -DECLOP_2VAR_PREOP(double2, --) - -DECLOP_2VAR_POSTOP(double2, ++) -DECLOP_2VAR_POSTOP(double2, --) - -DECLOP_2VAR_COMP(double2, ==) -DECLOP_2VAR_COMP(double2, !=) -DECLOP_2VAR_COMP(double2, <) -DECLOP_2VAR_COMP(double2, >) -DECLOP_2VAR_COMP(double2, <=) -DECLOP_2VAR_COMP(double2, >=) - -DECLOP_2VAR_SCALE_PRODUCT(double2, unsigned char) -DECLOP_2VAR_SCALE_PRODUCT(double2, signed char) -DECLOP_2VAR_SCALE_PRODUCT(double2, unsigned short) -DECLOP_2VAR_SCALE_PRODUCT(double2, signed short) -DECLOP_2VAR_SCALE_PRODUCT(double2, unsigned int) -DECLOP_2VAR_SCALE_PRODUCT(double2, signed int) -DECLOP_2VAR_SCALE_PRODUCT(double2, float) -DECLOP_2VAR_SCALE_PRODUCT(double2, unsigned long) -DECLOP_2VAR_SCALE_PRODUCT(double2, signed long) -DECLOP_2VAR_SCALE_PRODUCT(double2, double) -DECLOP_2VAR_SCALE_PRODUCT(double2, unsigned long long) -DECLOP_2VAR_SCALE_PRODUCT(double2, signed long long) - -// DOUBLE3 - -DECLOP_3VAR_2IN_1OUT(double3, +) -DECLOP_3VAR_2IN_1OUT(double3, -) -DECLOP_3VAR_2IN_1OUT(double3, *) -DECLOP_3VAR_2IN_1OUT(double3, /) - -DECLOP_3VAR_ASSIGN(double3, +=) -DECLOP_3VAR_ASSIGN(double3, -=) -DECLOP_3VAR_ASSIGN(double3, *=) -DECLOP_3VAR_ASSIGN(double3, /=) - -DECLOP_3VAR_PREOP(double3, ++) -DECLOP_3VAR_PREOP(double3, --) - -DECLOP_3VAR_POSTOP(double3, ++) -DECLOP_3VAR_POSTOP(double3, --) - -DECLOP_3VAR_COMP(double3, ==) -DECLOP_3VAR_COMP(double3, !=) -DECLOP_3VAR_COMP(double3, <) -DECLOP_3VAR_COMP(double3, >) -DECLOP_3VAR_COMP(double3, <=) -DECLOP_3VAR_COMP(double3, >=) - -DECLOP_3VAR_SCALE_PRODUCT(double3, unsigned char) -DECLOP_3VAR_SCALE_PRODUCT(double3, signed char) -DECLOP_3VAR_SCALE_PRODUCT(double3, unsigned short) -DECLOP_3VAR_SCALE_PRODUCT(double3, signed short) -DECLOP_3VAR_SCALE_PRODUCT(double3, unsigned int) -DECLOP_3VAR_SCALE_PRODUCT(double3, signed int) -DECLOP_3VAR_SCALE_PRODUCT(double3, float) -DECLOP_3VAR_SCALE_PRODUCT(double3, unsigned long) -DECLOP_3VAR_SCALE_PRODUCT(double3, signed long) -DECLOP_3VAR_SCALE_PRODUCT(double3, double) -DECLOP_3VAR_SCALE_PRODUCT(double3, unsigned long long) -DECLOP_3VAR_SCALE_PRODUCT(double3, signed long long) - -// DOUBLE4 - -DECLOP_4VAR_2IN_1OUT(double4, +) -DECLOP_4VAR_2IN_1OUT(double4, -) -DECLOP_4VAR_2IN_1OUT(double4, *) -DECLOP_4VAR_2IN_1OUT(double4, /) - -DECLOP_4VAR_ASSIGN(double4, +=) -DECLOP_4VAR_ASSIGN(double4, -=) -DECLOP_4VAR_ASSIGN(double4, *=) -DECLOP_4VAR_ASSIGN(double4, /=) - -DECLOP_4VAR_PREOP(double4, ++) -DECLOP_4VAR_PREOP(double4, --) - -DECLOP_4VAR_POSTOP(double4, ++) -DECLOP_4VAR_POSTOP(double4, --) - -DECLOP_4VAR_COMP(double4, ==) -DECLOP_4VAR_COMP(double4, !=) -DECLOP_4VAR_COMP(double4, <) -DECLOP_4VAR_COMP(double4, >) -DECLOP_4VAR_COMP(double4, <=) -DECLOP_4VAR_COMP(double4, >=) - -DECLOP_4VAR_SCALE_PRODUCT(double4, unsigned char) -DECLOP_4VAR_SCALE_PRODUCT(double4, signed char) -DECLOP_4VAR_SCALE_PRODUCT(double4, unsigned short) -DECLOP_4VAR_SCALE_PRODUCT(double4, signed short) -DECLOP_4VAR_SCALE_PRODUCT(double4, unsigned int) -DECLOP_4VAR_SCALE_PRODUCT(double4, signed int) -DECLOP_4VAR_SCALE_PRODUCT(double4, float) -DECLOP_4VAR_SCALE_PRODUCT(double4, unsigned long) -DECLOP_4VAR_SCALE_PRODUCT(double4, signed long) -DECLOP_4VAR_SCALE_PRODUCT(double4, double) -DECLOP_4VAR_SCALE_PRODUCT(double4, unsigned long long) -DECLOP_4VAR_SCALE_PRODUCT(double4, signed long long) - -// UNSIGNED LONG1 - -DECLOP_1VAR_2IN_1OUT(ulong1, +) -DECLOP_1VAR_2IN_1OUT(ulong1, -) -DECLOP_1VAR_2IN_1OUT(ulong1, *) -DECLOP_1VAR_2IN_1OUT(ulong1, /) -DECLOP_1VAR_2IN_1OUT(ulong1, %) -DECLOP_1VAR_2IN_1OUT(ulong1, &) -DECLOP_1VAR_2IN_1OUT(ulong1, |) -DECLOP_1VAR_2IN_1OUT(ulong1, ^) -DECLOP_1VAR_2IN_1OUT(ulong1, <<) -DECLOP_1VAR_2IN_1OUT(ulong1, >>) - - -DECLOP_1VAR_ASSIGN(ulong1, +=) -DECLOP_1VAR_ASSIGN(ulong1, -=) -DECLOP_1VAR_ASSIGN(ulong1, *=) -DECLOP_1VAR_ASSIGN(ulong1, /=) -DECLOP_1VAR_ASSIGN(ulong1, %=) -DECLOP_1VAR_ASSIGN(ulong1, &=) -DECLOP_1VAR_ASSIGN(ulong1, |=) -DECLOP_1VAR_ASSIGN(ulong1, ^=) -DECLOP_1VAR_ASSIGN(ulong1, <<=) -DECLOP_1VAR_ASSIGN(ulong1, >>=) - -DECLOP_1VAR_PREOP(ulong1, ++) -DECLOP_1VAR_PREOP(ulong1, --) - -DECLOP_1VAR_POSTOP(ulong1, ++) -DECLOP_1VAR_POSTOP(ulong1, --) - -DECLOP_1VAR_COMP(ulong1, ==) -DECLOP_1VAR_COMP(ulong1, !=) -DECLOP_1VAR_COMP(ulong1, <) -DECLOP_1VAR_COMP(ulong1, >) -DECLOP_1VAR_COMP(ulong1, <=) -DECLOP_1VAR_COMP(ulong1, >=) - -DECLOP_1VAR_COMP(ulong1, &&) -DECLOP_1VAR_COMP(ulong1, ||) - -DECLOP_1VAR_1IN_1OUT(ulong1, ~) -DECLOP_1VAR_1IN_BOOLOUT(ulong1, !) - -DECLOP_1VAR_SCALE_PRODUCT(ulong1, unsigned char) -DECLOP_1VAR_SCALE_PRODUCT(ulong1, signed char) -DECLOP_1VAR_SCALE_PRODUCT(ulong1, unsigned short) -DECLOP_1VAR_SCALE_PRODUCT(ulong1, signed short) -DECLOP_1VAR_SCALE_PRODUCT(ulong1, unsigned int) -DECLOP_1VAR_SCALE_PRODUCT(ulong1, signed int) -DECLOP_1VAR_SCALE_PRODUCT(ulong1, float) -DECLOP_1VAR_SCALE_PRODUCT(ulong1, unsigned long) -DECLOP_1VAR_SCALE_PRODUCT(ulong1, signed long) -DECLOP_1VAR_SCALE_PRODUCT(ulong1, double) -DECLOP_1VAR_SCALE_PRODUCT(ulong1, unsigned long long) -DECLOP_1VAR_SCALE_PRODUCT(ulong1, signed long long) - -// UNSIGNED LONG2 - -DECLOP_2VAR_2IN_1OUT(ulong2, +) -DECLOP_2VAR_2IN_1OUT(ulong2, -) -DECLOP_2VAR_2IN_1OUT(ulong2, *) -DECLOP_2VAR_2IN_1OUT(ulong2, /) -DECLOP_2VAR_2IN_1OUT(ulong2, %) -DECLOP_2VAR_2IN_1OUT(ulong2, &) -DECLOP_2VAR_2IN_1OUT(ulong2, |) -DECLOP_2VAR_2IN_1OUT(ulong2, ^) -DECLOP_2VAR_2IN_1OUT(ulong2, <<) -DECLOP_2VAR_2IN_1OUT(ulong2, >>) - -DECLOP_2VAR_ASSIGN(ulong2, +=) -DECLOP_2VAR_ASSIGN(ulong2, -=) -DECLOP_2VAR_ASSIGN(ulong2, *=) -DECLOP_2VAR_ASSIGN(ulong2, /=) -DECLOP_2VAR_ASSIGN(ulong2, %=) -DECLOP_2VAR_ASSIGN(ulong2, &=) -DECLOP_2VAR_ASSIGN(ulong2, |=) -DECLOP_2VAR_ASSIGN(ulong2, ^=) -DECLOP_2VAR_ASSIGN(ulong2, <<=) -DECLOP_2VAR_ASSIGN(ulong2, >>=) - -DECLOP_2VAR_PREOP(ulong2, ++) -DECLOP_2VAR_PREOP(ulong2, --) - -DECLOP_2VAR_POSTOP(ulong2, ++) -DECLOP_2VAR_POSTOP(ulong2, --) - -DECLOP_2VAR_COMP(ulong2, ==) -DECLOP_2VAR_COMP(ulong2, !=) -DECLOP_2VAR_COMP(ulong2, <) -DECLOP_2VAR_COMP(ulong2, >) -DECLOP_2VAR_COMP(ulong2, <=) -DECLOP_2VAR_COMP(ulong2, >=) - -DECLOP_2VAR_COMP(ulong2, &&) -DECLOP_2VAR_COMP(ulong2, ||) - -DECLOP_2VAR_1IN_1OUT(ulong2, ~) -DECLOP_2VAR_1IN_BOOLOUT(ulong2, !) - -DECLOP_2VAR_SCALE_PRODUCT(ulong2, unsigned char) -DECLOP_2VAR_SCALE_PRODUCT(ulong2, signed char) -DECLOP_2VAR_SCALE_PRODUCT(ulong2, unsigned short) -DECLOP_2VAR_SCALE_PRODUCT(ulong2, signed short) -DECLOP_2VAR_SCALE_PRODUCT(ulong2, unsigned int) -DECLOP_2VAR_SCALE_PRODUCT(ulong2, signed int) -DECLOP_2VAR_SCALE_PRODUCT(ulong2, float) -DECLOP_2VAR_SCALE_PRODUCT(ulong2, unsigned long) -DECLOP_2VAR_SCALE_PRODUCT(ulong2, signed long) -DECLOP_2VAR_SCALE_PRODUCT(ulong2, double) -DECLOP_2VAR_SCALE_PRODUCT(ulong2, unsigned long long) -DECLOP_2VAR_SCALE_PRODUCT(ulong2, signed long long) - -// UNSIGNED LONG3 - -DECLOP_3VAR_2IN_1OUT(ulong3, +) -DECLOP_3VAR_2IN_1OUT(ulong3, -) -DECLOP_3VAR_2IN_1OUT(ulong3, *) -DECLOP_3VAR_2IN_1OUT(ulong3, /) -DECLOP_3VAR_2IN_1OUT(ulong3, %) -DECLOP_3VAR_2IN_1OUT(ulong3, &) -DECLOP_3VAR_2IN_1OUT(ulong3, |) -DECLOP_3VAR_2IN_1OUT(ulong3, ^) -DECLOP_3VAR_2IN_1OUT(ulong3, <<) -DECLOP_3VAR_2IN_1OUT(ulong3, >>) - -DECLOP_3VAR_ASSIGN(ulong3, +=) -DECLOP_3VAR_ASSIGN(ulong3, -=) -DECLOP_3VAR_ASSIGN(ulong3, *=) -DECLOP_3VAR_ASSIGN(ulong3, /=) -DECLOP_3VAR_ASSIGN(ulong3, %=) -DECLOP_3VAR_ASSIGN(ulong3, &=) -DECLOP_3VAR_ASSIGN(ulong3, |=) -DECLOP_3VAR_ASSIGN(ulong3, ^=) -DECLOP_3VAR_ASSIGN(ulong3, <<=) -DECLOP_3VAR_ASSIGN(ulong3, >>=) - -DECLOP_3VAR_PREOP(ulong3, ++) -DECLOP_3VAR_PREOP(ulong3, --) - -DECLOP_3VAR_POSTOP(ulong3, ++) -DECLOP_3VAR_POSTOP(ulong3, --) - -DECLOP_3VAR_COMP(ulong3, ==) -DECLOP_3VAR_COMP(ulong3, !=) -DECLOP_3VAR_COMP(ulong3, <) -DECLOP_3VAR_COMP(ulong3, >) -DECLOP_3VAR_COMP(ulong3, <=) -DECLOP_3VAR_COMP(ulong3, >=) - -DECLOP_3VAR_COMP(ulong3, &&) -DECLOP_3VAR_COMP(ulong3, ||) - -DECLOP_3VAR_1IN_1OUT(ulong3, ~) -DECLOP_3VAR_1IN_BOOLOUT(ulong3, !) - -DECLOP_3VAR_SCALE_PRODUCT(ulong3, unsigned char) -DECLOP_3VAR_SCALE_PRODUCT(ulong3, signed char) -DECLOP_3VAR_SCALE_PRODUCT(ulong3, unsigned short) -DECLOP_3VAR_SCALE_PRODUCT(ulong3, signed short) -DECLOP_3VAR_SCALE_PRODUCT(ulong3, unsigned int) -DECLOP_3VAR_SCALE_PRODUCT(ulong3, signed int) -DECLOP_3VAR_SCALE_PRODUCT(ulong3, float) -DECLOP_3VAR_SCALE_PRODUCT(ulong3, unsigned long) -DECLOP_3VAR_SCALE_PRODUCT(ulong3, signed long) -DECLOP_3VAR_SCALE_PRODUCT(ulong3, double) -DECLOP_3VAR_SCALE_PRODUCT(ulong3, unsigned long long) -DECLOP_3VAR_SCALE_PRODUCT(ulong3, signed long long) - -// UNSIGNED LONG4 - -DECLOP_4VAR_2IN_1OUT(ulong4, +) -DECLOP_4VAR_2IN_1OUT(ulong4, -) -DECLOP_4VAR_2IN_1OUT(ulong4, *) -DECLOP_4VAR_2IN_1OUT(ulong4, /) -DECLOP_4VAR_2IN_1OUT(ulong4, %) -DECLOP_4VAR_2IN_1OUT(ulong4, &) -DECLOP_4VAR_2IN_1OUT(ulong4, |) -DECLOP_4VAR_2IN_1OUT(ulong4, ^) -DECLOP_4VAR_2IN_1OUT(ulong4, <<) -DECLOP_4VAR_2IN_1OUT(ulong4, >>) - -DECLOP_4VAR_ASSIGN(ulong4, +=) -DECLOP_4VAR_ASSIGN(ulong4, -=) -DECLOP_4VAR_ASSIGN(ulong4, *=) -DECLOP_4VAR_ASSIGN(ulong4, /=) -DECLOP_4VAR_ASSIGN(ulong4, %=) -DECLOP_4VAR_ASSIGN(ulong4, &=) -DECLOP_4VAR_ASSIGN(ulong4, |=) -DECLOP_4VAR_ASSIGN(ulong4, ^=) -DECLOP_4VAR_ASSIGN(ulong4, <<=) -DECLOP_4VAR_ASSIGN(ulong4, >>=) - -DECLOP_4VAR_PREOP(ulong4, ++) -DECLOP_4VAR_PREOP(ulong4, --) - -DECLOP_4VAR_POSTOP(ulong4, ++) -DECLOP_4VAR_POSTOP(ulong4, --) - -DECLOP_4VAR_COMP(ulong4, ==) -DECLOP_4VAR_COMP(ulong4, !=) -DECLOP_4VAR_COMP(ulong4, <) -DECLOP_4VAR_COMP(ulong4, >) -DECLOP_4VAR_COMP(ulong4, <=) -DECLOP_4VAR_COMP(ulong4, >=) - -DECLOP_4VAR_COMP(ulong4, &&) -DECLOP_4VAR_COMP(ulong4, ||) - -DECLOP_4VAR_1IN_1OUT(ulong4, ~) -DECLOP_4VAR_1IN_BOOLOUT(ulong4, !) - -DECLOP_4VAR_SCALE_PRODUCT(ulong4, unsigned char) -DECLOP_4VAR_SCALE_PRODUCT(ulong4, signed char) -DECLOP_4VAR_SCALE_PRODUCT(ulong4, unsigned short) -DECLOP_4VAR_SCALE_PRODUCT(ulong4, signed short) -DECLOP_4VAR_SCALE_PRODUCT(ulong4, unsigned int) -DECLOP_4VAR_SCALE_PRODUCT(ulong4, signed int) -DECLOP_4VAR_SCALE_PRODUCT(ulong4, float) -DECLOP_4VAR_SCALE_PRODUCT(ulong4, unsigned long) -DECLOP_4VAR_SCALE_PRODUCT(ulong4, signed long) -DECLOP_4VAR_SCALE_PRODUCT(ulong4, double) -DECLOP_4VAR_SCALE_PRODUCT(ulong4, unsigned long long) -DECLOP_4VAR_SCALE_PRODUCT(ulong4, signed long long) - -// SIGNED LONG1 - -DECLOP_1VAR_2IN_1OUT(long1, +) -DECLOP_1VAR_2IN_1OUT(long1, -) -DECLOP_1VAR_2IN_1OUT(long1, *) -DECLOP_1VAR_2IN_1OUT(long1, /) -DECLOP_1VAR_2IN_1OUT(long1, %) -DECLOP_1VAR_2IN_1OUT(long1, &) -DECLOP_1VAR_2IN_1OUT(long1, |) -DECLOP_1VAR_2IN_1OUT(long1, ^) -DECLOP_1VAR_2IN_1OUT(long1, <<) -DECLOP_1VAR_2IN_1OUT(long1, >>) - - -DECLOP_1VAR_ASSIGN(long1, +=) -DECLOP_1VAR_ASSIGN(long1, -=) -DECLOP_1VAR_ASSIGN(long1, *=) -DECLOP_1VAR_ASSIGN(long1, /=) -DECLOP_1VAR_ASSIGN(long1, %=) -DECLOP_1VAR_ASSIGN(long1, &=) -DECLOP_1VAR_ASSIGN(long1, |=) -DECLOP_1VAR_ASSIGN(long1, ^=) -DECLOP_1VAR_ASSIGN(long1, <<=) -DECLOP_1VAR_ASSIGN(long1, >>=) - -DECLOP_1VAR_PREOP(long1, ++) -DECLOP_1VAR_PREOP(long1, --) - -DECLOP_1VAR_POSTOP(long1, ++) -DECLOP_1VAR_POSTOP(long1, --) - -DECLOP_1VAR_COMP(long1, ==) -DECLOP_1VAR_COMP(long1, !=) -DECLOP_1VAR_COMP(long1, <) -DECLOP_1VAR_COMP(long1, >) -DECLOP_1VAR_COMP(long1, <=) -DECLOP_1VAR_COMP(long1, >=) - -DECLOP_1VAR_COMP(long1, &&) -DECLOP_1VAR_COMP(long1, ||) - -DECLOP_1VAR_1IN_1OUT(long1, ~) -DECLOP_1VAR_1IN_BOOLOUT(long1, !) - -DECLOP_1VAR_SCALE_PRODUCT(long1, unsigned char) -DECLOP_1VAR_SCALE_PRODUCT(long1, signed char) -DECLOP_1VAR_SCALE_PRODUCT(long1, unsigned short) -DECLOP_1VAR_SCALE_PRODUCT(long1, signed short) -DECLOP_1VAR_SCALE_PRODUCT(long1, unsigned int) -DECLOP_1VAR_SCALE_PRODUCT(long1, signed int) -DECLOP_1VAR_SCALE_PRODUCT(long1, float) -DECLOP_1VAR_SCALE_PRODUCT(long1, unsigned long) -DECLOP_1VAR_SCALE_PRODUCT(long1, signed long) -DECLOP_1VAR_SCALE_PRODUCT(long1, double) -DECLOP_1VAR_SCALE_PRODUCT(long1, unsigned long long) -DECLOP_1VAR_SCALE_PRODUCT(long1, signed long long) - -// SIGNED LONG2 - -DECLOP_2VAR_2IN_1OUT(long2, +) -DECLOP_2VAR_2IN_1OUT(long2, -) -DECLOP_2VAR_2IN_1OUT(long2, *) -DECLOP_2VAR_2IN_1OUT(long2, /) -DECLOP_2VAR_2IN_1OUT(long2, %) -DECLOP_2VAR_2IN_1OUT(long2, &) -DECLOP_2VAR_2IN_1OUT(long2, |) -DECLOP_2VAR_2IN_1OUT(long2, ^) -DECLOP_2VAR_2IN_1OUT(long2, <<) -DECLOP_2VAR_2IN_1OUT(long2, >>) - -DECLOP_2VAR_ASSIGN(long2, +=) -DECLOP_2VAR_ASSIGN(long2, -=) -DECLOP_2VAR_ASSIGN(long2, *=) -DECLOP_2VAR_ASSIGN(long2, /=) -DECLOP_2VAR_ASSIGN(long2, %=) -DECLOP_2VAR_ASSIGN(long2, &=) -DECLOP_2VAR_ASSIGN(long2, |=) -DECLOP_2VAR_ASSIGN(long2, ^=) -DECLOP_2VAR_ASSIGN(long2, <<=) -DECLOP_2VAR_ASSIGN(long2, >>=) - -DECLOP_2VAR_PREOP(long2, ++) -DECLOP_2VAR_PREOP(long2, --) - -DECLOP_2VAR_POSTOP(long2, ++) -DECLOP_2VAR_POSTOP(long2, --) - -DECLOP_2VAR_COMP(long2, ==) -DECLOP_2VAR_COMP(long2, !=) -DECLOP_2VAR_COMP(long2, <) -DECLOP_2VAR_COMP(long2, >) -DECLOP_2VAR_COMP(long2, <=) -DECLOP_2VAR_COMP(long2, >=) - -DECLOP_2VAR_COMP(long2, &&) -DECLOP_2VAR_COMP(long2, ||) - -DECLOP_2VAR_1IN_1OUT(long2, ~) -DECLOP_2VAR_1IN_BOOLOUT(long2, !) - -DECLOP_2VAR_SCALE_PRODUCT(long2, unsigned char) -DECLOP_2VAR_SCALE_PRODUCT(long2, signed char) -DECLOP_2VAR_SCALE_PRODUCT(long2, unsigned short) -DECLOP_2VAR_SCALE_PRODUCT(long2, signed short) -DECLOP_2VAR_SCALE_PRODUCT(long2, unsigned int) -DECLOP_2VAR_SCALE_PRODUCT(long2, signed int) -DECLOP_2VAR_SCALE_PRODUCT(long2, float) -DECLOP_2VAR_SCALE_PRODUCT(long2, unsigned long) -DECLOP_2VAR_SCALE_PRODUCT(long2, signed long) -DECLOP_2VAR_SCALE_PRODUCT(long2, double) -DECLOP_2VAR_SCALE_PRODUCT(long2, unsigned long long) -DECLOP_2VAR_SCALE_PRODUCT(long2, signed long long) - -// SIGNED LONG3 - -DECLOP_3VAR_2IN_1OUT(long3, +) -DECLOP_3VAR_2IN_1OUT(long3, -) -DECLOP_3VAR_2IN_1OUT(long3, *) -DECLOP_3VAR_2IN_1OUT(long3, /) -DECLOP_3VAR_2IN_1OUT(long3, %) -DECLOP_3VAR_2IN_1OUT(long3, &) -DECLOP_3VAR_2IN_1OUT(long3, |) -DECLOP_3VAR_2IN_1OUT(long3, ^) -DECLOP_3VAR_2IN_1OUT(long3, <<) -DECLOP_3VAR_2IN_1OUT(long3, >>) - -DECLOP_3VAR_ASSIGN(long3, +=) -DECLOP_3VAR_ASSIGN(long3, -=) -DECLOP_3VAR_ASSIGN(long3, *=) -DECLOP_3VAR_ASSIGN(long3, /=) -DECLOP_3VAR_ASSIGN(long3, %=) -DECLOP_3VAR_ASSIGN(long3, &=) -DECLOP_3VAR_ASSIGN(long3, |=) -DECLOP_3VAR_ASSIGN(long3, ^=) -DECLOP_3VAR_ASSIGN(long3, <<=) -DECLOP_3VAR_ASSIGN(long3, >>=) - -DECLOP_3VAR_PREOP(long3, ++) -DECLOP_3VAR_PREOP(long3, --) - -DECLOP_3VAR_POSTOP(long3, ++) -DECLOP_3VAR_POSTOP(long3, --) - -DECLOP_3VAR_COMP(long3, ==) -DECLOP_3VAR_COMP(long3, !=) -DECLOP_3VAR_COMP(long3, <) -DECLOP_3VAR_COMP(long3, >) -DECLOP_3VAR_COMP(long3, <=) -DECLOP_3VAR_COMP(long3, >=) - -DECLOP_3VAR_COMP(long3, &&) -DECLOP_3VAR_COMP(long3, ||) - -DECLOP_3VAR_1IN_1OUT(long3, ~) -DECLOP_3VAR_1IN_BOOLOUT(long3, !) - -DECLOP_3VAR_SCALE_PRODUCT(long3, unsigned char) -DECLOP_3VAR_SCALE_PRODUCT(long3, signed char) -DECLOP_3VAR_SCALE_PRODUCT(long3, unsigned short) -DECLOP_3VAR_SCALE_PRODUCT(long3, signed short) -DECLOP_3VAR_SCALE_PRODUCT(long3, unsigned int) -DECLOP_3VAR_SCALE_PRODUCT(long3, signed int) -DECLOP_3VAR_SCALE_PRODUCT(long3, float) -DECLOP_3VAR_SCALE_PRODUCT(long3, unsigned long) -DECLOP_3VAR_SCALE_PRODUCT(long3, signed long) -DECLOP_3VAR_SCALE_PRODUCT(long3, double) -DECLOP_3VAR_SCALE_PRODUCT(long3, unsigned long long) -DECLOP_3VAR_SCALE_PRODUCT(long3, signed long long) - -// SIGNED LONG4 - -DECLOP_4VAR_2IN_1OUT(long4, +) -DECLOP_4VAR_2IN_1OUT(long4, -) -DECLOP_4VAR_2IN_1OUT(long4, *) -DECLOP_4VAR_2IN_1OUT(long4, /) -DECLOP_4VAR_2IN_1OUT(long4, %) -DECLOP_4VAR_2IN_1OUT(long4, &) -DECLOP_4VAR_2IN_1OUT(long4, |) -DECLOP_4VAR_2IN_1OUT(long4, ^) -DECLOP_4VAR_2IN_1OUT(long4, <<) -DECLOP_4VAR_2IN_1OUT(long4, >>) - -DECLOP_4VAR_ASSIGN(long4, +=) -DECLOP_4VAR_ASSIGN(long4, -=) -DECLOP_4VAR_ASSIGN(long4, *=) -DECLOP_4VAR_ASSIGN(long4, /=) -DECLOP_4VAR_ASSIGN(long4, %=) -DECLOP_4VAR_ASSIGN(long4, &=) -DECLOP_4VAR_ASSIGN(long4, |=) -DECLOP_4VAR_ASSIGN(long4, ^=) -DECLOP_4VAR_ASSIGN(long4, <<=) -DECLOP_4VAR_ASSIGN(long4, >>=) - -DECLOP_4VAR_PREOP(long4, ++) -DECLOP_4VAR_PREOP(long4, --) - -DECLOP_4VAR_POSTOP(long4, ++) -DECLOP_4VAR_POSTOP(long4, --) - -DECLOP_4VAR_COMP(long4, ==) -DECLOP_4VAR_COMP(long4, !=) -DECLOP_4VAR_COMP(long4, <) -DECLOP_4VAR_COMP(long4, >) -DECLOP_4VAR_COMP(long4, <=) -DECLOP_4VAR_COMP(long4, >=) - -DECLOP_4VAR_COMP(long4, &&) -DECLOP_4VAR_COMP(long4, ||) - -DECLOP_4VAR_1IN_1OUT(long4, ~) -DECLOP_4VAR_1IN_BOOLOUT(long4, !) - -DECLOP_4VAR_SCALE_PRODUCT(long4, unsigned char) -DECLOP_4VAR_SCALE_PRODUCT(long4, signed char) -DECLOP_4VAR_SCALE_PRODUCT(long4, unsigned short) -DECLOP_4VAR_SCALE_PRODUCT(long4, signed short) -DECLOP_4VAR_SCALE_PRODUCT(long4, unsigned int) -DECLOP_4VAR_SCALE_PRODUCT(long4, signed int) -DECLOP_4VAR_SCALE_PRODUCT(long4, float) -DECLOP_4VAR_SCALE_PRODUCT(long4, unsigned long) -DECLOP_4VAR_SCALE_PRODUCT(long4, signed long) -DECLOP_4VAR_SCALE_PRODUCT(long4, double) -DECLOP_4VAR_SCALE_PRODUCT(long4, unsigned long long) -DECLOP_4VAR_SCALE_PRODUCT(long4, signed long long) - -// UNSIGNED LONGLONG1 - -DECLOP_1VAR_2IN_1OUT(ulonglong1, +) -DECLOP_1VAR_2IN_1OUT(ulonglong1, -) -DECLOP_1VAR_2IN_1OUT(ulonglong1, *) -DECLOP_1VAR_2IN_1OUT(ulonglong1, /) -DECLOP_1VAR_2IN_1OUT(ulonglong1, %) -DECLOP_1VAR_2IN_1OUT(ulonglong1, &) -DECLOP_1VAR_2IN_1OUT(ulonglong1, |) -DECLOP_1VAR_2IN_1OUT(ulonglong1, ^) -DECLOP_1VAR_2IN_1OUT(ulonglong1, <<) -DECLOP_1VAR_2IN_1OUT(ulonglong1, >>) - - -DECLOP_1VAR_ASSIGN(ulonglong1, +=) -DECLOP_1VAR_ASSIGN(ulonglong1, -=) -DECLOP_1VAR_ASSIGN(ulonglong1, *=) -DECLOP_1VAR_ASSIGN(ulonglong1, /=) -DECLOP_1VAR_ASSIGN(ulonglong1, %=) -DECLOP_1VAR_ASSIGN(ulonglong1, &=) -DECLOP_1VAR_ASSIGN(ulonglong1, |=) -DECLOP_1VAR_ASSIGN(ulonglong1, ^=) -DECLOP_1VAR_ASSIGN(ulonglong1, <<=) -DECLOP_1VAR_ASSIGN(ulonglong1, >>=) - -DECLOP_1VAR_PREOP(ulonglong1, ++) -DECLOP_1VAR_PREOP(ulonglong1, --) - -DECLOP_1VAR_POSTOP(ulonglong1, ++) -DECLOP_1VAR_POSTOP(ulonglong1, --) - -DECLOP_1VAR_COMP(ulonglong1, ==) -DECLOP_1VAR_COMP(ulonglong1, !=) -DECLOP_1VAR_COMP(ulonglong1, <) -DECLOP_1VAR_COMP(ulonglong1, >) -DECLOP_1VAR_COMP(ulonglong1, <=) -DECLOP_1VAR_COMP(ulonglong1, >=) - -DECLOP_1VAR_COMP(ulonglong1, &&) -DECLOP_1VAR_COMP(ulonglong1, ||) - -DECLOP_1VAR_1IN_1OUT(ulonglong1, ~) -DECLOP_1VAR_1IN_BOOLOUT(ulonglong1, !) - -DECLOP_1VAR_SCALE_PRODUCT(ulonglong1, unsigned char) -DECLOP_1VAR_SCALE_PRODUCT(ulonglong1, signed char) -DECLOP_1VAR_SCALE_PRODUCT(ulonglong1, unsigned short) -DECLOP_1VAR_SCALE_PRODUCT(ulonglong1, signed short) -DECLOP_1VAR_SCALE_PRODUCT(ulonglong1, unsigned int) -DECLOP_1VAR_SCALE_PRODUCT(ulonglong1, signed int) -DECLOP_1VAR_SCALE_PRODUCT(ulonglong1, float) -DECLOP_1VAR_SCALE_PRODUCT(ulonglong1, unsigned long) -DECLOP_1VAR_SCALE_PRODUCT(ulonglong1, signed long) -DECLOP_1VAR_SCALE_PRODUCT(ulonglong1, double) -DECLOP_1VAR_SCALE_PRODUCT(ulonglong1, unsigned long long) -DECLOP_1VAR_SCALE_PRODUCT(ulonglong1, signed long long) - -// UNSIGNED LONGLONG2 - -DECLOP_2VAR_2IN_1OUT(ulonglong2, +) -DECLOP_2VAR_2IN_1OUT(ulonglong2, -) -DECLOP_2VAR_2IN_1OUT(ulonglong2, *) -DECLOP_2VAR_2IN_1OUT(ulonglong2, /) -DECLOP_2VAR_2IN_1OUT(ulonglong2, %) -DECLOP_2VAR_2IN_1OUT(ulonglong2, &) -DECLOP_2VAR_2IN_1OUT(ulonglong2, |) -DECLOP_2VAR_2IN_1OUT(ulonglong2, ^) -DECLOP_2VAR_2IN_1OUT(ulonglong2, <<) -DECLOP_2VAR_2IN_1OUT(ulonglong2, >>) - -DECLOP_2VAR_ASSIGN(ulonglong2, +=) -DECLOP_2VAR_ASSIGN(ulonglong2, -=) -DECLOP_2VAR_ASSIGN(ulonglong2, *=) -DECLOP_2VAR_ASSIGN(ulonglong2, /=) -DECLOP_2VAR_ASSIGN(ulonglong2, %=) -DECLOP_2VAR_ASSIGN(ulonglong2, &=) -DECLOP_2VAR_ASSIGN(ulonglong2, |=) -DECLOP_2VAR_ASSIGN(ulonglong2, ^=) -DECLOP_2VAR_ASSIGN(ulonglong2, <<=) -DECLOP_2VAR_ASSIGN(ulonglong2, >>=) - -DECLOP_2VAR_PREOP(ulonglong2, ++) -DECLOP_2VAR_PREOP(ulonglong2, --) - -DECLOP_2VAR_POSTOP(ulonglong2, ++) -DECLOP_2VAR_POSTOP(ulonglong2, --) - -DECLOP_2VAR_COMP(ulonglong2, ==) -DECLOP_2VAR_COMP(ulonglong2, !=) -DECLOP_2VAR_COMP(ulonglong2, <) -DECLOP_2VAR_COMP(ulonglong2, >) -DECLOP_2VAR_COMP(ulonglong2, <=) -DECLOP_2VAR_COMP(ulonglong2, >=) - -DECLOP_2VAR_COMP(ulonglong2, &&) -DECLOP_2VAR_COMP(ulonglong2, ||) - -DECLOP_2VAR_1IN_1OUT(ulonglong2, ~) -DECLOP_2VAR_1IN_BOOLOUT(ulonglong2, !) - -DECLOP_2VAR_SCALE_PRODUCT(ulonglong2, unsigned char) -DECLOP_2VAR_SCALE_PRODUCT(ulonglong2, signed char) -DECLOP_2VAR_SCALE_PRODUCT(ulonglong2, unsigned short) -DECLOP_2VAR_SCALE_PRODUCT(ulonglong2, signed short) -DECLOP_2VAR_SCALE_PRODUCT(ulonglong2, unsigned int) -DECLOP_2VAR_SCALE_PRODUCT(ulonglong2, signed int) -DECLOP_2VAR_SCALE_PRODUCT(ulonglong2, float) -DECLOP_2VAR_SCALE_PRODUCT(ulonglong2, unsigned long) -DECLOP_2VAR_SCALE_PRODUCT(ulonglong2, signed long) -DECLOP_2VAR_SCALE_PRODUCT(ulonglong2, double) -DECLOP_2VAR_SCALE_PRODUCT(ulonglong2, unsigned long long) -DECLOP_2VAR_SCALE_PRODUCT(ulonglong2, signed long long) - -// UNSIGNED LONGLONG3 - -DECLOP_3VAR_2IN_1OUT(ulonglong3, +) -DECLOP_3VAR_2IN_1OUT(ulonglong3, -) -DECLOP_3VAR_2IN_1OUT(ulonglong3, *) -DECLOP_3VAR_2IN_1OUT(ulonglong3, /) -DECLOP_3VAR_2IN_1OUT(ulonglong3, %) -DECLOP_3VAR_2IN_1OUT(ulonglong3, &) -DECLOP_3VAR_2IN_1OUT(ulonglong3, |) -DECLOP_3VAR_2IN_1OUT(ulonglong3, ^) -DECLOP_3VAR_2IN_1OUT(ulonglong3, <<) -DECLOP_3VAR_2IN_1OUT(ulonglong3, >>) - -DECLOP_3VAR_ASSIGN(ulonglong3, +=) -DECLOP_3VAR_ASSIGN(ulonglong3, -=) -DECLOP_3VAR_ASSIGN(ulonglong3, *=) -DECLOP_3VAR_ASSIGN(ulonglong3, /=) -DECLOP_3VAR_ASSIGN(ulonglong3, %=) -DECLOP_3VAR_ASSIGN(ulonglong3, &=) -DECLOP_3VAR_ASSIGN(ulonglong3, |=) -DECLOP_3VAR_ASSIGN(ulonglong3, ^=) -DECLOP_3VAR_ASSIGN(ulonglong3, <<=) -DECLOP_3VAR_ASSIGN(ulonglong3, >>=) - -DECLOP_3VAR_PREOP(ulonglong3, ++) -DECLOP_3VAR_PREOP(ulonglong3, --) - -DECLOP_3VAR_POSTOP(ulonglong3, ++) -DECLOP_3VAR_POSTOP(ulonglong3, --) - -DECLOP_3VAR_COMP(ulonglong3, ==) -DECLOP_3VAR_COMP(ulonglong3, !=) -DECLOP_3VAR_COMP(ulonglong3, <) -DECLOP_3VAR_COMP(ulonglong3, >) -DECLOP_3VAR_COMP(ulonglong3, <=) -DECLOP_3VAR_COMP(ulonglong3, >=) - -DECLOP_3VAR_COMP(ulonglong3, &&) -DECLOP_3VAR_COMP(ulonglong3, ||) - -DECLOP_3VAR_1IN_1OUT(ulonglong3, ~) -DECLOP_3VAR_1IN_BOOLOUT(ulonglong3, !) - -DECLOP_3VAR_SCALE_PRODUCT(ulonglong3, unsigned char) -DECLOP_3VAR_SCALE_PRODUCT(ulonglong3, signed char) -DECLOP_3VAR_SCALE_PRODUCT(ulonglong3, unsigned short) -DECLOP_3VAR_SCALE_PRODUCT(ulonglong3, signed short) -DECLOP_3VAR_SCALE_PRODUCT(ulonglong3, unsigned int) -DECLOP_3VAR_SCALE_PRODUCT(ulonglong3, signed int) -DECLOP_3VAR_SCALE_PRODUCT(ulonglong3, float) -DECLOP_3VAR_SCALE_PRODUCT(ulonglong3, unsigned long) -DECLOP_3VAR_SCALE_PRODUCT(ulonglong3, signed long) -DECLOP_3VAR_SCALE_PRODUCT(ulonglong3, double) -DECLOP_3VAR_SCALE_PRODUCT(ulonglong3, unsigned long long) -DECLOP_3VAR_SCALE_PRODUCT(ulonglong3, signed long long) - -// UNSIGNED LONGLONG4 - -DECLOP_4VAR_2IN_1OUT(ulonglong4, +) -DECLOP_4VAR_2IN_1OUT(ulonglong4, -) -DECLOP_4VAR_2IN_1OUT(ulonglong4, *) -DECLOP_4VAR_2IN_1OUT(ulonglong4, /) -DECLOP_4VAR_2IN_1OUT(ulonglong4, %) -DECLOP_4VAR_2IN_1OUT(ulonglong4, &) -DECLOP_4VAR_2IN_1OUT(ulonglong4, |) -DECLOP_4VAR_2IN_1OUT(ulonglong4, ^) -DECLOP_4VAR_2IN_1OUT(ulonglong4, <<) -DECLOP_4VAR_2IN_1OUT(ulonglong4, >>) - -DECLOP_4VAR_ASSIGN(ulonglong4, +=) -DECLOP_4VAR_ASSIGN(ulonglong4, -=) -DECLOP_4VAR_ASSIGN(ulonglong4, *=) -DECLOP_4VAR_ASSIGN(ulonglong4, /=) -DECLOP_4VAR_ASSIGN(ulonglong4, %=) -DECLOP_4VAR_ASSIGN(ulonglong4, &=) -DECLOP_4VAR_ASSIGN(ulonglong4, |=) -DECLOP_4VAR_ASSIGN(ulonglong4, ^=) -DECLOP_4VAR_ASSIGN(ulonglong4, <<=) -DECLOP_4VAR_ASSIGN(ulonglong4, >>=) - -DECLOP_4VAR_PREOP(ulonglong4, ++) -DECLOP_4VAR_PREOP(ulonglong4, --) - -DECLOP_4VAR_POSTOP(ulonglong4, ++) -DECLOP_4VAR_POSTOP(ulonglong4, --) - -DECLOP_4VAR_COMP(ulonglong4, ==) -DECLOP_4VAR_COMP(ulonglong4, !=) -DECLOP_4VAR_COMP(ulonglong4, <) -DECLOP_4VAR_COMP(ulonglong4, >) -DECLOP_4VAR_COMP(ulonglong4, <=) -DECLOP_4VAR_COMP(ulonglong4, >=) - -DECLOP_4VAR_COMP(ulonglong4, &&) -DECLOP_4VAR_COMP(ulonglong4, ||) - -DECLOP_4VAR_1IN_1OUT(ulonglong4, ~) -DECLOP_4VAR_1IN_BOOLOUT(ulonglong4, !) - -DECLOP_4VAR_SCALE_PRODUCT(ulonglong4, unsigned char) -DECLOP_4VAR_SCALE_PRODUCT(ulonglong4, signed char) -DECLOP_4VAR_SCALE_PRODUCT(ulonglong4, unsigned short) -DECLOP_4VAR_SCALE_PRODUCT(ulonglong4, signed short) -DECLOP_4VAR_SCALE_PRODUCT(ulonglong4, unsigned int) -DECLOP_4VAR_SCALE_PRODUCT(ulonglong4, signed int) -DECLOP_4VAR_SCALE_PRODUCT(ulonglong4, float) -DECLOP_4VAR_SCALE_PRODUCT(ulonglong4, unsigned long) -DECLOP_4VAR_SCALE_PRODUCT(ulonglong4, signed long) -DECLOP_4VAR_SCALE_PRODUCT(ulonglong4, double) -DECLOP_4VAR_SCALE_PRODUCT(ulonglong4, unsigned long long) -DECLOP_4VAR_SCALE_PRODUCT(ulonglong4, signed long long) - -// SIGNED LONGLONG1 - -DECLOP_1VAR_2IN_1OUT(longlong1, +) -DECLOP_1VAR_2IN_1OUT(longlong1, -) -DECLOP_1VAR_2IN_1OUT(longlong1, *) -DECLOP_1VAR_2IN_1OUT(longlong1, /) -DECLOP_1VAR_2IN_1OUT(longlong1, %) -DECLOP_1VAR_2IN_1OUT(longlong1, &) -DECLOP_1VAR_2IN_1OUT(longlong1, |) -DECLOP_1VAR_2IN_1OUT(longlong1, ^) -DECLOP_1VAR_2IN_1OUT(longlong1, <<) -DECLOP_1VAR_2IN_1OUT(longlong1, >>) - - -DECLOP_1VAR_ASSIGN(longlong1, +=) -DECLOP_1VAR_ASSIGN(longlong1, -=) -DECLOP_1VAR_ASSIGN(longlong1, *=) -DECLOP_1VAR_ASSIGN(longlong1, /=) -DECLOP_1VAR_ASSIGN(longlong1, %=) -DECLOP_1VAR_ASSIGN(longlong1, &=) -DECLOP_1VAR_ASSIGN(longlong1, |=) -DECLOP_1VAR_ASSIGN(longlong1, ^=) -DECLOP_1VAR_ASSIGN(longlong1, <<=) -DECLOP_1VAR_ASSIGN(longlong1, >>=) - -DECLOP_1VAR_PREOP(longlong1, ++) -DECLOP_1VAR_PREOP(longlong1, --) - -DECLOP_1VAR_POSTOP(longlong1, ++) -DECLOP_1VAR_POSTOP(longlong1, --) - -DECLOP_1VAR_COMP(longlong1, ==) -DECLOP_1VAR_COMP(longlong1, !=) -DECLOP_1VAR_COMP(longlong1, <) -DECLOP_1VAR_COMP(longlong1, >) -DECLOP_1VAR_COMP(longlong1, <=) -DECLOP_1VAR_COMP(longlong1, >=) - -DECLOP_1VAR_COMP(longlong1, &&) -DECLOP_1VAR_COMP(longlong1, ||) - -DECLOP_1VAR_1IN_1OUT(longlong1, ~) -DECLOP_1VAR_1IN_BOOLOUT(longlong1, !) - -DECLOP_1VAR_SCALE_PRODUCT(longlong1, unsigned char) -DECLOP_1VAR_SCALE_PRODUCT(longlong1, signed char) -DECLOP_1VAR_SCALE_PRODUCT(longlong1, unsigned short) -DECLOP_1VAR_SCALE_PRODUCT(longlong1, signed short) -DECLOP_1VAR_SCALE_PRODUCT(longlong1, unsigned int) -DECLOP_1VAR_SCALE_PRODUCT(longlong1, signed int) -DECLOP_1VAR_SCALE_PRODUCT(longlong1, float) -DECLOP_1VAR_SCALE_PRODUCT(longlong1, unsigned long) -DECLOP_1VAR_SCALE_PRODUCT(longlong1, signed long) -DECLOP_1VAR_SCALE_PRODUCT(longlong1, double) -DECLOP_1VAR_SCALE_PRODUCT(longlong1, unsigned long long) -DECLOP_1VAR_SCALE_PRODUCT(longlong1, signed long long) - -// SIGNED LONGLONG2 - -DECLOP_2VAR_2IN_1OUT(longlong2, +) -DECLOP_2VAR_2IN_1OUT(longlong2, -) -DECLOP_2VAR_2IN_1OUT(longlong2, *) -DECLOP_2VAR_2IN_1OUT(longlong2, /) -DECLOP_2VAR_2IN_1OUT(longlong2, %) -DECLOP_2VAR_2IN_1OUT(longlong2, &) -DECLOP_2VAR_2IN_1OUT(longlong2, |) -DECLOP_2VAR_2IN_1OUT(longlong2, ^) -DECLOP_2VAR_2IN_1OUT(longlong2, <<) -DECLOP_2VAR_2IN_1OUT(longlong2, >>) - -DECLOP_2VAR_ASSIGN(longlong2, +=) -DECLOP_2VAR_ASSIGN(longlong2, -=) -DECLOP_2VAR_ASSIGN(longlong2, *=) -DECLOP_2VAR_ASSIGN(longlong2, /=) -DECLOP_2VAR_ASSIGN(longlong2, %=) -DECLOP_2VAR_ASSIGN(longlong2, &=) -DECLOP_2VAR_ASSIGN(longlong2, |=) -DECLOP_2VAR_ASSIGN(longlong2, ^=) -DECLOP_2VAR_ASSIGN(longlong2, <<=) -DECLOP_2VAR_ASSIGN(longlong2, >>=) - -DECLOP_2VAR_PREOP(longlong2, ++) -DECLOP_2VAR_PREOP(longlong2, --) - -DECLOP_2VAR_POSTOP(longlong2, ++) -DECLOP_2VAR_POSTOP(longlong2, --) - -DECLOP_2VAR_COMP(longlong2, ==) -DECLOP_2VAR_COMP(longlong2, !=) -DECLOP_2VAR_COMP(longlong2, <) -DECLOP_2VAR_COMP(longlong2, >) -DECLOP_2VAR_COMP(longlong2, <=) -DECLOP_2VAR_COMP(longlong2, >=) - -DECLOP_2VAR_COMP(longlong2, &&) -DECLOP_2VAR_COMP(longlong2, ||) - -DECLOP_2VAR_1IN_1OUT(longlong2, ~) -DECLOP_2VAR_1IN_BOOLOUT(longlong2, !) - -DECLOP_2VAR_SCALE_PRODUCT(longlong2, unsigned char) -DECLOP_2VAR_SCALE_PRODUCT(longlong2, signed char) -DECLOP_2VAR_SCALE_PRODUCT(longlong2, unsigned short) -DECLOP_2VAR_SCALE_PRODUCT(longlong2, signed short) -DECLOP_2VAR_SCALE_PRODUCT(longlong2, unsigned int) -DECLOP_2VAR_SCALE_PRODUCT(longlong2, signed int) -DECLOP_2VAR_SCALE_PRODUCT(longlong2, float) -DECLOP_2VAR_SCALE_PRODUCT(longlong2, unsigned long) -DECLOP_2VAR_SCALE_PRODUCT(longlong2, signed long) -DECLOP_2VAR_SCALE_PRODUCT(longlong2, double) -DECLOP_2VAR_SCALE_PRODUCT(longlong2, unsigned long long) -DECLOP_2VAR_SCALE_PRODUCT(longlong2, signed long long) - -// SIGNED LONGLONG3 - -DECLOP_3VAR_2IN_1OUT(longlong3, +) -DECLOP_3VAR_2IN_1OUT(longlong3, -) -DECLOP_3VAR_2IN_1OUT(longlong3, *) -DECLOP_3VAR_2IN_1OUT(longlong3, /) -DECLOP_3VAR_2IN_1OUT(longlong3, %) -DECLOP_3VAR_2IN_1OUT(longlong3, &) -DECLOP_3VAR_2IN_1OUT(longlong3, |) -DECLOP_3VAR_2IN_1OUT(longlong3, ^) -DECLOP_3VAR_2IN_1OUT(longlong3, <<) -DECLOP_3VAR_2IN_1OUT(longlong3, >>) - -DECLOP_3VAR_ASSIGN(longlong3, +=) -DECLOP_3VAR_ASSIGN(longlong3, -=) -DECLOP_3VAR_ASSIGN(longlong3, *=) -DECLOP_3VAR_ASSIGN(longlong3, /=) -DECLOP_3VAR_ASSIGN(longlong3, %=) -DECLOP_3VAR_ASSIGN(longlong3, &=) -DECLOP_3VAR_ASSIGN(longlong3, |=) -DECLOP_3VAR_ASSIGN(longlong3, ^=) -DECLOP_3VAR_ASSIGN(longlong3, <<=) -DECLOP_3VAR_ASSIGN(longlong3, >>=) - -DECLOP_3VAR_PREOP(longlong3, ++) -DECLOP_3VAR_PREOP(longlong3, --) - -DECLOP_3VAR_POSTOP(longlong3, ++) -DECLOP_3VAR_POSTOP(longlong3, --) - -DECLOP_3VAR_COMP(longlong3, ==) -DECLOP_3VAR_COMP(longlong3, !=) -DECLOP_3VAR_COMP(longlong3, <) -DECLOP_3VAR_COMP(longlong3, >) -DECLOP_3VAR_COMP(longlong3, <=) -DECLOP_3VAR_COMP(longlong3, >=) - -DECLOP_3VAR_COMP(longlong3, &&) -DECLOP_3VAR_COMP(longlong3, ||) - -DECLOP_3VAR_1IN_1OUT(longlong3, ~) -DECLOP_3VAR_1IN_BOOLOUT(longlong3, !) - -DECLOP_3VAR_SCALE_PRODUCT(longlong3, unsigned char) -DECLOP_3VAR_SCALE_PRODUCT(longlong3, signed char) -DECLOP_3VAR_SCALE_PRODUCT(longlong3, unsigned short) -DECLOP_3VAR_SCALE_PRODUCT(longlong3, signed short) -DECLOP_3VAR_SCALE_PRODUCT(longlong3, unsigned int) -DECLOP_3VAR_SCALE_PRODUCT(longlong3, signed int) -DECLOP_3VAR_SCALE_PRODUCT(longlong3, float) -DECLOP_3VAR_SCALE_PRODUCT(longlong3, unsigned long) -DECLOP_3VAR_SCALE_PRODUCT(longlong3, signed long) -DECLOP_3VAR_SCALE_PRODUCT(longlong3, double) -DECLOP_3VAR_SCALE_PRODUCT(longlong3, unsigned long long) -DECLOP_3VAR_SCALE_PRODUCT(longlong3, signed long long) - -// SIGNED LONGLONG4 - -DECLOP_4VAR_2IN_1OUT(longlong4, +) -DECLOP_4VAR_2IN_1OUT(longlong4, -) -DECLOP_4VAR_2IN_1OUT(longlong4, *) -DECLOP_4VAR_2IN_1OUT(longlong4, /) -DECLOP_4VAR_2IN_1OUT(longlong4, %) -DECLOP_4VAR_2IN_1OUT(longlong4, &) -DECLOP_4VAR_2IN_1OUT(longlong4, |) -DECLOP_4VAR_2IN_1OUT(longlong4, ^) -DECLOP_4VAR_2IN_1OUT(longlong4, <<) -DECLOP_4VAR_2IN_1OUT(longlong4, >>) - -DECLOP_4VAR_ASSIGN(longlong4, +=) -DECLOP_4VAR_ASSIGN(longlong4, -=) -DECLOP_4VAR_ASSIGN(longlong4, *=) -DECLOP_4VAR_ASSIGN(longlong4, /=) -DECLOP_4VAR_ASSIGN(longlong4, %=) -DECLOP_4VAR_ASSIGN(longlong4, &=) -DECLOP_4VAR_ASSIGN(longlong4, |=) -DECLOP_4VAR_ASSIGN(longlong4, ^=) -DECLOP_4VAR_ASSIGN(longlong4, <<=) -DECLOP_4VAR_ASSIGN(longlong4, >>=) - -DECLOP_4VAR_PREOP(longlong4, ++) -DECLOP_4VAR_PREOP(longlong4, --) - -DECLOP_4VAR_POSTOP(longlong4, ++) -DECLOP_4VAR_POSTOP(longlong4, --) - -DECLOP_4VAR_COMP(longlong4, ==) -DECLOP_4VAR_COMP(longlong4, !=) -DECLOP_4VAR_COMP(longlong4, <) -DECLOP_4VAR_COMP(longlong4, >) -DECLOP_4VAR_COMP(longlong4, <=) -DECLOP_4VAR_COMP(longlong4, >=) - -DECLOP_4VAR_COMP(longlong4, &&) -DECLOP_4VAR_COMP(longlong4, ||) - -DECLOP_4VAR_1IN_1OUT(longlong4, ~) -DECLOP_4VAR_1IN_BOOLOUT(longlong4, !) - -DECLOP_4VAR_SCALE_PRODUCT(longlong4, unsigned char) -DECLOP_4VAR_SCALE_PRODUCT(longlong4, signed char) -DECLOP_4VAR_SCALE_PRODUCT(longlong4, unsigned short) -DECLOP_4VAR_SCALE_PRODUCT(longlong4, signed short) -DECLOP_4VAR_SCALE_PRODUCT(longlong4, unsigned int) -DECLOP_4VAR_SCALE_PRODUCT(longlong4, signed int) -DECLOP_4VAR_SCALE_PRODUCT(longlong4, float) -DECLOP_4VAR_SCALE_PRODUCT(longlong4, unsigned long) -DECLOP_4VAR_SCALE_PRODUCT(longlong4, signed long) -DECLOP_4VAR_SCALE_PRODUCT(longlong4, double) -DECLOP_4VAR_SCALE_PRODUCT(longlong4, unsigned long long) -DECLOP_4VAR_SCALE_PRODUCT(longlong4, signed long long) - - -#endif - - -#endif +#endif \ No newline at end of file diff --git a/projects/hip/include/hip/hcc_detail/texture_functions.h b/projects/hip/include/hip/hcc_detail/texture_functions.h index 8a7aec9212..999f97e65e 100644 --- a/projects/hip/include/hip/hcc_detail/texture_functions.h +++ b/projects/hip/include/hip/hcc_detail/texture_functions.h @@ -110,47 +110,47 @@ union TData { #define TEXTURE_RETURN_UNSIGNED return texel.u.x; -#define TEXTURE_RETURN_CHAR_X return char1(texel.i.x); +#define TEXTURE_RETURN_CHAR_X return make_char1(texel.i.x); -#define TEXTURE_RETURN_UCHAR_X return uchar1(texel.u.x); +#define TEXTURE_RETURN_UCHAR_X return make_uchar1(texel.u.x); -#define TEXTURE_RETURN_SHORT_X return short1(texel.i.x); +#define TEXTURE_RETURN_SHORT_X return make_short1(texel.i.x); -#define TEXTURE_RETURN_USHORT_X return ushort1(texel.u.x); +#define TEXTURE_RETURN_USHORT_X return make_ushort1(texel.u.x); -#define TEXTURE_RETURN_INT_X return int1(texel.i.x); +#define TEXTURE_RETURN_INT_X return make_int1(texel.i.x); -#define TEXTURE_RETURN_UINT_X return uint1(texel.u.x); +#define TEXTURE_RETURN_UINT_X return make_uint1(texel.u.x); -#define TEXTURE_RETURN_FLOAT_X return float1(texel.f.x); +#define TEXTURE_RETURN_FLOAT_X return make_float1(texel.f.x); -#define TEXTURE_RETURN_CHAR_XY return char2(texel.i.x, texel.i.y); +#define TEXTURE_RETURN_CHAR_XY return make_char2(texel.i.x, texel.i.y); -#define TEXTURE_RETURN_UCHAR_XY return uchar2(texel.u.x, texel.u.y); +#define TEXTURE_RETURN_UCHAR_XY return make_uchar2(texel.u.x, texel.u.y); -#define TEXTURE_RETURN_SHORT_XY return short2(texel.i.x, texel.i.y); +#define TEXTURE_RETURN_SHORT_XY return make_short2(texel.i.x, texel.i.y); -#define TEXTURE_RETURN_USHORT_XY return ushort2(texel.u.x, texel.u.y); +#define TEXTURE_RETURN_USHORT_XY return make_ushort2(texel.u.x, texel.u.y); -#define TEXTURE_RETURN_INT_XY return int2(texel.i.x, texel.i.y); +#define TEXTURE_RETURN_INT_XY return make_int2(texel.i.x, texel.i.y); -#define TEXTURE_RETURN_UINT_XY return uint2(texel.u.x, texel.u.y); +#define TEXTURE_RETURN_UINT_XY return make_uint2(texel.u.x, texel.u.y); -#define TEXTURE_RETURN_FLOAT_XY return float2(texel.f.x, texel.f.y); +#define TEXTURE_RETURN_FLOAT_XY return make_float2(texel.f.x, texel.f.y); -#define TEXTURE_RETURN_CHAR_XYZW return char4(texel.i.x, texel.i.y, texel.i.z, texel.i.w); +#define TEXTURE_RETURN_CHAR_XYZW return make_char4(texel.i.x, texel.i.y, texel.i.z, texel.i.w); -#define TEXTURE_RETURN_UCHAR_XYZW return uchar4(texel.u.x, texel.u.y, texel.u.z, texel.u.w); +#define TEXTURE_RETURN_UCHAR_XYZW return make_uchar4(texel.u.x, texel.u.y, texel.u.z, texel.u.w); -#define TEXTURE_RETURN_SHORT_XYZW return short4(texel.i.x, texel.i.y, texel.i.z, texel.i.w); +#define TEXTURE_RETURN_SHORT_XYZW return make_short4(texel.i.x, texel.i.y, texel.i.z, texel.i.w); -#define TEXTURE_RETURN_USHORT_XYZW return ushort4(texel.u.x, texel.u.y, texel.u.z, texel.u.w); +#define TEXTURE_RETURN_USHORT_XYZW return make_ushort4(texel.u.x, texel.u.y, texel.u.z, texel.u.w); -#define TEXTURE_RETURN_INT_XYZW return int4(texel.i.x, texel.i.y, texel.i.z, texel.i.w); +#define TEXTURE_RETURN_INT_XYZW return make_int4(texel.i.x, texel.i.y, texel.i.z, texel.i.w); -#define TEXTURE_RETURN_UINT_XYZW return uint4(texel.u.x, texel.u.y, texel.u.z, texel.u.w); +#define TEXTURE_RETURN_UINT_XYZW return make_uint4(texel.u.x, texel.u.y, texel.u.z, texel.u.w); -#define TEXTURE_RETURN_FLOAT_XYZW return float4(texel.f.x, texel.f.y, texel.f.z, texel.f.w); +#define TEXTURE_RETURN_FLOAT_XYZW return make_float4(texel.f.x, texel.f.y, texel.f.z, texel.f.w); extern "C" { hc::short_vector::float4::vector_value_type __ockl_image_sample_1D(unsigned int ADDRESS_SPACE_CONSTANT* i, diff --git a/projects/hip/packaging/hip_hcc.txt b/projects/hip/packaging/hip_hcc.txt index 7c1736eee5..04293f2044 100644 --- a/projects/hip/packaging/hip_hcc.txt +++ b/projects/hip/packaging/hip_hcc.txt @@ -5,7 +5,7 @@ install(FILES @PROJECT_BINARY_DIR@/libhip_hcc.so DESTINATION lib) install(FILES @PROJECT_BINARY_DIR@/libhip_hcc_static.a DESTINATION lib) install(FILES @PROJECT_BINARY_DIR@/libhip_device.a DESTINATION lib) install(FILES @PROJECT_BINARY_DIR@/.hipInfo DESTINATION lib) -install(FILES @hip_SOURCE_DIR@/src/hip_hc.ll @hip_SOURCE_DIR@/src/hip_hc_gfx803.ll DESTINATION lib) +install(FILES @hip_SOURCE_DIR@/src/hip_hc.ll DESTINATION lib) install(FILES @PROJECT_BINARY_DIR@/hip-config.cmake @PROJECT_BINARY_DIR@/hip-config-version.cmake DESTINATION lib/cmake/hip) install(FILES @hip_SOURCE_DIR@/packaging/hip-targets.cmake @hip_SOURCE_DIR@/packaging/hip-targets-release.cmake DESTINATION lib/cmake/hip) diff --git a/projects/hip/src/hip_fp16.cpp b/projects/hip/src/hip_fp16.cpp deleted file mode 100644 index 3004b7805d..0000000000 --- a/projects/hip/src/hip_fp16.cpp +++ /dev/null @@ -1,399 +0,0 @@ -/* -Copyright (c) 2015 - present Advanced Micro Devices, Inc. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -#include "hip/hcc_detail/hip_fp16.h" - -struct hipHalfHolder { - union { - __half h; - unsigned short s; - }; -}; - -__device__ __half __hadd(__half a, __half b) { return a + b; } - -__device__ __half __hadd_sat(__half a, __half b) { return a + b; } - -__device__ __half __hfma(__half a, __half b, __half c) { return a * b + c; } - -__device__ __half __hfma_sat(__half a, __half b, __half c) { return a * b + c; } - -__device__ __half __hmul(__half a, __half b) { return a * b; } - -__device__ __half __hmul_sat(__half a, __half b) { return a * b; } - -__device__ __half __hneg(__half a) { return -a; } - -__device__ __half __hsub(__half a, __half b) { return a - b; } - -__device__ __half __hsub_sat(__half a, __half b) { return a - b; } - -__device__ __half hdiv(__half a, __half b) { return a / b; } - -/* -Half comparision Functions -*/ - -__device__ bool __heq(__half a, __half b) { return a == b ? true : false; } - -__device__ bool __hge(__half a, __half b) { return a >= b ? true : false; } - -__device__ bool __hgt(__half a, __half b) { return a > b ? true : false; } - -__device__ bool __hisinf(__half a) { - hipHalfHolder hH; - hH.h = a; - // mask with 0x7fff to drop the sign bit - // 0x7c00 is bit pattern for inf (exp = 11111, significand = 0) - return ((hH.s & 0x7fff) == 0x7c00) ? true : false; -} - -__device__ bool __hisnan(__half a) { - hipHalfHolder hH; - hH.h = a; - // mask with 0x7fff to drop the sign bit - // 0x7cXX is bit pattern for inf (exp = 11111, significand = 0) - return ((hH.s & 0x7fff) > 0x7c00) ? true : false; -} - -__device__ bool __hle(__half a, __half b) { return a <= b ? true : false; } - -__device__ bool __hlt(__half a, __half b) { return a < b ? true : false; } - -__device__ bool __hne(__half a, __half b) { return a != b ? true : false; } - -/* -Half2 Comparision Functions -*/ - -__device__ bool __hbeq2(__half2 a, __half2 b) { - return (a.x == b.x ? true : false) && (a.y == b.y ? true : false); -} - -__device__ bool __hbge2(__half2 a, __half2 b) { - return (a.x >= b.x ? true : false) && (a.y >= b.y ? true : false); -} - -__device__ bool __hbgt2(__half2 a, __half2 b) { - return (a.x > b.x ? true : false) && (a.y > b.y ? true : false); -} - -__device__ bool __hble2(__half2 a, __half2 b) { - return (a.x <= b.x ? true : false) && (a.y <= b.y ? true : false); -} - -__device__ bool __hblt2(__half2 a, __half2 b) { - return (a.x < b.x ? true : false) && (a.y < b.y ? true : false); -} - -__device__ bool __hbne2(__half2 a, __half2 b) { - return (a.x != b.x ? true : false) && (a.y != b.y ? true : false); -} - -__device__ __half2 __heq2(__half2 a, __half2 b) { - __half2 c; - c.x = (a.x == b.x) ? (__half)1 : (__half)0; - c.y = (a.y == b.y) ? (__half)1 : (__half)0; - return c; -} - -__device__ __half2 __hge2(__half2 a, __half2 b) { - __half2 c; - c.x = (a.x >= b.x) ? (__half)1 : (__half)0; - c.y = (a.y >= b.y) ? (__half)1 : (__half)0; - return c; -} - -__device__ __half2 __hgt2(__half2 a, __half2 b) { - __half2 c; - c.x = (a.x > b.x) ? (__half)1 : (__half)0; - c.y = (a.y > b.y) ? (__half)1 : (__half)0; - return c; -} - -__device__ __half2 __hisnan2(__half2 a) { - __half2 c; - c.x = (__hisnan(a.x)) ? (__half)1 : (__half)0; - c.y = (__hisnan(a.y)) ? (__half)1 : (__half)0; - return c; -} - -__device__ __half2 __hle2(__half2 a, __half2 b) { - __half2 c; - c.x = (a.x <= b.x) ? (__half)1 : (__half)0; - c.y = (a.y <= b.y) ? (__half)1 : (__half)0; - return c; -} - -__device__ __half2 __hlt2(__half2 a, __half2 b) { - __half2 c; - c.x = (a.x < b.x) ? (__half)1 : (__half)0; - c.y = (a.y < b.y) ? (__half)1 : (__half)0; - return c; -} - -__device__ __half2 __hne2(__half2 a, __half2 b) { - __half2 c; - c.x = (a.x != b.x) ? (__half)1 : (__half)0; - c.y = (a.y != b.y) ? (__half)1 : (__half)0; - return c; -} - -/* -Conversion instructions -*/ -__device__ __half2 __float22half2_rn(const float2 a) { - __half2 b; - b.x = (__half)a.x; - b.y = (__half)a.y; - return b; -} - -__device__ __half __float2half(const float a) { return (__half)a; } - -__device__ __half2 __float2half2_rn(const float a) { - __half2 b; - b.x = (__half)a; - b.y = (__half)a; - return b; -} - -__device__ __half __float2half_rd(const float a) { return (__half)a; } - -__device__ __half __float2half_rn(const float a) { return (__half)a; } - -__device__ __half __float2half_ru(const float a) { return (__half)a; } - -__device__ __half __float2half_rz(const float a) { return (__half)a; } - -__device__ __half2 __floats2half2_rn(const float a, const float b) { - __half2 c; - c.x = (__half)a; - c.y = (__half)b; - return c; -} - -__device__ float2 __half22float2(const __half2 a) { - float2 b; - b.x = (float)a.x; - b.y = (float)a.y; - return b; -} - -__device__ float __half2float(const __half a) { return (float)a; } - -__device__ __half2 half2half2(const __half a) { - __half2 b; - b.x = a; - b.y = a; - return b; -} - -__device__ int __half2int_rd(__half h) { return (int)h; } - -__device__ int __half2int_rn(__half h) { return (int)h; } - -__device__ int __half2int_ru(__half h) { return (int)h; } - -__device__ int __half2int_rz(__half h) { return (int)h; } - -__device__ long long int __half2ll_rd(__half h) { return (long long int)h; } - -__device__ long long int __half2ll_rn(__half h) { return (long long int)h; } - -__device__ long long int __half2ll_ru(__half h) { return (long long int)h; } - -__device__ long long int __half2ll_rz(__half h) { return (long long int)h; } - -__device__ short __half2short_rd(__half h) { return (short)h; } - -__device__ short __half2short_rn(__half h) { return (short)h; } - -__device__ short __half2short_ru(__half h) { return (short)h; } - -__device__ short __half2short_rz(__half h) { return (short)h; } - -__device__ unsigned int __half2uint_rd(__half h) { return (unsigned int)h; } - -__device__ unsigned int __half2uint_rn(__half h) { return (unsigned int)h; } - -__device__ unsigned int __half2uint_ru(__half h) { return (unsigned int)h; } - -__device__ unsigned int __half2uint_rz(__half h) { return (unsigned int)h; } - -__device__ unsigned long long int __half2ull_rd(__half h) { return (unsigned long long)h; } - -__device__ unsigned long long int __half2ull_rn(__half h) { return (unsigned long long)h; } - -__device__ unsigned long long int __half2ull_ru(__half h) { return (unsigned long long)h; } - -__device__ unsigned long long int __half2ull_rz(__half h) { return (unsigned long long)h; } - -__device__ unsigned short int __half2ushort_rd(__half h) { return (unsigned short int)h; } - -__device__ unsigned short int __half2ushort_rn(__half h) { return (unsigned short int)h; } - -__device__ unsigned short int __half2ushort_ru(__half h) { return (unsigned short int)h; } - -__device__ unsigned short int __half2ushort_rz(__half h) { return (unsigned short int)h; } - -__device__ short int __half_as_short(const __half h) { - hipHalfHolder hH; - hH.h = h; - return (short)hH.s; -} - -__device__ unsigned short int __half_as_ushort(const __half h) { - hipHalfHolder hH; - hH.h = h; - return hH.s; -} - -__device__ __half2 __halves2half2(const __half a, const __half b) { - __half2 c; - c.x = a; - c.y = b; - return c; -} - -__device__ float __high2float(const __half2 a) { return (float)a.y; } - -__device__ __half __high2half(const __half2 a) { return a.y; } - -__device__ __half2 __high2half2(const __half2 a) { - __half2 b; - b.x = a.y; - b.y = a.y; - return b; -} - -__device__ __half2 __highs2half2(const __half2 a, const __half2 b) { - __half2 c; - c.x = a.y; - c.y = b.y; - return c; -} - -__device__ __half __int2half_rd(int i) { return (__half)i; } - -__device__ __half __int2half_rn(int i) { return (__half)i; } - -__device__ __half __int2half_ru(int i) { return (__half)i; } - -__device__ __half __int2half_rz(int i) { return (__half)i; } - -__device__ __half __ll2half_rd(long long int i) { return (__half)i; } - -__device__ __half __ll2half_rn(long long int i) { return (__half)i; } - -__device__ __half __ll2half_ru(long long int i) { return (__half)i; } - -__device__ __half __ll2half_rz(long long int i) { return (__half)i; } - -__device__ float __low2float(const __half2 a) { return (float)a.x; } - -__device__ __half __low2half(const __half2 a) { return a.x; } - -__device__ __half2 __low2half2(const __half2 a, const __half2 b) { - __half2 c; - c.x = a.x; - c.y = b.x; - return c; -} - -__device__ __half2 __low2half2(const __half2 a) { - __half2 b; - b.x = a.x; - b.y = a.x; - return b; -} - -__device__ __half2 __lowhigh2highlow(const __half2 a) { - __half2 b; - b.x = a.y; - b.y = a.x; - return b; -} - -__device__ __half2 __lows2half2(const __half2 a, const __half2 b) { - __half2 c; - c.x = a.x; - c.y = b.x; - return c; -} - -__device__ __half __short2half_rd(short int i) { return (__half)i; } - -__device__ __half __short2half_rn(short int i) { return (__half)i; } - -__device__ __half __short2half_ru(short int i) { return (__half)i; } - -__device__ __half __short2half_rz(short int i) { return (__half)i; } - -__device__ __half __uint2half_rd(unsigned int i) { return (__half)i; } - -__device__ __half __uint2half_rn(unsigned int i) { return (__half)i; } - -__device__ __half __uint2half_ru(unsigned int i) { return (__half)i; } - -__device__ __half __uint2half_rz(unsigned int i) { return (__half)i; } - -__device__ __half __ull2half_rd(unsigned long long int i) { return (__half)i; } - -__device__ __half __ull2half_rn(unsigned long long int i) { return (__half)i; } - -__device__ __half __ull2half_ru(unsigned long long int i) { return (__half)i; } - -__device__ __half __ull2half_rz(unsigned long long int i) { return (__half)i; } - -__device__ __half __ushort2half_rd(unsigned short int i) { return (__half)i; } - -__device__ __half __ushort2half_rn(unsigned short int i) { return (__half)i; } - -__device__ __half __ushort2half_ru(unsigned short int i) { return (__half)i; } - -__device__ __half __ushort2half_rz(unsigned short int i) { return (__half)i; } - -__device__ __half __ushort_as_half(const unsigned short int i) { - hipHalfHolder hH; - hH.s = i; - return hH.h; -} - - -/* -Soft Implementation. Use it for backup. -*/ - - -static const unsigned sign_val = 0x8000; -static const __half __half_value_one_float = {0x3C00}; -static const __half __half_value_zero_float = {0x0}; -static const unsigned __half_pos_inf = 0x7C00; -static const unsigned __half_neg_inf = 0xFC00; - -typedef struct { - union { - float f; - unsigned u; - }; -} struct_float; diff --git a/projects/hip/src/hip_hc_gfx803.ll b/projects/hip/src/hip_hc_gfx803.ll deleted file mode 100644 index 7e3d0e37dd..0000000000 --- a/projects/hip/src/hip_hc_gfx803.ll +++ /dev/null @@ -1,123 +0,0 @@ -target datalayout = "e-p:32:32-p1:64:64-p2:64:64-p3:32:32-p4:64:64-p5:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64" -target triple = "amdgcn--amdhsa" - - -define <2 x half> @__hip_hc_ir_hadd2_int(<2 x half> %a, <2 x half> %b) #1 { - %1 = bitcast <2 x half> %a to i32 - %2 = bitcast <2 x half> %b to i32 - %3 = tail call i32 asm sideeffect "v_add_f16 $0, $1, $2","=v,v,v"(i32 %1, i32 %2) - tail call void asm sideeffect "v_add_f16_sdwa $0, $1, $2 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1 src1_sel:WORD_1","v,v,v"(i32 %3, i32 %1, i32 %2) - %4 = bitcast i32 %3 to <2 x half> - ret <2 x half> %4 -} - -define <2 x half> @__hip_hc_ir_hfma2_int(<2 x half> %a, <2 x half> %b, <2 x half> %c) #1 { - %1 = bitcast <2 x half> %a to i32 - %2 = bitcast <2 x half> %b to i32 - %3 = bitcast <2 x half> %c to i32 - %4 = tail call i32 asm sideeffect "v_mad_f16 $0, $1, $2, $3","=v,v,v,v"(i32 %1, i32 %2, i32 %3) - tail call void asm sideeffect "v_mul_f16_sdwa $0, $1, $2 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1 src1_sel:WORD_1","v,v,v"(i32 %4, i32 %1, i32 %2) - tail call void asm sideeffect "v_add_f16_sdwa $0, $1, $2 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1 src1_sel:WORD_1","v,v,v"(i32 %4, i32 %4, i32 %3) - %5 = bitcast i32 %4 to <2 x half> - ret <2 x half> %5 -} - -define <2 x half> @__hip_hc_ir_hmul2_int(<2 x half> %a, <2 x half> %b) #1 { - %1 = bitcast <2 x half> %a to i32 - %2 = bitcast <2 x half> %b to i32 - %3 = tail call i32 asm sideeffect "v_mul_f16 $0, $1, $2","=v,v,v"(i32 %1, i32 %2) - tail call void asm sideeffect "v_mul_f16_sdwa $0, $1, $2 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1 src1_sel:WORD_1","v,v,v"(i32 %3, i32 %1, i32 %2) - %4 = bitcast i32 %3 to <2 x half> - ret <2 x half> %4 -} - -define <2 x half> @__hip_hc_ir_hsub2_int(<2 x half> %a, <2 x half> %b) #1 { - %1 = bitcast <2 x half> %a to i32 - %2 = bitcast <2 x half> %b to i32 - %3 = tail call i32 asm sideeffect "v_sub_f16 $0, $1, $2","=v,v,v"(i32 %1, i32 %2) - tail call void asm sideeffect "v_sub_f16_sdwa $0, $1, $2 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1 src1_sel:WORD_1","v,v,v"(i32 %3, i32 %1, i32 %2) - %4 = bitcast i32 %3 to <2 x half> - ret <2 x half> %4 -} - -define <2 x half> @__hip_hc_ir_h2ceil_int(<2 x half> %a) #1 { - %1 = bitcast <2 x half> %a to i32 - %2 = tail call i32 asm sideeffect "v_ceil_f16 $0, $1","=v,v"(i32 %1) - tail call void asm sideeffect "v_ceil_f16_sdwa $0, $1 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1","v,v"(i32 %2, i32 %1) - %3 = bitcast i32 %2 to <2 x half> - ret <2 x half> %3 -} - -define <2 x half> @__hip_hc_ir_h2cos_int(<2 x half> %a) #1 { - %1 = bitcast <2 x half> %a to i32 - %2 = tail call i32 asm sideeffect "v_cos_f16 $0, $1","=v,v"(i32 %1) - tail call void asm sideeffect "v_cos_f16_sdwa $0, $1 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1","v,v"(i32 %2, i32 %1) - %3 = bitcast i32 %2 to <2 x half> - ret <2 x half> %3 -} - -define <2 x half> @__hip_hc_ir_h2exp2_int(<2 x half> %a) #1 { - %1 = bitcast <2 x half> %a to i32 - %2 = tail call i32 asm sideeffect "v_exp_f16 $0, $1","=v,v"(i32 %1) - tail call void asm sideeffect "v_exp_f16_sdwa $0, $1 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1","v,v"(i32 %2, i32 %1) - %3 = bitcast i32 %2 to <2 x half> - ret <2 x half> %3 -} - -define <2 x half> @__hip_hc_ir_h2floor_int(<2 x half> %a) #1 { - %1 = bitcast <2 x half> %a to i32 - %2 = tail call i32 asm sideeffect "v_floor_f16 $0, $1","=v,v"(i32 %1) - tail call void asm sideeffect "v_floor_f16_sdwa $0, $1 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1","v,v"(i32 %2, i32 %1) - %3 = bitcast i32 %2 to <2 x half> - ret <2 x half> %3 -} - -define <2 x half> @__hip_hc_ir_h2log2_int(<2 x half> %a) #1 { - %1 = bitcast <2 x half> %a to i32 - %2 = tail call i32 asm sideeffect "v_log_f16 $0, $1","=v,v"(i32 %1) - tail call void asm sideeffect "v_log_f16_sdwa $0, $1 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1","v,v"(i32 %2, i32 %1) - %3 = bitcast i32 %2 to <2 x half> - ret <2 x half> %3 -} - -define <2 x half> @__hip_hc_ir_h2rcp_int(<2 x half> %a) #1 { - %1 = bitcast <2 x half> %a to i32 - %2 = tail call i32 asm sideeffect "v_rcp_f16 $0, $1","=v,v"(i32 %1) - tail call void asm sideeffect "v_rcp_f16_sdwa $0, $1 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1","v,v"(i32 %2, i32 %1) - %3 = bitcast i32 %2 to <2 x half> - ret <2 x half> %3 -} - -define <2 x half> @__hip_hc_ir_h2rsqrt_int(<2 x half> %a) #1 { - %1 = bitcast <2 x half> %a to i32 - %2 = tail call i32 asm sideeffect "v_rsq_f16 $0, $1","=v,v"(i32 %1) - tail call void asm sideeffect "v_rsq_f16_sdwa $0, $1 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1","v,v"(i32 %2, i32 %1) - %3 = bitcast i32 %2 to <2 x half> - ret <2 x half> %3 -} - -define <2 x half> @__hip_hc_ir_h2sin_int(<2 x half> %a) #1 { - %1 = bitcast <2 x half> %a to i32 - %2 = tail call i32 asm sideeffect "v_sin_f16 $0, $1","=v,v"(i32 %1) - tail call void asm sideeffect "v_sin_f16_sdwa $0, $1 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1","v,v"(i32 %2, i32 %1) - %3 = bitcast i32 %2 to <2 x half> - ret <2 x half> %3 -} - -define <2 x half> @__hip_hc_ir_h2sqrt_int(<2 x half> %a) #1 { - %1 = bitcast <2 x half> %a to i32 - %2 = tail call i32 asm sideeffect "v_sqrt_f16 $0, $1","=v,v"(i32 %1) - tail call void asm sideeffect "v_sqrt_f16_sdwa $0, $1 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1","v,v"(i32 %2, i32 %1) - %3 = bitcast i32 %2 to <2 x half> - ret <2 x half> %3 -} - -define <2 x half> @__hip_hc_ir_h2trunc_int(<2 x half> %a) #1 { - %1 = bitcast <2 x half> %a to i32 - %2 = tail call i32 asm sideeffect "v_trunc_f16 $0, $1","=v,v"(i32 %1) - tail call void asm sideeffect "v_trunc_f16_sdwa $0, $1 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1","v,v"(i32 %2, i32 %1) - %3 = bitcast i32 %2 to <2 x half> - ret <2 x half> %3 -} - -attributes #1 = { alwaysinline nounwind } diff --git a/projects/hip/src/hip_memory.cpp b/projects/hip/src/hip_memory.cpp index 9b6758ddf4..dbaec8e1d8 100644 --- a/projects/hip/src/hip_memory.cpp +++ b/projects/hip/src/hip_memory.cpp @@ -1586,23 +1586,22 @@ hipError_t ihipMemset(void* dst, int value, size_t sizeBytes, hipStream_t strea return e; }; -int isLockedPointer(const void *ptr) +hipError_t getLockedPointer(const void *hostPtr, size_t dataLen, void **devicePtrPtr) { - hsa_amd_pointer_info_t info; - int isLocked = 0; + hc::accelerator acc; - info.size = sizeof(info); - hsa_status_t hsa_status = hsa_amd_pointer_info(const_cast(ptr), &info, nullptr, nullptr, nullptr); - if(hsa_status != HSA_STATUS_SUCCESS) { - return -1; - } - - if((info.type == HSA_EXT_POINTER_TYPE_HSA) || (info.type == HSA_EXT_POINTER_TYPE_LOCKED)) { - isLocked = 1; - } - - return isLocked; -} +#if (__hcc_workweek__ >= 17332) + hc::AmPointerInfo amPointerInfo(NULL, NULL, NULL, 0, acc, 0, 0); +#else + hc::AmPointerInfo amPointerInfo(NULL, NULL, 0, acc, 0, 0); +#endif + am_status_t status = hc::am_memtracker_getinfo(&amPointerInfo, hostPtr); + if (status == AM_SUCCESS) { + *devicePtrPtr = (char*)amPointerInfo._devicePointer; + return(hipSuccess); + }; + return(hipErrorHostMemoryNotRegistered); +}; // TODO - review and optimize hipError_t ihipMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, @@ -1611,12 +1610,20 @@ hipError_t ihipMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch hipStream_t stream = ihipSyncAndResolveStream(hipStreamNull); int isLocked = 0; - if(kind == hipMemcpyHostToDevice) { - isLocked = isLockedPointer(src); + void *pinnedPtr=NULL; + void *actualSrc = (void*)src; + void *actualDest = dst; + if(kind == hipMemcpyHostToDevice ) { + if(getLockedPointer((void*)src, spitch, &pinnedPtr) == hipSuccess ){ + isLocked = 1; + actualSrc = pinnedPtr; + } } else if(kind == hipMemcpyDeviceToHost) { - isLocked = isLockedPointer(dst); + if(getLockedPointer((void*)dst, dpitch, &pinnedPtr) == hipSuccess ){ + isLocked = 1; + actualDest = pinnedPtr; + } } - hc::completion_future marker; hipError_t e = hipSuccess; @@ -1624,12 +1631,12 @@ hipError_t ihipMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch stream->locked_copySync((void*)dst, (void*)src, width*height, kind, false); } else { try { - if(isLocked) { + if(!isLocked) { for (int i = 0; i < height; ++i) stream->locked_copySync((unsigned char*)dst + i * dpitch, (unsigned char*)src + i * spitch, width, kind); } else { - ihipMemcpy2dKernel (stream, static_cast (dst), static_cast (src), width, height, dpitch, spitch); + ihipMemcpy2dKernel (stream, static_cast (actualDest), static_cast (actualSrc), width, height, dpitch, spitch); stream->locked_wait(); } } catch (ihipException& ex) { @@ -1654,10 +1661,19 @@ hipError_t hipMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t sp if (dst == nullptr || src == nullptr || width > dpitch || width > spitch) return ihipLogStatus(hipErrorInvalidValue); hipError_t e = hipSuccess; int isLocked = 0; - if(kind == hipMemcpyHostToDevice) { - isLocked = isLockedPointer(src); + void *pinnedPtr=NULL; + void *actualSrc = (void*)src; + void *actualDest = dst; + if(kind == hipMemcpyHostToDevice ) { + if(getLockedPointer((void*)src, spitch, &pinnedPtr) == hipSuccess ){ + isLocked = 1; + actualSrc = pinnedPtr; + } } else if(kind == hipMemcpyDeviceToHost) { - isLocked = isLockedPointer(dst); + if(getLockedPointer((void*)dst, dpitch, &pinnedPtr) == hipSuccess ){ + isLocked = 1; + actualDest = pinnedPtr; + } } if((width == dpitch) && (width == spitch)) { hip_internal::memcpyAsync(dst, src, width*height, kind, stream); @@ -1668,7 +1684,7 @@ hipError_t hipMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t sp e = hip_internal::memcpyAsync((unsigned char*)dst + i * dpitch, (unsigned char*)src + i * spitch, width, kind, stream); } else{ - ihipMemcpy2dKernel (stream, static_cast (dst), static_cast (src), width, height, dpitch, spitch); + ihipMemcpy2dKernel (stream, static_cast (actualDest), static_cast (actualSrc), width, height, dpitch, spitch); } } catch (ihipException& ex) { e = ex._code; diff --git a/projects/hip/tests/src/deviceLib/hipTestHalf.cpp b/projects/hip/tests/src/deviceLib/hipTestHalf.cpp index 5a2aac2b29..125edd76eb 100644 --- a/projects/hip/tests/src/deviceLib/hipTestHalf.cpp +++ b/projects/hip/tests/src/deviceLib/hipTestHalf.cpp @@ -23,56 +23,67 @@ THE SOFTWARE. * HIT_END */ -#include #include #include "hip/hip_runtime.h" -#include "test_common.h" -#define LEN 64 -#define HALF_SIZE 64 * sizeof(__half) -#define HALF2_SIZE 64 * sizeof(__half2) +#include "test_common.h" #if __HIP_ARCH_GFX803__ || __HIP_ARCH_GFX900__ || __HIP_ARCH_GFX906__ -__global__ void __halfMath(hipLaunchParm lp, __half* A, __half* B, __half* C) { - int tx = threadIdx.x; - __half a = A[tx]; - __half b = B[tx]; - __half c = C[tx]; - c = __hadd(a, c); - c = __hadd_sat(b, c); - c = __hfma(a, c, b); - c = __hfma_sat(b, c, a); - c = __hsub(a, c); - c = __hsub_sat(b, c); - c = __hmul(a, c); - c = __hmul_sat(b, c); - c = hdiv(a, c); +__global__ +void __halfMath(bool* result, __half a) { + result[0] = __heq(__hadd(a, __half{1}), __half{2}); + result[0] = __heq(__hadd_sat(a, __half{1}), __half{1}) && result[0]; + result[0] = __heq(__hfma(a, __half{2}, __half{3}), __half{5}) && result[0]; + result[0] = + __heq(__hfma_sat(a, __half{2}, __half{3}), __half{1}) && result[0]; + result[0] = __heq(__hsub(a, __half{1}), __half{0}) && result[0]; + result[0] = __heq(__hsub_sat(a, __half{2}), __half{0}) && result[0]; + result[0] = __heq(__hmul(a, __half{2}), __half{2}) && result[0]; + result[0] = __heq(__hmul_sat(a, __half{2}), __half{1}) && result[0]; + result[0] = __heq(__hdiv(a, __half{2}), __half{0.5}) && result[0]; } -__global__ void __half2Math(hipLaunchParm lp, __half2* A, __half2* B, __half2* C) { - int tx = threadIdx.x; - __half2 a = A[tx]; - __half2 b = B[tx]; - __half2 c = C[tx]; - c = __hadd2(a, c); - c = __hadd2_sat(b, c); - c = __hfma2(a, c, b); - c = __hfma2_sat(b, c, a); - c = __hsub2(a, c); - c = __hsub2_sat(b, c); - c = __hmul2(a, c); - c = __hmul2_sat(b, c); +__device__ +bool to_bool(const __half2& x) +{ + auto r = static_cast(x); + + return r.data.x != 0 && r.data.y != 0; } -__global__ void kernel_hisnan(hipLaunchParm lp, __half* input, int* output) { - int tx = threadIdx.x; - output[tx] = __hisnan(input[tx]); +__global__ +void __half2Math(bool* result, __half2 a) { + result[0] = + to_bool(__heq2(__hadd2(a, __half2{1, 1}), __half2{2, 2})); + result[0] = to_bool(__heq2(__hadd2_sat(a, __half2{1, 1}), __half2{1, 1})) && + result[0]; + result[0] = to_bool(__heq2( + __hfma2(a, __half2{2, 2}, __half2{3, 3}), __half2{5, 5})) && result[0]; + result[0] = to_bool(__heq2( + __hfma2_sat(a, __half2{2, 2}, __half2{3, 3}), __half2{1, 1})) && result[0]; + result[0] = to_bool(__heq2(__hsub2(a, __half2{1, 1}), __half2{0, 0})) && + result[0]; + result[0] = to_bool(__heq2(__hsub2_sat(a, __half2{2, 2}), __half2{0, 0})) && + result[0]; + result[0] = to_bool(__heq2(__hmul2(a, __half2{2, 2}), __half2{2, 2})) && + result[0]; + result[0] = to_bool(__heq2(__hmul2_sat(a, __half2{2, 2}), __half2{1, 1})) && + result[0]; + result[0] = to_bool(__heq2(__h2div(a, __half2{2, 2}), __half2{0.5, 0.5})) && + result[0]; } -__global__ void kernel_hisinf(hipLaunchParm lp, __half* input, int* output) { - int tx = threadIdx.x; - output[tx] = __hisinf(input[tx]); +__global__ +void kernel_hisnan(__half* input, int* output) { + int tx = threadIdx.x; + output[tx] = __hisnan(input[tx]); +} + +__global__ +void kernel_hisinf(__half* input, int* output) { + int tx = threadIdx.x; + output[tx] = __hisinf(input[tx]); } #endif @@ -93,7 +104,8 @@ void check_hisnan(int NUM_INPUTS, __half* inputCPU, __half* inputGPU) { hipMalloc((void**)&outputGPU, memsize); // launch the kernel - hipLaunchKernel(kernel_hisnan, dim3(1), dim3(NUM_INPUTS), 0, 0, inputGPU, outputGPU); + hipLaunchKernelGGL( + kernel_hisnan, dim3(1), dim3(NUM_INPUTS), 0, 0, inputGPU, outputGPU); // copy output from device int* outputCPU = (int*) malloc(memsize); @@ -103,12 +115,18 @@ void check_hisnan(int NUM_INPUTS, __half* inputCPU, __half* inputGPU) { for (int i=0; i(inputCPU[i]), + i); } } else { // inputs are NOT nan, output should be false if (outputCPU[i] != 0) { - failed("__hisnan() returned true for %f (input idx = %d)\n", inputCPU[i], i); + failed( + "__hisnan() returned true for %f (input idx = %d)\n", + static_cast(inputCPU[i]), + i); } } } @@ -129,7 +147,8 @@ void check_hisinf(int NUM_INPUTS, __half* inputCPU, __half* inputGPU) { hipMalloc((void**)&outputGPU, memsize); // launch the kernel - hipLaunchKernel(kernel_hisinf, dim3(1), dim3(NUM_INPUTS), 0, 0, inputGPU, outputGPU); + hipLaunchKernelGGL( + kernel_hisinf, dim3(1), dim3(NUM_INPUTS), 0, 0, inputGPU, outputGPU); // copy output from device int* outputCPU = (int*) malloc(memsize); @@ -139,12 +158,18 @@ void check_hisinf(int NUM_INPUTS, __half* inputCPU, __half* inputGPU) { for (int i=0; i(inputCPU[i]), + i); } } else { // inputs are NOT inf, output should be false if (outputCPU[i] != 0) { - failed("__hisinf() returned true for %f (input idx = %d)\n", inputCPU[i], i); + failed( + "__hisinf() returned true for %f (input idx = %d)\n", + static_cast(inputCPU[i]), + i); } } } @@ -160,11 +185,11 @@ void check_hisinf(int NUM_INPUTS, __half* inputCPU, __half* inputGPU) { void checkFunctional() { - // allocate memory + // allocate memory const int NUM_INPUTS = 16; auto memsize = NUM_INPUTS * sizeof(__half); __half* inputCPU = (__half*) malloc(memsize); - + // populate inputs inputCPU[0] = host_ushort_as_half(0x7c00); // inf inputCPU[1] = host_ushort_as_half(0xfc00); // -inf @@ -203,25 +228,27 @@ void checkFunctional() { } int main() { - __half *A, *B, *C; - hipMalloc(&A, HALF_SIZE); - hipMalloc(&B, HALF_SIZE); - hipMalloc(&C, HALF_SIZE); - hipLaunchKernel(__halfMath, dim3(1, 1, 1), dim3(LEN, 1, 1), 0, 0, A, B, C); - hipFree(A); - hipFree(B); - hipFree(C); - __half2 *A2, *B2, *C2; - hipMalloc(&A2, HALF2_SIZE); - hipMalloc(&B2, HALF2_SIZE); - hipMalloc(&C2, HALF2_SIZE); - hipLaunchKernel(__half2Math, dim3(1, 1, 1), dim3(LEN, 1, 1), 0, 0, A2, B2, C2); - hipFree(A2); - hipFree(B2); - hipFree(C2); + bool* result{nullptr}; + hipHostMalloc(&result, sizeof(result)); - // run some functional checks - checkFunctional(); - - passed(); + result[0] = false; + hipLaunchKernelGGL( + __halfMath, dim3(1, 1, 1), dim3(1, 1, 1), 0, 0, result, __half{1}); + hipDeviceSynchronize(); + + if (!result[0]) { failed("Failed __half tests."); } + + result[0] = false; + hipLaunchKernelGGL( + __half2Math, dim3(1, 1, 1), dim3(1, 1, 1), 0, 0, result, __half2{1, 1}); + hipDeviceSynchronize(); + + if (!result[0]) { failed("Failed __half2 tests."); } + + hipHostFree(result); + + // run some functional checks + checkFunctional(); + + passed(); } diff --git a/projects/hip/tests/src/deviceLib/hipTestNativeHalf.cpp b/projects/hip/tests/src/deviceLib/hipTestNativeHalf.cpp new file mode 100644 index 0000000000..6e618618f6 --- /dev/null +++ b/projects/hip/tests/src/deviceLib/hipTestNativeHalf.cpp @@ -0,0 +1,184 @@ +/* +Copyright (c) 2015-2017 Advanced Micro Devices, Inc. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +/* HIT_START + * BUILD: %t %s ../test_common.cpp EXCLUDE_HIP_PLATFORM nvcc + * RUN: %t + * HIT_END + */ + +#include +#include "hip/hip_runtime.h" + +#include "test_common.h" + +#include + +using namespace std; + +#if __HIP_ARCH_GFX803__ || __HIP_ARCH_GFX900__ || __HIP_ARCH_GFX906__ + +__global__ +void __halfTest(bool* result, __half a) { + // Construction + static_assert(is_default_constructible<__half>{}, ""); + static_assert(is_copy_constructible<__half>{}, ""); + static_assert(is_move_constructible<__half>{}, ""); + static_assert(is_constructible<__half, float>{}, ""); + static_assert(is_constructible<__half, double>{}, ""); + static_assert(is_constructible<__half, unsigned short>{}, ""); + static_assert(is_constructible<__half, short>{}, ""); + static_assert(is_constructible<__half, unsigned int>{}, ""); + static_assert(is_constructible<__half, int>{}, ""); + static_assert(is_constructible<__half, unsigned long>{}, ""); + static_assert(is_constructible<__half, long>{}, ""); + static_assert(is_constructible<__half, long long>{}, ""); + static_assert(is_constructible<__half, unsigned long long>{}, ""); + static_assert(is_constructible<__half, __half_raw>{}, ""); + + // Assignment + static_assert(is_copy_assignable<__half>{}, ""); + static_assert(is_move_assignable<__half>{}, ""); + static_assert(is_assignable<__half, float>{}, ""); + static_assert(is_assignable<__half, double>{}, ""); + static_assert(is_assignable<__half, unsigned short>{}, ""); + static_assert(is_assignable<__half, short>{}, ""); + static_assert(is_assignable<__half, unsigned int>{}, ""); + static_assert(is_assignable<__half, int>{}, ""); + static_assert(is_assignable<__half, unsigned long>{}, ""); + static_assert(is_assignable<__half, long>{}, ""); + static_assert(is_assignable<__half, long long>{}, ""); + static_assert(is_assignable<__half, unsigned long long>{}, ""); + static_assert(is_assignable<__half, __half_raw>{}, ""); + static_assert(is_assignable<__half, volatile __half_raw&>{}, ""); + static_assert(is_assignable<__half, volatile __half_raw&&>{}, ""); + + // Conversion + static_assert(is_convertible<__half, float>{}, ""); + static_assert(is_convertible<__half, unsigned short>{}, ""); + static_assert(is_convertible<__half, short>{}, ""); + static_assert(is_convertible<__half, unsigned int>{}, ""); + static_assert(is_convertible<__half, int>{}, ""); + static_assert(is_convertible<__half, unsigned long>{}, ""); + static_assert(is_convertible<__half, long>{}, ""); + static_assert(is_convertible<__half, long long>{}, ""); + static_assert(is_convertible<__half, bool>{}, ""); + static_assert(is_convertible<__half, unsigned long long>{}, ""); + static_assert(is_convertible<__half, __half_raw>{}, ""); + static_assert(is_convertible<__half, volatile __half_raw>{}, ""); + + // Nullary + result[0] = __heq(a, +a) && result[0]; + result[0] = __heq(__hneg(a), -a) && result[0]; + + // Unary arithmetic + result[0] = __heq(a += 0, a) && result[0]; + result[0] = __heq(a -= 0, a) && result[0]; + result[0] = __heq(a *= 1, a) && result[0]; + result[0] = __heq(a /= 1, a) && result[0]; + + // Binary arithmetic + result[0] = __heq((a + a), __hadd(a, a)) && result[0]; + result[0] = __heq((a - a), __hsub(a, a)) && result[0]; + result[0] = __heq((a * a), __hmul(a, a)) && result[0]; + result[0] = __heq((a / a), __hdiv(a, a)) && result[0]; + + // Relations + result[0] = (a == a) && result[0]; + result[0] = !(a != a) && result[0]; + result[0] = (a <= a) && result[0]; + result[0] = (a >= a) && result[0]; + result[0] = !(a < a) && result[0]; + result[0] = !(a > a) && result[0]; +} + +__device__ +bool to_bool(const __half2& x) +{ + auto r = static_cast(x); + + return r.data.x != 0 && r.data.y != 0; +} + +__global__ +void __half2Test(bool* result, __half2 a) { + // Construction + static_assert(is_default_constructible<__half2>{}, ""); + static_assert(is_copy_constructible<__half2>{}, ""); + static_assert(is_move_constructible<__half2>{}, ""); + static_assert(is_constructible<__half2, __half, __half>{}, ""); + static_assert(is_constructible<__half2, __half2_raw>{}, ""); + + // Assignment + static_assert(is_copy_assignable<__half2>{}, ""); + static_assert(is_move_assignable<__half2>{}, ""); + static_assert(is_assignable<__half2, __half2_raw>{}, ""); + + // Conversion + static_assert(is_convertible<__half2, __half2_raw>{}, ""); + + // Nullary + result[0] = to_bool(__heq2(a, +a)) && result[0]; + result[0] = to_bool(__heq2(__hneg2(a), -a)) && result[0]; + + // Unary arithmetic + result[0] = to_bool(__heq2(a += 0, a)) && result[0]; + result[0] = to_bool(__heq2(a -= 0, a)) && result[0]; + result[0] = to_bool(__heq2(a *= 1, a)) && result[0]; + result[0] = to_bool(__heq2(a /= 1, a)) && result[0]; + + // Binary arithmetic + result[0] = to_bool(__heq2((a + a), __hadd2(a, a))) && result[0]; + result[0] = to_bool(__heq2((a - a), __hsub2(a, a))) && result[0]; + result[0] = to_bool(__heq2((a * a), __hmul2(a, a))) && result[0]; + result[0] = to_bool(__heq2((a / a), __h2div(a, a))) && result[0]; + + // Relations + result[0] = (a == a) && result[0]; + result[0] = !(a != a) && result[0]; + result[0] = (a <= a) && result[0]; + result[0] = (a >= a) && result[0]; + result[0] = !(a < a) && result[0]; + result[0] = !(a > a) && result[0]; +} + +#endif + +int main() { + bool* result{nullptr}; + hipHostMalloc(&result, 1); + + result[0] = true; + hipLaunchKernelGGL( + __halfTest, dim3(1, 1, 1), dim3(1, 1, 1), 0, 0, result, __half{1}); + hipDeviceSynchronize(); + + if (!result[0]) { failed("Failed __half tests."); } + + result[0] = true; + hipLaunchKernelGGL( + __half2Test, dim3(1, 1, 1), dim3(1, 1, 1), 0, 0, result, __half2{1, 1}); + hipDeviceSynchronize(); + + if (!result[0]) { failed("Failed __half2 tests."); } + + hipHostFree(result); + + passed(); +} diff --git a/projects/hip/tests/src/deviceLib/hipVectorTypes.cpp b/projects/hip/tests/src/deviceLib/hipVectorTypes.cpp index da9e24d079..3c36fb5d2e 100644 --- a/projects/hip/tests/src/deviceLib/hipVectorTypes.cpp +++ b/projects/hip/tests/src/deviceLib/hipVectorTypes.cpp @@ -26,7832 +26,182 @@ THE SOFTWARE. * HIT_END */ -#include -#include #include + +#include "vector_test_common.h" #include "test_common.h" -#define cmpVal1(in, exp) \ - if (in.x != exp) { \ - std::cout << "Failed at: " << __LINE__ << " in func: " << __func__ \ - << " expected output: " << exp << " but got: " << in.x << std::endl; \ - assert(-1); \ - } -#define cmpVal2(in, exp) \ - if (in.x != exp || in.y != exp) { \ - std::cout << "Failed at: " << __LINE__ << " in func: " << __func__ \ - << " expected output: " << exp << " but got: " << in.x << "," << in.y \ - << std::endl; \ - assert(-1); \ - } +#include +#include +#include +#include -#define cmpVal3(in, exp) \ - if (in.x != exp || in.y != exp || in.z != exp) { \ - std::cout << "Failed at: " << __LINE__ << " in func: " << __func__ \ - << " expected output: " << exp << " but got: " << in.x << "," << in.y << "," \ - << in.z << std::endl; \ - assert(-1); \ - } +using namespace std; -#define cmpVal4(in, exp) \ - if (in.x != exp || in.y != exp || in.z != exp || in.w != exp) { \ - std::cout << "Failed at: " << __LINE__ << " in func: " << __func__ \ - << " expected output: " << exp << " but got: " << in.x << "," << in.y << "," \ - << in.z << "," << in.w << std::endl; \ - assert(-1); \ - } +bool integer_unary_tests(...) { + return true; +} -bool TestUChar1() { - uchar1 f1, f2, f3; +bool integer_binary_tests(...) { + return true; +} + +template< + typename V, + Enable_if_t().x)>{}>* = nullptr> +__device__ +bool integer_unary_tests(V& f1, V& f2) { + f1 %= f2; + if (!cmp(f1, 0)) return false; + f1 &= f2; + if (!cmp(f1, 0)) return false; + f1 |= f2; + if (!cmp(f1, 1)) return false; + f1 ^= f2; + if (!cmp(f1, 0)) return false; f1.x = 1; - f2.x = 1; - f3 = f1 + f2; - cmpVal1(f3, 2); - f2 = f3 - f1; - cmpVal1(f2, 1); - f1 = f2 * f3; - cmpVal1(f1, 2); - f2 = f1 / f3; - cmpVal1(f2, 2 / 2); + f1 <<= f2; + if (!cmp(f1, 2)) return false; + f1 >>= f2; + if (!cmp(f1, 1)) return false; + f2 = ~f1; + return cmp(f2, ~1); +} + +template< + typename V, + Enable_if_t().x)>{}>* = nullptr> +__device__ +bool integer_binary_tests(V& f1, V& f2, V& f3) { f3 = f1 % f2; - cmpVal1(f3, 0); + if (!cmp(f3, 0)) return false; f1 = f3 & f2; - cmpVal1(f1, 0); + if (!cmp(f1, 0)) return false; f2 = f1 ^ f3; - cmpVal1(f2, 0); + if (!cmp(f2, 0)) return false; f1.x = 1; f2.x = 2; f3 = f1 << f2; - cmpVal1(f3, 4); + if (!cmp(f3, 4)) return false; f2 = f3 >> f1; - cmpVal1(f2, 2); - - f1.x = 2; - f2.x = 1; - f1 += f2; - cmpVal1(f1, 3); - f1 -= f2; - cmpVal1(f1, 2); - f1 *= f2; - cmpVal1(f1, 2); - f1 /= f2; - cmpVal1(f1, 2); - f1 %= f2; - cmpVal1(f1, 0); - f1 &= f2; - cmpVal1(f1, 0); - f1 |= f2; - cmpVal1(f1, 1); - f1 ^= f2; - cmpVal1(f1, 0); - f1.x = 1; - f1 <<= f2; - cmpVal1(f1, 2); - f1 >>= f2; - cmpVal1(f1, 1); - - f1.x = 2; - f2 = f1++; - cmpVal1(f1, 3); - cmpVal1(f2, 2); - f2 = f1--; - cmpVal1(f2, 3); - cmpVal1(f1, 2); - f2 = ++f1; - cmpVal1(f1, 3); - cmpVal1(f2, 3); - f2 = --f1; - cmpVal1(f1, 2); - cmpVal1(f2, 2); - - f2 = ~f1; - cmpVal1(f2, 253); - assert(!f1 == false); - f1.x = 3; - f1 = f1 * (unsigned char)1; - cmpVal1(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed char)1; - cmpVal1(f1, 3); - f1 = (signed char)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal1(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed short)1; - cmpVal1(f1, 3); - f1 = (signed short)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal1(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed int)1; - cmpVal1(f1, 3); - f1 = (signed int)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (float)1; - cmpVal1(f1, 3); - f1 = (float)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal1(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed long)1; - cmpVal1(f1, 3); - f1 = (signed long)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (double)1; - cmpVal1(f1, 3); - f1 = (double)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal1(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal1(f1, 3); - - uchar1 fa((unsigned char)1); - uchar1 fb((signed char)1); - uchar1 fc((unsigned short)1); - uchar1 fd((signed short)1); - uchar1 fe((unsigned int)1); - uchar1 fg((signed int)1); - uchar1 fh((float)1); - uchar1 fi((double)1); - uchar1 fj((unsigned long)1); - uchar1 fk((signed long)1); - uchar1 fl((unsigned long long)1); - uchar1 fm((signed long long)1); - - - f1.x = 3; - f2.x = 4; - f3.x = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; + if (!cmp(f2, 2)) return false; } -bool TestUChar2() { - uchar2 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f2.x = 1; - f2.y = 1; - f3 = f1 + f2; - cmpVal2(f3, 2); - f2 = f3 - f1; - cmpVal2(f2, 1); - f1 = f2 * f3; - cmpVal2(f1, 2); - f2 = f1 / f3; - cmpVal2(f2, 2 / 2); - f3 = f1 % f2; - cmpVal2(f3, 0); - f1 = f3 & f2; - cmpVal2(f1, 0); - f2 = f1 ^ f3; - cmpVal2(f2, 0); - f1.x = 1; - f1.y = 1; - f2.x = 2; - f2.y = 2; - f3 = f1 << f2; - cmpVal2(f3, 4); - f2 = f3 >> f1; - cmpVal2(f2, 2); - - f1.x = 2; - f1.y = 2; - f2.x = 1; - f2.y = 1; - f1 += f2; - cmpVal2(f1, 3); - f1 -= f2; - cmpVal2(f1, 2); - f1 *= f2; - cmpVal2(f1, 2); - f1 /= f2; - cmpVal2(f1, 2); - f1 %= f2; - cmpVal2(f1, 0); - f1 &= f2; - cmpVal2(f1, 0); - f1 |= f2; - cmpVal2(f1, 1); - f1 ^= f2; - cmpVal2(f1, 0); - f1.x = 1; - f1.y = 1; - f1 <<= f2; - cmpVal2(f1, 2); - f1 >>= f2; - cmpVal2(f1, 1); - - f1.x = 2; - f1.y = 2; - f2 = f1++; - cmpVal2(f1, 3); - cmpVal2(f2, 2); - f2 = f1--; - cmpVal2(f2, 3); - cmpVal2(f1, 2); - f2 = ++f1; - cmpVal2(f1, 3); - cmpVal2(f2, 3); - f2 = --f1; - cmpVal2(f1, 2); - cmpVal2(f2, 2); - - f2 = ~f1; - cmpVal2(f2, 253); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1 = f1 * (unsigned char)1; - cmpVal2(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed char)1; - cmpVal2(f1, 3); - f1 = (signed char)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal2(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed short)1; - cmpVal2(f1, 3); - f1 = (signed short)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal2(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed int)1; - cmpVal2(f1, 3); - f1 = (signed int)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (float)1; - cmpVal2(f1, 3); - f1 = (float)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal2(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed long)1; - cmpVal2(f1, 3); - f1 = (signed long)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (double)1; - cmpVal2(f1, 3); - f1 = (double)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal2(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal2(f1, 3); - - uchar2 fa1((unsigned char)1); - uchar2 fa2((unsigned char)1, (unsigned char)1); - uchar2 fb1((signed char)1); - uchar2 fb2((signed char)1, (signed char)1); - uchar2 fc1((unsigned short)1); - uchar2 fc2((unsigned short)1, (unsigned short)1); - uchar2 fd1((signed short)1); - uchar2 fd2((signed short)1, (signed short)1); - uchar2 fe1((unsigned int)1); - uchar2 fe2((unsigned int)1, (unsigned int)1); - uchar2 fg1((signed int)1); - uchar2 fg2((signed int)1, (signed int)1); - uchar2 fh1((float)1); - uchar2 fh2((float)1, (float)1); - uchar2 fi1((double)1); - uchar2 fi2((double)1, (double)1); - uchar2 fj1((unsigned long)1); - uchar2 fj2((unsigned long)1, (unsigned long)1); - uchar2 fk1((signed long)1); - uchar2 fk2((signed long)1, (signed long)1); - uchar2 fl1((unsigned long long)1); - uchar2 fl2((unsigned long long)1, (unsigned long long)1); - uchar2 fm1((signed long long)1); - uchar2 fm2((signed long long)1, (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f2.x = 4; - f2.y = 4; - f3.x = 3; - f3.y = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestUChar3() { - uchar3 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f3 = f1 + f2; - cmpVal3(f3, 2); - f2 = f3 - f1; - cmpVal3(f2, 1); - f1 = f2 * f3; - cmpVal3(f1, 2); - f2 = f1 / f3; - cmpVal3(f2, 2 / 2); - f3 = f1 % f2; - cmpVal3(f3, 0); - f1 = f3 & f2; - cmpVal3(f1, 0); - f2 = f1 ^ f3; - cmpVal3(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f3 = f1 << f2; - cmpVal3(f3, 4); - f2 = f3 >> f1; - cmpVal3(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f1 += f2; - cmpVal3(f1, 3); - f1 -= f2; - cmpVal3(f1, 2); - f1 *= f2; - cmpVal3(f1, 2); - f1 /= f2; - cmpVal3(f1, 2); - f1 %= f2; - cmpVal3(f1, 0); - f1 &= f2; - cmpVal3(f1, 0); - f1 |= f2; - cmpVal3(f1, 1); - f1 ^= f2; - cmpVal3(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1 <<= f2; - cmpVal3(f1, 2); - f1 >>= f2; - cmpVal3(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2 = f1++; - cmpVal3(f1, 3); - cmpVal3(f2, 2); - f2 = f1--; - cmpVal3(f2, 3); - cmpVal3(f1, 2); - f2 = ++f1; - cmpVal3(f1, 3); - cmpVal3(f2, 3); - f2 = --f1; - cmpVal3(f1, 2); - cmpVal3(f2, 2); - - f2 = ~f1; - cmpVal3(f2, 253); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1 = f1 * (unsigned char)1; - cmpVal3(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed char)1; - cmpVal3(f1, 3); - f1 = (signed char)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal3(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed short)1; - cmpVal3(f1, 3); - f1 = (signed short)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal3(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed int)1; - cmpVal3(f1, 3); - f1 = (signed int)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (float)1; - cmpVal3(f1, 3); - f1 = (float)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal3(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed long)1; - cmpVal3(f1, 3); - f1 = (signed long)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (double)1; - cmpVal3(f1, 3); - f1 = (double)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal3(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal3(f1, 3); - - uchar3 fa1((unsigned char)1); - uchar3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); - uchar3 fb1((signed char)1); - uchar3 fb2((signed char)1, (signed char)1, (signed char)1); - uchar3 fc1((unsigned short)1); - uchar3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); - uchar3 fd1((signed short)1); - uchar3 fd2((signed short)1, (signed short)1, (signed short)1); - uchar3 fe1((unsigned int)1); - uchar3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); - uchar3 fg1((signed int)1); - uchar3 fg2((signed int)1, (signed int)1, (signed int)1); - uchar3 fh1((float)1); - uchar3 fh2((float)1, (float)1, (float)1); - uchar3 fi1((double)1); - uchar3 fi2((double)1, (double)1, (double)1); - uchar3 fj1((unsigned long)1); - uchar3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); - uchar3 fk1((signed long)1); - uchar3 fk2((signed long)1, (signed long)1, (signed long)1); - uchar3 fl1((unsigned long long)1); - uchar3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); - uchar3 fm1((signed long long)1); - uchar3 fm2((signed long long)1, (signed long long)1, (signed long long)1); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestUChar4() { - uchar4 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f3 = f1 + f2; - cmpVal4(f3, 2); - f2 = f3 - f1; - cmpVal4(f2, 1); - f1 = f2 * f3; - cmpVal4(f1, 2); - f2 = f1 / f3; - cmpVal4(f2, 2 / 2); - f3 = f1 % f2; - cmpVal4(f3, 0); - f1 = f3 & f2; - cmpVal4(f1, 0); - f2 = f1 ^ f3; - cmpVal4(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f2.w = 2; - f3 = f1 << f2; - cmpVal4(f3, 4); - f2 = f3 >> f1; - cmpVal4(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f1 += f2; - cmpVal4(f1, 3); - f1 -= f2; - cmpVal4(f1, 2); - f1 *= f2; - cmpVal4(f1, 2); - f1 /= f2; - cmpVal4(f1, 2); - f1 %= f2; - cmpVal4(f1, 0); - f1 &= f2; - cmpVal4(f1, 0); - f1 |= f2; - cmpVal4(f1, 1); - f1 ^= f2; - cmpVal4(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f1 <<= f2; - cmpVal4(f1, 2); - f1 >>= f2; - cmpVal4(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2 = f1++; - cmpVal4(f1, 3); - cmpVal4(f2, 2); - f2 = f1--; - cmpVal4(f2, 3); - cmpVal4(f1, 2); - f2 = ++f1; - cmpVal4(f1, 3); - cmpVal4(f2, 3); - f2 = --f1; - cmpVal4(f1, 2); - cmpVal4(f2, 2); - - f2 = ~f1; - cmpVal4(f2, 253); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f1 = f1 * (unsigned char)1; - cmpVal4(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed char)1; - cmpVal4(f1, 3); - f1 = (signed char)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal4(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed short)1; - cmpVal4(f1, 3); - f1 = (signed short)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal4(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed int)1; - cmpVal4(f1, 3); - f1 = (signed int)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (float)1; - cmpVal4(f1, 3); - f1 = (float)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal4(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed long)1; - cmpVal4(f1, 3); - f1 = (signed long)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (double)1; - cmpVal4(f1, 3); - f1 = (double)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal4(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal4(f1, 3); - - - uchar4 fa1((unsigned char)1); - uchar4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); - uchar4 fb1((signed char)1); - uchar4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); - uchar4 fc1((unsigned short)1); - uchar4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); - uchar4 fd1((signed short)1); - uchar4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); - uchar4 fe1((unsigned int)1); - uchar4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); - uchar4 fg1((signed int)1); - uchar4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); - uchar4 fh1((float)1); - uchar4 fh2((float)1, (float)1, (float)1, (float)1); - uchar4 fi1((double)1); - uchar4 fi2((double)1, (double)1, (double)1, (double)1); - uchar4 fj1((unsigned long)1); - uchar4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); - uchar4 fk1((signed long)1); - uchar4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); - uchar4 fl1((unsigned long long)1); - uchar4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, - (unsigned long long)1); - uchar4 fm1((signed long long)1); - uchar4 fm2((signed long long)1, (signed long long)1, (signed long long)1, (signed long long)1); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f2.w = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - f3.w = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - - -bool TestChar1() { - char1 f1, f2, f3; - f1.x = 1; - f2.x = 1; - f3 = f1 + f2; - cmpVal1(f3, 2); - f2 = f3 - f1; - cmpVal1(f2, 1); - f1 = f2 * f3; - cmpVal1(f1, 2); - f2 = f1 / f3; - cmpVal1(f2, 2 / 2); - f3 = f1 % f2; - cmpVal1(f3, 0); - f1 = f3 & f2; - cmpVal1(f1, 0); - f2 = f1 ^ f3; - cmpVal1(f2, 0); - f1.x = 1; - f2.x = 2; - f3 = f1 << f2; - cmpVal1(f3, 4); - f2 = f3 >> f1; - cmpVal1(f2, 2); - - f1.x = 2; - f2.x = 1; - f1 += f2; - cmpVal1(f1, 3); - f1 -= f2; - cmpVal1(f1, 2); - f1 *= f2; - cmpVal1(f1, 2); - f1 /= f2; - cmpVal1(f1, 2); - f1 %= f2; - cmpVal1(f1, 0); - f1 &= f2; - cmpVal1(f1, 0); - f1 |= f2; - cmpVal1(f1, 1); - f1 ^= f2; - cmpVal1(f1, 0); - f1.x = 1; - f1 <<= f2; - cmpVal1(f1, 2); - f1 >>= f2; - cmpVal1(f1, 1); - - f1.x = 2; - f2 = f1++; - cmpVal1(f1, 3); - cmpVal1(f2, 2); - f2 = f1--; - cmpVal1(f2, 3); - cmpVal1(f1, 2); - f2 = ++f1; - cmpVal1(f1, 3); - cmpVal1(f2, 3); - f2 = --f1; - cmpVal1(f1, 2); - cmpVal1(f2, 2); - - f2 = ~f1; - cmpVal1(f2, (char)253); - assert(!f1 == false); - - f1.x = 3; - f1 = f1 * (unsigned char)1; - cmpVal1(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed char)1; - cmpVal1(f1, 3); - f1 = (signed char)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal1(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed short)1; - cmpVal1(f1, 3); - f1 = (signed short)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal1(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed int)1; - cmpVal1(f1, 3); - f1 = (signed int)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (float)1; - cmpVal1(f1, 3); - f1 = (float)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal1(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed long)1; - cmpVal1(f1, 3); - f1 = (signed long)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (double)1; - cmpVal1(f1, 3); - f1 = (double)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal1(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal1(f1, 3); - - char1 fa((unsigned char)1); - char1 fb((signed char)1); - char1 fc((unsigned short)1); - char1 fd((signed short)1); - char1 fe((unsigned int)1); - char1 fg((signed int)1); - char1 fh((float)1); - char1 fi((double)1); - char1 fj((unsigned long)1); - char1 fk((signed long)1); - char1 fl((unsigned long long)1); - char1 fm((signed long long)1); - - - f1.x = 3; - f2.x = 4; - f3.x = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestChar2() { - char2 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f2.x = 1; - f2.y = 1; - f3 = f1 + f2; - cmpVal2(f3, 2); - f2 = f3 - f1; - cmpVal2(f2, 1); - f1 = f2 * f3; - cmpVal2(f1, 2); - f2 = f1 / f3; - cmpVal2(f2, 2 / 2); - f3 = f1 % f2; - cmpVal2(f3, 0); - f1 = f3 & f2; - cmpVal2(f1, 0); - f2 = f1 ^ f3; - cmpVal2(f2, 0); - f1.x = 1; - f1.y = 1; - f2.x = 2; - f2.y = 2; - f3 = f1 << f2; - cmpVal2(f3, 4); - f2 = f3 >> f1; - cmpVal2(f2, 2); - - f1.x = 2; - f1.y = 2; - f2.x = 1; - f2.y = 1; - f1 += f2; - cmpVal2(f1, 3); - f1 -= f2; - cmpVal2(f1, 2); - f1 *= f2; - cmpVal2(f1, 2); - f1 /= f2; - cmpVal2(f1, 2); - f1 %= f2; - cmpVal2(f1, 0); - f1 &= f2; - cmpVal2(f1, 0); - f1 |= f2; - cmpVal2(f1, 1); - f1 ^= f2; - cmpVal2(f1, 0); - f1.x = 1; - f1.y = 1; - f1 <<= f2; - cmpVal2(f1, 2); - f1 >>= f2; - cmpVal2(f1, 1); - - f1.x = 2; - f1.y = 2; - f2 = f1++; - cmpVal2(f1, 3); - cmpVal2(f2, 2); - f2 = f1--; - cmpVal2(f2, 3); - cmpVal2(f1, 2); - f2 = ++f1; - cmpVal2(f1, 3); - cmpVal2(f2, 3); - f2 = --f1; - cmpVal2(f1, 2); - cmpVal2(f2, 2); - - f2 = ~f1; - cmpVal2(f2, (char)253); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1 = f1 * (unsigned char)1; - cmpVal2(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed char)1; - cmpVal2(f1, 3); - f1 = (signed char)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal2(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed short)1; - cmpVal2(f1, 3); - f1 = (signed short)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal2(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed int)1; - cmpVal2(f1, 3); - f1 = (signed int)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (float)1; - cmpVal2(f1, 3); - f1 = (float)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal2(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed long)1; - cmpVal2(f1, 3); - f1 = (signed long)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (double)1; - cmpVal2(f1, 3); - f1 = (double)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal2(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal2(f1, 3); - - char2 fa1((unsigned char)1); - char2 fa2((unsigned char)1, (unsigned char)1); - char2 fb1((signed char)1); - char2 fb2((signed char)1, (signed char)1); - char2 fc1((unsigned short)1); - char2 fc2((unsigned short)1, (unsigned short)1); - char2 fd1((signed short)1); - char2 fd2((signed short)1, (signed short)1); - char2 fe1((unsigned int)1); - char2 fe2((unsigned int)1, (unsigned int)1); - char2 fg1((signed int)1); - char2 fg2((signed int)1, (signed int)1); - char2 fh1((float)1); - char2 fh2((float)1, (float)1); - char2 fi1((double)1); - char2 fi2((double)1, (double)1); - char2 fj1((unsigned long)1); - char2 fj2((unsigned long)1, (unsigned long)1); - char2 fk1((signed long)1); - char2 fk2((signed long)1, (signed long)1); - char2 fl1((unsigned long long)1); - char2 fl2((unsigned long long)1, (unsigned long long)1); - char2 fm1((signed long long)1); - char2 fm2((signed long long)1, (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f2.x = 4; - f2.y = 4; - f3.x = 3; - f3.y = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestChar3() { - char3 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f3 = f1 + f2; - cmpVal3(f3, 2); - f2 = f3 - f1; - cmpVal3(f2, 1); - f1 = f2 * f3; - cmpVal3(f1, 2); - f2 = f1 / f3; - cmpVal3(f2, 2 / 2); - f3 = f1 % f2; - cmpVal3(f3, 0); - f1 = f3 & f2; - cmpVal3(f1, 0); - f2 = f1 ^ f3; - cmpVal3(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f3 = f1 << f2; - cmpVal3(f3, 4); - f2 = f3 >> f1; - cmpVal3(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f1 += f2; - cmpVal3(f1, 3); - f1 -= f2; - cmpVal3(f1, 2); - f1 *= f2; - cmpVal3(f1, 2); - f1 /= f2; - cmpVal3(f1, 2); - f1 %= f2; - cmpVal3(f1, 0); - f1 &= f2; - cmpVal3(f1, 0); - f1 |= f2; - cmpVal3(f1, 1); - f1 ^= f2; - cmpVal3(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1 <<= f2; - cmpVal3(f1, 2); - f1 >>= f2; - cmpVal3(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2 = f1++; - cmpVal3(f1, 3); - cmpVal3(f2, 2); - f2 = f1--; - cmpVal3(f2, 3); - cmpVal3(f1, 2); - f2 = ++f1; - cmpVal3(f1, 3); - cmpVal3(f2, 3); - f2 = --f1; - cmpVal3(f1, 2); - cmpVal3(f2, 2); - - f2 = ~f1; - cmpVal3(f2, (char)253); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1 = f1 * (unsigned char)1; - cmpVal3(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed char)1; - cmpVal3(f1, 3); - f1 = (signed char)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal3(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed short)1; - cmpVal3(f1, 3); - f1 = (signed short)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal3(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed int)1; - cmpVal3(f1, 3); - f1 = (signed int)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (float)1; - cmpVal3(f1, 3); - f1 = (float)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal3(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed long)1; - cmpVal3(f1, 3); - f1 = (signed long)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (double)1; - cmpVal3(f1, 3); - f1 = (double)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal3(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal3(f1, 3); - - char3 fa1((unsigned char)1); - char3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); - char3 fb1((signed char)1); - char3 fb2((signed char)1, (signed char)1, (signed char)1); - char3 fc1((unsigned short)1); - char3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); - char3 fd1((signed short)1); - char3 fd2((signed short)1, (signed short)1, (signed short)1); - char3 fe1((unsigned int)1); - char3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); - char3 fg1((signed int)1); - char3 fg2((signed int)1, (signed int)1, (signed int)1); - char3 fh1((float)1); - char3 fh2((float)1, (float)1, (float)1); - char3 fi1((double)1); - char3 fi2((double)1, (double)1, (double)1); - char3 fj1((unsigned long)1); - char3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); - char3 fk1((signed long)1); - char3 fk2((signed long)1, (signed long)1, (signed long)1); - char3 fl1((unsigned long long)1); - char3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); - char3 fm1((signed long long)1); - char3 fm2((signed long long)1, (signed long long)1, (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestChar4() { - char4 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f3 = f1 + f2; - cmpVal4(f3, 2); - f2 = f3 - f1; - cmpVal4(f2, 1); - f1 = f2 * f3; - cmpVal4(f1, 2); - f2 = f1 / f3; - cmpVal4(f2, 2 / 2); - f3 = f1 % f2; - cmpVal4(f3, 0); - f1 = f3 & f2; - cmpVal4(f1, 0); - f2 = f1 ^ f3; - cmpVal4(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f2.w = 2; - f3 = f1 << f2; - cmpVal4(f3, 4); - f2 = f3 >> f1; - cmpVal4(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f1 += f2; - cmpVal4(f1, 3); - f1 -= f2; - cmpVal4(f1, 2); - f1 *= f2; - cmpVal4(f1, 2); - f1 /= f2; - cmpVal4(f1, 2); - f1 %= f2; - cmpVal4(f1, 0); - f1 &= f2; - cmpVal4(f1, 0); - f1 |= f2; - cmpVal4(f1, 1); - f1 ^= f2; - cmpVal4(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f1 <<= f2; - cmpVal4(f1, 2); - f1 >>= f2; - cmpVal4(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2 = f1++; - cmpVal4(f1, 3); - cmpVal4(f2, 2); - f2 = f1--; - cmpVal4(f2, 3); - cmpVal4(f1, 2); - f2 = ++f1; - cmpVal4(f1, 3); - cmpVal4(f2, 3); - f2 = --f1; - cmpVal4(f1, 2); - cmpVal4(f2, 2); - - f2 = ~f1; - cmpVal4(f2, (char)253); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f1 = f1 * (unsigned char)1; - cmpVal4(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed char)1; - cmpVal4(f1, 3); - f1 = (signed char)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal4(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed short)1; - cmpVal4(f1, 3); - f1 = (signed short)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal4(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed int)1; - cmpVal4(f1, 3); - f1 = (signed int)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (float)1; - cmpVal4(f1, 3); - f1 = (float)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal4(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed long)1; - cmpVal4(f1, 3); - f1 = (signed long)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (double)1; - cmpVal4(f1, 3); - f1 = (double)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal4(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal4(f1, 3); - - char4 fa1((unsigned char)1); - char4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); - char4 fb1((signed char)1); - char4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); - char4 fc1((unsigned short)1); - char4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); - char4 fd1((signed short)1); - char4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); - char4 fe1((unsigned int)1); - char4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); - char4 fg1((signed int)1); - char4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); - char4 fh1((float)1); - char4 fh2((float)1, (float)1, (float)1, (float)1); - char4 fi1((double)1); - char4 fi2((double)1, (double)1, (double)1, (double)1); - char4 fj1((unsigned long)1); - char4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); - char4 fk1((signed long)1); - char4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); - char4 fl1((unsigned long long)1); - char4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, - (unsigned long long)1); - char4 fm1((signed long long)1); - char4 fm2((signed long long)1, (signed long long)1, (signed long long)1, (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f2.w = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - f3.w = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - - -bool TestUShort1() { - ushort1 f1, f2, f3; - f1.x = 1; - f2.x = 1; - f3 = f1 + f2; - cmpVal1(f3, 2); - f2 = f3 - f1; - cmpVal1(f2, 1); - f1 = f2 * f3; - cmpVal1(f1, 2); - f2 = f1 / f3; - cmpVal1(f2, 2 / 2); - f3 = f1 % f2; - cmpVal1(f3, 0); - f1 = f3 & f2; - cmpVal1(f1, 0); - f2 = f1 ^ f3; - cmpVal1(f2, 0); - f1.x = 1; - f2.x = 2; - f3 = f1 << f2; - cmpVal1(f3, 4); - f2 = f3 >> f1; - cmpVal1(f2, 2); - - f1.x = 2; - f2.x = 1; - f1 += f2; - cmpVal1(f1, 3); - f1 -= f2; - cmpVal1(f1, 2); - f1 *= f2; - cmpVal1(f1, 2); - f1 /= f2; - cmpVal1(f1, 2); - f1 %= f2; - cmpVal1(f1, 0); - f1 &= f2; - cmpVal1(f1, 0); - f1 |= f2; - cmpVal1(f1, 1); - f1 ^= f2; - cmpVal1(f1, 0); - f1.x = 1; - f1 <<= f2; - cmpVal1(f1, 2); - f1 >>= f2; - cmpVal1(f1, 1); - - f1.x = 2; - f2 = f1++; - cmpVal1(f1, 3); - cmpVal1(f2, 2); - f2 = f1--; - cmpVal1(f2, 3); - cmpVal1(f1, 2); - f2 = ++f1; - cmpVal1(f1, 3); - cmpVal1(f2, 3); - f2 = --f1; - cmpVal1(f1, 2); - cmpVal1(f2, 2); - - f2 = ~f1; - cmpVal1(f2, (unsigned short)65533); - assert(!f1 == false); - - f1.x = 3; - f1 = f1 * (unsigned char)1; - cmpVal1(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed char)1; - cmpVal1(f1, 3); - f1 = (signed char)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal1(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed short)1; - cmpVal1(f1, 3); - f1 = (signed short)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal1(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed int)1; - cmpVal1(f1, 3); - f1 = (signed int)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (float)1; - cmpVal1(f1, 3); - f1 = (float)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal1(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed long)1; - cmpVal1(f1, 3); - f1 = (signed long)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (double)1; - cmpVal1(f1, 3); - f1 = (double)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal1(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal1(f1, 3); - - ushort1 fa((unsigned char)1); - ushort1 fb((signed char)1); - ushort1 fc((unsigned short)1); - ushort1 fd((signed short)1); - ushort1 fe((unsigned int)1); - ushort1 fg((signed int)1); - ushort1 fh((float)1); - ushort1 fi((double)1); - ushort1 fj((unsigned long)1); - ushort1 fk((signed long)1); - ushort1 fl((unsigned long long)1); - ushort1 fm((signed long long)1); - - - f1.x = 3; - f2.x = 4; - f3.x = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestUShort2() { - ushort2 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f2.x = 1; - f2.y = 1; - f3 = f1 + f2; - cmpVal2(f3, 2); - f2 = f3 - f1; - cmpVal2(f2, 1); - f1 = f2 * f3; - cmpVal2(f1, 2); - f2 = f1 / f3; - cmpVal2(f2, 2 / 2); - f3 = f1 % f2; - cmpVal2(f3, 0); - f1 = f3 & f2; - cmpVal2(f1, 0); - f2 = f1 ^ f3; - cmpVal2(f2, 0); - f1.x = 1; - f1.y = 1; - f2.x = 2; - f2.y = 2; - f3 = f1 << f2; - cmpVal2(f3, 4); - f2 = f3 >> f1; - cmpVal2(f2, 2); - - f1.x = 2; - f1.y = 2; - f2.x = 1; - f2.y = 1; - f1 += f2; - cmpVal2(f1, 3); - f1 -= f2; - cmpVal2(f1, 2); - f1 *= f2; - cmpVal2(f1, 2); - f1 /= f2; - cmpVal2(f1, 2); - f1 %= f2; - cmpVal2(f1, 0); - f1 &= f2; - cmpVal2(f1, 0); - f1 |= f2; - cmpVal2(f1, 1); - f1 ^= f2; - cmpVal2(f1, 0); - f1.x = 1; - f1.y = 1; - f1 <<= f2; - cmpVal2(f1, 2); - f1 >>= f2; - cmpVal2(f1, 1); - - f1.x = 2; - f1.y = 2; - f2 = f1++; - cmpVal2(f1, 3); - cmpVal2(f2, 2); - f2 = f1--; - cmpVal2(f2, 3); - cmpVal2(f1, 2); - f2 = ++f1; - cmpVal2(f1, 3); - cmpVal2(f2, 3); - f2 = --f1; - cmpVal2(f1, 2); - cmpVal2(f2, 2); - - f2 = ~f1; - cmpVal2(f2, (unsigned short)65533); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1 = f1 * (unsigned char)1; - cmpVal2(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed char)1; - cmpVal2(f1, 3); - f1 = (signed char)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal2(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed short)1; - cmpVal2(f1, 3); - f1 = (signed short)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal2(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed int)1; - cmpVal2(f1, 3); - f1 = (signed int)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (float)1; - cmpVal2(f1, 3); - f1 = (float)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal2(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed long)1; - cmpVal2(f1, 3); - f1 = (signed long)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (double)1; - cmpVal2(f1, 3); - f1 = (double)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal2(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal2(f1, 3); - - ushort2 fa1((unsigned char)1); - ushort2 fa2((unsigned char)1, (unsigned char)1); - ushort2 fb1((signed char)1); - ushort2 fb2((signed char)1, (signed char)1); - ushort2 fc1((unsigned short)1); - ushort2 fc2((unsigned short)1, (unsigned short)1); - ushort2 fd1((signed short)1); - ushort2 fd2((signed short)1, (signed short)1); - ushort2 fe1((unsigned int)1); - ushort2 fe2((unsigned int)1, (unsigned int)1); - ushort2 fg1((signed int)1); - ushort2 fg2((signed int)1, (signed int)1); - ushort2 fh1((float)1); - ushort2 fh2((float)1, (float)1); - ushort2 fi1((double)1); - ushort2 fi2((double)1, (double)1); - ushort2 fj1((unsigned long)1); - ushort2 fj2((unsigned long)1, (unsigned long)1); - ushort2 fk1((signed long)1); - ushort2 fk2((signed long)1, (signed long)1); - ushort2 fl1((unsigned long long)1); - ushort2 fl2((unsigned long long)1, (unsigned long long)1); - ushort2 fm1((signed long long)1); - ushort2 fm2((signed long long)1, (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f2.x = 4; - f2.y = 4; - f3.x = 3; - f3.y = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestUShort3() { - ushort3 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f3 = f1 + f2; - cmpVal3(f3, 2); - f2 = f3 - f1; - cmpVal3(f2, 1); - f1 = f2 * f3; - cmpVal3(f1, 2); - f2 = f1 / f3; - cmpVal3(f2, 2 / 2); - f3 = f1 % f2; - cmpVal3(f3, 0); - f1 = f3 & f2; - cmpVal3(f1, 0); - f2 = f1 ^ f3; - cmpVal3(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f3 = f1 << f2; - cmpVal3(f3, 4); - f2 = f3 >> f1; - cmpVal3(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f1 += f2; - cmpVal3(f1, 3); - f1 -= f2; - cmpVal3(f1, 2); - f1 *= f2; - cmpVal3(f1, 2); - f1 /= f2; - cmpVal3(f1, 2); - f1 %= f2; - cmpVal3(f1, 0); - f1 &= f2; - cmpVal3(f1, 0); - f1 |= f2; - cmpVal3(f1, 1); - f1 ^= f2; - cmpVal3(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1 <<= f2; - cmpVal3(f1, 2); - f1 >>= f2; - cmpVal3(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2 = f1++; - cmpVal3(f1, 3); - cmpVal3(f2, 2); - f2 = f1--; - cmpVal3(f2, 3); - cmpVal3(f1, 2); - f2 = ++f1; - cmpVal3(f1, 3); - cmpVal3(f2, 3); - f2 = --f1; - cmpVal3(f1, 2); - cmpVal3(f2, 2); - - f2 = ~f1; - cmpVal3(f2, (unsigned short)65533); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1 = f1 * (unsigned char)1; - cmpVal3(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed char)1; - cmpVal3(f1, 3); - f1 = (signed char)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal3(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed short)1; - cmpVal3(f1, 3); - f1 = (signed short)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal3(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed int)1; - cmpVal3(f1, 3); - f1 = (signed int)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (float)1; - cmpVal3(f1, 3); - f1 = (float)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal3(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed long)1; - cmpVal3(f1, 3); - f1 = (signed long)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (double)1; - cmpVal3(f1, 3); - f1 = (double)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal3(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal3(f1, 3); - - ushort3 fa1((unsigned char)1); - ushort3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); - ushort3 fb1((signed char)1); - ushort3 fb2((signed char)1, (signed char)1, (signed char)1); - ushort3 fc1((unsigned short)1); - ushort3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); - ushort3 fd1((signed short)1); - ushort3 fd2((signed short)1, (signed short)1, (signed short)1); - ushort3 fe1((unsigned int)1); - ushort3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); - ushort3 fg1((signed int)1); - ushort3 fg2((signed int)1, (signed int)1, (signed int)1); - ushort3 fh1((float)1); - ushort3 fh2((float)1, (float)1, (float)1); - ushort3 fi1((double)1); - ushort3 fi2((double)1, (double)1, (double)1); - ushort3 fj1((unsigned long)1); - ushort3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); - ushort3 fk1((signed long)1); - ushort3 fk2((signed long)1, (signed long)1, (signed long)1); - ushort3 fl1((unsigned long long)1); - ushort3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); - ushort3 fm1((signed long long)1); - ushort3 fm2((signed long long)1, (signed long long)1, (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestUShort4() { - ushort4 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f3 = f1 + f2; - cmpVal4(f3, 2); - f2 = f3 - f1; - cmpVal4(f2, 1); - f1 = f2 * f3; - cmpVal4(f1, 2); - f2 = f1 / f3; - cmpVal4(f2, 2 / 2); - f3 = f1 % f2; - cmpVal4(f3, 0); - f1 = f3 & f2; - cmpVal4(f1, 0); - f2 = f1 ^ f3; - cmpVal4(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f2.w = 2; - f3 = f1 << f2; - cmpVal4(f3, 4); - f2 = f3 >> f1; - cmpVal4(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f1 += f2; - cmpVal4(f1, 3); - f1 -= f2; - cmpVal4(f1, 2); - f1 *= f2; - cmpVal4(f1, 2); - f1 /= f2; - cmpVal4(f1, 2); - f1 %= f2; - cmpVal4(f1, 0); - f1 &= f2; - cmpVal4(f1, 0); - f1 |= f2; - cmpVal4(f1, 1); - f1 ^= f2; - cmpVal4(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f1 <<= f2; - cmpVal4(f1, 2); - f1 >>= f2; - cmpVal4(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2 = f1++; - cmpVal4(f1, 3); - cmpVal4(f2, 2); - f2 = f1--; - cmpVal4(f2, 3); - cmpVal4(f1, 2); - f2 = ++f1; - cmpVal4(f1, 3); - cmpVal4(f2, 3); - f2 = --f1; - cmpVal4(f1, 2); - cmpVal4(f2, 2); - - f2 = ~f1; - cmpVal4(f2, (unsigned short)65533); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f1 = f1 * (unsigned char)1; - cmpVal4(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed char)1; - cmpVal4(f1, 3); - f1 = (signed char)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal4(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed short)1; - cmpVal4(f1, 3); - f1 = (signed short)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal4(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed int)1; - cmpVal4(f1, 3); - f1 = (signed int)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (float)1; - cmpVal4(f1, 3); - f1 = (float)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal4(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed long)1; - cmpVal4(f1, 3); - f1 = (signed long)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (double)1; - cmpVal4(f1, 3); - f1 = (double)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal4(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal4(f1, 3); - - ushort4 fa1((unsigned char)1); - ushort4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); - ushort4 fb1((signed char)1); - ushort4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); - ushort4 fc1((unsigned short)1); - ushort4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); - ushort4 fd1((signed short)1); - ushort4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); - ushort4 fe1((unsigned int)1); - ushort4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); - ushort4 fg1((signed int)1); - ushort4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); - ushort4 fh1((float)1); - ushort4 fh2((float)1, (float)1, (float)1, (float)1); - ushort4 fi1((double)1); - ushort4 fi2((double)1, (double)1, (double)1, (double)1); - ushort4 fj1((unsigned long)1); - ushort4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); - ushort4 fk1((signed long)1); - ushort4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); - ushort4 fl1((unsigned long long)1); - ushort4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, - (unsigned long long)1); - ushort4 fm1((signed long long)1); - ushort4 fm2((signed long long)1, (signed long long)1, (signed long long)1, (signed long long)1); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f2.w = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - f3.w = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - - -bool TestShort1() { - short1 f1, f2, f3; - f1.x = 1; - f2.x = 1; - f3 = f1 + f2; - cmpVal1(f3, 2); - f2 = f3 - f1; - cmpVal1(f2, 1); - f1 = f2 * f3; - cmpVal1(f1, 2); - f2 = f1 / f3; - cmpVal1(f2, 2 / 2); - f3 = f1 % f2; - cmpVal1(f3, 0); - f1 = f3 & f2; - cmpVal1(f1, 0); - f2 = f1 ^ f3; - cmpVal1(f2, 0); - f1.x = 1; - f2.x = 2; - f3 = f1 << f2; - cmpVal1(f3, 4); - f2 = f3 >> f1; - cmpVal1(f2, 2); - - f1.x = 2; - f2.x = 1; - f1 += f2; - cmpVal1(f1, 3); - f1 -= f2; - cmpVal1(f1, 2); - f1 *= f2; - cmpVal1(f1, 2); - f1 /= f2; - cmpVal1(f1, 2); - f1 %= f2; - cmpVal1(f1, 0); - f1 &= f2; - cmpVal1(f1, 0); - f1 |= f2; - cmpVal1(f1, 1); - f1 ^= f2; - cmpVal1(f1, 0); - f1.x = 1; - f1 <<= f2; - cmpVal1(f1, 2); - f1 >>= f2; - cmpVal1(f1, 1); - - f1.x = 2; - f2 = f1++; - cmpVal1(f1, 3); - cmpVal1(f2, 2); - f2 = f1--; - cmpVal1(f2, 3); - cmpVal1(f1, 2); - f2 = ++f1; - cmpVal1(f1, 3); - cmpVal1(f2, 3); - f2 = --f1; - cmpVal1(f1, 2); - cmpVal1(f2, 2); - - f2 = ~f1; - cmpVal1(f2, (signed short)65533); - assert(!f1 == false); - - f1.x = 3; - f1 = f1 * (unsigned char)1; - cmpVal1(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed char)1; - cmpVal1(f1, 3); - f1 = (signed char)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal1(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed short)1; - cmpVal1(f1, 3); - f1 = (signed short)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal1(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed int)1; - cmpVal1(f1, 3); - f1 = (signed int)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (float)1; - cmpVal1(f1, 3); - f1 = (float)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal1(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed long)1; - cmpVal1(f1, 3); - f1 = (signed long)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (double)1; - cmpVal1(f1, 3); - f1 = (double)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal1(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal1(f1, 3); - - short1 fa((unsigned char)1); - short1 fb((signed char)1); - short1 fc((unsigned short)1); - short1 fd((signed short)1); - short1 fe((unsigned int)1); - short1 fg((signed int)1); - short1 fh((float)1); - short1 fi((double)1); - short1 fj((unsigned long)1); - short1 fk((signed long)1); - short1 fl((unsigned long long)1); - short1 fm((signed long long)1); - - - f1.x = 3; - f2.x = 4; - f3.x = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestShort2() { - short2 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f2.x = 1; - f2.y = 1; - f3 = f1 + f2; - cmpVal2(f3, 2); - f2 = f3 - f1; - cmpVal2(f2, 1); - f1 = f2 * f3; - cmpVal2(f1, 2); - f2 = f1 / f3; - cmpVal2(f2, 2 / 2); - f3 = f1 % f2; - cmpVal2(f3, 0); - f1 = f3 & f2; - cmpVal2(f1, 0); - f2 = f1 ^ f3; - cmpVal2(f2, 0); - f1.x = 1; - f1.y = 1; - f2.x = 2; - f2.y = 2; - f3 = f1 << f2; - cmpVal2(f3, 4); - f2 = f3 >> f1; - cmpVal2(f2, 2); - - f1.x = 2; - f1.y = 2; - f2.x = 1; - f2.y = 1; - f1 += f2; - cmpVal2(f1, 3); - f1 -= f2; - cmpVal2(f1, 2); - f1 *= f2; - cmpVal2(f1, 2); - f1 /= f2; - cmpVal2(f1, 2); - f1 %= f2; - cmpVal2(f1, 0); - f1 &= f2; - cmpVal2(f1, 0); - f1 |= f2; - cmpVal2(f1, 1); - f1 ^= f2; - cmpVal2(f1, 0); - f1.x = 1; - f1.y = 1; - f1 <<= f2; - cmpVal2(f1, 2); - f1 >>= f2; - cmpVal2(f1, 1); - - f1.x = 2; - f1.y = 2; - f2 = f1++; - cmpVal2(f1, 3); - cmpVal2(f2, 2); - f2 = f1--; - cmpVal2(f2, 3); - cmpVal2(f1, 2); - f2 = ++f1; - cmpVal2(f1, 3); - cmpVal2(f2, 3); - f2 = --f1; - cmpVal2(f1, 2); - cmpVal2(f2, 2); - - f2 = ~f1; - cmpVal2(f2, (signed short)65533); - assert(!f1 == false); - - cmpVal2(f1, 3); - f1.x = 3; - f1.y = 3; - f1 = f1 * (unsigned char)1; - cmpVal2(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed char)1; - cmpVal2(f1, 3); - f1 = (signed char)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal2(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed short)1; - cmpVal2(f1, 3); - f1 = (signed short)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal2(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed int)1; - cmpVal2(f1, 3); - f1 = (signed int)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (float)1; - cmpVal2(f1, 3); - f1 = (float)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal2(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed long)1; - cmpVal2(f1, 3); - f1 = (signed long)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (double)1; - cmpVal2(f1, 3); - f1 = (double)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal2(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal2(f1, 3); - - short2 fa1((unsigned char)1); - short2 fa2((unsigned char)1, (unsigned char)1); - short2 fb1((signed char)1); - short2 fb2((signed char)1, (signed char)1); - short2 fc1((unsigned short)1); - short2 fc2((unsigned short)1, (unsigned short)1); - short2 fd1((signed short)1); - short2 fd2((signed short)1, (signed short)1); - short2 fe1((unsigned int)1); - short2 fe2((unsigned int)1, (unsigned int)1); - short2 fg1((signed int)1); - short2 fg2((signed int)1, (signed int)1); - short2 fh1((float)1); - short2 fh2((float)1, (float)1); - short2 fi1((double)1); - short2 fi2((double)1, (double)1); - short2 fj1((unsigned long)1); - short2 fj2((unsigned long)1, (unsigned long)1); - short2 fk1((signed long)1); - short2 fk2((signed long)1, (signed long)1); - short2 fl1((unsigned long long)1); - short2 fl2((unsigned long long)1, (unsigned long long)1); - short2 fm1((signed long long)1); - short2 fm2((signed long long)1, (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f2.x = 4; - f2.y = 4; - f3.x = 3; - f3.y = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestShort3() { - short3 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f3 = f1 + f2; - cmpVal3(f3, 2); - f2 = f3 - f1; - cmpVal3(f2, 1); - f1 = f2 * f3; - cmpVal3(f1, 2); - f2 = f1 / f3; - cmpVal3(f2, 2 / 2); - f3 = f1 % f2; - cmpVal3(f3, 0); - f1 = f3 & f2; - cmpVal3(f1, 0); - f2 = f1 ^ f3; - cmpVal3(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f3 = f1 << f2; - cmpVal3(f3, 4); - f2 = f3 >> f1; - cmpVal3(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f1 += f2; - cmpVal3(f1, 3); - f1 -= f2; - cmpVal3(f1, 2); - f1 *= f2; - cmpVal3(f1, 2); - f1 /= f2; - cmpVal3(f1, 2); - f1 %= f2; - cmpVal3(f1, 0); - f1 &= f2; - cmpVal3(f1, 0); - f1 |= f2; - cmpVal3(f1, 1); - f1 ^= f2; - cmpVal3(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1 <<= f2; - cmpVal3(f1, 2); - f1 >>= f2; - cmpVal3(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2 = f1++; - cmpVal3(f1, 3); - cmpVal3(f2, 2); - f2 = f1--; - cmpVal3(f2, 3); - cmpVal3(f1, 2); - f2 = ++f1; - cmpVal3(f1, 3); - cmpVal3(f2, 3); - f2 = --f1; - cmpVal3(f1, 2); - cmpVal3(f2, 2); - - f2 = ~f1; - cmpVal3(f2, (signed short)65533); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1 = f1 * (unsigned char)1; - cmpVal3(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed char)1; - cmpVal3(f1, 3); - f1 = (signed char)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal3(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed short)1; - cmpVal3(f1, 3); - f1 = (signed short)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal3(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed int)1; - cmpVal3(f1, 3); - f1 = (signed int)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (float)1; - cmpVal3(f1, 3); - f1 = (float)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal3(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed long)1; - cmpVal3(f1, 3); - f1 = (signed long)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (double)1; - cmpVal3(f1, 3); - f1 = (double)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal3(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal3(f1, 3); - - short3 fa1((unsigned char)1); - short3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); - short3 fb1((signed char)1); - short3 fb2((signed char)1, (signed char)1, (signed char)1); - short3 fc1((unsigned short)1); - short3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); - short3 fd1((signed short)1); - short3 fd2((signed short)1, (signed short)1, (signed short)1); - short3 fe1((unsigned int)1); - short3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); - short3 fg1((signed int)1); - short3 fg2((signed int)1, (signed int)1, (signed int)1); - short3 fh1((float)1); - short3 fh2((float)1, (float)1, (float)1); - short3 fi1((double)1); - short3 fi2((double)1, (double)1, (double)1); - short3 fj1((unsigned long)1); - short3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); - short3 fk1((signed long)1); - short3 fk2((signed long)1, (signed long)1, (signed long)1); - short3 fl1((unsigned long long)1); - short3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); - short3 fm1((signed long long)1); - short3 fm2((signed long long)1, (signed long long)1, (signed long long)1); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestShort4() { - short4 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f3 = f1 + f2; - cmpVal4(f3, 2); - f2 = f3 - f1; - cmpVal4(f2, 1); - f1 = f2 * f3; - cmpVal4(f1, 2); - f2 = f1 / f3; - cmpVal4(f2, 2 / 2); - f3 = f1 % f2; - cmpVal4(f3, 0); - f1 = f3 & f2; - cmpVal4(f1, 0); - f2 = f1 ^ f3; - cmpVal4(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f2.w = 2; - f3 = f1 << f2; - cmpVal4(f3, 4); - f2 = f3 >> f1; - cmpVal4(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f1 += f2; - cmpVal4(f1, 3); - f1 -= f2; - cmpVal4(f1, 2); - f1 *= f2; - cmpVal4(f1, 2); - f1 /= f2; - cmpVal4(f1, 2); - f1 %= f2; - cmpVal4(f1, 0); - f1 &= f2; - cmpVal4(f1, 0); - f1 |= f2; - cmpVal4(f1, 1); - f1 ^= f2; - cmpVal4(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f1 <<= f2; - cmpVal4(f1, 2); - f1 >>= f2; - cmpVal4(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2 = f1++; - cmpVal4(f1, 3); - cmpVal4(f2, 2); - f2 = f1--; - cmpVal4(f2, 3); - cmpVal4(f1, 2); - f2 = ++f1; - cmpVal4(f1, 3); - cmpVal4(f2, 3); - f2 = --f1; - cmpVal4(f1, 2); - cmpVal4(f2, 2); - - f2 = ~f1; - cmpVal4(f2, (signed short)65533); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f1 = f1 * (unsigned char)1; - cmpVal4(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed char)1; - cmpVal4(f1, 3); - f1 = (signed char)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal4(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed short)1; - cmpVal4(f1, 3); - f1 = (signed short)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal4(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed int)1; - cmpVal4(f1, 3); - f1 = (signed int)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (float)1; - cmpVal4(f1, 3); - f1 = (float)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal4(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed long)1; - cmpVal4(f1, 3); - f1 = (signed long)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (double)1; - cmpVal4(f1, 3); - f1 = (double)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal4(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal4(f1, 3); - - short4 fa1((unsigned char)1); - short4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); - short4 fb1((signed char)1); - short4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); - short4 fc1((unsigned short)1); - short4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); - short4 fd1((signed short)1); - short4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); - short4 fe1((unsigned int)1); - short4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); - short4 fg1((signed int)1); - short4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); - short4 fh1((float)1); - short4 fh2((float)1, (float)1, (float)1, (float)1); - short4 fi1((double)1); - short4 fi2((double)1, (double)1, (double)1, (double)1); - short4 fj1((unsigned long)1); - short4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); - short4 fk1((signed long)1); - short4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); - short4 fl1((unsigned long long)1); - short4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, - (unsigned long long)1); - short4 fm1((signed long long)1); - short4 fm2((signed long long)1, (signed long long)1, (signed long long)1, (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f2.w = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - f3.w = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - - -bool TestUInt1() { - uint1 f1, f2, f3; - f1.x = 1; - f2.x = 1; - f3 = f1 + f2; - cmpVal1(f3, 2); - f2 = f3 - f1; - cmpVal1(f2, 1); - f1 = f2 * f3; - cmpVal1(f1, 2); - f2 = f1 / f3; - cmpVal1(f2, 2 / 2); - f3 = f1 % f2; - cmpVal1(f3, 0); - f1 = f3 & f2; - cmpVal1(f1, 0); - f2 = f1 ^ f3; - cmpVal1(f2, 0); - f1.x = 1; - f2.x = 2; - f3 = f1 << f2; - cmpVal1(f3, 4); - f2 = f3 >> f1; - cmpVal1(f2, 2); - - f1.x = 2; - f2.x = 1; - f1 += f2; - cmpVal1(f1, 3); - f1 -= f2; - cmpVal1(f1, 2); - f1 *= f2; - cmpVal1(f1, 2); - f1 /= f2; - cmpVal1(f1, 2); - f1 %= f2; - cmpVal1(f1, 0); - f1 &= f2; - cmpVal1(f1, 0); - f1 |= f2; - cmpVal1(f1, 1); - f1 ^= f2; - cmpVal1(f1, 0); - f1.x = 1; - f1 <<= f2; - cmpVal1(f1, 2); - f1 >>= f2; - cmpVal1(f1, 1); - - f1.x = 2; - f2 = f1++; - cmpVal1(f1, 3); - cmpVal1(f2, 2); - f2 = f1--; - cmpVal1(f2, 3); - cmpVal1(f1, 2); - f2 = ++f1; - cmpVal1(f1, 3); - cmpVal1(f2, 3); - f2 = --f1; - cmpVal1(f1, 2); - cmpVal1(f2, 2); - - f2 = ~f1; - cmpVal1(f2, (unsigned int)4294967293); - assert(!f1 == false); - - f1.x = 3; - f1 = f1 * (unsigned char)1; - cmpVal1(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed char)1; - cmpVal1(f1, 3); - f1 = (signed char)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal1(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed short)1; - cmpVal1(f1, 3); - f1 = (signed short)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal1(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed int)1; - cmpVal1(f1, 3); - f1 = (signed int)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (float)1; - cmpVal1(f1, 3); - f1 = (float)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal1(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed long)1; - cmpVal1(f1, 3); - f1 = (signed long)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (double)1; - cmpVal1(f1, 3); - f1 = (double)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal1(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal1(f1, 3); - - uint1 fa((unsigned char)1); - uint1 fb((signed char)1); - uint1 fc((unsigned short)1); - uint1 fd((signed short)1); - uint1 fe((unsigned int)1); - uint1 fg((signed int)1); - uint1 fh((float)1); - uint1 fi((double)1); - uint1 fj((unsigned long)1); - uint1 fk((signed long)1); - uint1 fl((unsigned long long)1); - uint1 fm((signed long long)1); - - - f1.x = 3; - f2.x = 4; - f3.x = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestUInt2() { - uint2 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f2.x = 1; - f2.y = 1; - f3 = f1 + f2; - cmpVal2(f3, 2); - f2 = f3 - f1; - cmpVal2(f2, 1); - f1 = f2 * f3; - cmpVal2(f1, 2); - f2 = f1 / f3; - cmpVal2(f2, 2 / 2); - f3 = f1 % f2; - cmpVal2(f3, 0); - f1 = f3 & f2; - cmpVal2(f1, 0); - f2 = f1 ^ f3; - cmpVal2(f2, 0); - f1.x = 1; - f1.y = 1; - f2.x = 2; - f2.y = 2; - f3 = f1 << f2; - cmpVal2(f3, 4); - f2 = f3 >> f1; - cmpVal2(f2, 2); - - f1.x = 2; - f1.y = 2; - f2.x = 1; - f2.y = 1; - f1 += f2; - cmpVal2(f1, 3); - f1 -= f2; - cmpVal2(f1, 2); - f1 *= f2; - cmpVal2(f1, 2); - f1 /= f2; - cmpVal2(f1, 2); - f1 %= f2; - cmpVal2(f1, 0); - f1 &= f2; - cmpVal2(f1, 0); - f1 |= f2; - cmpVal2(f1, 1); - f1 ^= f2; - cmpVal2(f1, 0); - f1.x = 1; - f1.y = 1; - f1 <<= f2; - cmpVal2(f1, 2); - f1 >>= f2; - cmpVal2(f1, 1); - - f1.x = 2; - f1.y = 2; - f2 = f1++; - cmpVal2(f1, 3); - cmpVal2(f2, 2); - f2 = f1--; - cmpVal2(f2, 3); - cmpVal2(f1, 2); - f2 = ++f1; - cmpVal2(f1, 3); - cmpVal2(f2, 3); - f2 = --f1; - cmpVal2(f1, 2); - cmpVal2(f2, 2); - - f2 = ~f1; - cmpVal2(f2, (unsigned int)4294967293); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1 = f1 * (unsigned char)1; - cmpVal2(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed char)1; - cmpVal2(f1, 3); - f1 = (signed char)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal2(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed short)1; - cmpVal2(f1, 3); - f1 = (signed short)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal2(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed int)1; - cmpVal2(f1, 3); - f1 = (signed int)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (float)1; - cmpVal2(f1, 3); - f1 = (float)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal2(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed long)1; - cmpVal2(f1, 3); - f1 = (signed long)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (double)1; - cmpVal2(f1, 3); - f1 = (double)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal2(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal2(f1, 3); - - uint2 fa1((unsigned char)1); - uint2 fa2((unsigned char)1, (unsigned char)1); - uint2 fb1((signed char)1); - uint2 fb2((signed char)1, (signed char)1); - uint2 fc1((unsigned short)1); - uint2 fc2((unsigned short)1, (unsigned short)1); - uint2 fd1((signed short)1); - uint2 fd2((signed short)1, (signed short)1); - uint2 fe1((unsigned int)1); - uint2 fe2((unsigned int)1, (unsigned int)1); - uint2 fg1((signed int)1); - uint2 fg2((signed int)1, (signed int)1); - uint2 fh1((float)1); - uint2 fh2((float)1, (float)1); - uint2 fi1((double)1); - uint2 fi2((double)1, (double)1); - uint2 fj1((unsigned long)1); - uint2 fj2((unsigned long)1, (unsigned long)1); - uint2 fk1((signed long)1); - uint2 fk2((signed long)1, (signed long)1); - uint2 fl1((unsigned long long)1); - uint2 fl2((unsigned long long)1, (unsigned long long)1); - uint2 fm1((signed long long)1); - uint2 fm2((signed long long)1, (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f2.x = 4; - f2.y = 4; - f3.x = 3; - f3.y = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestUInt3() { - uint3 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f3 = f1 + f2; - cmpVal3(f3, 2); - f2 = f3 - f1; - cmpVal3(f2, 1); - f1 = f2 * f3; - cmpVal3(f1, 2); - f2 = f1 / f3; - cmpVal3(f2, 2 / 2); - f3 = f1 % f2; - cmpVal3(f3, 0); - f1 = f3 & f2; - cmpVal3(f1, 0); - f2 = f1 ^ f3; - cmpVal3(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f3 = f1 << f2; - cmpVal3(f3, 4); - f2 = f3 >> f1; - cmpVal3(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f1 += f2; - cmpVal3(f1, 3); - f1 -= f2; - cmpVal3(f1, 2); - f1 *= f2; - cmpVal3(f1, 2); - f1 /= f2; - cmpVal3(f1, 2); - f1 %= f2; - cmpVal3(f1, 0); - f1 &= f2; - cmpVal3(f1, 0); - f1 |= f2; - cmpVal3(f1, 1); - f1 ^= f2; - cmpVal3(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1 <<= f2; - cmpVal3(f1, 2); - f1 >>= f2; - cmpVal3(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2 = f1++; - cmpVal3(f1, 3); - cmpVal3(f2, 2); - f2 = f1--; - cmpVal3(f2, 3); - cmpVal3(f1, 2); - f2 = ++f1; - cmpVal3(f1, 3); - cmpVal3(f2, 3); - f2 = --f1; - cmpVal3(f1, 2); - cmpVal3(f2, 2); - - f2 = ~f1; - cmpVal3(f2, (unsigned int)4294967293); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1 = f1 * (unsigned char)1; - cmpVal3(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed char)1; - cmpVal3(f1, 3); - f1 = (signed char)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal3(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed short)1; - cmpVal3(f1, 3); - f1 = (signed short)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal3(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed int)1; - cmpVal3(f1, 3); - f1 = (signed int)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (float)1; - cmpVal3(f1, 3); - f1 = (float)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal3(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed long)1; - cmpVal3(f1, 3); - f1 = (signed long)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (double)1; - cmpVal3(f1, 3); - f1 = (double)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal3(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal3(f1, 3); - - uint3 fa1((unsigned char)1); - uint3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); - uint3 fb1((signed char)1); - uint3 fb2((signed char)1, (signed char)1, (signed char)1); - uint3 fc1((unsigned short)1); - uint3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); - uint3 fd1((signed short)1); - uint3 fd2((signed short)1, (signed short)1, (signed short)1); - uint3 fe1((unsigned int)1); - uint3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); - uint3 fg1((signed int)1); - uint3 fg2((signed int)1, (signed int)1, (signed int)1); - uint3 fh1((float)1); - uint3 fh2((float)1, (float)1, (float)1); - uint3 fi1((double)1); - uint3 fi2((double)1, (double)1, (double)1); - uint3 fj1((unsigned long)1); - uint3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); - uint3 fk1((signed long)1); - uint3 fk2((signed long)1, (signed long)1, (signed long)1); - uint3 fl1((unsigned long long)1); - uint3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); - uint3 fm1((signed long long)1); - uint3 fm2((signed long long)1, (signed long long)1, (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestUInt4() { - uint4 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f3 = f1 + f2; - cmpVal4(f3, 2); - f2 = f3 - f1; - cmpVal4(f2, 1); - f1 = f2 * f3; - cmpVal4(f1, 2); - f2 = f1 / f3; - cmpVal4(f2, 2 / 2); - f3 = f1 % f2; - cmpVal4(f3, 0); - f1 = f3 & f2; - cmpVal4(f1, 0); - f2 = f1 ^ f3; - cmpVal4(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f2.w = 2; - f3 = f1 << f2; - cmpVal4(f3, 4); - f2 = f3 >> f1; - cmpVal4(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f1 += f2; - cmpVal4(f1, 3); - f1 -= f2; - cmpVal4(f1, 2); - f1 *= f2; - cmpVal4(f1, 2); - f1 /= f2; - cmpVal4(f1, 2); - f1 %= f2; - cmpVal4(f1, 0); - f1 &= f2; - cmpVal4(f1, 0); - f1 |= f2; - cmpVal4(f1, 1); - f1 ^= f2; - cmpVal4(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f1 <<= f2; - cmpVal4(f1, 2); - f1 >>= f2; - cmpVal4(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2 = f1++; - cmpVal4(f1, 3); - cmpVal4(f2, 2); - f2 = f1--; - cmpVal4(f2, 3); - cmpVal4(f1, 2); - f2 = ++f1; - cmpVal4(f1, 3); - cmpVal4(f2, 3); - f2 = --f1; - cmpVal4(f1, 2); - cmpVal4(f2, 2); - - f2 = ~f1; - cmpVal4(f2, (unsigned int)4294967293); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f1 = f1 * (unsigned char)1; - cmpVal4(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed char)1; - cmpVal4(f1, 3); - f1 = (signed char)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal4(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed short)1; - cmpVal4(f1, 3); - f1 = (signed short)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal4(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed int)1; - cmpVal4(f1, 3); - f1 = (signed int)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (float)1; - cmpVal4(f1, 3); - f1 = (float)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal4(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed long)1; - cmpVal4(f1, 3); - f1 = (signed long)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (double)1; - cmpVal4(f1, 3); - f1 = (double)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal4(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal4(f1, 3); - - uint4 fa1((unsigned char)1); - uint4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); - uint4 fb1((signed char)1); - uint4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); - uint4 fc1((unsigned short)1); - uint4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); - uint4 fd1((signed short)1); - uint4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); - uint4 fe1((unsigned int)1); - uint4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); - uint4 fg1((signed int)1); - uint4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); - uint4 fh1((float)1); - uint4 fh2((float)1, (float)1, (float)1, (float)1); - uint4 fi1((double)1); - uint4 fi2((double)1, (double)1, (double)1, (double)1); - uint4 fj1((unsigned long)1); - uint4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); - uint4 fk1((signed long)1); - uint4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); - uint4 fl1((unsigned long long)1); - uint4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, - (unsigned long long)1); - uint4 fm1((signed long long)1); - uint4 fm2((signed long long)1, (signed long long)1, (signed long long)1, (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f2.w = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - f3.w = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - - -bool TestInt1() { - int1 f1, f2, f3; - f1.x = 1; - f2.x = 1; - f3 = f1 + f2; - cmpVal1(f3, 2); - f2 = f3 - f1; - cmpVal1(f2, 1); - f1 = f2 * f3; - cmpVal1(f1, 2); - f2 = f1 / f3; - cmpVal1(f2, 2 / 2); - f3 = f1 % f2; - cmpVal1(f3, 0); - f1 = f3 & f2; - cmpVal1(f1, 0); - f2 = f1 ^ f3; - cmpVal1(f2, 0); - f1.x = 1; - f2.x = 2; - f3 = f1 << f2; - cmpVal1(f3, 4); - f2 = f3 >> f1; - cmpVal1(f2, 2); - - f1.x = 2; - f2.x = 1; - f1 += f2; - cmpVal1(f1, 3); - f1 -= f2; - cmpVal1(f1, 2); - f1 *= f2; - cmpVal1(f1, 2); - f1 /= f2; - cmpVal1(f1, 2); - f1 %= f2; - cmpVal1(f1, 0); - f1 &= f2; - cmpVal1(f1, 0); - f1 |= f2; - cmpVal1(f1, 1); - f1 ^= f2; - cmpVal1(f1, 0); - f1.x = 1; - f1 <<= f2; - cmpVal1(f1, 2); - f1 >>= f2; - cmpVal1(f1, 1); - - f1.x = 2; - f2 = f1++; - cmpVal1(f1, 3); - cmpVal1(f2, 2); - f2 = f1--; - cmpVal1(f2, 3); - cmpVal1(f1, 2); - f2 = ++f1; - cmpVal1(f1, 3); - cmpVal1(f2, 3); - f2 = --f1; - cmpVal1(f1, 2); - cmpVal1(f2, 2); - - f2 = ~f1; - cmpVal1(f2, (signed int)4294967293); - assert(!f1 == false); - - f1.x = 3; - f1 = f1 * (unsigned char)1; - cmpVal1(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed char)1; - cmpVal1(f1, 3); - f1 = (signed char)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal1(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed short)1; - cmpVal1(f1, 3); - f1 = (signed short)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal1(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed int)1; - cmpVal1(f1, 3); - f1 = (signed int)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (float)1; - cmpVal1(f1, 3); - f1 = (float)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal1(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed long)1; - cmpVal1(f1, 3); - f1 = (signed long)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (double)1; - cmpVal1(f1, 3); - f1 = (double)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal1(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal1(f1, 3); - - int1 fa((unsigned char)1); - int1 fb((signed char)1); - int1 fc((unsigned short)1); - int1 fd((signed short)1); - int1 fe((unsigned int)1); - int1 fg((signed int)1); - int1 fh((float)1); - int1 fi((double)1); - int1 fj((unsigned long)1); - int1 fk((signed long)1); - int1 fl((unsigned long long)1); - int1 fm((signed long long)1); - - - f1.x = 3; - f2.x = 4; - f3.x = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestInt2() { - int2 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f2.x = 1; - f2.y = 1; - f3 = f1 + f2; - cmpVal2(f3, 2); - f2 = f3 - f1; - cmpVal2(f2, 1); - f1 = f2 * f3; - cmpVal2(f1, 2); - f2 = f1 / f3; - cmpVal2(f2, 2 / 2); - f3 = f1 % f2; - cmpVal2(f3, 0); - f1 = f3 & f2; - cmpVal2(f1, 0); - f2 = f1 ^ f3; - cmpVal2(f2, 0); - f1.x = 1; - f1.y = 1; - f2.x = 2; - f2.y = 2; - f3 = f1 << f2; - cmpVal2(f3, 4); - f2 = f3 >> f1; - cmpVal2(f2, 2); - - f1.x = 2; - f1.y = 2; - f2.x = 1; - f2.y = 1; - f1 += f2; - cmpVal2(f1, 3); - f1 -= f2; - cmpVal2(f1, 2); - f1 *= f2; - cmpVal2(f1, 2); - f1 /= f2; - cmpVal2(f1, 2); - f1 %= f2; - cmpVal2(f1, 0); - f1 &= f2; - cmpVal2(f1, 0); - f1 |= f2; - cmpVal2(f1, 1); - f1 ^= f2; - cmpVal2(f1, 0); - f1.x = 1; - f1.y = 1; - f1 <<= f2; - cmpVal2(f1, 2); - f1 >>= f2; - cmpVal2(f1, 1); - - f1.x = 2; - f1.y = 2; - f2 = f1++; - cmpVal2(f1, 3); - cmpVal2(f2, 2); - f2 = f1--; - cmpVal2(f2, 3); - cmpVal2(f1, 2); - f2 = ++f1; - cmpVal2(f1, 3); - cmpVal2(f2, 3); - f2 = --f1; - cmpVal2(f1, 2); - cmpVal2(f2, 2); - - f2 = ~f1; - cmpVal2(f2, (signed int)4294967293); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1 = f1 * (unsigned char)1; - cmpVal2(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed char)1; - cmpVal2(f1, 3); - f1 = (signed char)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal2(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed short)1; - cmpVal2(f1, 3); - f1 = (signed short)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal2(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed int)1; - cmpVal2(f1, 3); - f1 = (signed int)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (float)1; - cmpVal2(f1, 3); - f1 = (float)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal2(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed long)1; - cmpVal2(f1, 3); - f1 = (signed long)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (double)1; - cmpVal2(f1, 3); - f1 = (double)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal2(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal2(f1, 3); - - int2 fa1((unsigned char)1); - int2 fa2((unsigned char)1, (unsigned char)1); - int2 fb1((signed char)1); - int2 fb2((signed char)1, (signed char)1); - int2 fc1((unsigned short)1); - int2 fc2((unsigned short)1, (unsigned short)1); - int2 fd1((signed short)1); - int2 fd2((signed short)1, (signed short)1); - int2 fe1((unsigned int)1); - int2 fe2((unsigned int)1, (unsigned int)1); - int2 fg1((signed int)1); - int2 fg2((signed int)1, (signed int)1); - int2 fh1((float)1); - int2 fh2((float)1, (float)1); - int2 fi1((double)1); - int2 fi2((double)1, (double)1); - int2 fj1((unsigned long)1); - int2 fj2((unsigned long)1, (unsigned long)1); - int2 fk1((signed long)1); - int2 fk2((signed long)1, (signed long)1); - int2 fl1((unsigned long long)1); - int2 fl2((unsigned long long)1, (unsigned long long)1); - int2 fm1((signed long long)1); - int2 fm2((signed long long)1, (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f2.x = 4; - f2.y = 4; - f3.x = 3; - f3.y = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestInt3() { - int3 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f3 = f1 + f2; - cmpVal3(f3, 2); - f2 = f3 - f1; - cmpVal3(f2, 1); - f1 = f2 * f3; - cmpVal3(f1, 2); - f2 = f1 / f3; - cmpVal3(f2, 2 / 2); - f3 = f1 % f2; - cmpVal3(f3, 0); - f1 = f3 & f2; - cmpVal3(f1, 0); - f2 = f1 ^ f3; - cmpVal3(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f3 = f1 << f2; - cmpVal3(f3, 4); - f2 = f3 >> f1; - cmpVal3(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f1 += f2; - cmpVal3(f1, 3); - f1 -= f2; - cmpVal3(f1, 2); - f1 *= f2; - cmpVal3(f1, 2); - f1 /= f2; - cmpVal3(f1, 2); - f1 %= f2; - cmpVal3(f1, 0); - f1 &= f2; - cmpVal3(f1, 0); - f1 |= f2; - cmpVal3(f1, 1); - f1 ^= f2; - cmpVal3(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1 <<= f2; - cmpVal3(f1, 2); - f1 >>= f2; - cmpVal3(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2 = f1++; - cmpVal3(f1, 3); - cmpVal3(f2, 2); - f2 = f1--; - cmpVal3(f2, 3); - cmpVal3(f1, 2); - f2 = ++f1; - cmpVal3(f1, 3); - cmpVal3(f2, 3); - f2 = --f1; - cmpVal3(f1, 2); - cmpVal3(f2, 2); - - f2 = ~f1; - cmpVal3(f2, (signed int)4294967293); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1 = f1 * (unsigned char)1; - cmpVal3(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed char)1; - cmpVal3(f1, 3); - f1 = (signed char)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal3(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed short)1; - cmpVal3(f1, 3); - f1 = (signed short)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal3(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed int)1; - cmpVal3(f1, 3); - f1 = (signed int)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (float)1; - cmpVal3(f1, 3); - f1 = (float)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal3(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed long)1; - cmpVal3(f1, 3); - f1 = (signed long)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (double)1; - cmpVal3(f1, 3); - f1 = (double)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal3(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal3(f1, 3); - - int3 fa1((unsigned char)1); - int3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); - int3 fb1((signed char)1); - int3 fb2((signed char)1, (signed char)1, (signed char)1); - int3 fc1((unsigned short)1); - int3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); - int3 fd1((signed short)1); - int3 fd2((signed short)1, (signed short)1, (signed short)1); - int3 fe1((unsigned int)1); - int3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); - int3 fg1((signed int)1); - int3 fg2((signed int)1, (signed int)1, (signed int)1); - int3 fh1((float)1); - int3 fh2((float)1, (float)1, (float)1); - int3 fi1((double)1); - int3 fi2((double)1, (double)1, (double)1); - int3 fj1((unsigned long)1); - int3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); - int3 fk1((signed long)1); - int3 fk2((signed long)1, (signed long)1, (signed long)1); - int3 fl1((unsigned long long)1); - int3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); - int3 fm1((signed long long)1); - int3 fm2((signed long long)1, (signed long long)1, (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestInt4() { - int4 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f3 = f1 + f2; - cmpVal4(f3, 2); - f2 = f3 - f1; - cmpVal4(f2, 1); - f1 = f2 * f3; - cmpVal4(f1, 2); - f2 = f1 / f3; - cmpVal4(f2, 2 / 2); - f3 = f1 % f2; - cmpVal4(f3, 0); - f1 = f3 & f2; - cmpVal4(f1, 0); - f2 = f1 ^ f3; - cmpVal4(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f2.w = 2; - f3 = f1 << f2; - cmpVal4(f3, 4); - f2 = f3 >> f1; - cmpVal4(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f1 += f2; - cmpVal4(f1, 3); - f1 -= f2; - cmpVal4(f1, 2); - f1 *= f2; - cmpVal4(f1, 2); - f1 /= f2; - cmpVal4(f1, 2); - f1 %= f2; - cmpVal4(f1, 0); - f1 &= f2; - cmpVal4(f1, 0); - f1 |= f2; - cmpVal4(f1, 1); - f1 ^= f2; - cmpVal4(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f1 <<= f2; - cmpVal4(f1, 2); - f1 >>= f2; - cmpVal4(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2 = f1++; - cmpVal4(f1, 3); - cmpVal4(f2, 2); - f2 = f1--; - cmpVal4(f2, 3); - cmpVal4(f1, 2); - f2 = ++f1; - cmpVal4(f1, 3); - cmpVal4(f2, 3); - f2 = --f1; - cmpVal4(f1, 2); - cmpVal4(f2, 2); - - f2 = ~f1; - cmpVal4(f2, (signed int)4294967293); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f1 = f1 * (unsigned char)1; - cmpVal4(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed char)1; - cmpVal4(f1, 3); - f1 = (signed char)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal4(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed short)1; - cmpVal4(f1, 3); - f1 = (signed short)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal4(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed int)1; - cmpVal4(f1, 3); - f1 = (signed int)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (float)1; - cmpVal4(f1, 3); - f1 = (float)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal4(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed long)1; - cmpVal4(f1, 3); - f1 = (signed long)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (double)1; - cmpVal4(f1, 3); - f1 = (double)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal4(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal4(f1, 3); - - int4 fa1((unsigned char)1); - int4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); - int4 fb1((signed char)1); - int4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); - int4 fc1((unsigned short)1); - int4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); - int4 fd1((signed short)1); - int4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); - int4 fe1((unsigned int)1); - int4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); - int4 fg1((signed int)1); - int4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); - int4 fh1((float)1); - int4 fh2((float)1, (float)1, (float)1, (float)1); - int4 fi1((double)1); - int4 fi2((double)1, (double)1, (double)1, (double)1); - int4 fj1((unsigned long)1); - int4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); - int4 fk1((signed long)1); - int4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); - int4 fl1((unsigned long long)1); - int4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, - (unsigned long long)1); - int4 fm1((signed long long)1); - int4 fm2((signed long long)1, (signed long long)1, (signed long long)1, (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f2.w = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - f3.w = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - - -bool TestFloat1() { - float1 f1, f2, f3; - f1.x = 1.0f; - f2.x = 1.0f; - f3 = f1 + f2; - cmpVal1(f3, 2.0f); - f2 = f3 - f1; - cmpVal1(f2, 1.0f); - f1 = f2 * f3; - cmpVal1(f1, 2.0f); - f2 = f1 / f3; - cmpVal1(f2, 2.0f / 2.0f); - f1 += f2; - cmpVal1(f1, 3.0f); - f1 -= f2; - cmpVal1(f1, 2.0f); - f1 *= f2; - cmpVal1(f1, 2.0f); - f1 /= f2; - cmpVal1(f1, 2.0f); - f2 = f1++; - cmpVal1(f1, 3.0f); - cmpVal1(f2, 2.0f); - f2 = f1--; - cmpVal1(f2, 3.0f); - cmpVal1(f1, 2.0f); - f2 = ++f1; - cmpVal1(f1, 3.0f); - cmpVal1(f2, 3.0f); - f2 = --f1; - cmpVal1(f1, 2.0f); - cmpVal1(f1, 2.0f); - - f1.x = 3.0f; - f1 = f1 * (unsigned char)1; - cmpVal1(f1, 3.0f); - f1 = (unsigned char)1 * f1; - cmpVal1(f1, 3.0f); - f1 = f1 * (signed char)1; - cmpVal1(f1, 3.0f); - f1 = (signed char)1 * f1; - cmpVal1(f1, 3.0f); - f1 = f1 * (unsigned short)1; - cmpVal1(f1, 3.0f); - f1 = (unsigned short)1 * f1; - cmpVal1(f1, 3.0f); - f1 = f1 * (signed short)1; - cmpVal1(f1, 3.0f); - f1 = (signed short)1 * f1; - cmpVal1(f1, 3.0f); - f1 = f1 * (unsigned int)1; - cmpVal1(f1, 3.0f); - f1 = (unsigned int)1 * f1; - cmpVal1(f1, 3.0f); - f1 = f1 * (signed int)1; - cmpVal1(f1, 3.0f); - f1 = (signed int)1 * f1; - cmpVal1(f1, 3.0f); - f1 = f1 * (float)1; - cmpVal1(f1, 3.0f); - f1 = (float)1 * f1; - cmpVal1(f1, 3.0f); - f1 = f1 * (unsigned long)1; - cmpVal1(f1, 3.0f); - f1 = (unsigned long)1 * f1; - cmpVal1(f1, 3.0f); - f1 = f1 * (signed long)1; - cmpVal1(f1, 3.0f); - f1 = (signed long)1 * f1; - cmpVal1(f1, 3.0f); - f1 = f1 * (double)1; - cmpVal1(f1, 3.0f); - f1 = (double)1 * f1; - cmpVal1(f1, 3.0f); - f1 = f1 * (unsigned long long)1; - cmpVal1(f1, 3.0f); - f1 = (unsigned long long)1 * f1; - cmpVal1(f1, 3.0f); - - float1 fa((unsigned char)1); - float1 fb((signed char)1); - float1 fc((unsigned short)1); - float1 fd((signed short)1); - float1 fe((unsigned int)1); - float1 fg((signed int)1); - float1 fh((float)1); - float1 fi((double)1); - float1 fj((unsigned long)1); - float1 fk((signed long)1); - float1 fl((unsigned long long)1); - float1 fm((signed long long)1); - - - f1.x = 3.0f; - f2.x = 4.0f; - f3.x = 3.0f; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); +template +bool constructor_tests() { + static_assert(is_constructible{}, ""); + static_assert(is_constructible{}, ""); + static_assert(is_constructible{}, ""); + static_assert(is_constructible{}, ""); + static_assert(is_constructible{}, ""); + static_assert(is_constructible{}, ""); + static_assert(is_constructible{}, ""); + static_assert(is_constructible{}, ""); + static_assert(is_constructible{}, ""); + static_assert(is_constructible{}, ""); + static_assert(is_constructible{}, ""); + static_assert(is_constructible{}, ""); return true; } -bool TestFloat2() { - float2 f1, f2, f3; - f1.x = 1.0f; - f1.y = 1.0f; - f2.x = 1.0f; - f2.y = 1.0f; - f3 = f1 + f2; - cmpVal2(f3, 2.0f); +template +bool TestVectorType() { + V f1(1); + V f2(1); + V f3 = f1 + f2; + if (!cmp(f3, 2)) return false; f2 = f3 - f1; - cmpVal2(f2, 1.0f); + if (!cmp(f2, 1)) return false; f1 = f2 * f3; - cmpVal2(f1, 2.0f); + if (!cmp(f1, 2)) return false; f2 = f1 / f3; - cmpVal2(f2, 2.0f / 2.0f); + if (!cmp(f2, 2 / 2)) return false; + if (!integer_binary_tests(f1, f2, f3)) return false; + + f1 = V(2); + f2 = V(1); f1 += f2; - cmpVal2(f1, 3.0f); + if (!cmp(f1, 3)) return false; f1 -= f2; - cmpVal2(f1, 2.0f); + if (!cmp(f1, 2)) return false; f1 *= f2; - cmpVal2(f1, 2.0f); + if (!cmp(f1, 2)) return false; f1 /= f2; - cmpVal2(f1, 2.0f); + if (!cmp(f1, 2)) return false; + if (!integer_unary_tests(f1, f2)) return false; - f2 = f1++; - cmpVal2(f1, 3.0f); - cmpVal2(f2, 2.0f); - f2 = f1--; - cmpVal2(f2, 3.0f); - cmpVal2(f1, 2.0f); - f2 = ++f1; - cmpVal2(f1, 3.0f); - cmpVal2(f2, 3.0f); - f2 = --f1; - cmpVal2(f1, 2.0f); - cmpVal2(f1, 2.0f); + #if false // We do not enable nullary increment / decrement yet. + f1 = V(2); + f2 = f1++; + if (!cmp(f1, 3)) return false; + if (!cmp(f2, 2)) return false; + f2 = f1--; + if (!cmp(f2, 3)) return false; + if (!cmp(f1, 2)) return false; + f2 = ++f1; + if (!cmp(f1, 3)) return false; + if (!cmp(f2, 3)) return false; + f2 = --f1; + if (!cmp(f1, 2)) return false; + if (!cmp(f2, 2)) return false; + #endif - f1.x = 3.0f; - f1.y = 3.0f; - f1 = f1 * (unsigned char)1; - cmpVal2(f1, 3.0f); - f1 = (unsigned char)1 * f1; - cmpVal2(f1, 3.0f); - f1 = f1 * (signed char)1; - cmpVal2(f1, 3.0f); - f1 = (signed char)1 * f1; - cmpVal2(f1, 3.0f); - f1 = f1 * (unsigned short)1; - cmpVal2(f1, 3.0f); - f1 = (unsigned short)1 * f1; - cmpVal2(f1, 3.0f); - f1 = f1 * (signed short)1; - cmpVal2(f1, 3.0f); - f1 = (signed short)1 * f1; - cmpVal2(f1, 3.0f); - f1 = f1 * (unsigned int)1; - cmpVal2(f1, 3.0f); - f1 = (unsigned int)1 * f1; - cmpVal2(f1, 3.0f); - f1 = f1 * (signed int)1; - cmpVal2(f1, 3.0f); - f1 = (signed int)1 * f1; - cmpVal2(f1, 3.0f); - f1 = f1 * (float)1; - cmpVal2(f1, 3.0f); - f1 = (float)1 * f1; - cmpVal2(f1, 3.0f); - f1 = f1 * (unsigned long)1; - cmpVal2(f1, 3.0f); - f1 = (unsigned long)1 * f1; - cmpVal2(f1, 3.0f); - f1 = f1 * (signed long)1; - cmpVal2(f1, 3.0f); - f1 = (signed long)1 * f1; - cmpVal2(f1, 3.0f); - f1 = f1 * (double)1; - cmpVal2(f1, 3.0f); - f1 = (double)1 * f1; - cmpVal2(f1, 3.0f); - f1 = f1 * (unsigned long long)1; - cmpVal2(f1, 3.0f); - f1 = (unsigned long long)1 * f1; - cmpVal2(f1, 3.0f); - - float2 fa1((unsigned char)1); - float2 fa2((unsigned char)1, (unsigned char)1); - float2 fb1((signed char)1); - float2 fb2((signed char)1, (signed char)1); - float2 fc1((unsigned short)1); - float2 fc2((unsigned short)1, (unsigned short)1); - float2 fd1((signed short)1); - float2 fd2((signed short)1, (signed short)1); - float2 fe1((unsigned int)1); - float2 fe2((unsigned int)1, (unsigned int)1); - float2 fg1((signed int)1); - float2 fg2((signed int)1, (signed int)1); - float2 fh1((float)1); - float2 fh2((float)1, (float)1); - float2 fi1((double)1); - float2 fi2((double)1, (double)1); - float2 fj1((unsigned long)1); - float2 fj2((unsigned long)1, (unsigned long)1); - float2 fk1((signed long)1); - float2 fk2((signed long)1, (signed long)1); - float2 fl1((unsigned long long)1); - float2 fl2((unsigned long long)1, (unsigned long long)1); - float2 fm1((signed long long)1); - float2 fm2((signed long long)1, (signed long long)1); - - - f1.x = 3.0f; - f1.y = 3.0f; - f2.x = 4.0f; - f2.y = 4.0f; - f3.x = 3.0f; - f3.y = 3.0f; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); + if (!constructor_tests()) return false; + f1 = V(3); + f2 = V(4); + f3 = V(3); + if (cmp(f1 == f2, true)) return false; + if (cmp(f1 != f2, false)) return false; + if (cmp(f1 < f2, false)) return false; + if (cmp(f2 > f1, false)) return false; + if (cmp(f1 >= f3, false)) return false; + if (cmp(f1 <= f3, false)) return false; + if (cmp(f1 && f2, false)) return false; + if (cmp(f1 || f2, false)) return false; return true; } -bool TestFloat3() { - float3 f1, f2, f3; - f1.x = 1.0f; - f1.y = 1.0f; - f1.z = 1.0f; - f2.x = 1.0f; - f2.y = 1.0f; - f2.z = 1.0f; - f3 = f1 + f2; - cmpVal3(f3, 2.0f); - f2 = f3 - f1; - cmpVal3(f2, 1.0f); - f1 = f2 * f3; - cmpVal3(f1, 2.0f); - f2 = f1 / f3; - cmpVal3(f2, 2.0f / 2.0f); - f1 += f2; - cmpVal3(f1, 3.0f); - f1 -= f2; - cmpVal3(f1, 2.0f); - f1 *= f2; - cmpVal3(f1, 2.0f); - f1 /= f2; - f2 = f1++; - cmpVal3(f1, 3.0f); - cmpVal3(f2, 2.0f); - f2 = f1--; - cmpVal3(f2, 3.0f); - cmpVal3(f1, 2.0f); - f2 = ++f1; - cmpVal3(f1, 3.0f); - cmpVal3(f2, 3.0f); - f2 = --f1; - cmpVal3(f1, 2.0f); - cmpVal3(f1, 2.0f); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1 = f1 * (unsigned char)1; - cmpVal3(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed char)1; - cmpVal3(f1, 3); - f1 = (signed char)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal3(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed short)1; - cmpVal3(f1, 3); - f1 = (signed short)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal3(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed int)1; - cmpVal3(f1, 3); - f1 = (signed int)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (float)1; - cmpVal3(f1, 3); - f1 = (float)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal3(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed long)1; - cmpVal3(f1, 3); - f1 = (signed long)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (double)1; - cmpVal3(f1, 3); - f1 = (double)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal3(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal3(f1, 3); - - float3 fa1((unsigned char)1); - float3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); - float3 fb1((signed char)1); - float3 fb2((signed char)1, (signed char)1, (signed char)1); - float3 fc1((unsigned short)1); - float3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); - float3 fd1((signed short)1); - float3 fd2((signed short)1, (signed short)1, (signed short)1); - float3 fe1((unsigned int)1); - float3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); - float3 fg1((signed int)1); - float3 fg2((signed int)1, (signed int)1, (signed int)1); - float3 fh1((float)1); - float3 fh2((float)1, (float)1, (float)1); - float3 fi1((double)1); - float3 fi2((double)1, (double)1, (double)1); - float3 fj1((unsigned long)1); - float3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); - float3 fk1((signed long)1); - float3 fk2((signed long)1, (signed long)1, (signed long)1); - float3 fl1((unsigned long long)1); - float3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); - float3 fm1((signed long long)1); - float3 fm2((signed long long)1, (signed long long)1, (signed long long)1); - - - f1.x = 3.0f; - f1.y = 3.0f; - f1.z = 3.0f; - f2.x = 4.0f; - f2.y = 4.0f; - f2.z = 4.0f; - f3.x = 3.0f; - f3.y = 3.0f; - f3.z = 3.0f; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - +template* = nullptr> +bool TestVectorTypes() { return true; } -bool TestFloat4() { - float4 f1, f2, f3; - f1.x = 1.0f; - f1.y = 1.0f; - f1.z = 1.0f; - f1.w = 1.0f; - f2.x = 1.0f; - f2.y = 1.0f; - f2.z = 1.0f; - f2.w = 1.0f; - f3 = f1 + f2; - cmpVal4(f3, 2.0f); - f2 = f3 - f1; - cmpVal4(f2, 1.0f); - f1 = f2 * f3; - cmpVal4(f1, 2.0f); - f2 = f1 / f3; - cmpVal4(f2, 2.0f / 2.0f); - f1 += f2; - cmpVal4(f1, 3.0f); - f1 -= f2; - cmpVal4(f1, 2.0f); - f1 *= f2; - cmpVal4(f1, 2.0f); - f1 /= f2; - f2 = f1++; - cmpVal4(f1, 3.0f); - cmpVal4(f2, 2.0f); - f2 = f1--; - cmpVal4(f2, 3.0f); - cmpVal4(f1, 2.0f); - f2 = ++f1; - cmpVal4(f1, 3.0f); - cmpVal4(f2, 3.0f); - f2 = --f1; - cmpVal4(f1, 2.0f); - cmpVal4(f1, 2.0f); - - f1.x = 3.0f; - f1.y = 3.0f; - f1.z = 3.0f; - f1.w = 3.0f; - f1 = f1 * (unsigned char)1; - cmpVal4(f1, 3.0f); - f1 = (unsigned char)1 * f1; - cmpVal4(f1, 3.0f); - f1 = f1 * (signed char)1; - cmpVal4(f1, 3.0f); - f1 = (signed char)1 * f1; - cmpVal4(f1, 3.0f); - f1 = f1 * (unsigned short)1; - cmpVal4(f1, 3.0f); - f1 = (unsigned short)1 * f1; - cmpVal4(f1, 3.0f); - f1 = f1 * (signed short)1; - cmpVal4(f1, 3.0f); - f1 = (signed short)1 * f1; - cmpVal4(f1, 3.0f); - f1 = f1 * (unsigned int)1; - cmpVal4(f1, 3.0f); - f1 = (unsigned int)1 * f1; - cmpVal4(f1, 3.0f); - f1 = f1 * (signed int)1; - cmpVal4(f1, 3.0f); - f1 = (signed int)1 * f1; - cmpVal4(f1, 3.0f); - f1 = f1 * (float)1; - cmpVal4(f1, 3.0f); - f1 = (float)1 * f1; - cmpVal4(f1, 3.0f); - f1 = f1 * (unsigned long)1; - cmpVal4(f1, 3.0f); - f1 = (unsigned long)1 * f1; - cmpVal4(f1, 3.0f); - f1 = f1 * (signed long)1; - cmpVal4(f1, 3.0f); - f1 = (signed long)1 * f1; - cmpVal4(f1, 3.0f); - f1 = f1 * (double)1; - cmpVal4(f1, 3.0f); - f1 = (double)1 * f1; - cmpVal4(f1, 3.0f); - f1 = f1 * (unsigned long long)1; - cmpVal4(f1, 3.0f); - f1 = (unsigned long long)1 * f1; - cmpVal4(f1, 3.0f); - - float4 fa1((unsigned char)1); - float4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); - float4 fb1((signed char)1); - float4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); - float4 fc1((unsigned short)1); - float4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); - float4 fd1((signed short)1); - float4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); - float4 fe1((unsigned int)1); - float4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); - float4 fg1((signed int)1); - float4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); - float4 fh1((float)1); - float4 fh2((float)1, (float)1, (float)1, (float)1); - float4 fi1((double)1); - float4 fi2((double)1, (double)1, (double)1, (double)1); - float4 fj1((unsigned long)1); - float4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); - float4 fk1((signed long)1); - float4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); - float4 fl1((unsigned long long)1); - float4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, - (unsigned long long)1); - float4 fm1((signed long long)1); - float4 fm2((signed long long)1, (signed long long)1, (signed long long)1, (signed long long)1); - - - f1.x = 3.0f; - f1.y = 3.0f; - f1.z = 3.0f; - f1.w = 3.0f; - f2.x = 4.0f; - f2.y = 4.0f; - f2.z = 4.0f; - f2.w = 4.0f; - f3.x = 3.0f; - f3.y = 3.0f; - f3.z = 3.0f; - f3.w = 3.0f; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - return true; +template +bool TestVectorTypes() { + if (!TestVectorType()) return false; + return TestVectorTypes(); } - -bool TestULong1() { - ulong1 f1, f2, f3; - f1.x = 1; - f2.x = 1; - f3 = f1 + f2; - cmpVal1(f3, 2); - f2 = f3 - f1; - cmpVal1(f2, 1); - f1 = f2 * f3; - cmpVal1(f1, 2); - f2 = f1 / f3; - cmpVal1(f2, 2 / 2); - f3 = f1 % f2; - cmpVal1(f3, 0); - f1 = f3 & f2; - cmpVal1(f1, 0); - f2 = f1 ^ f3; - cmpVal1(f2, 0); - f1.x = 1; - f2.x = 2; - f3 = f1 << f2; - cmpVal1(f3, 4); - f2 = f3 >> f1; - cmpVal1(f2, 2); - - f1.x = 2; - f2.x = 1; - f1 += f2; - cmpVal1(f1, 3); - f1 -= f2; - cmpVal1(f1, 2); - f1 *= f2; - cmpVal1(f1, 2); - f1 /= f2; - cmpVal1(f1, 2); - f1 %= f2; - cmpVal1(f1, 0); - f1 &= f2; - cmpVal1(f1, 0); - f1 |= f2; - cmpVal1(f1, 1); - f1 ^= f2; - cmpVal1(f1, 0); - f1.x = 1; - f1 <<= f2; - cmpVal1(f1, 2); - f1 >>= f2; - cmpVal1(f1, 1); - - f1.x = 2; - f2 = f1++; - cmpVal1(f1, 3); - cmpVal1(f2, 2); - f2 = f1--; - cmpVal1(f2, 3); - cmpVal1(f1, 2); - f2 = ++f1; - cmpVal1(f1, 3); - cmpVal1(f2, 3); - f2 = --f1; - cmpVal1(f1, 2); - cmpVal1(f2, 2); - - f2 = ~f1; - cmpVal1(f2, 18446744073709551613UL); - assert(!f1 == false); - - f1.x = 3; - f1 = f1 * (unsigned char)1; - cmpVal1(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed char)1; - cmpVal1(f1, 3); - f1 = (signed char)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal1(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed short)1; - cmpVal1(f1, 3); - f1 = (signed short)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal1(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed int)1; - cmpVal1(f1, 3); - f1 = (signed int)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (float)1; - cmpVal1(f1, 3); - f1 = (float)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal1(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed long)1; - cmpVal1(f1, 3); - f1 = (signed long)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (double)1; - cmpVal1(f1, 3); - f1 = (double)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal1(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal1(f1, 3); - - ulong1 fa((unsigned char)1); - ulong1 fb((signed char)1); - ulong1 fc((unsigned short)1); - ulong1 fd((signed short)1); - ulong1 fe((unsigned int)1); - ulong1 fg((signed int)1); - ulong1 fh((float)1); - ulong1 fi((double)1); - ulong1 fj((unsigned long)1); - ulong1 fk((signed long)1); - ulong1 fl((unsigned long long)1); - ulong1 fm((signed long long)1); - - - f1.x = 3; - f2.x = 4; - f3.x = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestULong2() { - ulong2 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f2.x = 1; - f2.y = 1; - f3 = f1 + f2; - cmpVal2(f3, 2); - f2 = f3 - f1; - cmpVal2(f2, 1); - f1 = f2 * f3; - cmpVal2(f1, 2); - f2 = f1 / f3; - cmpVal2(f2, 2 / 2); - f3 = f1 % f2; - cmpVal2(f3, 0); - f1 = f3 & f2; - cmpVal2(f1, 0); - f2 = f1 ^ f3; - cmpVal2(f2, 0); - f1.x = 1; - f1.y = 1; - f2.x = 2; - f2.y = 2; - f3 = f1 << f2; - cmpVal2(f3, 4); - f2 = f3 >> f1; - cmpVal2(f2, 2); - - f1.x = 2; - f1.y = 2; - f2.x = 1; - f2.y = 1; - f1 += f2; - cmpVal2(f1, 3); - f1 -= f2; - cmpVal2(f1, 2); - f1 *= f2; - cmpVal2(f1, 2); - f1 /= f2; - cmpVal2(f1, 2); - f1 %= f2; - cmpVal2(f1, 0); - f1 &= f2; - cmpVal2(f1, 0); - f1 |= f2; - cmpVal2(f1, 1); - f1 ^= f2; - cmpVal2(f1, 0); - f1.x = 1; - f1.y = 1; - f1 <<= f2; - cmpVal2(f1, 2); - f1 >>= f2; - cmpVal2(f1, 1); - - f1.x = 2; - f1.y = 2; - f2 = f1++; - cmpVal2(f1, 3); - cmpVal2(f2, 2); - f2 = f1--; - cmpVal2(f2, 3); - cmpVal2(f1, 2); - f2 = ++f1; - cmpVal2(f1, 3); - cmpVal2(f2, 3); - f2 = --f1; - cmpVal2(f1, 2); - cmpVal2(f2, 2); - - f2 = ~f1; - cmpVal2(f2, 18446744073709551613UL); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1 = f1 * (unsigned char)1; - cmpVal2(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed char)1; - cmpVal2(f1, 3); - f1 = (signed char)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal2(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed short)1; - cmpVal2(f1, 3); - f1 = (signed short)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal2(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed int)1; - cmpVal2(f1, 3); - f1 = (signed int)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (float)1; - cmpVal2(f1, 3); - f1 = (float)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal2(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed long)1; - cmpVal2(f1, 3); - f1 = (signed long)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (double)1; - cmpVal2(f1, 3); - f1 = (double)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal2(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal2(f1, 3); - - ulong2 fa1((unsigned char)1); - ulong2 fa2((unsigned char)1, (unsigned char)1); - ulong2 fb1((signed char)1); - ulong2 fb2((signed char)1, (signed char)1); - ulong2 fc1((unsigned short)1); - ulong2 fc2((unsigned short)1, (unsigned short)1); - ulong2 fd1((signed short)1); - ulong2 fd2((signed short)1, (signed short)1); - ulong2 fe1((unsigned int)1); - ulong2 fe2((unsigned int)1, (unsigned int)1); - ulong2 fg1((signed int)1); - ulong2 fg2((signed int)1, (signed int)1); - ulong2 fh1((float)1); - ulong2 fh2((float)1, (float)1); - ulong2 fi1((double)1); - ulong2 fi2((double)1, (double)1); - ulong2 fj1((unsigned long)1); - ulong2 fj2((unsigned long)1, (unsigned long)1); - ulong2 fk1((signed long)1); - ulong2 fk2((signed long)1, (signed long)1); - ulong2 fl1((unsigned long long)1); - ulong2 fl2((unsigned long long)1, (unsigned long long)1); - ulong2 fm1((signed long long)1); - ulong2 fm2((signed long long)1, (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f2.x = 4; - f2.y = 4; - f3.x = 3; - f3.y = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestULong3() { - ulong3 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f3 = f1 + f2; - cmpVal3(f3, 2); - f2 = f3 - f1; - cmpVal3(f2, 1); - f1 = f2 * f3; - cmpVal3(f1, 2); - f2 = f1 / f3; - cmpVal3(f2, 2 / 2); - f3 = f1 % f2; - cmpVal3(f3, 0); - f1 = f3 & f2; - cmpVal3(f1, 0); - f2 = f1 ^ f3; - cmpVal3(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f3 = f1 << f2; - cmpVal3(f3, 4); - f2 = f3 >> f1; - cmpVal3(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f1 += f2; - cmpVal3(f1, 3); - f1 -= f2; - cmpVal3(f1, 2); - f1 *= f2; - cmpVal3(f1, 2); - f1 /= f2; - cmpVal3(f1, 2); - f1 %= f2; - cmpVal3(f1, 0); - f1 &= f2; - cmpVal3(f1, 0); - f1 |= f2; - cmpVal3(f1, 1); - f1 ^= f2; - cmpVal3(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1 <<= f2; - cmpVal3(f1, 2); - f1 >>= f2; - cmpVal3(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2 = f1++; - cmpVal3(f1, 3); - cmpVal3(f2, 2); - f2 = f1--; - cmpVal3(f2, 3); - cmpVal3(f1, 2); - f2 = ++f1; - cmpVal3(f1, 3); - cmpVal3(f2, 3); - f2 = --f1; - cmpVal3(f1, 2); - cmpVal3(f2, 2); - - f2 = ~f1; - cmpVal3(f2, 18446744073709551613UL); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1 = f1 * (unsigned char)1; - cmpVal3(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed char)1; - cmpVal3(f1, 3); - f1 = (signed char)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal3(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed short)1; - cmpVal3(f1, 3); - f1 = (signed short)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal3(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed int)1; - cmpVal3(f1, 3); - f1 = (signed int)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (float)1; - cmpVal3(f1, 3); - f1 = (float)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal3(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed long)1; - cmpVal3(f1, 3); - f1 = (signed long)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (double)1; - cmpVal3(f1, 3); - f1 = (double)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal3(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal3(f1, 3); - - ulong3 fa1((unsigned char)1); - ulong3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); - ulong3 fb1((signed char)1); - ulong3 fb2((signed char)1, (signed char)1, (signed char)1); - ulong3 fc1((unsigned short)1); - ulong3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); - ulong3 fd1((signed short)1); - ulong3 fd2((signed short)1, (signed short)1, (signed short)1); - ulong3 fe1((unsigned int)1); - ulong3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); - ulong3 fg1((signed int)1); - ulong3 fg2((signed int)1, (signed int)1, (signed int)1); - ulong3 fh1((float)1); - ulong3 fh2((float)1, (float)1, (float)1); - ulong3 fi1((double)1); - ulong3 fi2((double)1, (double)1, (double)1); - ulong3 fj1((unsigned long)1); - ulong3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); - ulong3 fk1((signed long)1); - ulong3 fk2((signed long)1, (signed long)1, (signed long)1); - ulong3 fl1((unsigned long long)1); - ulong3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); - ulong3 fm1((signed long long)1); - ulong3 fm2((signed long long)1, (signed long long)1, (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestULong4() { - ulong4 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f3 = f1 + f2; - cmpVal4(f3, 2); - f2 = f3 - f1; - cmpVal4(f2, 1); - f1 = f2 * f3; - cmpVal4(f1, 2); - f2 = f1 / f3; - cmpVal4(f2, 2 / 2); - f3 = f1 % f2; - cmpVal4(f3, 0); - f1 = f3 & f2; - cmpVal4(f1, 0); - f2 = f1 ^ f3; - cmpVal4(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f2.w = 2; - f3 = f1 << f2; - cmpVal4(f3, 4); - f2 = f3 >> f1; - cmpVal4(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f1 += f2; - cmpVal4(f1, 3); - f1 -= f2; - cmpVal4(f1, 2); - f1 *= f2; - cmpVal4(f1, 2); - f1 /= f2; - cmpVal4(f1, 2); - f1 %= f2; - cmpVal4(f1, 0); - f1 &= f2; - cmpVal4(f1, 0); - f1 |= f2; - cmpVal4(f1, 1); - f1 ^= f2; - cmpVal4(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f1 <<= f2; - cmpVal4(f1, 2); - f1 >>= f2; - cmpVal4(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2 = f1++; - cmpVal4(f1, 3); - cmpVal4(f2, 2); - f2 = f1--; - cmpVal4(f2, 3); - cmpVal4(f1, 2); - f2 = ++f1; - cmpVal4(f1, 3); - cmpVal4(f2, 3); - f2 = --f1; - cmpVal4(f1, 2); - cmpVal4(f2, 2); - - f2 = ~f1; - cmpVal4(f2, 18446744073709551613UL); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f1 = f1 * (unsigned char)1; - cmpVal4(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed char)1; - cmpVal4(f1, 3); - f1 = (signed char)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal4(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed short)1; - cmpVal4(f1, 3); - f1 = (signed short)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal4(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed int)1; - cmpVal4(f1, 3); - f1 = (signed int)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (float)1; - cmpVal4(f1, 3); - f1 = (float)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal4(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed long)1; - cmpVal4(f1, 3); - f1 = (signed long)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (double)1; - cmpVal4(f1, 3); - f1 = (double)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal4(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal4(f1, 3); - - ulong4 fa1((unsigned char)1); - ulong4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); - ulong4 fb1((signed char)1); - ulong4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); - ulong4 fc1((unsigned short)1); - ulong4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); - ulong4 fd1((signed short)1); - ulong4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); - ulong4 fe1((unsigned int)1); - ulong4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); - ulong4 fg1((signed int)1); - ulong4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); - ulong4 fh1((float)1); - ulong4 fh2((float)1, (float)1, (float)1, (float)1); - ulong4 fi1((double)1); - ulong4 fi2((double)1, (double)1, (double)1, (double)1); - ulong4 fj1((unsigned long)1); - ulong4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); - ulong4 fk1((signed long)1); - ulong4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); - ulong4 fl1((unsigned long long)1); - ulong4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, - (unsigned long long)1); - ulong4 fm1((signed long long)1); - ulong4 fm2((signed long long)1, (signed long long)1, (signed long long)1, (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f2.w = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - f3.w = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - - -bool TestLong1() { - long1 f1, f2, f3; - f1.x = 1; - f2.x = 1; - f3 = f1 + f2; - cmpVal1(f3, 2); - f2 = f3 - f1; - cmpVal1(f2, 1); - f1 = f2 * f3; - cmpVal1(f1, 2); - f2 = f1 / f3; - cmpVal1(f2, 2 / 2); - f3 = f1 % f2; - cmpVal1(f3, 0); - f1 = f3 & f2; - cmpVal1(f1, 0); - f2 = f1 ^ f3; - cmpVal1(f2, 0); - f1.x = 1; - f2.x = 2; - f3 = f1 << f2; - cmpVal1(f3, 4); - f2 = f3 >> f1; - cmpVal1(f2, 2); - - f1.x = 2; - f2.x = 1; - f1 += f2; - cmpVal1(f1, 3); - f1 -= f2; - cmpVal1(f1, 2); - f1 *= f2; - cmpVal1(f1, 2); - f1 /= f2; - cmpVal1(f1, 2); - f1 %= f2; - cmpVal1(f1, 0); - f1 &= f2; - cmpVal1(f1, 0); - f1 |= f2; - cmpVal1(f1, 1); - f1 ^= f2; - cmpVal1(f1, 0); - f1.x = 1; - f1 <<= f2; - cmpVal1(f1, 2); - f1 >>= f2; - cmpVal1(f1, 1); - - f1.x = 2; - f2 = f1++; - cmpVal1(f1, 3); - cmpVal1(f2, 2); - f2 = f1--; - cmpVal1(f2, 3); - cmpVal1(f1, 2); - f2 = ++f1; - cmpVal1(f1, 3); - cmpVal1(f2, 3); - f2 = --f1; - cmpVal1(f1, 2); - cmpVal1(f2, 2); - - f2 = ~f1; - cmpVal1(f2, -3); - assert(!f1 == false); - - f1.x = 3; - f1 = f1 * (unsigned char)1; - cmpVal1(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed char)1; - cmpVal1(f1, 3); - f1 = (signed char)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal1(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed short)1; - cmpVal1(f1, 3); - f1 = (signed short)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal1(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed int)1; - cmpVal1(f1, 3); - f1 = (signed int)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (float)1; - cmpVal1(f1, 3); - f1 = (float)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal1(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed long)1; - cmpVal1(f1, 3); - f1 = (signed long)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (double)1; - cmpVal1(f1, 3); - f1 = (double)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal1(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal1(f1, 3); - - long1 fa((unsigned char)1); - long1 fb((signed char)1); - long1 fc((unsigned short)1); - long1 fd((signed short)1); - long1 fe((unsigned int)1); - long1 fg((signed int)1); - long1 fh((float)1); - long1 fi((double)1); - long1 fj((unsigned long)1); - long1 fk((signed long)1); - long1 fl((unsigned long long)1); - long1 fm((signed long long)1); - - - f1.x = 3; - f2.x = 4; - f3.x = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestLong2() { - long2 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f2.x = 1; - f2.y = 1; - f3 = f1 + f2; - cmpVal2(f3, 2); - f2 = f3 - f1; - cmpVal2(f2, 1); - f1 = f2 * f3; - cmpVal2(f1, 2); - f2 = f1 / f3; - cmpVal2(f2, 2 / 2); - f3 = f1 % f2; - cmpVal2(f3, 0); - f1 = f3 & f2; - cmpVal2(f1, 0); - f2 = f1 ^ f3; - cmpVal2(f2, 0); - f1.x = 1; - f1.y = 1; - f2.x = 2; - f2.y = 2; - f3 = f1 << f2; - cmpVal2(f3, 4); - f2 = f3 >> f1; - cmpVal2(f2, 2); - - f1.x = 2; - f1.y = 2; - f2.x = 1; - f2.y = 1; - f1 += f2; - cmpVal2(f1, 3); - f1 -= f2; - cmpVal2(f1, 2); - f1 *= f2; - cmpVal2(f1, 2); - f1 /= f2; - cmpVal2(f1, 2); - f1 %= f2; - cmpVal2(f1, 0); - f1 &= f2; - cmpVal2(f1, 0); - f1 |= f2; - cmpVal2(f1, 1); - f1 ^= f2; - cmpVal2(f1, 0); - f1.x = 1; - f1.y = 1; - f1 <<= f2; - cmpVal2(f1, 2); - f1 >>= f2; - cmpVal2(f1, 1); - - f1.x = 2; - f1.y = 2; - f2 = f1++; - cmpVal2(f1, 3); - cmpVal2(f2, 2); - f2 = f1--; - cmpVal2(f2, 3); - cmpVal2(f1, 2); - f2 = ++f1; - cmpVal2(f1, 3); - cmpVal2(f2, 3); - f2 = --f1; - cmpVal2(f1, 2); - cmpVal2(f2, 2); - - f2 = ~f1; - cmpVal2(f2, -3); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1 = f1 * (unsigned char)1; - cmpVal2(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed char)1; - cmpVal2(f1, 3); - f1 = (signed char)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal2(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed short)1; - cmpVal2(f1, 3); - f1 = (signed short)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal2(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed int)1; - cmpVal2(f1, 3); - f1 = (signed int)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (float)1; - cmpVal2(f1, 3); - f1 = (float)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal2(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed long)1; - cmpVal2(f1, 3); - f1 = (signed long)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (double)1; - cmpVal2(f1, 3); - f1 = (double)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal2(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal2(f1, 3); - - long2 fa1((unsigned char)1); - long2 fa2((unsigned char)1, (unsigned char)1); - long2 fb1((signed char)1); - long2 fb2((signed char)1, (signed char)1); - long2 fc1((unsigned short)1); - long2 fc2((unsigned short)1, (unsigned short)1); - long2 fd1((signed short)1); - long2 fd2((signed short)1, (signed short)1); - long2 fe1((unsigned int)1); - long2 fe2((unsigned int)1, (unsigned int)1); - long2 fg1((signed int)1); - long2 fg2((signed int)1, (signed int)1); - long2 fh1((float)1); - long2 fh2((float)1, (float)1); - long2 fi1((double)1); - long2 fi2((double)1, (double)1); - long2 fj1((unsigned long)1); - long2 fj2((unsigned long)1, (unsigned long)1); - long2 fk1((signed long)1); - long2 fk2((signed long)1, (signed long)1); - long2 fl1((unsigned long long)1); - long2 fl2((unsigned long long)1, (unsigned long long)1); - long2 fm1((signed long long)1); - long2 fm2((signed long long)1, (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f2.x = 4; - f2.y = 4; - f3.x = 3; - f3.y = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestLong3() { - long3 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f3 = f1 + f2; - cmpVal3(f3, 2); - f2 = f3 - f1; - cmpVal3(f2, 1); - f1 = f2 * f3; - cmpVal3(f1, 2); - f2 = f1 / f3; - cmpVal3(f2, 2 / 2); - f3 = f1 % f2; - cmpVal3(f3, 0); - f1 = f3 & f2; - cmpVal3(f1, 0); - f2 = f1 ^ f3; - cmpVal3(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f3 = f1 << f2; - cmpVal3(f3, 4); - f2 = f3 >> f1; - cmpVal3(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f1 += f2; - cmpVal3(f1, 3); - f1 -= f2; - cmpVal3(f1, 2); - f1 *= f2; - cmpVal3(f1, 2); - f1 /= f2; - cmpVal3(f1, 2); - f1 %= f2; - cmpVal3(f1, 0); - f1 &= f2; - cmpVal3(f1, 0); - f1 |= f2; - cmpVal3(f1, 1); - f1 ^= f2; - cmpVal3(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1 <<= f2; - cmpVal3(f1, 2); - f1 >>= f2; - cmpVal3(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2 = f1++; - cmpVal3(f1, 3); - cmpVal3(f2, 2); - f2 = f1--; - cmpVal3(f2, 3); - cmpVal3(f1, 2); - f2 = ++f1; - cmpVal3(f1, 3); - cmpVal3(f2, 3); - f2 = --f1; - cmpVal3(f1, 2); - cmpVal3(f2, 2); - - f2 = ~f1; - cmpVal3(f2, -3); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1 = f1 * (unsigned char)1; - cmpVal3(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed char)1; - cmpVal3(f1, 3); - f1 = (signed char)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal3(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed short)1; - cmpVal3(f1, 3); - f1 = (signed short)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal3(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed int)1; - cmpVal3(f1, 3); - f1 = (signed int)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (float)1; - cmpVal3(f1, 3); - f1 = (float)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal3(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed long)1; - cmpVal3(f1, 3); - f1 = (signed long)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (double)1; - cmpVal3(f1, 3); - f1 = (double)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal3(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal3(f1, 3); - - - long3 fa1((unsigned char)1); - long3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); - long3 fb1((signed char)1); - long3 fb2((signed char)1, (signed char)1, (signed char)1); - long3 fc1((unsigned short)1); - long3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); - long3 fd1((signed short)1); - long3 fd2((signed short)1, (signed short)1, (signed short)1); - long3 fe1((unsigned int)1); - long3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); - long3 fg1((signed int)1); - long3 fg2((signed int)1, (signed int)1, (signed int)1); - long3 fh1((float)1); - long3 fh2((float)1, (float)1, (float)1); - long3 fi1((double)1); - long3 fi2((double)1, (double)1, (double)1); - long3 fj1((unsigned long)1); - long3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); - long3 fk1((signed long)1); - long3 fk2((signed long)1, (signed long)1, (signed long)1); - long3 fl1((unsigned long long)1); - long3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); - long3 fm1((signed long long)1); - long3 fm2((signed long long)1, (signed long long)1, (signed long long)1); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestLong4() { - long4 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f3 = f1 + f2; - cmpVal4(f3, 2); - f2 = f3 - f1; - cmpVal4(f2, 1); - f1 = f2 * f3; - cmpVal4(f1, 2); - f2 = f1 / f3; - cmpVal4(f2, 2 / 2); - f3 = f1 % f2; - cmpVal4(f3, 0); - f1 = f3 & f2; - cmpVal4(f1, 0); - f2 = f1 ^ f3; - cmpVal4(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f2.w = 2; - f3 = f1 << f2; - cmpVal4(f3, 4); - f2 = f3 >> f1; - cmpVal4(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f1 += f2; - cmpVal4(f1, 3); - f1 -= f2; - cmpVal4(f1, 2); - f1 *= f2; - cmpVal4(f1, 2); - f1 /= f2; - cmpVal4(f1, 2); - f1 %= f2; - cmpVal4(f1, 0); - f1 &= f2; - cmpVal4(f1, 0); - f1 |= f2; - cmpVal4(f1, 1); - f1 ^= f2; - cmpVal4(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f1 <<= f2; - cmpVal4(f1, 2); - f1 >>= f2; - cmpVal4(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2 = f1++; - cmpVal4(f1, 3); - cmpVal4(f2, 2); - f2 = f1--; - cmpVal4(f2, 3); - cmpVal4(f1, 2); - f2 = ++f1; - cmpVal4(f1, 3); - cmpVal4(f2, 3); - f2 = --f1; - cmpVal4(f1, 2); - cmpVal4(f2, 2); - - f2 = ~f1; - cmpVal4(f2, -3); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f1 = f1 * (unsigned char)1; - cmpVal4(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed char)1; - cmpVal4(f1, 3); - f1 = (signed char)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal4(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed short)1; - cmpVal4(f1, 3); - f1 = (signed short)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal4(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed int)1; - cmpVal4(f1, 3); - f1 = (signed int)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (float)1; - cmpVal4(f1, 3); - f1 = (float)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal4(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed long)1; - cmpVal4(f1, 3); - f1 = (signed long)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (double)1; - cmpVal4(f1, 3); - f1 = (double)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal4(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal4(f1, 3); - - long4 fa1((unsigned char)1); - long4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); - long4 fb1((signed char)1); - long4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); - long4 fc1((unsigned short)1); - long4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); - long4 fd1((signed short)1); - long4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); - long4 fe1((unsigned int)1); - long4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); - long4 fg1((signed int)1); - long4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); - long4 fh1((float)1); - long4 fh2((float)1, (float)1, (float)1, (float)1); - long4 fi1((double)1); - long4 fi2((double)1, (double)1, (double)1, (double)1); - long4 fj1((unsigned long)1); - long4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); - long4 fk1((signed long)1); - long4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); - long4 fl1((unsigned long long)1); - long4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, - (unsigned long long)1); - long4 fm1((signed long long)1); - long4 fm2((signed long long)1, (signed long long)1, (signed long long)1, (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f2.w = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - f3.w = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - - -bool TestDouble1() { - double1 f1, f2, f3; - f1.x = 1.0; - f2.x = 1.0; - f3 = f1 + f2; - cmpVal1(f3, 2.0); - f2 = f3 - f1; - cmpVal1(f2, 1.0); - f1 = f2 * f3; - cmpVal1(f1, 2.0); - f2 = f1 / f3; - cmpVal1(f2, 2.0 / 2.0); - f1 += f2; - cmpVal1(f1, 3.0); - f1 -= f2; - cmpVal1(f1, 2.0); - f1 *= f2; - cmpVal1(f1, 2.0); - f1 /= f2; - cmpVal1(f1, 2.0); - f2 = f1++; - cmpVal1(f1, 3.0); - cmpVal1(f2, 2.0); - f2 = f1--; - cmpVal1(f2, 3.0); - cmpVal1(f1, 2.0); - f2 = ++f1; - cmpVal1(f1, 3.0); - cmpVal1(f2, 3.0); - f2 = --f1; - cmpVal1(f1, 2.0); - cmpVal1(f1, 2.0); - - f1.x = 3.0; - f1 = f1 * (unsigned char)1; - cmpVal1(f1, 3.0); - f1 = (unsigned char)1 * f1; - cmpVal1(f1, 3.0); - f1 = f1 * (signed char)1; - cmpVal1(f1, 3.0); - f1 = (signed char)1 * f1; - cmpVal1(f1, 3.0); - f1 = f1 * (unsigned short)1; - cmpVal1(f1, 3.0); - f1 = (unsigned short)1 * f1; - cmpVal1(f1, 3.0); - f1 = f1 * (signed short)1; - cmpVal1(f1, 3.0); - f1 = (signed short)1 * f1; - cmpVal1(f1, 3.0); - f1 = f1 * (unsigned int)1; - cmpVal1(f1, 3.0); - f1 = (unsigned int)1 * f1; - cmpVal1(f1, 3.0); - f1 = f1 * (signed int)1; - cmpVal1(f1, 3.0); - f1 = (signed int)1 * f1; - cmpVal1(f1, 3.0); - f1 = f1 * (float)1; - cmpVal1(f1, 3.0); - f1 = (float)1 * f1; - cmpVal1(f1, 3.0); - f1 = f1 * (unsigned long)1; - cmpVal1(f1, 3.0); - f1 = (unsigned long)1 * f1; - cmpVal1(f1, 3.0); - f1 = f1 * (signed long)1; - cmpVal1(f1, 3.0); - f1 = (signed long)1 * f1; - cmpVal1(f1, 3.0); - f1 = f1 * (double)1; - cmpVal1(f1, 3.0); - f1 = (double)1 * f1; - cmpVal1(f1, 3.0); - f1 = f1 * (unsigned long long)1; - cmpVal1(f1, 3.0); - f1 = (unsigned long long)1 * f1; - cmpVal1(f1, 3.0); - - double1 fa((unsigned char)1); - double1 fb((signed char)1); - double1 fc((unsigned short)1); - double1 fd((signed short)1); - double1 fe((unsigned int)1); - double1 fg((signed int)1); - double1 fh((float)1); - double1 fi((double)1); - double1 fj((unsigned long)1); - double1 fk((signed long)1); - double1 fl((unsigned long long)1); - double1 fm((signed long long)1); - - - f1.x = 3.0; - f2.x = 4.0; - f3.x = 3.0; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - return true; -} - -bool TestDouble2() { - double2 f1, f2, f3; - f1.x = 1.0; - f1.y = 1.0; - f2.x = 1.0; - f2.y = 1.0; - f3 = f1 + f2; - cmpVal2(f3, 2.0); - f2 = f3 - f1; - cmpVal2(f2, 1.0); - f1 = f2 * f3; - cmpVal2(f1, 2.0); - f2 = f1 / f3; - cmpVal2(f2, 2.0f / 2.0); - f1 += f2; - cmpVal2(f1, 3.0); - f1 -= f2; - cmpVal2(f1, 2.0); - f1 *= f2; - cmpVal2(f1, 2.0); - f1 /= f2; - cmpVal2(f1, 2.0); - - f2 = f1++; - cmpVal2(f1, 3.0); - cmpVal2(f2, 2.0); - f2 = f1--; - cmpVal2(f2, 3.0); - cmpVal2(f1, 2.0); - f2 = ++f1; - cmpVal2(f1, 3.0); - cmpVal2(f2, 3.0); - f2 = --f1; - cmpVal2(f1, 2.0); - cmpVal2(f1, 2.0); - - f1.x = 3.0; - f1.y = 3.0; - f1 = f1 * (unsigned char)1; - cmpVal2(f1, 3.0); - f1 = (unsigned char)1 * f1; - cmpVal2(f1, 3.0); - f1 = f1 * (signed char)1; - cmpVal2(f1, 3.0); - f1 = (signed char)1 * f1; - cmpVal2(f1, 3.0); - f1 = f1 * (unsigned short)1; - cmpVal2(f1, 3.0); - f1 = (unsigned short)1 * f1; - cmpVal2(f1, 3.0); - f1 = f1 * (signed short)1; - cmpVal2(f1, 3.0); - f1 = (signed short)1 * f1; - cmpVal2(f1, 3.0); - f1 = f1 * (unsigned int)1; - cmpVal2(f1, 3.0); - f1 = (unsigned int)1 * f1; - cmpVal2(f1, 3.0); - f1 = f1 * (signed int)1; - cmpVal2(f1, 3.0); - f1 = (signed int)1 * f1; - cmpVal2(f1, 3.0); - f1 = f1 * (float)1; - cmpVal2(f1, 3.0); - f1 = (float)1 * f1; - cmpVal2(f1, 3.0); - f1 = f1 * (unsigned long)1; - cmpVal2(f1, 3.0); - f1 = (unsigned long)1 * f1; - cmpVal2(f1, 3.0); - f1 = f1 * (signed long)1; - cmpVal2(f1, 3.0); - f1 = (signed long)1 * f1; - cmpVal2(f1, 3.0); - f1 = f1 * (double)1; - cmpVal2(f1, 3.0); - f1 = (double)1 * f1; - cmpVal2(f1, 3.0); - f1 = f1 * (unsigned long long)1; - cmpVal2(f1, 3.0); - f1 = (unsigned long long)1 * f1; - cmpVal2(f1, 3.0); - - double2 fa1((unsigned char)1); - double2 fa2((unsigned char)1, (unsigned char)1); - double2 fb1((signed char)1); - double2 fb2((signed char)1, (signed char)1); - double2 fc1((unsigned short)1); - double2 fc2((unsigned short)1, (unsigned short)1); - double2 fd1((signed short)1); - double2 fd2((signed short)1, (signed short)1); - double2 fe1((unsigned int)1); - double2 fe2((unsigned int)1, (unsigned int)1); - double2 fg1((signed int)1); - double2 fg2((signed int)1, (signed int)1); - double2 fh1((float)1); - double2 fh2((float)1, (float)1); - double2 fi1((double)1); - double2 fi2((double)1, (double)1); - double2 fj1((unsigned long)1); - double2 fj2((unsigned long)1, (unsigned long)1); - double2 fk1((signed long)1); - double2 fk2((signed long)1, (signed long)1); - double2 fl1((unsigned long long)1); - double2 fl2((unsigned long long)1, (unsigned long long)1); - double2 fm1((signed long long)1); - double2 fm2((signed long long)1, (signed long long)1); - - - f1.x = 3.0; - f1.y = 3.0; - f2.x = 4.0; - f2.y = 4.0; - f3.x = 3.0; - f3.y = 3.0; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - - return true; -} - -bool TestDouble3() { - double3 f1, f2, f3; - f1.x = 1.0; - f1.y = 1.0; - f1.z = 1.0; - f2.x = 1.0; - f2.y = 1.0; - f2.z = 1.0; - f3 = f1 + f2; - cmpVal3(f3, 2.0); - f2 = f3 - f1; - cmpVal3(f2, 1.0); - f1 = f2 * f3; - cmpVal3(f1, 2.0); - f2 = f1 / f3; - cmpVal3(f2, 2.0f / 2.0); - f1 += f2; - cmpVal3(f1, 3.0); - f1 -= f2; - cmpVal3(f1, 2.0); - f1 *= f2; - cmpVal3(f1, 2.0); - f1 /= f2; - f2 = f1++; - cmpVal3(f1, 3.0); - cmpVal3(f2, 2.0); - f2 = f1--; - cmpVal3(f2, 3.0); - cmpVal3(f1, 2.0); - f2 = ++f1; - cmpVal3(f1, 3.0); - cmpVal3(f2, 3.0); - f2 = --f1; - cmpVal3(f1, 2.0); - cmpVal3(f1, 2.0); - - f1.x = 3.0; - f1.y = 3.0; - f1.z = 3.0; - f1 = f1 * (unsigned char)1; - cmpVal3(f1, 3.0); - f1 = (unsigned char)1 * f1; - cmpVal3(f1, 3.0); - f1 = f1 * (signed char)1; - cmpVal3(f1, 3.0); - f1 = (signed char)1 * f1; - cmpVal3(f1, 3.0); - f1 = f1 * (unsigned short)1; - cmpVal3(f1, 3.0); - f1 = (unsigned short)1 * f1; - cmpVal3(f1, 3.0); - f1 = f1 * (signed short)1; - cmpVal3(f1, 3.0); - f1 = (signed short)1 * f1; - cmpVal3(f1, 3.0); - f1 = f1 * (unsigned int)1; - cmpVal3(f1, 3.0); - f1 = (unsigned int)1 * f1; - cmpVal3(f1, 3.0); - f1 = f1 * (signed int)1; - cmpVal3(f1, 3.0); - f1 = (signed int)1 * f1; - cmpVal3(f1, 3.0); - f1 = f1 * (float)1; - cmpVal3(f1, 3.0); - f1 = (float)1 * f1; - cmpVal3(f1, 3.0); - f1 = f1 * (unsigned long)1; - cmpVal3(f1, 3.0); - f1 = (unsigned long)1 * f1; - cmpVal3(f1, 3.0); - f1 = f1 * (signed long)1; - cmpVal3(f1, 3.0); - f1 = (signed long)1 * f1; - cmpVal3(f1, 3.0); - f1 = f1 * (double)1; - cmpVal3(f1, 3.0); - f1 = (double)1 * f1; - cmpVal3(f1, 3.0); - f1 = f1 * (unsigned long long)1; - cmpVal3(f1, 3.0); - f1 = (unsigned long long)1 * f1; - cmpVal3(f1, 3.0); - - double3 fa1((unsigned char)1); - double3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); - double3 fb1((signed char)1); - double3 fb2((signed char)1, (signed char)1, (signed char)1); - double3 fc1((unsigned short)1); - double3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); - double3 fd1((signed short)1); - double3 fd2((signed short)1, (signed short)1, (signed short)1); - double3 fe1((unsigned int)1); - double3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); - double3 fg1((signed int)1); - double3 fg2((signed int)1, (signed int)1, (signed int)1); - double3 fh1((float)1); - double3 fh2((float)1, (float)1, (float)1); - double3 fi1((double)1); - double3 fi2((double)1, (double)1, (double)1); - double3 fj1((unsigned long)1); - double3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); - double3 fk1((signed long)1); - double3 fk2((signed long)1, (signed long)1, (signed long)1); - double3 fl1((unsigned long long)1); - double3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); - double3 fm1((signed long long)1); - double3 fm2((signed long long)1, (signed long long)1, (signed long long)1); - - - f1.x = 3.0; - f1.y = 3.0; - f1.z = 3.0; - f2.x = 4.0; - f2.y = 4.0; - f2.z = 4.0; - f3.x = 3.0; - f3.y = 3.0; - f3.z = 3.0; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - - return true; -} - -bool TestDouble4() { - double4 f1, f2, f3; - f1.x = 1.0; - f1.y = 1.0; - f1.z = 1.0; - f1.w = 1.0; - f2.x = 1.0; - f2.y = 1.0; - f2.z = 1.0; - f2.w = 1.0; - f3 = f1 + f2; - cmpVal4(f3, 2.0); - f2 = f3 - f1; - cmpVal4(f2, 1.0); - f1 = f2 * f3; - cmpVal4(f1, 2.0); - f2 = f1 / f3; - cmpVal4(f2, 2.0f / 2.0); - f1 += f2; - cmpVal4(f1, 3.0); - f1 -= f2; - cmpVal4(f1, 2.0); - f1 *= f2; - cmpVal4(f1, 2.0); - f1 /= f2; - f2 = f1++; - cmpVal4(f1, 3.0); - cmpVal4(f2, 2.0); - f2 = f1--; - cmpVal4(f2, 3.0); - cmpVal4(f1, 2.0); - f2 = ++f1; - cmpVal4(f1, 3.0); - cmpVal4(f2, 3.0); - f2 = --f1; - cmpVal4(f1, 2.0); - cmpVal4(f1, 2.0); - - f1.x = 3.0; - f1.y = 3.0; - f1.z = 3.0; - f1.w = 3.0; - f1 = f1 * (unsigned char)1; - cmpVal4(f1, 3.0); - f1 = (unsigned char)1 * f1; - cmpVal4(f1, 3.0); - f1 = f1 * (signed char)1; - cmpVal4(f1, 3.0); - f1 = (signed char)1 * f1; - cmpVal4(f1, 3.0); - f1 = f1 * (unsigned short)1; - cmpVal4(f1, 3.0); - f1 = (unsigned short)1 * f1; - cmpVal4(f1, 3.0); - f1 = f1 * (signed short)1; - cmpVal4(f1, 3.0); - f1 = (signed short)1 * f1; - cmpVal4(f1, 3.0); - f1 = f1 * (unsigned int)1; - cmpVal4(f1, 3.0); - f1 = (unsigned int)1 * f1; - cmpVal4(f1, 3.0); - f1 = f1 * (signed int)1; - cmpVal4(f1, 3.0); - f1 = (signed int)1 * f1; - cmpVal4(f1, 3.0); - f1 = f1 * (float)1; - cmpVal4(f1, 3.0); - f1 = (float)1 * f1; - cmpVal4(f1, 3.0); - f1 = f1 * (unsigned long)1; - cmpVal4(f1, 3.0); - f1 = (unsigned long)1 * f1; - cmpVal4(f1, 3.0); - f1 = f1 * (signed long)1; - cmpVal4(f1, 3.0); - f1 = (signed long)1 * f1; - cmpVal4(f1, 3.0); - f1 = f1 * (double)1; - cmpVal4(f1, 3.0); - f1 = (double)1 * f1; - cmpVal4(f1, 3.0); - f1 = f1 * (unsigned long long)1; - cmpVal4(f1, 3.0); - f1 = (unsigned long long)1 * f1; - cmpVal4(f1, 3.0); - - double4 fa1((unsigned char)1); - double4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); - double4 fb1((signed char)1); - double4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); - double4 fc1((unsigned short)1); - double4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); - double4 fd1((signed short)1); - double4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); - double4 fe1((unsigned int)1); - double4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); - double4 fg1((signed int)1); - double4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); - double4 fh1((float)1); - double4 fh2((float)1, (float)1, (float)1, (float)1); - double4 fi1((double)1); - double4 fi2((double)1, (double)1, (double)1, (double)1); - double4 fj1((unsigned long)1); - double4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); - double4 fk1((signed long)1); - double4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); - double4 fl1((unsigned long long)1); - double4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, - (unsigned long long)1); - double4 fm1((signed long long)1); - double4 fm2((signed long long)1, (signed long long)1, (signed long long)1, (signed long long)1); - - - f1.x = 3.0; - f1.y = 3.0; - f1.z = 3.0; - f1.w = 3.0; - f2.x = 4.0; - f2.y = 4.0; - f2.z = 4.0; - f2.w = 4.0; - f3.x = 3.0; - f3.y = 3.0; - f3.z = 3.0; - f3.w = 3.0; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - return true; -} - - -bool TestULongLong1() { - long1 f1, f2, f3; - f1.x = 1; - f2.x = 1; - f3 = f1 + f2; - cmpVal1(f3, 2); - f2 = f3 - f1; - cmpVal1(f2, 1); - f1 = f2 * f3; - cmpVal1(f1, 2); - f2 = f1 / f3; - cmpVal1(f2, 2 / 2); - f3 = f1 % f2; - cmpVal1(f3, 0); - f1 = f3 & f2; - cmpVal1(f1, 0); - f2 = f1 ^ f3; - cmpVal1(f2, 0); - f1.x = 1; - f2.x = 2; - f3 = f1 << f2; - cmpVal1(f3, 4); - f2 = f3 >> f1; - cmpVal1(f2, 2); - - f1.x = 2; - f2.x = 1; - f1 += f2; - cmpVal1(f1, 3); - f1 -= f2; - cmpVal1(f1, 2); - f1 *= f2; - cmpVal1(f1, 2); - f1 /= f2; - cmpVal1(f1, 2); - f1 %= f2; - cmpVal1(f1, 0); - f1 &= f2; - cmpVal1(f1, 0); - f1 |= f2; - cmpVal1(f1, 1); - f1 ^= f2; - cmpVal1(f1, 0); - f1.x = 1; - f1 <<= f2; - cmpVal1(f1, 2); - f1 >>= f2; - cmpVal1(f1, 1); - - f1.x = 2; - f2 = f1++; - cmpVal1(f1, 3); - cmpVal1(f2, 2); - f2 = f1--; - cmpVal1(f2, 3); - cmpVal1(f1, 2); - f2 = ++f1; - cmpVal1(f1, 3); - cmpVal1(f2, 3); - f2 = --f1; - cmpVal1(f1, 2); - cmpVal1(f2, 2); - - f2 = ~f1; - cmpVal1(f2, -3); - assert(!f1 == false); - - f1.x = 3; - f1 = f1 * (unsigned char)1; - cmpVal1(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed char)1; - cmpVal1(f1, 3); - f1 = (signed char)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal1(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed short)1; - cmpVal1(f1, 3); - f1 = (signed short)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal1(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed int)1; - cmpVal1(f1, 3); - f1 = (signed int)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (float)1; - cmpVal1(f1, 3); - f1 = (float)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal1(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed long)1; - cmpVal1(f1, 3); - f1 = (signed long)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (double)1; - cmpVal1(f1, 3); - f1 = (double)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal1(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal1(f1, 3); - - ulonglong1 fa((unsigned char)1); - ulonglong1 fb((signed char)1); - ulonglong1 fc((unsigned short)1); - ulonglong1 fd((signed short)1); - ulonglong1 fe((unsigned int)1); - ulonglong1 fg((signed int)1); - ulonglong1 fh((float)1); - ulonglong1 fi((double)1); - ulonglong1 fj((unsigned long)1); - ulonglong1 fk((signed long)1); - ulonglong1 fl((unsigned long long)1); - ulonglong1 fm((signed long long)1); - - - f1.x = 3; - f2.x = 4; - f3.x = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestULongLong2() { - long2 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f2.x = 1; - f2.y = 1; - f3 = f1 + f2; - cmpVal2(f3, 2); - f2 = f3 - f1; - cmpVal2(f2, 1); - f1 = f2 * f3; - cmpVal2(f1, 2); - f2 = f1 / f3; - cmpVal2(f2, 2 / 2); - f3 = f1 % f2; - cmpVal2(f3, 0); - f1 = f3 & f2; - cmpVal2(f1, 0); - f2 = f1 ^ f3; - cmpVal2(f2, 0); - f1.x = 1; - f1.y = 1; - f2.x = 2; - f2.y = 2; - f3 = f1 << f2; - cmpVal2(f3, 4); - f2 = f3 >> f1; - cmpVal2(f2, 2); - - f1.x = 2; - f1.y = 2; - f2.x = 1; - f2.y = 1; - f1 += f2; - cmpVal2(f1, 3); - f1 -= f2; - cmpVal2(f1, 2); - f1 *= f2; - cmpVal2(f1, 2); - f1 /= f2; - cmpVal2(f1, 2); - f1 %= f2; - cmpVal2(f1, 0); - f1 &= f2; - cmpVal2(f1, 0); - f1 |= f2; - cmpVal2(f1, 1); - f1 ^= f2; - cmpVal2(f1, 0); - f1.x = 1; - f1.y = 1; - f1 <<= f2; - cmpVal2(f1, 2); - f1 >>= f2; - cmpVal2(f1, 1); - - f1.x = 2; - f1.y = 2; - f2 = f1++; - cmpVal2(f1, 3); - cmpVal2(f2, 2); - f2 = f1--; - cmpVal2(f2, 3); - cmpVal2(f1, 2); - f2 = ++f1; - cmpVal2(f1, 3); - cmpVal2(f2, 3); - f2 = --f1; - cmpVal2(f1, 2); - cmpVal2(f2, 2); - - f2 = ~f1; - cmpVal2(f2, -3); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1 = f1 * (unsigned char)1; - cmpVal2(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed char)1; - cmpVal2(f1, 3); - f1 = (signed char)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal2(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed short)1; - cmpVal2(f1, 3); - f1 = (signed short)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal2(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed int)1; - cmpVal2(f1, 3); - f1 = (signed int)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (float)1; - cmpVal2(f1, 3); - f1 = (float)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal2(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed long)1; - cmpVal2(f1, 3); - f1 = (signed long)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (double)1; - cmpVal2(f1, 3); - f1 = (double)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal2(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal2(f1, 3); - - ulonglong2 fa1((unsigned char)1); - ulonglong2 fa2((unsigned char)1, (unsigned char)1); - ulonglong2 fb1((signed char)1); - ulonglong2 fb2((signed char)1, (signed char)1); - ulonglong2 fc1((unsigned short)1); - ulonglong2 fc2((unsigned short)1, (unsigned short)1); - ulonglong2 fd1((signed short)1); - ulonglong2 fd2((signed short)1, (signed short)1); - ulonglong2 fe1((unsigned int)1); - ulonglong2 fe2((unsigned int)1, (unsigned int)1); - ulonglong2 fg1((signed int)1); - ulonglong2 fg2((signed int)1, (signed int)1); - ulonglong2 fh1((float)1); - ulonglong2 fh2((float)1, (float)1); - ulonglong2 fi1((double)1); - ulonglong2 fi2((double)1, (double)1); - ulonglong2 fj1((unsigned long)1); - ulonglong2 fj2((unsigned long)1, (unsigned long)1); - ulonglong2 fk1((signed long)1); - ulonglong2 fk2((signed long)1, (signed long)1); - ulonglong2 fl1((unsigned long long)1); - ulonglong2 fl2((unsigned long long)1, (unsigned long long)1); - ulonglong2 fm1((signed long long)1); - ulonglong2 fm2((signed long long)1, (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f2.x = 4; - f2.y = 4; - f3.x = 3; - f3.y = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestULongLong3() { - long3 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f3 = f1 + f2; - cmpVal3(f3, 2); - f2 = f3 - f1; - cmpVal3(f2, 1); - f1 = f2 * f3; - cmpVal3(f1, 2); - f2 = f1 / f3; - cmpVal3(f2, 2 / 2); - f3 = f1 % f2; - cmpVal3(f3, 0); - f1 = f3 & f2; - cmpVal3(f1, 0); - f2 = f1 ^ f3; - cmpVal3(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f3 = f1 << f2; - cmpVal3(f3, 4); - f2 = f3 >> f1; - cmpVal3(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f1 += f2; - cmpVal3(f1, 3); - f1 -= f2; - cmpVal3(f1, 2); - f1 *= f2; - cmpVal3(f1, 2); - f1 /= f2; - cmpVal3(f1, 2); - f1 %= f2; - cmpVal3(f1, 0); - f1 &= f2; - cmpVal3(f1, 0); - f1 |= f2; - cmpVal3(f1, 1); - f1 ^= f2; - cmpVal3(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1 <<= f2; - cmpVal3(f1, 2); - f1 >>= f2; - cmpVal3(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2 = f1++; - cmpVal3(f1, 3); - cmpVal3(f2, 2); - f2 = f1--; - cmpVal3(f2, 3); - cmpVal3(f1, 2); - f2 = ++f1; - cmpVal3(f1, 3); - cmpVal3(f2, 3); - f2 = --f1; - cmpVal3(f1, 2); - cmpVal3(f2, 2); - - f2 = ~f1; - cmpVal3(f2, -3); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1 = f1 * (unsigned char)1; - cmpVal3(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed char)1; - cmpVal3(f1, 3); - f1 = (signed char)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal3(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed short)1; - cmpVal3(f1, 3); - f1 = (signed short)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal3(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed int)1; - cmpVal3(f1, 3); - f1 = (signed int)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (float)1; - cmpVal3(f1, 3); - f1 = (float)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal3(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed long)1; - cmpVal3(f1, 3); - f1 = (signed long)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (double)1; - cmpVal3(f1, 3); - f1 = (double)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal3(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal3(f1, 3); - - ulonglong3 fa1((unsigned char)1); - ulonglong3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); - ulonglong3 fb1((signed char)1); - ulonglong3 fb2((signed char)1, (signed char)1, (signed char)1); - ulonglong3 fc1((unsigned short)1); - ulonglong3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); - ulonglong3 fd1((signed short)1); - ulonglong3 fd2((signed short)1, (signed short)1, (signed short)1); - ulonglong3 fe1((unsigned int)1); - ulonglong3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); - ulonglong3 fg1((signed int)1); - ulonglong3 fg2((signed int)1, (signed int)1, (signed int)1); - ulonglong3 fh1((float)1); - ulonglong3 fh2((float)1, (float)1, (float)1); - ulonglong3 fi1((double)1); - ulonglong3 fi2((double)1, (double)1, (double)1); - ulonglong3 fj1((unsigned long)1); - ulonglong3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); - ulonglong3 fk1((signed long)1); - ulonglong3 fk2((signed long)1, (signed long)1, (signed long)1); - ulonglong3 fl1((unsigned long long)1); - ulonglong3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); - ulonglong3 fm1((signed long long)1); - ulonglong3 fm2((signed long long)1, (signed long long)1, (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestULongLong4() { - long4 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f3 = f1 + f2; - cmpVal4(f3, 2); - f2 = f3 - f1; - cmpVal4(f2, 1); - f1 = f2 * f3; - cmpVal4(f1, 2); - f2 = f1 / f3; - cmpVal4(f2, 2 / 2); - f3 = f1 % f2; - cmpVal4(f3, 0); - f1 = f3 & f2; - cmpVal4(f1, 0); - f2 = f1 ^ f3; - cmpVal4(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f2.w = 2; - f3 = f1 << f2; - cmpVal4(f3, 4); - f2 = f3 >> f1; - cmpVal4(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f1 += f2; - cmpVal4(f1, 3); - f1 -= f2; - cmpVal4(f1, 2); - f1 *= f2; - cmpVal4(f1, 2); - f1 /= f2; - cmpVal4(f1, 2); - f1 %= f2; - cmpVal4(f1, 0); - f1 &= f2; - cmpVal4(f1, 0); - f1 |= f2; - cmpVal4(f1, 1); - f1 ^= f2; - cmpVal4(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f1 <<= f2; - cmpVal4(f1, 2); - f1 >>= f2; - cmpVal4(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2 = f1++; - cmpVal4(f1, 3); - cmpVal4(f2, 2); - f2 = f1--; - cmpVal4(f2, 3); - cmpVal4(f1, 2); - f2 = ++f1; - cmpVal4(f1, 3); - cmpVal4(f2, 3); - f2 = --f1; - cmpVal4(f1, 2); - cmpVal4(f2, 2); - - f2 = ~f1; - cmpVal4(f2, -3); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f1 = f1 * (unsigned char)1; - cmpVal4(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed char)1; - cmpVal4(f1, 3); - f1 = (signed char)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal4(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed short)1; - cmpVal4(f1, 3); - f1 = (signed short)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal4(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed int)1; - cmpVal4(f1, 3); - f1 = (signed int)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (float)1; - cmpVal4(f1, 3); - f1 = (float)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal4(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed long)1; - cmpVal4(f1, 3); - f1 = (signed long)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (double)1; - cmpVal4(f1, 3); - f1 = (double)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal4(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal4(f1, 3); - - ulonglong4 fa1((unsigned char)1); - ulonglong4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); - ulonglong4 fb1((signed char)1); - ulonglong4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); - ulonglong4 fc1((unsigned short)1); - ulonglong4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); - ulonglong4 fd1((signed short)1); - ulonglong4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); - ulonglong4 fe1((unsigned int)1); - ulonglong4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); - ulonglong4 fg1((signed int)1); - ulonglong4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); - ulonglong4 fh1((float)1); - ulonglong4 fh2((float)1, (float)1, (float)1, (float)1); - ulonglong4 fi1((double)1); - ulonglong4 fi2((double)1, (double)1, (double)1, (double)1); - ulonglong4 fj1((unsigned long)1); - ulonglong4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); - ulonglong4 fk1((signed long)1); - ulonglong4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); - ulonglong4 fl1((unsigned long long)1); - ulonglong4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, - (unsigned long long)1); - ulonglong4 fm1((signed long long)1); - ulonglong4 fm2((signed long long)1, (signed long long)1, (signed long long)1, - (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f2.w = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - f3.w = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - - -bool TestLongLong1() { - long1 f1, f2, f3; - f1.x = 1; - f2.x = 1; - f3 = f1 + f2; - cmpVal1(f3, 2); - f2 = f3 - f1; - cmpVal1(f2, 1); - f1 = f2 * f3; - cmpVal1(f1, 2); - f2 = f1 / f3; - cmpVal1(f2, 2 / 2); - f3 = f1 % f2; - cmpVal1(f3, 0); - f1 = f3 & f2; - cmpVal1(f1, 0); - f2 = f1 ^ f3; - cmpVal1(f2, 0); - f1.x = 1; - f2.x = 2; - f3 = f1 << f2; - cmpVal1(f3, 4); - f2 = f3 >> f1; - cmpVal1(f2, 2); - - f1.x = 2; - f2.x = 1; - f1 += f2; - cmpVal1(f1, 3); - f1 -= f2; - cmpVal1(f1, 2); - f1 *= f2; - cmpVal1(f1, 2); - f1 /= f2; - cmpVal1(f1, 2); - f1 %= f2; - cmpVal1(f1, 0); - f1 &= f2; - cmpVal1(f1, 0); - f1 |= f2; - cmpVal1(f1, 1); - f1 ^= f2; - cmpVal1(f1, 0); - f1.x = 1; - f1 <<= f2; - cmpVal1(f1, 2); - f1 >>= f2; - cmpVal1(f1, 1); - - f1.x = 2; - f2 = f1++; - cmpVal1(f1, 3); - cmpVal1(f2, 2); - f2 = f1--; - cmpVal1(f2, 3); - cmpVal1(f1, 2); - f2 = ++f1; - cmpVal1(f1, 3); - cmpVal1(f2, 3); - f2 = --f1; - cmpVal1(f1, 2); - cmpVal1(f2, 2); - - f2 = ~f1; - cmpVal1(f2, -3); - assert(!f1 == false); - - f1.x = 3; - f1 = f1 * (unsigned char)1; - cmpVal1(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed char)1; - cmpVal1(f1, 3); - f1 = (signed char)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal1(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed short)1; - cmpVal1(f1, 3); - f1 = (signed short)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal1(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed int)1; - cmpVal1(f1, 3); - f1 = (signed int)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (float)1; - cmpVal1(f1, 3); - f1 = (float)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal1(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed long)1; - cmpVal1(f1, 3); - f1 = (signed long)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (double)1; - cmpVal1(f1, 3); - f1 = (double)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal1(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal1(f1, 3); - - longlong1 fa((unsigned char)1); - longlong1 fb((signed char)1); - longlong1 fc((unsigned short)1); - longlong1 fd((signed short)1); - longlong1 fe((unsigned int)1); - longlong1 fg((signed int)1); - longlong1 fh((float)1); - longlong1 fi((double)1); - longlong1 fj((unsigned long)1); - longlong1 fk((signed long)1); - longlong1 fl((unsigned long long)1); - longlong1 fm((signed long long)1); - - - f1.x = 3; - f2.x = 4; - f3.x = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestLongLong2() { - long2 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f2.x = 1; - f2.y = 1; - f3 = f1 + f2; - cmpVal2(f3, 2); - f2 = f3 - f1; - cmpVal2(f2, 1); - f1 = f2 * f3; - cmpVal2(f1, 2); - f2 = f1 / f3; - cmpVal2(f2, 2 / 2); - f3 = f1 % f2; - cmpVal2(f3, 0); - f1 = f3 & f2; - cmpVal2(f1, 0); - f2 = f1 ^ f3; - cmpVal2(f2, 0); - f1.x = 1; - f1.y = 1; - f2.x = 2; - f2.y = 2; - f3 = f1 << f2; - cmpVal2(f3, 4); - f2 = f3 >> f1; - cmpVal2(f2, 2); - - f1.x = 2; - f1.y = 2; - f2.x = 1; - f2.y = 1; - f1 += f2; - cmpVal2(f1, 3); - f1 -= f2; - cmpVal2(f1, 2); - f1 *= f2; - cmpVal2(f1, 2); - f1 /= f2; - cmpVal2(f1, 2); - f1 %= f2; - cmpVal2(f1, 0); - f1 &= f2; - cmpVal2(f1, 0); - f1 |= f2; - cmpVal2(f1, 1); - f1 ^= f2; - cmpVal2(f1, 0); - f1.x = 1; - f1.y = 1; - f1 <<= f2; - cmpVal2(f1, 2); - f1 >>= f2; - cmpVal2(f1, 1); - - f1.x = 2; - f1.y = 2; - f2 = f1++; - cmpVal2(f1, 3); - cmpVal2(f2, 2); - f2 = f1--; - cmpVal2(f2, 3); - cmpVal2(f1, 2); - f2 = ++f1; - cmpVal2(f1, 3); - cmpVal2(f2, 3); - f2 = --f1; - cmpVal2(f1, 2); - cmpVal2(f2, 2); - - f2 = ~f1; - cmpVal2(f2, -3); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1 = f1 * (unsigned char)1; - cmpVal2(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed char)1; - cmpVal2(f1, 3); - f1 = (signed char)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal2(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed short)1; - cmpVal2(f1, 3); - f1 = (signed short)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal2(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed int)1; - cmpVal2(f1, 3); - f1 = (signed int)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (float)1; - cmpVal2(f1, 3); - f1 = (float)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal2(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (signed long)1; - cmpVal2(f1, 3); - f1 = (signed long)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (double)1; - cmpVal2(f1, 3); - f1 = (double)1 * f1; - cmpVal2(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal2(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal2(f1, 3); - - longlong2 fa1((unsigned char)1); - longlong2 fa2((unsigned char)1, (unsigned char)1); - longlong2 fb1((signed char)1); - longlong2 fb2((signed char)1, (signed char)1); - longlong2 fc1((unsigned short)1); - longlong2 fc2((unsigned short)1, (unsigned short)1); - longlong2 fd1((signed short)1); - longlong2 fd2((signed short)1, (signed short)1); - longlong2 fe1((unsigned int)1); - longlong2 fe2((unsigned int)1, (unsigned int)1); - longlong2 fg1((signed int)1); - longlong2 fg2((signed int)1, (signed int)1); - longlong2 fh1((float)1); - longlong2 fh2((float)1, (float)1); - longlong2 fi1((double)1); - longlong2 fi2((double)1, (double)1); - longlong2 fj1((unsigned long)1); - longlong2 fj2((unsigned long)1, (unsigned long)1); - longlong2 fk1((signed long)1); - longlong2 fk2((signed long)1, (signed long)1); - longlong2 fl1((unsigned long long)1); - longlong2 fl2((unsigned long long)1, (unsigned long long)1); - longlong2 fm1((signed long long)1); - longlong2 fm2((signed long long)1, (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f2.x = 4; - f2.y = 4; - f3.x = 3; - f3.y = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestLongLong3() { - long3 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f3 = f1 + f2; - cmpVal3(f3, 2); - f2 = f3 - f1; - cmpVal3(f2, 1); - f1 = f2 * f3; - cmpVal3(f1, 2); - f2 = f1 / f3; - cmpVal3(f2, 2 / 2); - f3 = f1 % f2; - cmpVal3(f3, 0); - f1 = f3 & f2; - cmpVal3(f1, 0); - f2 = f1 ^ f3; - cmpVal3(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f3 = f1 << f2; - cmpVal3(f3, 4); - f2 = f3 >> f1; - cmpVal3(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f1 += f2; - cmpVal3(f1, 3); - f1 -= f2; - cmpVal3(f1, 2); - f1 *= f2; - cmpVal3(f1, 2); - f1 /= f2; - cmpVal3(f1, 2); - f1 %= f2; - cmpVal3(f1, 0); - f1 &= f2; - cmpVal3(f1, 0); - f1 |= f2; - cmpVal3(f1, 1); - f1 ^= f2; - cmpVal3(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1 <<= f2; - cmpVal3(f1, 2); - f1 >>= f2; - cmpVal3(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2 = f1++; - cmpVal3(f1, 3); - cmpVal3(f2, 2); - f2 = f1--; - cmpVal3(f2, 3); - cmpVal3(f1, 2); - f2 = ++f1; - cmpVal3(f1, 3); - cmpVal3(f2, 3); - f2 = --f1; - cmpVal3(f1, 2); - cmpVal3(f2, 2); - - f2 = ~f1; - cmpVal3(f2, -3); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1 = f1 * (unsigned char)1; - cmpVal3(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed char)1; - cmpVal3(f1, 3); - f1 = (signed char)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal3(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed short)1; - cmpVal3(f1, 3); - f1 = (signed short)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal3(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed int)1; - cmpVal3(f1, 3); - f1 = (signed int)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (float)1; - cmpVal3(f1, 3); - f1 = (float)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal3(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (signed long)1; - cmpVal3(f1, 3); - f1 = (signed long)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (double)1; - cmpVal3(f1, 3); - f1 = (double)1 * f1; - cmpVal3(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal3(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal3(f1, 3); - - longlong3 fa1((unsigned char)1); - longlong3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); - longlong3 fb1((signed char)1); - longlong3 fb2((signed char)1, (signed char)1, (signed char)1); - longlong3 fc1((unsigned short)1); - longlong3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); - longlong3 fd1((signed short)1); - longlong3 fd2((signed short)1, (signed short)1, (signed short)1); - longlong3 fe1((unsigned int)1); - longlong3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); - longlong3 fg1((signed int)1); - longlong3 fg2((signed int)1, (signed int)1, (signed int)1); - longlong3 fh1((float)1); - longlong3 fh2((float)1, (float)1, (float)1); - longlong3 fi1((double)1); - longlong3 fi2((double)1, (double)1, (double)1); - longlong3 fj1((unsigned long)1); - longlong3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); - longlong3 fk1((signed long)1); - longlong3 fk2((signed long)1, (signed long)1, (signed long)1); - longlong3 fl1((unsigned long long)1); - longlong3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); - longlong3 fm1((signed long long)1); - longlong3 fm2((signed long long)1, (signed long long)1, (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; -} - -bool TestLongLong4() { - long4 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f3 = f1 + f2; - cmpVal4(f3, 2); - f2 = f3 - f1; - cmpVal4(f2, 1); - f1 = f2 * f3; - cmpVal4(f1, 2); - f2 = f1 / f3; - cmpVal4(f2, 2 / 2); - f3 = f1 % f2; - cmpVal4(f3, 0); - f1 = f3 & f2; - cmpVal4(f1, 0); - f2 = f1 ^ f3; - cmpVal4(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f2.w = 2; - f3 = f1 << f2; - cmpVal4(f3, 4); - f2 = f3 >> f1; - cmpVal4(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f1 += f2; - cmpVal4(f1, 3); - f1 -= f2; - cmpVal4(f1, 2); - f1 *= f2; - cmpVal4(f1, 2); - f1 /= f2; - cmpVal4(f1, 2); - f1 %= f2; - cmpVal4(f1, 0); - f1 &= f2; - cmpVal4(f1, 0); - f1 |= f2; - cmpVal4(f1, 1); - f1 ^= f2; - cmpVal4(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f1 <<= f2; - cmpVal4(f1, 2); - f1 >>= f2; - cmpVal4(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2 = f1++; - cmpVal4(f1, 3); - cmpVal4(f2, 2); - f2 = f1--; - cmpVal4(f2, 3); - cmpVal4(f1, 2); - f2 = ++f1; - cmpVal4(f1, 3); - cmpVal4(f2, 3); - f2 = --f1; - cmpVal4(f1, 2); - cmpVal4(f2, 2); - - f2 = ~f1; - cmpVal4(f2, -3); - assert(!f1 == false); - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f1 = f1 * (unsigned char)1; - cmpVal4(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed char)1; - cmpVal4(f1, 3); - f1 = (signed char)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal4(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed short)1; - cmpVal4(f1, 3); - f1 = (signed short)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal4(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed int)1; - cmpVal4(f1, 3); - f1 = (signed int)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (float)1; - cmpVal4(f1, 3); - f1 = (float)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal4(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (signed long)1; - cmpVal4(f1, 3); - f1 = (signed long)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (double)1; - cmpVal4(f1, 3); - f1 = (double)1 * f1; - cmpVal4(f1, 3); - f1 = f1 * (unsigned long long)1; - cmpVal4(f1, 3); - f1 = (unsigned long long)1 * f1; - cmpVal4(f1, 3); - - longlong4 fa1((unsigned char)1); - longlong4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); - longlong4 fb1((signed char)1); - longlong4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); - longlong4 fc1((unsigned short)1); - longlong4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); - longlong4 fd1((signed short)1); - longlong4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); - longlong4 fe1((unsigned int)1); - longlong4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); - longlong4 fg1((signed int)1); - longlong4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); - longlong4 fh1((float)1); - longlong4 fh2((float)1, (float)1, (float)1, (float)1); - longlong4 fi1((double)1); - longlong4 fi2((double)1, (double)1, (double)1, (double)1); - longlong4 fj1((unsigned long)1); - longlong4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); - longlong4 fk1((signed long)1); - longlong4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); - longlong4 fl1((unsigned long long)1); - longlong4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, - (unsigned long long)1); - longlong4 fm1((signed long long)1); - longlong4 fm2((signed long long)1, (signed long long)1, (signed long long)1, - (signed long long)1); - - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f2.w = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - f3.w = 3; - assert((f1 == f2) == false); - assert((f1 != f2) == true); - assert((f1 < f2) == true); - assert((f2 > f1) == true); - assert((f1 >= f3) == true); - assert((f1 <= f3) == true); - - assert((f1 && f2) == true); - assert((f1 || f2) == true); - return true; +bool CheckVectorTypes() { + return TestVectorTypes< + char1, char2, char3, char4, + uchar1, uchar2, uchar3, uchar4, + short1, short2, short3, short4, + ushort1, ushort2, ushort3, ushort4, + int1, int2, int3, int4, + uint1, uint2, uint3, uint4, + long1, long2, long3, long4, + ulong1, ulong2, ulong3, ulong4, + longlong1, longlong2, longlong3, longlong4, + ulonglong1, ulonglong2, ulonglong3, ulonglong4, + float1, float2, float3, float4, + double1, double2, double3, double4>(); } int main() { - assert(sizeof(float1) == 4); - assert(sizeof(float2) == 8); - assert(sizeof(float3) == 12); - assert(sizeof(float4) == 16); - assert(TestFloat1() && TestFloat2() && TestFloat3() && TestFloat4() && TestDouble1() && - TestDouble2() && TestDouble3() && TestDouble4() && TestUChar1() && TestUChar2() && - TestUChar3() && TestUChar4() && TestChar1() && TestChar2() && TestChar3() && - TestChar4() && TestUShort1() && TestUShort2() && TestUShort3() && TestUShort4() && - TestShort1() && TestShort2() && TestShort3() && TestShort4() && TestUInt1() && - TestUInt2() && TestUInt3() && TestUInt4() && TestInt1() && TestInt2() && TestInt3() && - TestInt4() && TestULong1() && TestULong2() && TestULong3() && TestULong4() && - TestLong1() && TestLong2() && TestLong3() && TestLong4() && TestULongLong1() && - TestULongLong2() && TestULongLong3() && TestULongLong4() && TestLongLong1() && - TestLongLong2() && TestLongLong3() && TestLongLong4() == true); - passed(); - float1 f1 = make_float1(1.0f); -} + static_assert(sizeof(float1) == 4, ""); + static_assert(sizeof(float2) >= 8, ""); + static_assert(sizeof(float3) >= 12, ""); + static_assert(sizeof(float4) >= 16, ""); + + if (CheckVectorTypes()) { + float1 f1 = make_float1(1.0f); + passed(); + } + else { + failed("Failed some vector test on the host side."); + } +} \ No newline at end of file diff --git a/projects/hip/tests/src/deviceLib/hipVectorTypesDevice.cpp b/projects/hip/tests/src/deviceLib/hipVectorTypesDevice.cpp index 24ac3f4a02..edb817ced1 100644 --- a/projects/hip/tests/src/deviceLib/hipVectorTypesDevice.cpp +++ b/projects/hip/tests/src/deviceLib/hipVectorTypesDevice.cpp @@ -26,4212 +26,182 @@ THE SOFTWARE. * HIT_END */ -#include #include + +#include "vector_test_common.h" #include "test_common.h" -#define cmpVal1(in, exp) \ - if (in.x != exp) { \ - } -#define cmpVal2(in, exp) \ - if (in.x != exp || in.y != exp) { \ - } +#include +#include +#include -#define cmpVal3(in, exp) \ - if (in.x != exp || in.y != exp || in.z != exp) { \ - } +using namespace std; -#define cmpVal4(in, exp) \ - if (in.x != exp || in.y != exp || in.z != exp || in.w != exp) { \ - } +template< + typename V, + Enable_if_t().x)>{}>* = nullptr> +constexpr +bool integer_unary_tests(const V&, const V&) { + return true; +} -__device__ bool TestUChar1() { - uchar1 f1, f2, f3; +template< + typename V, + Enable_if_t().x)>{}>* = nullptr> +__device__ +bool integer_unary_tests(V& f1, V& f2) { + f1 %= f2; + if (!cmp(f1, 0)) return false; + f1 &= f2; + if (!cmp(f1, 0)) return false; + f1 |= f2; + if (!cmp(f1, 1)) return false; + f1 ^= f2; + if (!cmp(f1, 0)) return false; f1.x = 1; - f2.x = 1; - f3 = f1 + f2; - cmpVal1(f3, 2); - f2 = f3 - f1; - cmpVal1(f2, 1); - f1 = f2 * f3; - cmpVal1(f1, 2); - f2 = f1 / f3; - cmpVal1(f2, 2 / 2); + f1 <<= f2; + if (!cmp(f1, 2)) return false; + f1 >>= f2; + if (!cmp(f1, 1)) return false; + f2 = ~f1; + return cmp(f2, ~1); +} + +template< + typename V, + Enable_if_t().x)>{}>* = nullptr> +constexpr +bool integer_binary_tests(const V&, const V&, const V&) { + return true; +} + +template< + typename V, + Enable_if_t().x)>{}>* = nullptr> +__device__ +bool integer_binary_tests(V& f1, V& f2, V& f3) { f3 = f1 % f2; - cmpVal1(f3, 0); + if (!cmp(f3, 0)) return false; f1 = f3 & f2; - cmpVal1(f1, 0); + if (!cmp(f1, 0)) return false; f2 = f1 ^ f3; - cmpVal1(f2, 0); + if (!cmp(f2, 0)) return false; f1.x = 1; f2.x = 2; f3 = f1 << f2; - cmpVal1(f3, 4); + if (!cmp(f3, 4)) return false; f2 = f3 >> f1; - cmpVal1(f2, 2); - - f1.x = 2; - f2.x = 1; - f1 += f2; - cmpVal1(f1, 3); - f1 -= f2; - cmpVal1(f1, 2); - f1 *= f2; - cmpVal1(f1, 2); - f1 /= f2; - cmpVal1(f1, 2); - f1 %= f2; - cmpVal1(f1, 0); - f1 &= f2; - cmpVal1(f1, 0); - f1 |= f2; - cmpVal1(f1, 1); - f1 ^= f2; - cmpVal1(f1, 0); - f1.x = 1; - f1 <<= f2; - cmpVal1(f1, 2); - f1 >>= f2; - cmpVal1(f1, 1); - - f1.x = 2; - f2 = f1++; - cmpVal1(f1, 3); - cmpVal1(f2, 2); - f2 = f1--; - cmpVal1(f2, 3); - cmpVal1(f1, 2); - f2 = ++f1; - cmpVal1(f1, 3); - cmpVal1(f2, 3); - f2 = --f1; - cmpVal1(f1, 2); - cmpVal1(f2, 2); - - f2 = ~f1; - cmpVal1(f2, 253); - - f1.x = 3; - f1 = f1 * (unsigned char)1; - cmpVal1(f1, 3); - f1 = (unsigned char)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed char)1; - cmpVal1(f1, 3); - f1 = (signed char)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned short)1; - cmpVal1(f1, 3); - f1 = (unsigned short)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed short)1; - cmpVal1(f1, 3); - f1 = (signed short)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned int)1; - cmpVal1(f1, 3); - f1 = (unsigned int)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed int)1; - cmpVal1(f1, 3); - f1 = (signed int)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (float)1; - cmpVal1(f1, 3); - f1 = (float)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (unsigned long)1; - cmpVal1(f1, 3); - f1 = (unsigned long)1 * f1; - cmpVal1(f1, 3); - f1 = f1 * (signed long)1; - cmpVal1(f1, 3); - f1 = (signed long)1 * f1; - cmpVal1(f1, 3); - - // signed char sc = 1; - - f1.x = 3; - f2.x = 4; - f3.x = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; + if (!cmp(f2, 2)) return false; } -__device__ bool TestUChar2() { - uchar2 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f2.x = 1; - f2.y = 1; - f3 = f1 + f2; - cmpVal2(f3, 2); +template +__device__ +bool TestVectorType() { + V f1(1); + V f2(1); + V f3 = f1 + f2; + if (!cmp(f3, 2)) return false; f2 = f3 - f1; - cmpVal2(f2, 1); + if (!cmp(f2, 1)) return false; f1 = f2 * f3; - cmpVal2(f1, 2); + if (!cmp(f1, 2)) return false; f2 = f1 / f3; - cmpVal2(f2, 2 / 2); - f3 = f1 % f2; - cmpVal2(f3, 0); - f1 = f3 & f2; - cmpVal2(f1, 0); - f2 = f1 ^ f3; - cmpVal2(f2, 0); - f1.x = 1; - f1.y = 1; - f2.x = 2; - f2.y = 2; - f3 = f1 << f2; - cmpVal2(f3, 4); - f2 = f3 >> f1; - cmpVal2(f2, 2); + if (!cmp(f2, 2 / 2)) return false; + if (!integer_binary_tests(f1, f2, f3)) return false; - f1.x = 2; - f1.y = 2; - f2.x = 1; - f2.y = 1; + f1 = V(2); + f2 = V(1); f1 += f2; - cmpVal2(f1, 3); + if (!cmp(f1, 3)) return false; f1 -= f2; - cmpVal2(f1, 2); + if (!cmp(f1, 2)) return false; f1 *= f2; - cmpVal2(f1, 2); + if (!cmp(f1, 2)) return false; f1 /= f2; - cmpVal2(f1, 2); - f1 %= f2; - cmpVal2(f1, 0); - f1 &= f2; - cmpVal2(f1, 0); - f1 |= f2; - cmpVal2(f1, 1); - f1 ^= f2; - cmpVal2(f1, 0); - f1.x = 1; - f1.y = 1; - f1 <<= f2; - cmpVal2(f1, 2); - f1 >>= f2; - cmpVal2(f1, 1); + if (!cmp(f1, 2)) return false; + if (!integer_unary_tests(f1, f2)) return false; - f1.x = 2; - f1.y = 2; - f2 = f1++; - cmpVal2(f1, 3); - cmpVal2(f2, 2); - f2 = f1--; - cmpVal2(f2, 3); - cmpVal2(f1, 2); - f2 = ++f1; - cmpVal2(f1, 3); - cmpVal2(f2, 3); - f2 = --f1; - cmpVal2(f1, 2); - cmpVal2(f2, 2); + #if false // We do not enable nullary increment / decrement yet. + f1 = V(2); + f2 = f1++; + if (!cmp(f1, 3)) return false; + if (!cmp(f2, 2)) return false; + f2 = f1--; + if (!cmp(f2, 3)) return false; + if (!cmp(f1, 2)) return false; + f2 = ++f1; + if (!cmp(f1, 3)) return false; + if (!cmp(f2, 3)) return false; + f2 = --f1; + if (!cmp(f1, 2)) return false; + if (!cmp(f2, 2)) return false; + #endif - f2 = ~f1; - cmpVal2(f2, 253); - if (!f1 == false) { - } + f1 = V(3); + f2 = V(4); + f3 = V(3); + if (cmp(f1 == f2, true)) return false; + if (cmp(f1 != f2, false)) return false; + if (cmp(f1 < f2, false)) return false; + if (cmp(f2 > f1, false)) return false; + if (cmp(f1 >= f3, false)) return false; + if (cmp(f1 <= f3, false)) return false; - f1.x = 3; - f1.y = 3; - f2.x = 4; - f2.y = 4; - f3.x = 3; - f3.y = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } + if (cmp(f1 && f2, false)) return false; + if (cmp(f1 || f2, false)) return false; return true; } -__device__ bool TestUChar3() { - uchar3 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f3 = f1 + f2; - cmpVal3(f3, 2); - f2 = f3 - f1; - cmpVal3(f2, 1); - f1 = f2 * f3; - cmpVal3(f1, 2); - f2 = f1 / f3; - cmpVal3(f2, 2 / 2); - f3 = f1 % f2; - cmpVal3(f3, 0); - f1 = f3 & f2; - cmpVal3(f1, 0); - f2 = f1 ^ f3; - cmpVal3(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f3 = f1 << f2; - cmpVal3(f3, 4); - f2 = f3 >> f1; - cmpVal3(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f1 += f2; - cmpVal3(f1, 3); - f1 -= f2; - cmpVal3(f1, 2); - f1 *= f2; - cmpVal3(f1, 2); - f1 /= f2; - cmpVal3(f1, 2); - f1 %= f2; - cmpVal3(f1, 0); - f1 &= f2; - cmpVal3(f1, 0); - f1 |= f2; - cmpVal3(f1, 1); - f1 ^= f2; - cmpVal3(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1 <<= f2; - cmpVal3(f1, 2); - f1 >>= f2; - cmpVal3(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2 = f1++; - cmpVal3(f1, 3); - cmpVal3(f2, 2); - f2 = f1--; - cmpVal3(f2, 3); - cmpVal3(f1, 2); - f2 = ++f1; - cmpVal3(f1, 3); - cmpVal3(f2, 3); - f2 = --f1; - cmpVal3(f1, 2); - cmpVal3(f2, 2); - - f2 = ~f1; - cmpVal3(f2, 253); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } +template* = nullptr> +__device__ +bool TestVectorTypes() { return true; } -__device__ bool TestUChar4() { - uchar4 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f3 = f1 + f2; - cmpVal4(f3, 2); - f2 = f3 - f1; - cmpVal4(f2, 1); - f1 = f2 * f3; - cmpVal4(f1, 2); - f2 = f1 / f3; - cmpVal4(f2, 2 / 2); - f3 = f1 % f2; - cmpVal4(f3, 0); - f1 = f3 & f2; - cmpVal4(f1, 0); - f2 = f1 ^ f3; - cmpVal4(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f2.w = 2; - f3 = f1 << f2; - cmpVal4(f3, 4); - f2 = f3 >> f1; - cmpVal4(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f1 += f2; - cmpVal4(f1, 3); - f1 -= f2; - cmpVal4(f1, 2); - f1 *= f2; - cmpVal4(f1, 2); - f1 /= f2; - cmpVal4(f1, 2); - f1 %= f2; - cmpVal4(f1, 0); - f1 &= f2; - cmpVal4(f1, 0); - f1 |= f2; - cmpVal4(f1, 1); - f1 ^= f2; - cmpVal4(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f1 <<= f2; - cmpVal4(f1, 2); - f1 >>= f2; - cmpVal4(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2 = f1++; - cmpVal4(f1, 3); - cmpVal4(f2, 2); - f2 = f1--; - cmpVal4(f2, 3); - cmpVal4(f1, 2); - f2 = ++f1; - cmpVal4(f1, 3); - cmpVal4(f2, 3); - f2 = --f1; - cmpVal4(f1, 2); - cmpVal4(f2, 2); - - f2 = ~f1; - cmpVal4(f2, 253); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f2.w = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - f3.w = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; +template +__device__ +bool TestVectorTypes() { + if (!TestVectorType()) return false; + return TestVectorTypes(); } -__device__ bool TestChar1() { - char1 f1, f2, f3; - f1.x = 1; - f2.x = 1; - f3 = f1 + f2; - cmpVal1(f3, 2); - f2 = f3 - f1; - cmpVal1(f2, 1); - f1 = f2 * f3; - cmpVal1(f1, 2); - f2 = f1 / f3; - cmpVal1(f2, 2 / 2); - f3 = f1 % f2; - cmpVal1(f3, 0); - f1 = f3 & f2; - cmpVal1(f1, 0); - f2 = f1 ^ f3; - cmpVal1(f2, 0); - f1.x = 1; - f2.x = 2; - f3 = f1 << f2; - cmpVal1(f3, 4); - f2 = f3 >> f1; - cmpVal1(f2, 2); - - f1.x = 2; - f2.x = 1; - f1 += f2; - cmpVal1(f1, 3); - f1 -= f2; - cmpVal1(f1, 2); - f1 *= f2; - cmpVal1(f1, 2); - f1 /= f2; - cmpVal1(f1, 2); - f1 %= f2; - cmpVal1(f1, 0); - f1 &= f2; - cmpVal1(f1, 0); - f1 |= f2; - cmpVal1(f1, 1); - f1 ^= f2; - cmpVal1(f1, 0); - f1.x = 1; - f1 <<= f2; - cmpVal1(f1, 2); - f1 >>= f2; - cmpVal1(f1, 1); - - f1.x = 2; - f2 = f1++; - cmpVal1(f1, 3); - cmpVal1(f2, 2); - f2 = f1--; - cmpVal1(f2, 3); - cmpVal1(f1, 2); - f2 = ++f1; - cmpVal1(f1, 3); - cmpVal1(f2, 3); - f2 = --f1; - cmpVal1(f1, 2); - cmpVal1(f2, 2); - - f2 = ~f1; - cmpVal1(f2, (char)253); - if (!f1 == false) { - } - - f1.x = 3; - f2.x = 4; - f3.x = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestChar2() { - char2 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f2.x = 1; - f2.y = 1; - f3 = f1 + f2; - cmpVal2(f3, 2); - f2 = f3 - f1; - cmpVal2(f2, 1); - f1 = f2 * f3; - cmpVal2(f1, 2); - f2 = f1 / f3; - cmpVal2(f2, 2 / 2); - f3 = f1 % f2; - cmpVal2(f3, 0); - f1 = f3 & f2; - cmpVal2(f1, 0); - f2 = f1 ^ f3; - cmpVal2(f2, 0); - f1.x = 1; - f1.y = 1; - f2.x = 2; - f2.y = 2; - f3 = f1 << f2; - cmpVal2(f3, 4); - f2 = f3 >> f1; - cmpVal2(f2, 2); - - f1.x = 2; - f1.y = 2; - f2.x = 1; - f2.y = 1; - f1 += f2; - cmpVal2(f1, 3); - f1 -= f2; - cmpVal2(f1, 2); - f1 *= f2; - cmpVal2(f1, 2); - f1 /= f2; - cmpVal2(f1, 2); - f1 %= f2; - cmpVal2(f1, 0); - f1 &= f2; - cmpVal2(f1, 0); - f1 |= f2; - cmpVal2(f1, 1); - f1 ^= f2; - cmpVal2(f1, 0); - f1.x = 1; - f1.y = 1; - f1 <<= f2; - cmpVal2(f1, 2); - f1 >>= f2; - cmpVal2(f1, 1); - - f1.x = 2; - f1.y = 2; - f2 = f1++; - cmpVal2(f1, 3); - cmpVal2(f2, 2); - f2 = f1--; - cmpVal2(f2, 3); - cmpVal2(f1, 2); - f2 = ++f1; - cmpVal2(f1, 3); - cmpVal2(f2, 3); - f2 = --f1; - cmpVal2(f1, 2); - cmpVal2(f2, 2); - - f2 = ~f1; - cmpVal2(f2, (char)253); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f2.x = 4; - f2.y = 4; - f3.x = 3; - f3.y = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestChar3() { - char3 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f3 = f1 + f2; - cmpVal3(f3, 2); - f2 = f3 - f1; - cmpVal3(f2, 1); - f1 = f2 * f3; - cmpVal3(f1, 2); - f2 = f1 / f3; - cmpVal3(f2, 2 / 2); - f3 = f1 % f2; - cmpVal3(f3, 0); - f1 = f3 & f2; - cmpVal3(f1, 0); - f2 = f1 ^ f3; - cmpVal3(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f3 = f1 << f2; - cmpVal3(f3, 4); - f2 = f3 >> f1; - cmpVal3(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f1 += f2; - cmpVal3(f1, 3); - f1 -= f2; - cmpVal3(f1, 2); - f1 *= f2; - cmpVal3(f1, 2); - f1 /= f2; - cmpVal3(f1, 2); - f1 %= f2; - cmpVal3(f1, 0); - f1 &= f2; - cmpVal3(f1, 0); - f1 |= f2; - cmpVal3(f1, 1); - f1 ^= f2; - cmpVal3(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1 <<= f2; - cmpVal3(f1, 2); - f1 >>= f2; - cmpVal3(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2 = f1++; - cmpVal3(f1, 3); - cmpVal3(f2, 2); - f2 = f1--; - cmpVal3(f2, 3); - cmpVal3(f1, 2); - f2 = ++f1; - cmpVal3(f1, 3); - cmpVal3(f2, 3); - f2 = --f1; - cmpVal3(f1, 2); - cmpVal3(f2, 2); - - f2 = ~f1; - cmpVal3(f2, (char)253); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestChar4() { - char4 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f3 = f1 + f2; - cmpVal4(f3, 2); - f2 = f3 - f1; - cmpVal4(f2, 1); - f1 = f2 * f3; - cmpVal4(f1, 2); - f2 = f1 / f3; - cmpVal4(f2, 2 / 2); - f3 = f1 % f2; - cmpVal4(f3, 0); - f1 = f3 & f2; - cmpVal4(f1, 0); - f2 = f1 ^ f3; - cmpVal4(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f2.w = 2; - f3 = f1 << f2; - cmpVal4(f3, 4); - f2 = f3 >> f1; - cmpVal4(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f1 += f2; - cmpVal4(f1, 3); - f1 -= f2; - cmpVal4(f1, 2); - f1 *= f2; - cmpVal4(f1, 2); - f1 /= f2; - cmpVal4(f1, 2); - f1 %= f2; - cmpVal4(f1, 0); - f1 &= f2; - cmpVal4(f1, 0); - f1 |= f2; - cmpVal4(f1, 1); - f1 ^= f2; - cmpVal4(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f1 <<= f2; - cmpVal4(f1, 2); - f1 >>= f2; - cmpVal4(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2 = f1++; - cmpVal4(f1, 3); - cmpVal4(f2, 2); - f2 = f1--; - cmpVal4(f2, 3); - cmpVal4(f1, 2); - f2 = ++f1; - cmpVal4(f1, 3); - cmpVal4(f2, 3); - f2 = --f1; - cmpVal4(f1, 2); - cmpVal4(f2, 2); - - f2 = ~f1; - cmpVal4(f2, (char)253); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f2.w = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - f3.w = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestUShort1() { - ushort1 f1, f2, f3; - f1.x = 1; - f2.x = 1; - f3 = f1 + f2; - cmpVal1(f3, 2); - f2 = f3 - f1; - cmpVal1(f2, 1); - f1 = f2 * f3; - cmpVal1(f1, 2); - f2 = f1 / f3; - cmpVal1(f2, 2 / 2); - f3 = f1 % f2; - cmpVal1(f3, 0); - f1 = f3 & f2; - cmpVal1(f1, 0); - f2 = f1 ^ f3; - cmpVal1(f2, 0); - f1.x = 1; - f2.x = 2; - f3 = f1 << f2; - cmpVal1(f3, 4); - f2 = f3 >> f1; - cmpVal1(f2, 2); - - f1.x = 2; - f2.x = 1; - f1 += f2; - cmpVal1(f1, 3); - f1 -= f2; - cmpVal1(f1, 2); - f1 *= f2; - cmpVal1(f1, 2); - f1 /= f2; - cmpVal1(f1, 2); - f1 %= f2; - cmpVal1(f1, 0); - f1 &= f2; - cmpVal1(f1, 0); - f1 |= f2; - cmpVal1(f1, 1); - f1 ^= f2; - cmpVal1(f1, 0); - f1.x = 1; - f1 <<= f2; - cmpVal1(f1, 2); - f1 >>= f2; - cmpVal1(f1, 1); - - f1.x = 2; - f2 = f1++; - cmpVal1(f1, 3); - cmpVal1(f2, 2); - f2 = f1--; - cmpVal1(f2, 3); - cmpVal1(f1, 2); - f2 = ++f1; - cmpVal1(f1, 3); - cmpVal1(f2, 3); - f2 = --f1; - cmpVal1(f1, 2); - cmpVal1(f2, 2); - - f2 = ~f1; - cmpVal1(f2, (unsigned short)65533); - if (!f1 == false) { - } - - f1.x = 3; - f2.x = 4; - f3.x = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestUShort2() { - ushort2 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f2.x = 1; - f2.y = 1; - f3 = f1 + f2; - cmpVal2(f3, 2); - f2 = f3 - f1; - cmpVal2(f2, 1); - f1 = f2 * f3; - cmpVal2(f1, 2); - f2 = f1 / f3; - cmpVal2(f2, 2 / 2); - f3 = f1 % f2; - cmpVal2(f3, 0); - f1 = f3 & f2; - cmpVal2(f1, 0); - f2 = f1 ^ f3; - cmpVal2(f2, 0); - f1.x = 1; - f1.y = 1; - f2.x = 2; - f2.y = 2; - f3 = f1 << f2; - cmpVal2(f3, 4); - f2 = f3 >> f1; - cmpVal2(f2, 2); - - f1.x = 2; - f1.y = 2; - f2.x = 1; - f2.y = 1; - f1 += f2; - cmpVal2(f1, 3); - f1 -= f2; - cmpVal2(f1, 2); - f1 *= f2; - cmpVal2(f1, 2); - f1 /= f2; - cmpVal2(f1, 2); - f1 %= f2; - cmpVal2(f1, 0); - f1 &= f2; - cmpVal2(f1, 0); - f1 |= f2; - cmpVal2(f1, 1); - f1 ^= f2; - cmpVal2(f1, 0); - f1.x = 1; - f1.y = 1; - f1 <<= f2; - cmpVal2(f1, 2); - f1 >>= f2; - cmpVal2(f1, 1); - - f1.x = 2; - f1.y = 2; - f2 = f1++; - cmpVal2(f1, 3); - cmpVal2(f2, 2); - f2 = f1--; - cmpVal2(f2, 3); - cmpVal2(f1, 2); - f2 = ++f1; - cmpVal2(f1, 3); - cmpVal2(f2, 3); - f2 = --f1; - cmpVal2(f1, 2); - cmpVal2(f2, 2); - - f2 = ~f1; - cmpVal2(f2, (unsigned short)65533); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f2.x = 4; - f2.y = 4; - f3.x = 3; - f3.y = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestUShort3() { - ushort3 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f3 = f1 + f2; - cmpVal3(f3, 2); - f2 = f3 - f1; - cmpVal3(f2, 1); - f1 = f2 * f3; - cmpVal3(f1, 2); - f2 = f1 / f3; - cmpVal3(f2, 2 / 2); - f3 = f1 % f2; - cmpVal3(f3, 0); - f1 = f3 & f2; - cmpVal3(f1, 0); - f2 = f1 ^ f3; - cmpVal3(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f3 = f1 << f2; - cmpVal3(f3, 4); - f2 = f3 >> f1; - cmpVal3(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f1 += f2; - cmpVal3(f1, 3); - f1 -= f2; - cmpVal3(f1, 2); - f1 *= f2; - cmpVal3(f1, 2); - f1 /= f2; - cmpVal3(f1, 2); - f1 %= f2; - cmpVal3(f1, 0); - f1 &= f2; - cmpVal3(f1, 0); - f1 |= f2; - cmpVal3(f1, 1); - f1 ^= f2; - cmpVal3(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1 <<= f2; - cmpVal3(f1, 2); - f1 >>= f2; - cmpVal3(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2 = f1++; - cmpVal3(f1, 3); - cmpVal3(f2, 2); - f2 = f1--; - cmpVal3(f2, 3); - cmpVal3(f1, 2); - f2 = ++f1; - cmpVal3(f1, 3); - cmpVal3(f2, 3); - f2 = --f1; - cmpVal3(f1, 2); - cmpVal3(f2, 2); - - f2 = ~f1; - cmpVal3(f2, (unsigned short)65533); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestUShort4() { - ushort4 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f3 = f1 + f2; - cmpVal4(f3, 2); - f2 = f3 - f1; - cmpVal4(f2, 1); - f1 = f2 * f3; - cmpVal4(f1, 2); - f2 = f1 / f3; - cmpVal4(f2, 2 / 2); - f3 = f1 % f2; - cmpVal4(f3, 0); - f1 = f3 & f2; - cmpVal4(f1, 0); - f2 = f1 ^ f3; - cmpVal4(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f2.w = 2; - f3 = f1 << f2; - cmpVal4(f3, 4); - f2 = f3 >> f1; - cmpVal4(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f1 += f2; - cmpVal4(f1, 3); - f1 -= f2; - cmpVal4(f1, 2); - f1 *= f2; - cmpVal4(f1, 2); - f1 /= f2; - cmpVal4(f1, 2); - f1 %= f2; - cmpVal4(f1, 0); - f1 &= f2; - cmpVal4(f1, 0); - f1 |= f2; - cmpVal4(f1, 1); - f1 ^= f2; - cmpVal4(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f1 <<= f2; - cmpVal4(f1, 2); - f1 >>= f2; - cmpVal4(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2 = f1++; - cmpVal4(f1, 3); - cmpVal4(f2, 2); - f2 = f1--; - cmpVal4(f2, 3); - cmpVal4(f1, 2); - f2 = ++f1; - cmpVal4(f1, 3); - cmpVal4(f2, 3); - f2 = --f1; - cmpVal4(f1, 2); - cmpVal4(f2, 2); - - f2 = ~f1; - cmpVal4(f2, (unsigned short)65533); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f2.w = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - f3.w = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestShort1() { - short1 f1, f2, f3; - f1.x = 1; - f2.x = 1; - f3 = f1 + f2; - cmpVal1(f3, 2); - f2 = f3 - f1; - cmpVal1(f2, 1); - f1 = f2 * f3; - cmpVal1(f1, 2); - f2 = f1 / f3; - cmpVal1(f2, 2 / 2); - f3 = f1 % f2; - cmpVal1(f3, 0); - f1 = f3 & f2; - cmpVal1(f1, 0); - f2 = f1 ^ f3; - cmpVal1(f2, 0); - f1.x = 1; - f2.x = 2; - f3 = f1 << f2; - cmpVal1(f3, 4); - f2 = f3 >> f1; - cmpVal1(f2, 2); - - f1.x = 2; - f2.x = 1; - f1 += f2; - cmpVal1(f1, 3); - f1 -= f2; - cmpVal1(f1, 2); - f1 *= f2; - cmpVal1(f1, 2); - f1 /= f2; - cmpVal1(f1, 2); - f1 %= f2; - cmpVal1(f1, 0); - f1 &= f2; - cmpVal1(f1, 0); - f1 |= f2; - cmpVal1(f1, 1); - f1 ^= f2; - cmpVal1(f1, 0); - f1.x = 1; - f1 <<= f2; - cmpVal1(f1, 2); - f1 >>= f2; - cmpVal1(f1, 1); - - f1.x = 2; - f2 = f1++; - cmpVal1(f1, 3); - cmpVal1(f2, 2); - f2 = f1--; - cmpVal1(f2, 3); - cmpVal1(f1, 2); - f2 = ++f1; - cmpVal1(f1, 3); - cmpVal1(f2, 3); - f2 = --f1; - cmpVal1(f1, 2); - cmpVal1(f2, 2); - - f2 = ~f1; - cmpVal1(f2, (signed short)65533); - if (!f1 == false) { - } - - f1.x = 3; - f2.x = 4; - f3.x = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestShort2() { - short2 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f2.x = 1; - f2.y = 1; - f3 = f1 + f2; - cmpVal2(f3, 2); - f2 = f3 - f1; - cmpVal2(f2, 1); - f1 = f2 * f3; - cmpVal2(f1, 2); - f2 = f1 / f3; - cmpVal2(f2, 2 / 2); - f3 = f1 % f2; - cmpVal2(f3, 0); - f1 = f3 & f2; - cmpVal2(f1, 0); - f2 = f1 ^ f3; - cmpVal2(f2, 0); - f1.x = 1; - f1.y = 1; - f2.x = 2; - f2.y = 2; - f3 = f1 << f2; - cmpVal2(f3, 4); - f2 = f3 >> f1; - cmpVal2(f2, 2); - - f1.x = 2; - f1.y = 2; - f2.x = 1; - f2.y = 1; - f1 += f2; - cmpVal2(f1, 3); - f1 -= f2; - cmpVal2(f1, 2); - f1 *= f2; - cmpVal2(f1, 2); - f1 /= f2; - cmpVal2(f1, 2); - f1 %= f2; - cmpVal2(f1, 0); - f1 &= f2; - cmpVal2(f1, 0); - f1 |= f2; - cmpVal2(f1, 1); - f1 ^= f2; - cmpVal2(f1, 0); - f1.x = 1; - f1.y = 1; - f1 <<= f2; - cmpVal2(f1, 2); - f1 >>= f2; - cmpVal2(f1, 1); - - f1.x = 2; - f1.y = 2; - f2 = f1++; - cmpVal2(f1, 3); - cmpVal2(f2, 2); - f2 = f1--; - cmpVal2(f2, 3); - cmpVal2(f1, 2); - f2 = ++f1; - cmpVal2(f1, 3); - cmpVal2(f2, 3); - f2 = --f1; - cmpVal2(f1, 2); - cmpVal2(f2, 2); - - f2 = ~f1; - cmpVal2(f2, (signed short)65533); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f2.x = 4; - f2.y = 4; - f3.x = 3; - f3.y = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestShort3() { - short3 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f3 = f1 + f2; - cmpVal3(f3, 2); - f2 = f3 - f1; - cmpVal3(f2, 1); - f1 = f2 * f3; - cmpVal3(f1, 2); - f2 = f1 / f3; - cmpVal3(f2, 2 / 2); - f3 = f1 % f2; - cmpVal3(f3, 0); - f1 = f3 & f2; - cmpVal3(f1, 0); - f2 = f1 ^ f3; - cmpVal3(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f3 = f1 << f2; - cmpVal3(f3, 4); - f2 = f3 >> f1; - cmpVal3(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f1 += f2; - cmpVal3(f1, 3); - f1 -= f2; - cmpVal3(f1, 2); - f1 *= f2; - cmpVal3(f1, 2); - f1 /= f2; - cmpVal3(f1, 2); - f1 %= f2; - cmpVal3(f1, 0); - f1 &= f2; - cmpVal3(f1, 0); - f1 |= f2; - cmpVal3(f1, 1); - f1 ^= f2; - cmpVal3(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1 <<= f2; - cmpVal3(f1, 2); - f1 >>= f2; - cmpVal3(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2 = f1++; - cmpVal3(f1, 3); - cmpVal3(f2, 2); - f2 = f1--; - cmpVal3(f2, 3); - cmpVal3(f1, 2); - f2 = ++f1; - cmpVal3(f1, 3); - cmpVal3(f2, 3); - f2 = --f1; - cmpVal3(f1, 2); - cmpVal3(f2, 2); - - f2 = ~f1; - cmpVal3(f2, (signed short)65533); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestShort4() { - short4 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f3 = f1 + f2; - cmpVal4(f3, 2); - f2 = f3 - f1; - cmpVal4(f2, 1); - f1 = f2 * f3; - cmpVal4(f1, 2); - f2 = f1 / f3; - cmpVal4(f2, 2 / 2); - f3 = f1 % f2; - cmpVal4(f3, 0); - f1 = f3 & f2; - cmpVal4(f1, 0); - f2 = f1 ^ f3; - cmpVal4(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f2.w = 2; - f3 = f1 << f2; - cmpVal4(f3, 4); - f2 = f3 >> f1; - cmpVal4(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f1 += f2; - cmpVal4(f1, 3); - f1 -= f2; - cmpVal4(f1, 2); - f1 *= f2; - cmpVal4(f1, 2); - f1 /= f2; - cmpVal4(f1, 2); - f1 %= f2; - cmpVal4(f1, 0); - f1 &= f2; - cmpVal4(f1, 0); - f1 |= f2; - cmpVal4(f1, 1); - f1 ^= f2; - cmpVal4(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f1 <<= f2; - cmpVal4(f1, 2); - f1 >>= f2; - cmpVal4(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2 = f1++; - cmpVal4(f1, 3); - cmpVal4(f2, 2); - f2 = f1--; - cmpVal4(f2, 3); - cmpVal4(f1, 2); - f2 = ++f1; - cmpVal4(f1, 3); - cmpVal4(f2, 3); - f2 = --f1; - cmpVal4(f1, 2); - cmpVal4(f2, 2); - - f2 = ~f1; - cmpVal4(f2, (signed short)65533); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f2.w = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - f3.w = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - - -__device__ bool TestUInt1() { - uint1 f1, f2, f3; - f1.x = 1; - f2.x = 1; - f3 = f1 + f2; - cmpVal1(f3, 2); - f2 = f3 - f1; - cmpVal1(f2, 1); - f1 = f2 * f3; - cmpVal1(f1, 2); - f2 = f1 / f3; - cmpVal1(f2, 2 / 2); - f3 = f1 % f2; - cmpVal1(f3, 0); - f1 = f3 & f2; - cmpVal1(f1, 0); - f2 = f1 ^ f3; - cmpVal1(f2, 0); - f1.x = 1; - f2.x = 2; - f3 = f1 << f2; - cmpVal1(f3, 4); - f2 = f3 >> f1; - cmpVal1(f2, 2); - - f1.x = 2; - f2.x = 1; - f1 += f2; - cmpVal1(f1, 3); - f1 -= f2; - cmpVal1(f1, 2); - f1 *= f2; - cmpVal1(f1, 2); - f1 /= f2; - cmpVal1(f1, 2); - f1 %= f2; - cmpVal1(f1, 0); - f1 &= f2; - cmpVal1(f1, 0); - f1 |= f2; - cmpVal1(f1, 1); - f1 ^= f2; - cmpVal1(f1, 0); - f1.x = 1; - f1 <<= f2; - cmpVal1(f1, 2); - f1 >>= f2; - cmpVal1(f1, 1); - - f1.x = 2; - f2 = f1++; - cmpVal1(f1, 3); - cmpVal1(f2, 2); - f2 = f1--; - cmpVal1(f2, 3); - cmpVal1(f1, 2); - f2 = ++f1; - cmpVal1(f1, 3); - cmpVal1(f2, 3); - f2 = --f1; - cmpVal1(f1, 2); - cmpVal1(f2, 2); - - f2 = ~f1; - cmpVal1(f2, (unsigned int)4294967293); - if (!f1 == false) { - } - - f1.x = 3; - f2.x = 4; - f3.x = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestUInt2() { - uint2 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f2.x = 1; - f2.y = 1; - f3 = f1 + f2; - cmpVal2(f3, 2); - f2 = f3 - f1; - cmpVal2(f2, 1); - f1 = f2 * f3; - cmpVal2(f1, 2); - f2 = f1 / f3; - cmpVal2(f2, 2 / 2); - f3 = f1 % f2; - cmpVal2(f3, 0); - f1 = f3 & f2; - cmpVal2(f1, 0); - f2 = f1 ^ f3; - cmpVal2(f2, 0); - f1.x = 1; - f1.y = 1; - f2.x = 2; - f2.y = 2; - f3 = f1 << f2; - cmpVal2(f3, 4); - f2 = f3 >> f1; - cmpVal2(f2, 2); - - f1.x = 2; - f1.y = 2; - f2.x = 1; - f2.y = 1; - f1 += f2; - cmpVal2(f1, 3); - f1 -= f2; - cmpVal2(f1, 2); - f1 *= f2; - cmpVal2(f1, 2); - f1 /= f2; - cmpVal2(f1, 2); - f1 %= f2; - cmpVal2(f1, 0); - f1 &= f2; - cmpVal2(f1, 0); - f1 |= f2; - cmpVal2(f1, 1); - f1 ^= f2; - cmpVal2(f1, 0); - f1.x = 1; - f1.y = 1; - f1 <<= f2; - cmpVal2(f1, 2); - f1 >>= f2; - cmpVal2(f1, 1); - - f1.x = 2; - f1.y = 2; - f2 = f1++; - cmpVal2(f1, 3); - cmpVal2(f2, 2); - f2 = f1--; - cmpVal2(f2, 3); - cmpVal2(f1, 2); - f2 = ++f1; - cmpVal2(f1, 3); - cmpVal2(f2, 3); - f2 = --f1; - cmpVal2(f1, 2); - cmpVal2(f2, 2); - - f2 = ~f1; - cmpVal2(f2, (unsigned int)4294967293); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f2.x = 4; - f2.y = 4; - f3.x = 3; - f3.y = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestUInt3() { - uint3 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f3 = f1 + f2; - cmpVal3(f3, 2); - f2 = f3 - f1; - cmpVal3(f2, 1); - f1 = f2 * f3; - cmpVal3(f1, 2); - f2 = f1 / f3; - cmpVal3(f2, 2 / 2); - f3 = f1 % f2; - cmpVal3(f3, 0); - f1 = f3 & f2; - cmpVal3(f1, 0); - f2 = f1 ^ f3; - cmpVal3(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f3 = f1 << f2; - cmpVal3(f3, 4); - f2 = f3 >> f1; - cmpVal3(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f1 += f2; - cmpVal3(f1, 3); - f1 -= f2; - cmpVal3(f1, 2); - f1 *= f2; - cmpVal3(f1, 2); - f1 /= f2; - cmpVal3(f1, 2); - f1 %= f2; - cmpVal3(f1, 0); - f1 &= f2; - cmpVal3(f1, 0); - f1 |= f2; - cmpVal3(f1, 1); - f1 ^= f2; - cmpVal3(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1 <<= f2; - cmpVal3(f1, 2); - f1 >>= f2; - cmpVal3(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2 = f1++; - cmpVal3(f1, 3); - cmpVal3(f2, 2); - f2 = f1--; - cmpVal3(f2, 3); - cmpVal3(f1, 2); - f2 = ++f1; - cmpVal3(f1, 3); - cmpVal3(f2, 3); - f2 = --f1; - cmpVal3(f1, 2); - cmpVal3(f2, 2); - - f2 = ~f1; - cmpVal3(f2, (unsigned int)4294967293); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestUInt4() { - uint4 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f3 = f1 + f2; - cmpVal4(f3, 2); - f2 = f3 - f1; - cmpVal4(f2, 1); - f1 = f2 * f3; - cmpVal4(f1, 2); - f2 = f1 / f3; - cmpVal4(f2, 2 / 2); - f3 = f1 % f2; - cmpVal4(f3, 0); - f1 = f3 & f2; - cmpVal4(f1, 0); - f2 = f1 ^ f3; - cmpVal4(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f2.w = 2; - f3 = f1 << f2; - cmpVal4(f3, 4); - f2 = f3 >> f1; - cmpVal4(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f1 += f2; - cmpVal4(f1, 3); - f1 -= f2; - cmpVal4(f1, 2); - f1 *= f2; - cmpVal4(f1, 2); - f1 /= f2; - cmpVal4(f1, 2); - f1 %= f2; - cmpVal4(f1, 0); - f1 &= f2; - cmpVal4(f1, 0); - f1 |= f2; - cmpVal4(f1, 1); - f1 ^= f2; - cmpVal4(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f1 <<= f2; - cmpVal4(f1, 2); - f1 >>= f2; - cmpVal4(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2 = f1++; - cmpVal4(f1, 3); - cmpVal4(f2, 2); - f2 = f1--; - cmpVal4(f2, 3); - cmpVal4(f1, 2); - f2 = ++f1; - cmpVal4(f1, 3); - cmpVal4(f2, 3); - f2 = --f1; - cmpVal4(f1, 2); - cmpVal4(f2, 2); - - f2 = ~f1; - cmpVal4(f2, (unsigned int)4294967293); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f2.w = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - f3.w = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestInt1() { - int1 f1, f2, f3; - f1.x = 1; - f2.x = 1; - f3 = f1 + f2; - cmpVal1(f3, 2); - f2 = f3 - f1; - cmpVal1(f2, 1); - f1 = f2 * f3; - cmpVal1(f1, 2); - f2 = f1 / f3; - cmpVal1(f2, 2 / 2); - f3 = f1 % f2; - cmpVal1(f3, 0); - f1 = f3 & f2; - cmpVal1(f1, 0); - f2 = f1 ^ f3; - cmpVal1(f2, 0); - f1.x = 1; - f2.x = 2; - f3 = f1 << f2; - cmpVal1(f3, 4); - f2 = f3 >> f1; - cmpVal1(f2, 2); - - f1.x = 2; - f2.x = 1; - f1 += f2; - cmpVal1(f1, 3); - f1 -= f2; - cmpVal1(f1, 2); - f1 *= f2; - cmpVal1(f1, 2); - f1 /= f2; - cmpVal1(f1, 2); - f1 %= f2; - cmpVal1(f1, 0); - f1 &= f2; - cmpVal1(f1, 0); - f1 |= f2; - cmpVal1(f1, 1); - f1 ^= f2; - cmpVal1(f1, 0); - f1.x = 1; - f1 <<= f2; - cmpVal1(f1, 2); - f1 >>= f2; - cmpVal1(f1, 1); - - f1.x = 2; - f2 = f1++; - cmpVal1(f1, 3); - cmpVal1(f2, 2); - f2 = f1--; - cmpVal1(f2, 3); - cmpVal1(f1, 2); - f2 = ++f1; - cmpVal1(f1, 3); - cmpVal1(f2, 3); - f2 = --f1; - cmpVal1(f1, 2); - cmpVal1(f2, 2); - - f2 = ~f1; - cmpVal1(f2, (signed int)4294967293); - if (!f1 == false) { - } - - f1.x = 3; - f2.x = 4; - f3.x = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestInt2() { - int2 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f2.x = 1; - f2.y = 1; - f3 = f1 + f2; - cmpVal2(f3, 2); - f2 = f3 - f1; - cmpVal2(f2, 1); - f1 = f2 * f3; - cmpVal2(f1, 2); - f2 = f1 / f3; - cmpVal2(f2, 2 / 2); - f3 = f1 % f2; - cmpVal2(f3, 0); - f1 = f3 & f2; - cmpVal2(f1, 0); - f2 = f1 ^ f3; - cmpVal2(f2, 0); - f1.x = 1; - f1.y = 1; - f2.x = 2; - f2.y = 2; - f3 = f1 << f2; - cmpVal2(f3, 4); - f2 = f3 >> f1; - cmpVal2(f2, 2); - - f1.x = 2; - f1.y = 2; - f2.x = 1; - f2.y = 1; - f1 += f2; - cmpVal2(f1, 3); - f1 -= f2; - cmpVal2(f1, 2); - f1 *= f2; - cmpVal2(f1, 2); - f1 /= f2; - cmpVal2(f1, 2); - f1 %= f2; - cmpVal2(f1, 0); - f1 &= f2; - cmpVal2(f1, 0); - f1 |= f2; - cmpVal2(f1, 1); - f1 ^= f2; - cmpVal2(f1, 0); - f1.x = 1; - f1.y = 1; - f1 <<= f2; - cmpVal2(f1, 2); - f1 >>= f2; - cmpVal2(f1, 1); - - f1.x = 2; - f1.y = 2; - f2 = f1++; - cmpVal2(f1, 3); - cmpVal2(f2, 2); - f2 = f1--; - cmpVal2(f2, 3); - cmpVal2(f1, 2); - f2 = ++f1; - cmpVal2(f1, 3); - cmpVal2(f2, 3); - f2 = --f1; - cmpVal2(f1, 2); - cmpVal2(f2, 2); - - f2 = ~f1; - cmpVal2(f2, (signed int)4294967293); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f2.x = 4; - f2.y = 4; - f3.x = 3; - f3.y = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestInt3() { - int3 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f3 = f1 + f2; - cmpVal3(f3, 2); - f2 = f3 - f1; - cmpVal3(f2, 1); - f1 = f2 * f3; - cmpVal3(f1, 2); - f2 = f1 / f3; - cmpVal3(f2, 2 / 2); - f3 = f1 % f2; - cmpVal3(f3, 0); - f1 = f3 & f2; - cmpVal3(f1, 0); - f2 = f1 ^ f3; - cmpVal3(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f3 = f1 << f2; - cmpVal3(f3, 4); - f2 = f3 >> f1; - cmpVal3(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f1 += f2; - cmpVal3(f1, 3); - f1 -= f2; - cmpVal3(f1, 2); - f1 *= f2; - cmpVal3(f1, 2); - f1 /= f2; - cmpVal3(f1, 2); - f1 %= f2; - cmpVal3(f1, 0); - f1 &= f2; - cmpVal3(f1, 0); - f1 |= f2; - cmpVal3(f1, 1); - f1 ^= f2; - cmpVal3(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1 <<= f2; - cmpVal3(f1, 2); - f1 >>= f2; - cmpVal3(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2 = f1++; - cmpVal3(f1, 3); - cmpVal3(f2, 2); - f2 = f1--; - cmpVal3(f2, 3); - cmpVal3(f1, 2); - f2 = ++f1; - cmpVal3(f1, 3); - cmpVal3(f2, 3); - f2 = --f1; - cmpVal3(f1, 2); - cmpVal3(f2, 2); - - f2 = ~f1; - cmpVal3(f2, (signed int)4294967293); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestInt4() { - int4 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f3 = f1 + f2; - cmpVal4(f3, 2); - f2 = f3 - f1; - cmpVal4(f2, 1); - f1 = f2 * f3; - cmpVal4(f1, 2); - f2 = f1 / f3; - cmpVal4(f2, 2 / 2); - f3 = f1 % f2; - cmpVal4(f3, 0); - f1 = f3 & f2; - cmpVal4(f1, 0); - f2 = f1 ^ f3; - cmpVal4(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f2.w = 2; - f3 = f1 << f2; - cmpVal4(f3, 4); - f2 = f3 >> f1; - cmpVal4(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f1 += f2; - cmpVal4(f1, 3); - f1 -= f2; - cmpVal4(f1, 2); - f1 *= f2; - cmpVal4(f1, 2); - f1 /= f2; - cmpVal4(f1, 2); - f1 %= f2; - cmpVal4(f1, 0); - f1 &= f2; - cmpVal4(f1, 0); - f1 |= f2; - cmpVal4(f1, 1); - f1 ^= f2; - cmpVal4(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f1 <<= f2; - cmpVal4(f1, 2); - f1 >>= f2; - cmpVal4(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2 = f1++; - cmpVal4(f1, 3); - cmpVal4(f2, 2); - f2 = f1--; - cmpVal4(f2, 3); - cmpVal4(f1, 2); - f2 = ++f1; - cmpVal4(f1, 3); - cmpVal4(f2, 3); - f2 = --f1; - cmpVal4(f1, 2); - cmpVal4(f2, 2); - - f2 = ~f1; - cmpVal4(f2, (signed int)4294967293); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f2.w = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - f3.w = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestULong1() { - ulong1 f1, f2, f3; - f1.x = 1; - f2.x = 1; - f3 = f1 + f2; - cmpVal1(f3, 2); - f2 = f3 - f1; - cmpVal1(f2, 1); - f1 = f2 * f3; - cmpVal1(f1, 2); - f2 = f1 / f3; - cmpVal1(f2, 2 / 2); - f3 = f1 % f2; - cmpVal1(f3, 0); - f1 = f3 & f2; - cmpVal1(f1, 0); - f2 = f1 ^ f3; - cmpVal1(f2, 0); - f1.x = 1; - f2.x = 2; - f3 = f1 << f2; - cmpVal1(f3, 4); - f2 = f3 >> f1; - cmpVal1(f2, 2); - - f1.x = 2; - f2.x = 1; - f1 += f2; - cmpVal1(f1, 3); - f1 -= f2; - cmpVal1(f1, 2); - f1 *= f2; - cmpVal1(f1, 2); - f1 /= f2; - cmpVal1(f1, 2); - f1 %= f2; - cmpVal1(f1, 0); - f1 &= f2; - cmpVal1(f1, 0); - f1 |= f2; - cmpVal1(f1, 1); - f1 ^= f2; - cmpVal1(f1, 0); - f1.x = 1; - f1 <<= f2; - cmpVal1(f1, 2); - f1 >>= f2; - cmpVal1(f1, 1); - - f1.x = 2; - f2 = f1++; - cmpVal1(f1, 3); - cmpVal1(f2, 2); - f2 = f1--; - cmpVal1(f2, 3); - cmpVal1(f1, 2); - f2 = ++f1; - cmpVal1(f1, 3); - cmpVal1(f2, 3); - f2 = --f1; - cmpVal1(f1, 2); - cmpVal1(f2, 2); - - f2 = ~f1; - cmpVal1(f2, 18446744073709551613UL); - if (!f1 == false) { - } - - f1.x = 3; - f2.x = 4; - f3.x = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestULong2() { - ulong2 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f2.x = 1; - f2.y = 1; - f3 = f1 + f2; - cmpVal2(f3, 2); - f2 = f3 - f1; - cmpVal2(f2, 1); - f1 = f2 * f3; - cmpVal2(f1, 2); - f2 = f1 / f3; - cmpVal2(f2, 2 / 2); - f3 = f1 % f2; - cmpVal2(f3, 0); - f1 = f3 & f2; - cmpVal2(f1, 0); - f2 = f1 ^ f3; - cmpVal2(f2, 0); - f1.x = 1; - f1.y = 1; - f2.x = 2; - f2.y = 2; - f3 = f1 << f2; - cmpVal2(f3, 4); - f2 = f3 >> f1; - cmpVal2(f2, 2); - - f1.x = 2; - f1.y = 2; - f2.x = 1; - f2.y = 1; - f1 += f2; - cmpVal2(f1, 3); - f1 -= f2; - cmpVal2(f1, 2); - f1 *= f2; - cmpVal2(f1, 2); - f1 /= f2; - cmpVal2(f1, 2); - f1 %= f2; - cmpVal2(f1, 0); - f1 &= f2; - cmpVal2(f1, 0); - f1 |= f2; - cmpVal2(f1, 1); - f1 ^= f2; - cmpVal2(f1, 0); - f1.x = 1; - f1.y = 1; - f1 <<= f2; - cmpVal2(f1, 2); - f1 >>= f2; - cmpVal2(f1, 1); - - f1.x = 2; - f1.y = 2; - f2 = f1++; - cmpVal2(f1, 3); - cmpVal2(f2, 2); - f2 = f1--; - cmpVal2(f2, 3); - cmpVal2(f1, 2); - f2 = ++f1; - cmpVal2(f1, 3); - cmpVal2(f2, 3); - f2 = --f1; - cmpVal2(f1, 2); - cmpVal2(f2, 2); - - f2 = ~f1; - cmpVal2(f2, 18446744073709551613UL); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f2.x = 4; - f2.y = 4; - f3.x = 3; - f3.y = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestULong3() { - ulong3 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f3 = f1 + f2; - cmpVal3(f3, 2); - f2 = f3 - f1; - cmpVal3(f2, 1); - f1 = f2 * f3; - cmpVal3(f1, 2); - f2 = f1 / f3; - cmpVal3(f2, 2 / 2); - f3 = f1 % f2; - cmpVal3(f3, 0); - f1 = f3 & f2; - cmpVal3(f1, 0); - f2 = f1 ^ f3; - cmpVal3(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f3 = f1 << f2; - cmpVal3(f3, 4); - f2 = f3 >> f1; - cmpVal3(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f1 += f2; - cmpVal3(f1, 3); - f1 -= f2; - cmpVal3(f1, 2); - f1 *= f2; - cmpVal3(f1, 2); - f1 /= f2; - cmpVal3(f1, 2); - f1 %= f2; - cmpVal3(f1, 0); - f1 &= f2; - cmpVal3(f1, 0); - f1 |= f2; - cmpVal3(f1, 1); - f1 ^= f2; - cmpVal3(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1 <<= f2; - cmpVal3(f1, 2); - f1 >>= f2; - cmpVal3(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2 = f1++; - cmpVal3(f1, 3); - cmpVal3(f2, 2); - f2 = f1--; - cmpVal3(f2, 3); - cmpVal3(f1, 2); - f2 = ++f1; - cmpVal3(f1, 3); - cmpVal3(f2, 3); - f2 = --f1; - cmpVal3(f1, 2); - cmpVal3(f2, 2); - - f2 = ~f1; - cmpVal3(f2, 18446744073709551613UL); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestULong4() { - ulong4 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f3 = f1 + f2; - cmpVal4(f3, 2); - f2 = f3 - f1; - cmpVal4(f2, 1); - f1 = f2 * f3; - cmpVal4(f1, 2); - f2 = f1 / f3; - cmpVal4(f2, 2 / 2); - f3 = f1 % f2; - cmpVal4(f3, 0); - f1 = f3 & f2; - cmpVal4(f1, 0); - f2 = f1 ^ f3; - cmpVal4(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f2.w = 2; - f3 = f1 << f2; - cmpVal4(f3, 4); - f2 = f3 >> f1; - cmpVal4(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f1 += f2; - cmpVal4(f1, 3); - f1 -= f2; - cmpVal4(f1, 2); - f1 *= f2; - cmpVal4(f1, 2); - f1 /= f2; - cmpVal4(f1, 2); - f1 %= f2; - cmpVal4(f1, 0); - f1 &= f2; - cmpVal4(f1, 0); - f1 |= f2; - cmpVal4(f1, 1); - f1 ^= f2; - cmpVal4(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f1 <<= f2; - cmpVal4(f1, 2); - f1 >>= f2; - cmpVal4(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2 = f1++; - cmpVal4(f1, 3); - cmpVal4(f2, 2); - f2 = f1--; - cmpVal4(f2, 3); - cmpVal4(f1, 2); - f2 = ++f1; - cmpVal4(f1, 3); - cmpVal4(f2, 3); - f2 = --f1; - cmpVal4(f1, 2); - cmpVal4(f2, 2); - - f2 = ~f1; - cmpVal4(f2, 18446744073709551613UL); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f2.w = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - f3.w = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestLong1() { - long1 f1, f2, f3; - f1.x = 1; - f2.x = 1; - f3 = f1 + f2; - cmpVal1(f3, 2); - f2 = f3 - f1; - cmpVal1(f2, 1); - f1 = f2 * f3; - cmpVal1(f1, 2); - f2 = f1 / f3; - cmpVal1(f2, 2 / 2); - f3 = f1 % f2; - cmpVal1(f3, 0); - f1 = f3 & f2; - cmpVal1(f1, 0); - f2 = f1 ^ f3; - cmpVal1(f2, 0); - f1.x = 1; - f2.x = 2; - f3 = f1 << f2; - cmpVal1(f3, 4); - f2 = f3 >> f1; - cmpVal1(f2, 2); - - f1.x = 2; - f2.x = 1; - f1 += f2; - cmpVal1(f1, 3); - f1 -= f2; - cmpVal1(f1, 2); - f1 *= f2; - cmpVal1(f1, 2); - f1 /= f2; - cmpVal1(f1, 2); - f1 %= f2; - cmpVal1(f1, 0); - f1 &= f2; - cmpVal1(f1, 0); - f1 |= f2; - cmpVal1(f1, 1); - f1 ^= f2; - cmpVal1(f1, 0); - f1.x = 1; - f1 <<= f2; - cmpVal1(f1, 2); - f1 >>= f2; - cmpVal1(f1, 1); - - f1.x = 2; - f2 = f1++; - cmpVal1(f1, 3); - cmpVal1(f2, 2); - f2 = f1--; - cmpVal1(f2, 3); - cmpVal1(f1, 2); - f2 = ++f1; - cmpVal1(f1, 3); - cmpVal1(f2, 3); - f2 = --f1; - cmpVal1(f1, 2); - cmpVal1(f2, 2); - - f2 = ~f1; - cmpVal1(f2, -3); - if (!f1 == false) { - } - - f1.x = 3; - f2.x = 4; - f3.x = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestLong2() { - long2 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f2.x = 1; - f2.y = 1; - f3 = f1 + f2; - cmpVal2(f3, 2); - f2 = f3 - f1; - cmpVal2(f2, 1); - f1 = f2 * f3; - cmpVal2(f1, 2); - f2 = f1 / f3; - cmpVal2(f2, 2 / 2); - f3 = f1 % f2; - cmpVal2(f3, 0); - f1 = f3 & f2; - cmpVal2(f1, 0); - f2 = f1 ^ f3; - cmpVal2(f2, 0); - f1.x = 1; - f1.y = 1; - f2.x = 2; - f2.y = 2; - f3 = f1 << f2; - cmpVal2(f3, 4); - f2 = f3 >> f1; - cmpVal2(f2, 2); - - f1.x = 2; - f1.y = 2; - f2.x = 1; - f2.y = 1; - f1 += f2; - cmpVal2(f1, 3); - f1 -= f2; - cmpVal2(f1, 2); - f1 *= f2; - cmpVal2(f1, 2); - f1 /= f2; - cmpVal2(f1, 2); - f1 %= f2; - cmpVal2(f1, 0); - f1 &= f2; - cmpVal2(f1, 0); - f1 |= f2; - cmpVal2(f1, 1); - f1 ^= f2; - cmpVal2(f1, 0); - f1.x = 1; - f1.y = 1; - f1 <<= f2; - cmpVal2(f1, 2); - f1 >>= f2; - cmpVal2(f1, 1); - - f1.x = 2; - f1.y = 2; - f2 = f1++; - cmpVal2(f1, 3); - cmpVal2(f2, 2); - f2 = f1--; - cmpVal2(f2, 3); - cmpVal2(f1, 2); - f2 = ++f1; - cmpVal2(f1, 3); - cmpVal2(f2, 3); - f2 = --f1; - cmpVal2(f1, 2); - cmpVal2(f2, 2); - - f2 = ~f1; - cmpVal2(f2, -3); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f2.x = 4; - f2.y = 4; - f3.x = 3; - f3.y = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestLong3() { - long3 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f3 = f1 + f2; - cmpVal3(f3, 2); - f2 = f3 - f1; - cmpVal3(f2, 1); - f1 = f2 * f3; - cmpVal3(f1, 2); - f2 = f1 / f3; - cmpVal3(f2, 2 / 2); - f3 = f1 % f2; - cmpVal3(f3, 0); - f1 = f3 & f2; - cmpVal3(f1, 0); - f2 = f1 ^ f3; - cmpVal3(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f3 = f1 << f2; - cmpVal3(f3, 4); - f2 = f3 >> f1; - cmpVal3(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f1 += f2; - cmpVal3(f1, 3); - f1 -= f2; - cmpVal3(f1, 2); - f1 *= f2; - cmpVal3(f1, 2); - f1 /= f2; - cmpVal3(f1, 2); - f1 %= f2; - cmpVal3(f1, 0); - f1 &= f2; - cmpVal3(f1, 0); - f1 |= f2; - cmpVal3(f1, 1); - f1 ^= f2; - cmpVal3(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1 <<= f2; - cmpVal3(f1, 2); - f1 >>= f2; - cmpVal3(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2 = f1++; - cmpVal3(f1, 3); - cmpVal3(f2, 2); - f2 = f1--; - cmpVal3(f2, 3); - cmpVal3(f1, 2); - f2 = ++f1; - cmpVal3(f1, 3); - cmpVal3(f2, 3); - f2 = --f1; - cmpVal3(f1, 2); - cmpVal3(f2, 2); - - f2 = ~f1; - cmpVal3(f2, -3); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestLong4() { - long4 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f3 = f1 + f2; - cmpVal4(f3, 2); - f2 = f3 - f1; - cmpVal4(f2, 1); - f1 = f2 * f3; - cmpVal4(f1, 2); - f2 = f1 / f3; - cmpVal4(f2, 2 / 2); - f3 = f1 % f2; - cmpVal4(f3, 0); - f1 = f3 & f2; - cmpVal4(f1, 0); - f2 = f1 ^ f3; - cmpVal4(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f2.w = 2; - f3 = f1 << f2; - cmpVal4(f3, 4); - f2 = f3 >> f1; - cmpVal4(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f1 += f2; - cmpVal4(f1, 3); - f1 -= f2; - cmpVal4(f1, 2); - f1 *= f2; - cmpVal4(f1, 2); - f1 /= f2; - cmpVal4(f1, 2); - f1 %= f2; - cmpVal4(f1, 0); - f1 &= f2; - cmpVal4(f1, 0); - f1 |= f2; - cmpVal4(f1, 1); - f1 ^= f2; - cmpVal4(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f1 <<= f2; - cmpVal4(f1, 2); - f1 >>= f2; - cmpVal4(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2 = f1++; - cmpVal4(f1, 3); - cmpVal4(f2, 2); - f2 = f1--; - cmpVal4(f2, 3); - cmpVal4(f1, 2); - f2 = ++f1; - cmpVal4(f1, 3); - cmpVal4(f2, 3); - f2 = --f1; - cmpVal4(f1, 2); - cmpVal4(f2, 2); - - f2 = ~f1; - cmpVal4(f2, -3); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f2.w = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - f3.w = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - - -__device__ bool TestFloat1() { - float1 f1, f2, f3; - // float1 f4(1); - // cmpVal1(f4, 1.0f); - // float1 f5(2.0f); - // cmpVal1(f5, 2.0f); - f1.x = 1.0f; - f2.x = 1.0f; - f3 = f1 + f2; - cmpVal1(f3, 2.0f); - f2 = f3 - f1; - cmpVal1(f2, 1.0f); - f1 = f2 * f3; - cmpVal1(f1, 2.0f); - f2 = f1 / f3; - cmpVal1(f2, 2.0f / 2.0f); - f1 += f2; - cmpVal1(f1, 3.0f); - f1 -= f2; - cmpVal1(f1, 2.0f); - f1 *= f2; - cmpVal1(f1, 2.0f); - f1 /= f2; - cmpVal1(f1, 2.0f); - f2 = f1++; - cmpVal1(f1, 3.0f); - cmpVal1(f2, 2.0f); - f2 = f1--; - cmpVal1(f2, 3.0f); - cmpVal1(f1, 2.0f); - f2 = ++f1; - cmpVal1(f1, 3.0f); - cmpVal1(f2, 3.0f); - f2 = --f1; - cmpVal1(f1, 2.0f); - cmpVal1(f1, 2.0f); - - f1.x = 3.0f; - f2.x = 4.0f; - f3.x = 3.0f; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - return true; -} - -__device__ bool TestFloat2() { - float2 f1, f2, f3; - f1.x = 1.0f; - f1.y = 1.0f; - f2.x = 1.0f; - f2.y = 1.0f; - f3 = f1 + f2; - cmpVal2(f3, 2.0f); - f2 = f3 - f1; - cmpVal2(f2, 1.0f); - f1 = f2 * f3; - cmpVal2(f1, 2.0f); - f2 = f1 / f3; - cmpVal2(f2, 2.0f / 2.0f); - f1 += f2; - cmpVal2(f1, 3.0f); - f1 -= f2; - cmpVal2(f1, 2.0f); - f1 *= f2; - cmpVal2(f1, 2.0f); - f1 /= f2; - cmpVal2(f1, 2.0f); - - f2 = f1++; - cmpVal2(f1, 3.0f); - cmpVal2(f2, 2.0f); - f2 = f1--; - cmpVal2(f2, 3.0f); - cmpVal2(f1, 2.0f); - f2 = ++f1; - cmpVal2(f1, 3.0f); - cmpVal2(f2, 3.0f); - f2 = --f1; - cmpVal2(f1, 2.0f); - cmpVal2(f1, 2.0f); - - f1.x = 3.0f; - f1.y = 3.0f; - f2.x = 4.0f; - f2.y = 4.0f; - f3.x = 3.0f; - f3.y = 3.0f; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - - return true; -} - -__device__ bool TestFloat3() { - float3 f1, f2, f3; - f1.x = 1.0f; - f1.y = 1.0f; - f1.z = 1.0f; - f2.x = 1.0f; - f2.y = 1.0f; - f2.z = 1.0f; - f3 = f1 + f2; - cmpVal3(f3, 2.0f); - f2 = f3 - f1; - cmpVal3(f2, 1.0f); - f1 = f2 * f3; - cmpVal3(f1, 2.0f); - f2 = f1 / f3; - cmpVal3(f2, 2.0f / 2.0f); - f1 += f2; - cmpVal3(f1, 3.0f); - f1 -= f2; - cmpVal3(f1, 2.0f); - f1 *= f2; - cmpVal3(f1, 2.0f); - f1 /= f2; - f2 = f1++; - cmpVal3(f1, 3.0f); - cmpVal3(f2, 2.0f); - f2 = f1--; - cmpVal3(f2, 3.0f); - cmpVal3(f1, 2.0f); - f2 = ++f1; - cmpVal3(f1, 3.0f); - cmpVal3(f2, 3.0f); - f2 = --f1; - cmpVal3(f1, 2.0f); - cmpVal3(f1, 2.0f); - - f1.x = 3.0f; - f1.y = 3.0f; - f1.z = 3.0f; - f2.x = 4.0f; - f2.y = 4.0f; - f2.z = 4.0f; - f3.x = 3.0f; - f3.y = 3.0f; - f3.z = 3.0f; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - - return true; -} - - -__device__ bool TestFloat4() { - float4 f1, f2, f3; - f1.x = 1.0f; - f1.y = 1.0f; - f1.z = 1.0f; - f1.w = 1.0f; - f2.x = 1.0f; - f2.y = 1.0f; - f2.z = 1.0f; - f2.w = 1.0f; - f3 = f1 + f2; - cmpVal4(f3, 2.0f); - f2 = f3 - f1; - cmpVal4(f2, 1.0f); - f1 = f2 * f3; - cmpVal4(f1, 2.0f); - f2 = f1 / f3; - cmpVal4(f2, 2.0f / 2.0f); - f1 += f2; - cmpVal4(f1, 3.0f); - f1 -= f2; - cmpVal4(f1, 2.0f); - f1 *= f2; - cmpVal4(f1, 2.0f); - f1 /= f2; - f2 = f1++; - cmpVal4(f1, 3.0f); - cmpVal4(f2, 2.0f); - f2 = f1--; - cmpVal4(f2, 3.0f); - cmpVal4(f1, 2.0f); - f2 = ++f1; - cmpVal4(f1, 3.0f); - cmpVal4(f2, 3.0f); - f2 = --f1; - cmpVal4(f1, 2.0f); - cmpVal4(f1, 2.0f); - - f1.x = 3.0f; - f1.y = 3.0f; - f1.z = 3.0f; - f1.w = 3.0f; - f2.x = 4.0f; - f2.y = 4.0f; - f2.z = 4.0f; - f2.w = 4.0f; - f3.x = 3.0f; - f3.y = 3.0f; - f3.z = 3.0f; - f3.w = 3.0f; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - return true; -} - -__device__ bool TestULongLong1() { - ulonglong1 f1, f2, f3; - f1.x = 1; - f2.x = 1; - f3 = f1 + f2; - cmpVal1(f3, 2); - f2 = f3 - f1; - cmpVal1(f2, 1); - f1 = f2 * f3; - cmpVal1(f1, 2); - f2 = f1 / f3; - cmpVal1(f2, 2 / 2); - f3 = f1 % f2; - cmpVal1(f3, 0); - f1 = f3 & f2; - cmpVal1(f1, 0); - f2 = f1 ^ f3; - cmpVal1(f2, 0); - f1.x = 1; - f2.x = 2; - f3 = f1 << f2; - cmpVal1(f3, 4); - f2 = f3 >> f1; - cmpVal1(f2, 2); - - f1.x = 2; - f2.x = 1; - f1 += f2; - cmpVal1(f1, 3); - f1 -= f2; - cmpVal1(f1, 2); - f1 *= f2; - cmpVal1(f1, 2); - f1 /= f2; - cmpVal1(f1, 2); - f1 %= f2; - cmpVal1(f1, 0); - f1 &= f2; - cmpVal1(f1, 0); - f1 |= f2; - cmpVal1(f1, 1); - f1 ^= f2; - cmpVal1(f1, 0); - f1.x = 1; - f1 <<= f2; - cmpVal1(f1, 2); - f1 >>= f2; - cmpVal1(f1, 1); - - f1.x = 2; - f2 = f1++; - cmpVal1(f1, 3); - cmpVal1(f2, 2); - f2 = f1--; - cmpVal1(f2, 3); - cmpVal1(f1, 2); - f2 = ++f1; - cmpVal1(f1, 3); - cmpVal1(f2, 3); - f2 = --f1; - cmpVal1(f1, 2); - cmpVal1(f2, 2); - - f2 = ~f1; - cmpVal1(f2, -3); - if (!f1 == false) { - } - - f1.x = 3; - f2.x = 4; - f3.x = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - - -__device__ bool TestULongLong2() { - ulonglong2 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f2.x = 1; - f2.y = 1; - f3 = f1 + f2; - cmpVal2(f3, 2); - f2 = f3 - f1; - cmpVal2(f2, 1); - f1 = f2 * f3; - cmpVal2(f1, 2); - f2 = f1 / f3; - cmpVal2(f2, 2 / 2); - f3 = f1 % f2; - cmpVal2(f3, 0); - f1 = f3 & f2; - cmpVal2(f1, 0); - f2 = f1 ^ f3; - cmpVal2(f2, 0); - f1.x = 1; - f1.y = 1; - f2.x = 2; - f2.y = 2; - f3 = f1 << f2; - cmpVal2(f3, 4); - f2 = f3 >> f1; - cmpVal2(f2, 2); - - f1.x = 2; - f1.y = 2; - f2.x = 1; - f2.y = 1; - f1 += f2; - cmpVal2(f1, 3); - f1 -= f2; - cmpVal2(f1, 2); - f1 *= f2; - cmpVal2(f1, 2); - f1 /= f2; - cmpVal2(f1, 2); - f1 %= f2; - cmpVal2(f1, 0); - f1 &= f2; - cmpVal2(f1, 0); - f1 |= f2; - cmpVal2(f1, 1); - f1 ^= f2; - cmpVal2(f1, 0); - f1.x = 1; - f1.y = 1; - f1 <<= f2; - cmpVal2(f1, 2); - f1 >>= f2; - cmpVal2(f1, 1); - - f1.x = 2; - f1.y = 2; - f2 = f1++; - cmpVal2(f1, 3); - cmpVal2(f2, 2); - f2 = f1--; - cmpVal2(f2, 3); - cmpVal2(f1, 2); - f2 = ++f1; - cmpVal2(f1, 3); - cmpVal2(f2, 3); - f2 = --f1; - cmpVal2(f1, 2); - cmpVal2(f2, 2); - - f2 = ~f1; - cmpVal2(f2, -3); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f2.x = 4; - f2.y = 4; - f3.x = 3; - f3.y = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestULongLong3() { - ulonglong3 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f3 = f1 + f2; - cmpVal3(f3, 2); - f2 = f3 - f1; - cmpVal3(f2, 1); - f1 = f2 * f3; - cmpVal3(f1, 2); - f2 = f1 / f3; - cmpVal3(f2, 2 / 2); - f3 = f1 % f2; - cmpVal3(f3, 0); - f1 = f3 & f2; - cmpVal3(f1, 0); - f2 = f1 ^ f3; - cmpVal3(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f3 = f1 << f2; - cmpVal3(f3, 4); - f2 = f3 >> f1; - cmpVal3(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f1 += f2; - cmpVal3(f1, 3); - f1 -= f2; - cmpVal3(f1, 2); - f1 *= f2; - cmpVal3(f1, 2); - f1 /= f2; - cmpVal3(f1, 2); - f1 %= f2; - cmpVal3(f1, 0); - f1 &= f2; - cmpVal3(f1, 0); - f1 |= f2; - cmpVal3(f1, 1); - f1 ^= f2; - cmpVal3(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1 <<= f2; - cmpVal3(f1, 2); - f1 >>= f2; - cmpVal3(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f2 = f1++; - cmpVal3(f1, 3); - cmpVal3(f2, 2); - f2 = f1--; - cmpVal3(f2, 3); - cmpVal3(f1, 2); - f2 = ++f1; - cmpVal3(f1, 3); - cmpVal3(f2, 3); - f2 = --f1; - cmpVal3(f1, 2); - cmpVal3(f2, 2); - - f2 = ~f1; - cmpVal3(f2, -3); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - -__device__ bool TestULongLong4() { - ulonglong4 f1, f2, f3; - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f3 = f1 + f2; - cmpVal4(f3, 2); - f2 = f3 - f1; - cmpVal4(f2, 1); - f1 = f2 * f3; - cmpVal4(f1, 2); - f2 = f1 / f3; - cmpVal4(f2, 2 / 2); - f3 = f1 % f2; - cmpVal4(f3, 0); - f1 = f3 & f2; - cmpVal4(f1, 0); - f2 = f1 ^ f3; - cmpVal4(f2, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f2.x = 2; - f2.y = 2; - f2.z = 2; - f2.w = 2; - f3 = f1 << f2; - cmpVal4(f3, 4); - f2 = f3 >> f1; - cmpVal4(f2, 2); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2.x = 1; - f2.y = 1; - f2.z = 1; - f2.w = 1; - f1 += f2; - cmpVal4(f1, 3); - f1 -= f2; - cmpVal4(f1, 2); - f1 *= f2; - cmpVal4(f1, 2); - f1 /= f2; - cmpVal4(f1, 2); - f1 %= f2; - cmpVal4(f1, 0); - f1 &= f2; - cmpVal4(f1, 0); - f1 |= f2; - cmpVal4(f1, 1); - f1 ^= f2; - cmpVal4(f1, 0); - f1.x = 1; - f1.y = 1; - f1.z = 1; - f1.w = 1; - f1 <<= f2; - cmpVal4(f1, 2); - f1 >>= f2; - cmpVal4(f1, 1); - - f1.x = 2; - f1.y = 2; - f1.z = 2; - f1.w = 2; - f2 = f1++; - cmpVal4(f1, 3); - cmpVal4(f2, 2); - f2 = f1--; - cmpVal4(f2, 3); - cmpVal4(f1, 2); - f2 = ++f1; - cmpVal4(f1, 3); - cmpVal4(f2, 3); - f2 = --f1; - cmpVal4(f1, 2); - cmpVal4(f2, 2); - - f2 = ~f1; - cmpVal4(f2, -3); - if (!f1 == false) { - } - - f1.x = 3; - f1.y = 3; - f1.z = 3; - f1.w = 3; - f2.x = 4; - f2.y = 4; - f2.z = 4; - f2.w = 4; - f3.x = 3; - f3.y = 3; - f3.z = 3; - f3.w = 3; - if ((f1 == f2) == false) { - } - if ((f1 != f2) == true) { - } - if ((f1 < f2) == true) { - } - if ((f2 > f1) == true) { - } - if ((f1 >= f3) == true) { - } - if ((f1 <= f3) == true) { - } - - if ((f1 && f2) == true) { - } - if ((f1 || f2) == true) { - } - return true; -} - - -__global__ void CheckVectorTypes(hipLaunchParm lp, bool* ptr) { - if (TestFloat1() && TestFloat2() && TestFloat3() && TestFloat4() && TestUChar1() && - TestUChar2() && TestUChar3() && TestUChar4() && TestChar1() && TestChar2() && TestChar3() && - TestChar4() && TestUShort1() && TestUShort2() && TestUShort3() && TestUShort4() && - TestShort1() && TestShort2() && TestShort3() && TestShort4() && TestUInt1() && - TestUInt2() && TestUInt3() && TestUInt4() && TestInt1() && TestInt2() && TestInt3() && - TestInt4() && TestULong1() && TestULong2() && TestULong3() && TestULong4() && TestLong1() && - TestLong2() && TestLong3() && TestLong4() && TestULongLong1() && TestULongLong2() && - TestULongLong3() && TestULongLong4() == true) { - ptr[0] = true; - } +__global__ +void CheckVectorTypes(bool* ptr) { + ptr[0] = TestVectorTypes< + char1, char2, char3, char4, + uchar1, uchar2, uchar3, uchar4, + short1, short2, short3, short4, + ushort1, ushort2, ushort3, ushort4, + int1, int2, int3, int4, + uint1, uint2, uint3, uint4, + long1, long2, long3, long4, + ulong1, ulong2, ulong3, ulong4, + longlong1, longlong2, longlong3, longlong4, + ulonglong1, ulonglong2, ulonglong3, ulonglong4, + float1, float2, float3, float4, + double1, double2, double3, double4>(); } int main() { - assert(sizeof(float1) == 4); - assert(sizeof(float2) == 8); - assert(sizeof(float3) == 12); - assert(sizeof(float4) == 16); + static_assert(sizeof(float1) == 4, ""); + static_assert(sizeof(float2) >= 8, ""); + static_assert(sizeof(float3) >= 12, ""); + static_assert(sizeof(float4) >= 16, ""); bool* ptr = nullptr; if (hipMalloc(&ptr, sizeof(bool)) != HIP_SUCCESS) return EXIT_FAILURE; - std::unique_ptr correct{ptr, hipFree}; - hipLaunchKernel(CheckVectorTypes, dim3(1, 1, 1), dim3(1, 1, 1), 0, 0, correct.get()); - bool passed = false; + unique_ptr correct{ptr, hipFree}; + hipLaunchKernelGGL( + CheckVectorTypes, dim3(1, 1, 1), dim3(1, 1, 1), 0, 0, correct.get()); + bool passed = true; if (hipMemcpyDtoH(&passed, correct.get(), sizeof(bool)) != HIP_SUCCESS) { return EXIT_FAILURE; } if (passed == true) { - std::cout << "PASSED" << std::endl; - return 0; - } else - return EXIT_FAILURE; -} + passed(); + } + else { + failed("Failed some vector test."); + } +} \ No newline at end of file diff --git a/projects/hip/tests/src/deviceLib/vector_test_common.h b/projects/hip/tests/src/deviceLib/vector_test_common.h new file mode 100644 index 0000000000..d5bc4c57a2 --- /dev/null +++ b/projects/hip/tests/src/deviceLib/vector_test_common.h @@ -0,0 +1,105 @@ +/* +Copyright (c) 2015-2017 Advanced Micro Devices, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ +#pragma once + +#include + +template +using Enable_if_t = typename std::enable_if::type; + +__host__ __device__ +std::false_type is_vec4(...); +__host__ __device__ +std::false_type is_vec3(...); +__host__ __device__ +std::false_type is_vec2(...); +__host__ __device__ +std::false_type is_vec1(...); + +template +__host__ __device__ +auto is_vec4(const T&) -> decltype(std::declval().xyzw, std::true_type{}); +template< + typename T, Enable_if_t())){}>* = nullptr> +__host__ __device__ +auto is_vec3(const T&) -> decltype(std::declval().xyz, std::true_type{}); +template< + typename T, + Enable_if_t< + !decltype(is_vec4(std::declval())){} && + !decltype(is_vec3(std::declval())){}>* = nullptr> +__host__ __device__ +auto is_vec2(const T&) -> decltype(std::declval().xy, std::true_type{}); +template< + typename T, + Enable_if_t< + !decltype(is_vec4(std::declval())){} && + !decltype(is_vec3(std::declval())){} && + !decltype(is_vec2(std::declval())){}>* = nullptr> +__host__ __device__ +auto is_vec1(const T&) -> decltype(std::declval().x, std::true_type{}); + +template +__host__ __device__ +constexpr +bool is_vec() { + return (dimension == 1) ? decltype(is_vec1(std::declval())){} : + ((dimension == 2) ? decltype(is_vec2(std::declval())){} : + ((dimension == 3) ? decltype(is_vec3(std::declval())){} : + decltype(is_vec4(std::declval())){})); +} + +template()>* = nullptr> +__host__ __device__ +inline +bool cmp(const T& x, U expected) { + const auto r = x == T(expected); + + return r.x != 0; +} + +template()>* = nullptr> +__host__ __device__ +inline +bool cmp(const T& x, U expected) { + const auto r = x == T(expected); + + return r.x != 0 && r.y != 0; +} + +template()>* = nullptr> +__host__ __device__ +inline +bool cmp(const T& x, U expected) { + const auto r = x == T(expected); + + return r.x != 0 && r.y != 0 && r.z != 0; +} + +template()>* = nullptr> +__host__ __device__ +inline +bool cmp(const T& x, U expected) { + const auto r = x == T(expected); + + return r.x != 0 && r.y != 0 && r.z != 0 && r.w != 0; +} \ No newline at end of file