1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,AVX512F
3 ; RUN: llc < %s -mattr=+avx512f,+avx512vl,+avx512bw,+avx512dq | FileCheck %s --check-prefixes=CHECK,AVX512VL
5 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
6 target triple = "x86_64-unknown-linux-gnu"
8 define void @test(<4 x i64> %a, <4 x x86_fp80> %b, <8 x x86_fp80>* %c) local_unnamed_addr {
11 ; AVX512F-NEXT: vmovq %xmm0, %rax
12 ; AVX512F-NEXT: vpextrq $1, %xmm0, %rcx
13 ; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm0
14 ; AVX512F-NEXT: vmovq %xmm0, %rdx
15 ; AVX512F-NEXT: vpextrq $1, %xmm0, %rsi
16 ; AVX512F-NEXT: cmpq $3, %rsi
19 ; AVX512F-NEXT: fld %st(0)
20 ; AVX512F-NEXT: fcmove %st(2), %st
21 ; AVX512F-NEXT: cmpq $2, %rdx
22 ; AVX512F-NEXT: fld %st(1)
23 ; AVX512F-NEXT: fcmove %st(3), %st
24 ; AVX512F-NEXT: cmpq $1, %rcx
25 ; AVX512F-NEXT: fld %st(2)
26 ; AVX512F-NEXT: fcmove %st(4), %st
27 ; AVX512F-NEXT: testq %rax, %rax
28 ; AVX512F-NEXT: fxch %st(3)
29 ; AVX512F-NEXT: fcmove %st(4), %st
30 ; AVX512F-NEXT: fstp %st(4)
31 ; AVX512F-NEXT: fldt {{[0-9]+}}(%rsp)
32 ; AVX512F-NEXT: fstpt 70(%rdi)
33 ; AVX512F-NEXT: fldt {{[0-9]+}}(%rsp)
34 ; AVX512F-NEXT: fstpt 50(%rdi)
35 ; AVX512F-NEXT: fldt {{[0-9]+}}(%rsp)
36 ; AVX512F-NEXT: fstpt 30(%rdi)
37 ; AVX512F-NEXT: fldt {{[0-9]+}}(%rsp)
38 ; AVX512F-NEXT: fstpt 10(%rdi)
39 ; AVX512F-NEXT: fxch %st(1)
40 ; AVX512F-NEXT: fadd %st, %st(0)
41 ; AVX512F-NEXT: fstpt 60(%rdi)
42 ; AVX512F-NEXT: fadd %st, %st(0)
43 ; AVX512F-NEXT: fstpt 40(%rdi)
44 ; AVX512F-NEXT: fadd %st, %st(0)
45 ; AVX512F-NEXT: fstpt 20(%rdi)
46 ; AVX512F-NEXT: fadd %st, %st(0)
47 ; AVX512F-NEXT: fstpt (%rdi)
49 ; AVX512VL-LABEL: test:
51 ; AVX512VL-NEXT: vpcmpeqq {{.*}}(%rip), %ymm0, %k0
52 ; AVX512VL-NEXT: kshiftrb $2, %k0, %k1
53 ; AVX512VL-NEXT: kshiftrb $1, %k0, %k2
54 ; AVX512VL-NEXT: kmovd %k0, %eax
55 ; AVX512VL-NEXT: testb $1, %al
58 ; AVX512VL-NEXT: fld %st(0)
59 ; AVX512VL-NEXT: fcmovne %st(2), %st
60 ; AVX512VL-NEXT: kshiftrb $1, %k1, %k0
61 ; AVX512VL-NEXT: kmovd %k0, %eax
62 ; AVX512VL-NEXT: testb $1, %al
63 ; AVX512VL-NEXT: fld %st(1)
64 ; AVX512VL-NEXT: fcmovne %st(3), %st
65 ; AVX512VL-NEXT: kmovd %k1, %eax
66 ; AVX512VL-NEXT: testb $1, %al
67 ; AVX512VL-NEXT: fld %st(2)
68 ; AVX512VL-NEXT: fcmovne %st(4), %st
69 ; AVX512VL-NEXT: kmovd %k2, %eax
70 ; AVX512VL-NEXT: testb $1, %al
71 ; AVX512VL-NEXT: fxch %st(3)
72 ; AVX512VL-NEXT: fcmovne %st(4), %st
73 ; AVX512VL-NEXT: fstp %st(4)
74 ; AVX512VL-NEXT: fldt {{[0-9]+}}(%rsp)
75 ; AVX512VL-NEXT: fstpt 70(%rdi)
76 ; AVX512VL-NEXT: fldt {{[0-9]+}}(%rsp)
77 ; AVX512VL-NEXT: fstpt 50(%rdi)
78 ; AVX512VL-NEXT: fldt {{[0-9]+}}(%rsp)
79 ; AVX512VL-NEXT: fstpt 30(%rdi)
80 ; AVX512VL-NEXT: fldt {{[0-9]+}}(%rsp)
81 ; AVX512VL-NEXT: fstpt 10(%rdi)
82 ; AVX512VL-NEXT: fxch %st(1)
83 ; AVX512VL-NEXT: fadd %st, %st(0)
84 ; AVX512VL-NEXT: fstpt (%rdi)
85 ; AVX512VL-NEXT: fadd %st, %st(0)
86 ; AVX512VL-NEXT: fstpt 60(%rdi)
87 ; AVX512VL-NEXT: fadd %st, %st(0)
88 ; AVX512VL-NEXT: fstpt 40(%rdi)
89 ; AVX512VL-NEXT: fadd %st, %st(0)
90 ; AVX512VL-NEXT: fstpt 20(%rdi)
91 %1 = icmp eq <4 x i64> <i64 0, i64 1, i64 2, i64 3>, %a
92 %2 = select <4 x i1> %1, <4 x x86_fp80> <x86_fp80 0xK3FFF8000000000000000, x86_fp80 0xK3FFF8000000000000000, x86_fp80 0xK3FFF8000000000000000, x86_fp80 0xK3FFF8000000000000000>, <4 x x86_fp80> zeroinitializer
93 %3 = fadd <4 x x86_fp80> %2, %2
94 %4 = shufflevector <4 x x86_fp80> %3, <4 x x86_fp80> %b, <8 x i32> <i32 0, i32 4, i32 1, i32 5, i32 2, i32 6, i32 3, i32 7>
95 store <8 x x86_fp80> %4, <8 x x86_fp80>* %c, align 16