annotate clang/test/CodeGen/arm64_vdupq_n_f64.c @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents 79ff65ed7e25
children 1f2b6ac9f198
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
1 // RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon -ffreestanding -S -o - -disable-O0-optnone -emit-llvm %s | opt -S -mem2reg | FileCheck %s
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
2
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
3 // REQUIRES: aarch64-registered-target || arm-registered-target
150
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 #include <arm_neon.h>
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 // vdupq_n_f64 -> dup.2d v0, v0[0]
anatofuz
parents:
diff changeset
8 //
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
9 // CHECK-LABEL: define{{.*}} <2 x double> @test_vdupq_n_f64(double noundef %w) #0 {
150
anatofuz
parents:
diff changeset
10 // CHECK: [[VECINIT_I:%.*]] = insertelement <2 x double> undef, double %w, i32 0
anatofuz
parents:
diff changeset
11 // CHECK: [[VECINIT1_I:%.*]] = insertelement <2 x double> [[VECINIT_I]], double %w, i32 1
anatofuz
parents:
diff changeset
12 // CHECK: ret <2 x double> [[VECINIT1_I]]
anatofuz
parents:
diff changeset
13 float64x2_t test_vdupq_n_f64(float64_t w) {
anatofuz
parents:
diff changeset
14 return vdupq_n_f64(w);
anatofuz
parents:
diff changeset
15 }
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 // might as well test this while we're here
anatofuz
parents:
diff changeset
18 // vdupq_n_f32 -> dup.4s v0, v0[0]
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
19 // CHECK-LABEL: define{{.*}} <4 x float> @test_vdupq_n_f32(float noundef %w) #0 {
150
anatofuz
parents:
diff changeset
20 // CHECK: [[VECINIT_I:%.*]] = insertelement <4 x float> undef, float %w, i32 0
anatofuz
parents:
diff changeset
21 // CHECK: [[VECINIT1_I:%.*]] = insertelement <4 x float> [[VECINIT_I]], float %w, i32 1
anatofuz
parents:
diff changeset
22 // CHECK: [[VECINIT2_I:%.*]] = insertelement <4 x float> [[VECINIT1_I]], float %w, i32 2
anatofuz
parents:
diff changeset
23 // CHECK: [[VECINIT3_I:%.*]] = insertelement <4 x float> [[VECINIT2_I]], float %w, i32 3
anatofuz
parents:
diff changeset
24 // CHECK: ret <4 x float> [[VECINIT3_I]]
anatofuz
parents:
diff changeset
25 float32x4_t test_vdupq_n_f32(float32_t w) {
anatofuz
parents:
diff changeset
26 return vdupq_n_f32(w);
anatofuz
parents:
diff changeset
27 }
anatofuz
parents:
diff changeset
28
anatofuz
parents:
diff changeset
29 // vdupq_lane_f64 -> dup.2d v0, v0[0]
anatofuz
parents:
diff changeset
30 // this was in <rdar://problem/11778405>, but had already been implemented,
anatofuz
parents:
diff changeset
31 // test anyway
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
32 // CHECK-LABEL: define{{.*}} <2 x double> @test_vdupq_lane_f64(<1 x double> noundef %V) #0 {
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
33 // CHECK: [[TMP0:%.*]] = bitcast <1 x double> %V to <8 x i8>
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
34 // CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x double>
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
35 // CHECK: [[SHUFFLE:%.*]] = shufflevector <1 x double> [[TMP1]], <1 x double> [[TMP1]], <2 x i32> zeroinitializer
150
anatofuz
parents:
diff changeset
36 // CHECK: ret <2 x double> [[SHUFFLE]]
anatofuz
parents:
diff changeset
37 float64x2_t test_vdupq_lane_f64(float64x1_t V) {
anatofuz
parents:
diff changeset
38 return vdupq_lane_f64(V, 0);
anatofuz
parents:
diff changeset
39 }
anatofuz
parents:
diff changeset
40
anatofuz
parents:
diff changeset
41 // vmovq_n_f64 -> dup Vd.2d,X0
anatofuz
parents:
diff changeset
42 // this wasn't in <rdar://problem/11778405>, but it was between the vdups
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
43 // CHECK-LABEL: define{{.*}} <2 x double> @test_vmovq_n_f64(double noundef %w) #0 {
150
anatofuz
parents:
diff changeset
44 // CHECK: [[VECINIT_I:%.*]] = insertelement <2 x double> undef, double %w, i32 0
anatofuz
parents:
diff changeset
45 // CHECK: [[VECINIT1_I:%.*]] = insertelement <2 x double> [[VECINIT_I]], double %w, i32 1
anatofuz
parents:
diff changeset
46 // CHECK: ret <2 x double> [[VECINIT1_I]]
anatofuz
parents:
diff changeset
47 float64x2_t test_vmovq_n_f64(float64_t w) {
anatofuz
parents:
diff changeset
48 return vmovq_n_f64(w);
anatofuz
parents:
diff changeset
49 }
anatofuz
parents:
diff changeset
50
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
51 // CHECK-LABEL: define{{.*}} <4 x half> @test_vmov_n_f16(ptr noundef %a1) #1 {
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
52 // CHECK: [[TMP0:%.*]] = load half, ptr %a1, align 2
150
anatofuz
parents:
diff changeset
53 // CHECK: [[VECINIT:%.*]] = insertelement <4 x half> undef, half [[TMP0]], i32 0
anatofuz
parents:
diff changeset
54 // CHECK: [[VECINIT1:%.*]] = insertelement <4 x half> [[VECINIT]], half [[TMP0]], i32 1
anatofuz
parents:
diff changeset
55 // CHECK: [[VECINIT2:%.*]] = insertelement <4 x half> [[VECINIT1]], half [[TMP0]], i32 2
anatofuz
parents:
diff changeset
56 // CHECK: [[VECINIT3:%.*]] = insertelement <4 x half> [[VECINIT2]], half [[TMP0]], i32 3
anatofuz
parents:
diff changeset
57 // CHECK: ret <4 x half> [[VECINIT3]]
anatofuz
parents:
diff changeset
58 float16x4_t test_vmov_n_f16(float16_t *a1) {
anatofuz
parents:
diff changeset
59 return vmov_n_f16(*a1);
anatofuz
parents:
diff changeset
60 }
anatofuz
parents:
diff changeset
61
anatofuz
parents:
diff changeset
62 /*
anatofuz
parents:
diff changeset
63 float64x1_t test_vmov_n_f64(float64_t a1) {
anatofuz
parents:
diff changeset
64 return vmov_n_f64(a1);
anatofuz
parents:
diff changeset
65 }
anatofuz
parents:
diff changeset
66 */
anatofuz
parents:
diff changeset
67
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
68 // CHECK-LABEL: define{{.*}} <8 x half> @test_vmovq_n_f16(ptr noundef %a1) #0 {
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
69 // CHECK: [[TMP0:%.*]] = load half, ptr %a1, align 2
150
anatofuz
parents:
diff changeset
70 // CHECK: [[VECINIT:%.*]] = insertelement <8 x half> undef, half [[TMP0]], i32 0
anatofuz
parents:
diff changeset
71 // CHECK: [[VECINIT1:%.*]] = insertelement <8 x half> [[VECINIT]], half [[TMP0]], i32 1
anatofuz
parents:
diff changeset
72 // CHECK: [[VECINIT2:%.*]] = insertelement <8 x half> [[VECINIT1]], half [[TMP0]], i32 2
anatofuz
parents:
diff changeset
73 // CHECK: [[VECINIT3:%.*]] = insertelement <8 x half> [[VECINIT2]], half [[TMP0]], i32 3
anatofuz
parents:
diff changeset
74 // CHECK: [[VECINIT4:%.*]] = insertelement <8 x half> [[VECINIT3]], half [[TMP0]], i32 4
anatofuz
parents:
diff changeset
75 // CHECK: [[VECINIT5:%.*]] = insertelement <8 x half> [[VECINIT4]], half [[TMP0]], i32 5
anatofuz
parents:
diff changeset
76 // CHECK: [[VECINIT6:%.*]] = insertelement <8 x half> [[VECINIT5]], half [[TMP0]], i32 6
anatofuz
parents:
diff changeset
77 // CHECK: [[VECINIT7:%.*]] = insertelement <8 x half> [[VECINIT6]], half [[TMP0]], i32 7
anatofuz
parents:
diff changeset
78 // CHECK: ret <8 x half> [[VECINIT7]]
anatofuz
parents:
diff changeset
79 float16x8_t test_vmovq_n_f16(float16_t *a1) {
anatofuz
parents:
diff changeset
80 return vmovq_n_f16(*a1);
anatofuz
parents:
diff changeset
81 }
anatofuz
parents:
diff changeset
82
anatofuz
parents:
diff changeset
83 // CHECK: attributes #0 ={{.*}}"min-legal-vector-width"="128"
anatofuz
parents:
diff changeset
84 // CHECK: attributes #1 ={{.*}}"min-legal-vector-width"="64"