1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl --show-mc-encoding | FileCheck %s --check-prefix AVX512
2 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx --show-mc-encoding | FileCheck %s --check-prefix AVX
4 ; AVX512-LABEL: @test_fdiv
5 ; AVX512: vdivss %xmm{{.*}} ## encoding: [0x62
6 ; AVX-LABEL: @test_fdiv
7 ; AVX: vdivss %xmm{{.*}} ## encoding: [0xc5
9 define float @test_fdiv(float %a, float %b) {
10 %c = fdiv float %a, %b
14 ; AVX512-LABEL: @test_fsub
15 ; AVX512: vsubss %xmm{{.*}} ## encoding: [0x62
16 ; AVX-LABEL: @test_fsub
17 ; AVX: vsubss %xmm{{.*}} ## encoding: [0xc5
19 define float @test_fsub(float %a, float %b) {
20 %c = fsub float %a, %b
24 ; AVX512-LABEL: @test_fadd
25 ; AVX512: vaddsd %xmm{{.*}} ## encoding: [0x62
26 ; AVX-LABEL: @test_fadd
27 ; AVX: vaddsd %xmm{{.*}} ## encoding: [0xc5
29 define double @test_fadd(double %a, double %b) {
30 %c = fadd double %a, %b
34 declare float @llvm.trunc.f32(float %Val)
35 declare double @llvm.trunc.f64(double %Val)
36 declare float @llvm.rint.f32(float %Val)
37 declare double @llvm.rint.f64(double %Val)
38 declare double @llvm.sqrt.f64(double %Val)
39 declare float @llvm.sqrt.f32(float %Val)
41 ; AVX512-LABEL: @test_trunc
43 ; AVX-LABEL: @test_trunc
46 define float @test_trunc(float %a) {
47 %c = call float @llvm.trunc.f32(float %a)
51 ; AVX512-LABEL: @test_sqrt
52 ; AVX512: vsqrtsd %xmm{{.*}} ## encoding: [0x62
53 ; AVX-LABEL: @test_sqrt
54 ; AVX: vsqrtsd %xmm{{.*}} ## encoding: [0xc5
56 define double @test_sqrt(double %a) {
57 %c = call double @llvm.sqrt.f64(double %a)
61 ; AVX512-LABEL: @test_rint
63 ; AVX-LABEL: @test_rint
66 define float @test_rint(float %a) {
67 %c = call float @llvm.rint.f32(float %a)
71 ; AVX512-LABEL: @test_vmax
72 ; AVX512: vmaxss %xmm{{.*}} ## encoding: [0x62
73 ; AVX-LABEL: @test_vmax
74 ; AVX: vmaxss %xmm{{.*}} ## encoding: [0xc5
76 define float @test_vmax(float %i, float %j) {
77 %cmp_res = fcmp ogt float %i, %j
78 %max = select i1 %cmp_res, float %i, float %j
82 ; AVX512-LABEL: @test_mov
83 ; AVX512: vcmpltss %xmm{{.*}} ## encoding: [0x62
84 ; AVX-LABEL: @test_mov
85 ; AVX: vcmpltss %xmm{{.*}} ## encoding: [0xc5
87 define float @test_mov(float %a, float %b, float %i, float %j) {
88 %cmp_res = fcmp ogt float %i, %j
89 %max = select i1 %cmp_res, float %b, float %a