added broadcast

This commit is contained in:
Evghenii
2014-01-22 20:46:41 +01:00
parent 7d0aa7a336
commit 11964a8ce8
2 changed files with 16 additions and 7 deletions

View File

@@ -1125,6 +1125,22 @@ rotate(i64)
rotate(float) rotate(float)
rotate(double) rotate(double)
define(`broadcast', `
define <1 x $1> @__broadcast_$1(<1 x $1>, i32) nounwind readnone alwaysinline
{
%val = extractelement <1 x $1> %0, i32 0
%rets = tail call $1 @__shfl_$1_nvptx($1 %val, i32 %1)
%retv = insertelement <1 x $1> undef, $1 %rets, i32 0
ret <1 x $1> %retv
}
')
broadcast(i8)
broadcast(i16)
broadcast(i32)
broadcast(i64)
broadcast(float)
broadcast(double)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; unaligned loads/loads+broadcasts ;; unaligned loads/loads+broadcasts

View File

@@ -757,13 +757,6 @@ divert`'dnl
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
define(`shuffles', ` define(`shuffles', `
define <WIDTH x $1> @__broadcast_$1(<WIDTH x $1>, i32) nounwind readnone alwaysinline {
%v = extractelement <WIDTH x $1> %0, i32 %1
%broadcast_init = insertelement <WIDTH x $1> undef, $1 %v, i32 0
%broadcast = shufflevector <WIDTH x $1> %broadcast_init, <WIDTH x $1> undef, <WIDTH x i32> zeroinitializer
ret <WIDTH x $1> %broadcast
}
') ')
define(`define_shuffles',` define(`define_shuffles',`