[PATCH][AVX2] Fix GATHER execution domains
Cameron McInally
cameron.mcinally at nyu.edu
Mon Mar 10 08:28:03 PDT 2014
Hey guys,
It appears that the packed floating point gathers have incorrect
execution domains. The FP gathers do accept packed integers as the
indices operand, but I have not found definitive proof that this
affects the execution domain.
Does anyone have any insight?
Thanks,
Cameron
-------------- next part --------------
Index: test/CodeGen/X86/avx2-gather.ll
===================================================================
--- test/CodeGen/X86/avx2-gather.ll (revision 203455)
+++ test/CodeGen/X86/avx2-gather.ll (working copy)
@@ -15,4 +15,20 @@
; CHECK: vgatherdps
; CHECK-NOT: [[DST]]
; CHECK: [[DST:%xmm[0-9]+]]{{$}}
+; CHECK: vmovaps
; CHECK: ret
+
+declare <2 x double> @llvm.x86.avx2.gather.d.pd(<2 x double>, i8*,
+ <4 x i32>, <2 x double>, i8) nounwind readonly
+
+define <2 x double> @test_x86_avx2_gather_d_pd(i8* %a1,
+ <4 x i32> %idx, <2 x double> %mask) {
+ %res = call <2 x double> @llvm.x86.avx2.gather.d.pd(<2 x double> undef,
+ i8* %a1, <4 x i32> %idx, <2 x double> %mask, i8 2) ;
+ ret <2 x double> %res
+}
+
+; CHECK: test_x86_avx2_gather_d_pd
+; CHECK: vgatherdpd
+; CHECK: vmovapd
+; CHECK: ret
Index: test/CodeGen/X86/avx2-intrinsics-x86.ll
===================================================================
--- test/CodeGen/X86/avx2-intrinsics-x86.ll (revision 203455)
+++ test/CodeGen/X86/avx2-intrinsics-x86.ll (working copy)
@@ -1142,7 +1142,7 @@
<8 x i32> %idx, <8 x float> %mask,
float* nocapture %out) {
; CHECK: test_gather_mask
-; CHECK: vmovdqa %ymm2, [[DEST:%.*]]
+; CHECK: vmovaps %ymm2, [[DEST:%.*]]
; CHECK: vgatherdps [[DEST]]
;; gather with mask
%a_i8 = bitcast float* %a to i8*
Index: lib/Target/X86/X86InstrSSE.td
===================================================================
--- lib/Target/X86/X86InstrSSE.td (revision 203461)
+++ lib/Target/X86/X86InstrSSE.td (working copy)
@@ -8766,12 +8766,18 @@
let mayLoad = 1, Constraints
= "@earlyclobber $dst, at earlyclobber $mask_wb, $src1 = $dst, $mask = $mask_wb"
in {
- defm VGATHERDPD : avx2_gather<0x92, "vgatherdpd", VR256, vx64mem, vx64mem>, VEX_W;
- defm VGATHERQPD : avx2_gather<0x93, "vgatherqpd", VR256, vx64mem, vy64mem>, VEX_W;
- defm VGATHERDPS : avx2_gather<0x92, "vgatherdps", VR256, vx32mem, vy32mem>;
- defm VGATHERQPS : avx2_gather<0x93, "vgatherqps", VR128, vx32mem, vy32mem>;
defm VPGATHERDQ : avx2_gather<0x90, "vpgatherdq", VR256, vx64mem, vx64mem>, VEX_W;
defm VPGATHERQQ : avx2_gather<0x91, "vpgatherqq", VR256, vx64mem, vy64mem>, VEX_W;
defm VPGATHERDD : avx2_gather<0x90, "vpgatherdd", VR256, vx32mem, vy32mem>;
defm VPGATHERQD : avx2_gather<0x91, "vpgatherqd", VR128, vx32mem, vy32mem>;
+
+ let ExeDomain = SSEPackedDouble in {
+ defm VGATHERDPD : avx2_gather<0x92, "vgatherdpd", VR256, vx64mem, vx64mem>, VEX_W;
+ defm VGATHERQPD : avx2_gather<0x93, "vgatherqpd", VR256, vx64mem, vy64mem>, VEX_W;
+ }
+
+ let ExeDomain = SSEPackedSingle in {
+ defm VGATHERDPS : avx2_gather<0x92, "vgatherdps", VR256, vx32mem, vy32mem>;
+ defm VGATHERQPS : avx2_gather<0x93, "vgatherqps", VR128, vx32mem, vy32mem>;
+ }
}
More information about the llvm-commits
mailing list