diff --git a/builtins/util.m4 b/builtins/util.m4 index 4bdc501b..a991ae09 100644 --- a/builtins/util.m4 +++ b/builtins/util.m4 @@ -50,11 +50,11 @@ define(`MASK_HIGH_BIT_ON', ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; vector convertation utilities -;; convert 1-wide vector into 8-wide vector +;; convert vector of one width into vector of other width ;; ;; $1: vector element type -;; $2: 1-wide vector -;; $3: 8-wide vector +;; $2: vector of the first width +;; $3: vector of the second width define(`convert1to8', ` @@ -129,13 +129,6 @@ define(`convert16to32', ` i32 undef, i32 undef, i32 undef, i32 undef> ') -;; convert 4-wide vector into 8-wide vector -;; -;; $1: vector element type -;; $2: 8-wide vector -;; $3: 1-wide vector - - define(`convert8to1', ` $3 = shufflevector <8 x $1> $2, <8 x $1> undef, <1 x i32> @@ -212,7 +205,6 @@ ifelse(WIDTH, `4', `<$1 $2, $1 $2, $1 $2, $1 $2>', ;; $1: {add,sub} (used in constructing function names) define(`saturation_arithmetic_novec_universal', ` -declare <16 x i8> @llvm.x86.sse2.p$1s.b(<16 x i8>, <16 x i8>) nounwind readnone define @__p$1s_vi8(, ) { %v0_i16 = sext %0 to %v1_i16 = sext %1 to @@ -225,7 +217,6 @@ define @__p$1s_vi8(, ) { ret %ret } -declare <8 x i16> @llvm.x86.sse2.p$1s.w(<8 x i16>, <8 x i16>) nounwind readnone define @__p$1s_vi16(, ) { %v0_i32 = sext %0 to %v1_i32 = sext %1 to @@ -238,7 +229,6 @@ define @__p$1s_vi16(, ) { ret %ret } -declare <16 x i8> @llvm.x86.sse2.p$1us.b(<16 x i8>, <16 x i8>) nounwind readnone define @__p$1us_vi8(, ) { %v0_i16 = zext %0 to %v1_i16 = zext %1 to @@ -251,7 +241,6 @@ define @__p$1us_vi8(, ) { ret %ret } -declare <8 x i16> @llvm.x86.sse2.p$1us.w(<8 x i16>, <8 x i16>) nounwind readnone define @__p$1us_vi16(, ) { %v0_i32 = zext %0 to %v1_i32 = zext %1 to diff --git a/stdlib.ispc b/stdlib.ispc index f977abf8..9bb13f4e 100644 --- a/stdlib.ispc +++ b/stdlib.ispc @@ -58,15 +58,6 @@ #endif /* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32768) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483648) -#endif #ifndef INT8_MAX #define INT8_MAX (127) #endif @@ -76,6 +67,9 @@ #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif +#ifndef INT64_MAX +#define INT64_MAX (9223372036854775807) +#endif #ifndef UINT8_MAX #define UINT8_MAX (255) #endif @@ -85,6 +79,21 @@ #ifndef UINT32_MAX #define UINT32_MAX (4294967295) #endif +#ifndef UINT64_MAX +#define UINT64_MAX (18446744073709551615) +#endif +#ifndef INT8_MIN +#define INT8_MIN (-INT8_MAX - 1) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-INT16_MAX - 1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-INT32_MAX - 1) +#endif +#ifndef INT64_MIN +#define INT64_MIN (-INT64_MAX - 1) +#endif /////////////////////////////////////////////////////////////////////////// // Low level primitives