Some errors in comments and code were fixed
This commit is contained in:
@@ -50,11 +50,11 @@ define(`MASK_HIGH_BIT_ON',
|
|||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
;; vector convertation utilities
|
;; 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
|
;; $1: vector element type
|
||||||
;; $2: 1-wide vector
|
;; $2: vector of the first width
|
||||||
;; $3: 8-wide vector
|
;; $3: vector of the second width
|
||||||
|
|
||||||
|
|
||||||
define(`convert1to8', `
|
define(`convert1to8', `
|
||||||
@@ -129,13 +129,6 @@ define(`convert16to32', `
|
|||||||
i32 undef, i32 undef, i32 undef, i32 undef>
|
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', `
|
define(`convert8to1', `
|
||||||
$3 = shufflevector <8 x $1> $2, <8 x $1> undef,
|
$3 = shufflevector <8 x $1> $2, <8 x $1> undef,
|
||||||
<1 x i32> <i32 0>
|
<1 x i32> <i32 0>
|
||||||
@@ -212,7 +205,6 @@ ifelse(WIDTH, `4', `<$1 $2, $1 $2, $1 $2, $1 $2>',
|
|||||||
;; $1: {add,sub} (used in constructing function names)
|
;; $1: {add,sub} (used in constructing function names)
|
||||||
|
|
||||||
define(`saturation_arithmetic_novec_universal', `
|
define(`saturation_arithmetic_novec_universal', `
|
||||||
declare <16 x i8> @llvm.x86.sse2.p$1s.b(<16 x i8>, <16 x i8>) nounwind readnone
|
|
||||||
define <WIDTH x i8> @__p$1s_vi8(<WIDTH x i8>, <WIDTH x i8>) {
|
define <WIDTH x i8> @__p$1s_vi8(<WIDTH x i8>, <WIDTH x i8>) {
|
||||||
%v0_i16 = sext <WIDTH x i8> %0 to <WIDTH x i16>
|
%v0_i16 = sext <WIDTH x i8> %0 to <WIDTH x i16>
|
||||||
%v1_i16 = sext <WIDTH x i8> %1 to <WIDTH x i16>
|
%v1_i16 = sext <WIDTH x i8> %1 to <WIDTH x i16>
|
||||||
@@ -225,7 +217,6 @@ define <WIDTH x i8> @__p$1s_vi8(<WIDTH x i8>, <WIDTH x i8>) {
|
|||||||
ret <WIDTH x i8> %ret
|
ret <WIDTH x i8> %ret
|
||||||
}
|
}
|
||||||
|
|
||||||
declare <8 x i16> @llvm.x86.sse2.p$1s.w(<8 x i16>, <8 x i16>) nounwind readnone
|
|
||||||
define <WIDTH x i16> @__p$1s_vi16(<WIDTH x i16>, <WIDTH x i16>) {
|
define <WIDTH x i16> @__p$1s_vi16(<WIDTH x i16>, <WIDTH x i16>) {
|
||||||
%v0_i32 = sext <WIDTH x i16> %0 to <WIDTH x i32>
|
%v0_i32 = sext <WIDTH x i16> %0 to <WIDTH x i32>
|
||||||
%v1_i32 = sext <WIDTH x i16> %1 to <WIDTH x i32>
|
%v1_i32 = sext <WIDTH x i16> %1 to <WIDTH x i32>
|
||||||
@@ -238,7 +229,6 @@ define <WIDTH x i16> @__p$1s_vi16(<WIDTH x i16>, <WIDTH x i16>) {
|
|||||||
ret <WIDTH x i16> %ret
|
ret <WIDTH x i16> %ret
|
||||||
}
|
}
|
||||||
|
|
||||||
declare <16 x i8> @llvm.x86.sse2.p$1us.b(<16 x i8>, <16 x i8>) nounwind readnone
|
|
||||||
define <WIDTH x i8> @__p$1us_vi8(<WIDTH x i8>, <WIDTH x i8>) {
|
define <WIDTH x i8> @__p$1us_vi8(<WIDTH x i8>, <WIDTH x i8>) {
|
||||||
%v0_i16 = zext <WIDTH x i8> %0 to <WIDTH x i16>
|
%v0_i16 = zext <WIDTH x i8> %0 to <WIDTH x i16>
|
||||||
%v1_i16 = zext <WIDTH x i8> %1 to <WIDTH x i16>
|
%v1_i16 = zext <WIDTH x i8> %1 to <WIDTH x i16>
|
||||||
@@ -251,7 +241,6 @@ define <WIDTH x i8> @__p$1us_vi8(<WIDTH x i8>, <WIDTH x i8>) {
|
|||||||
ret <WIDTH x i8> %ret
|
ret <WIDTH x i8> %ret
|
||||||
}
|
}
|
||||||
|
|
||||||
declare <8 x i16> @llvm.x86.sse2.p$1us.w(<8 x i16>, <8 x i16>) nounwind readnone
|
|
||||||
define <WIDTH x i16> @__p$1us_vi16(<WIDTH x i16>, <WIDTH x i16>) {
|
define <WIDTH x i16> @__p$1us_vi16(<WIDTH x i16>, <WIDTH x i16>) {
|
||||||
%v0_i32 = zext <WIDTH x i16> %0 to <WIDTH x i32>
|
%v0_i32 = zext <WIDTH x i16> %0 to <WIDTH x i32>
|
||||||
%v1_i32 = zext <WIDTH x i16> %1 to <WIDTH x i32>
|
%v1_i32 = zext <WIDTH x i16> %1 to <WIDTH x i32>
|
||||||
|
|||||||
27
stdlib.ispc
27
stdlib.ispc
@@ -58,15 +58,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Limits of integral types. */
|
/* 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
|
#ifndef INT8_MAX
|
||||||
#define INT8_MAX (127)
|
#define INT8_MAX (127)
|
||||||
#endif
|
#endif
|
||||||
@@ -76,6 +67,9 @@
|
|||||||
#ifndef INT32_MAX
|
#ifndef INT32_MAX
|
||||||
#define INT32_MAX (2147483647)
|
#define INT32_MAX (2147483647)
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef INT64_MAX
|
||||||
|
#define INT64_MAX (9223372036854775807)
|
||||||
|
#endif
|
||||||
#ifndef UINT8_MAX
|
#ifndef UINT8_MAX
|
||||||
#define UINT8_MAX (255)
|
#define UINT8_MAX (255)
|
||||||
#endif
|
#endif
|
||||||
@@ -85,6 +79,21 @@
|
|||||||
#ifndef UINT32_MAX
|
#ifndef UINT32_MAX
|
||||||
#define UINT32_MAX (4294967295)
|
#define UINT32_MAX (4294967295)
|
||||||
#endif
|
#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
|
// Low level primitives
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user