From a6b7e717f5794bb9118a9446ad9303efde2e21b1 Mon Sep 17 00:00:00 2001 From: Anton Mitrokhin Date: Thu, 7 May 2015 15:47:22 +0300 Subject: [PATCH] [AVX512]: gathers/scatters --- builtins/target-avx512-common.ll | 62 ++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/builtins/target-avx512-common.ll b/builtins/target-avx512-common.ll index 641585a8..cc05288f 100644 --- a/builtins/target-avx512-common.ll +++ b/builtins/target-avx512-common.ll @@ -155,9 +155,6 @@ define <16 x double> @__ceil_varying_double(<16 x double>) nounwind readonly alw round4to16double(%0, 10) } - - - ;; min/max int64minmax() @@ -496,32 +493,45 @@ define void @__masked_store_blend_double(* nocapture, ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; gather/scatter -define(`gather_scatter', ` -declare @__gather_base_offsets32_$1(i8 * nocapture, i32, , - ) nounwind readonly -declare @__gather_base_offsets64_$1(i8 * nocapture, i32, , - ) nounwind readonly -declare @__gather32_$1(, - ) nounwind readonly -declare @__gather64_$1(, - ) nounwind readonly +define(`scatterbo32_64', ` +define void @__scatter_base_offsets32_$1(i8* %ptr, i32 %scale, %offsets, + %vals, %mask) nounwind { + call void @__scatter_factored_base_offsets32_$1(i8* %ptr, <16 x i32> %offsets, + i32 %scale, <16 x i32> zeroinitializer, <16 x $1> %vals, %mask) + ret void +} -declare void @__scatter_base_offsets32_$1(i8* nocapture, i32, , - , ) nounwind -declare void @__scatter_base_offsets64_$1(i8* nocapture, i32, , - , ) nounwind -declare void @__scatter32_$1(, , - ) nounwind -declare void @__scatter64_$1(, , - ) nounwind +define void @__scatter_base_offsets64_$1(i8* %ptr, i32 %scale, %offsets, + %vals, %mask) nounwind { + call void @__scatter_factored_base_offsets64_$1(i8* %ptr, <16 x i64> %offsets, + i32 %scale, <16 x i64> zeroinitializer, <16 x $1> %vals, %mask) + ret void +} ') -gather_scatter(i8) -gather_scatter(i16) -gather_scatter(i32) -gather_scatter(float) -gather_scatter(i64) -gather_scatter(double) + +gen_gather(i8) +gen_gather(i16) +gen_gather(i32) +gen_gather(i64) +gen_gather(float) +gen_gather(double) + +scatterbo32_64(i8) +scatterbo32_64(i16) +scatterbo32_64(i32) +scatterbo32_64(i64) +scatterbo32_64(float) +scatterbo32_64(double) + +gen_scatter(i8) +gen_scatter(i16) +gen_scatter(i32) +gen_scatter(i64) +gen_scatter(float) +gen_scatter(double) + + packed_load_and_store()