File: neon-faminmax-intrinsics.c

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,235,796 kB
  • sloc: cpp: 7,617,614; ansic: 1,433,901; asm: 1,058,726; python: 252,096; f90: 94,671; objc: 70,753; lisp: 42,813; pascal: 18,401; sh: 10,032; ml: 5,111; perl: 4,720; awk: 3,523; makefile: 3,401; javascript: 2,272; xml: 892; fortran: 770
file content (107 lines) | stat: -rw-r--r-- 5,195 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon -target-feature +faminmax -O3 -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon -target-feature +faminmax -S -O3 -Werror -Wall -o /dev/null %s

// REQUIRES: aarch64-registered-target

#include <arm_neon.h>

// CHECK-LABEL: define dso_local <4 x half> @test_vamin_f16(
// CHECK-SAME: <4 x half> noundef [[VN:%.*]], <4 x half> noundef [[VM:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
// CHECK-NEXT:  [[ENTRY:.*:]]
// CHECK-NEXT:    [[FAMIN2_I:%.*]] = tail call <4 x half> @llvm.aarch64.neon.famin.v4f16(<4 x half> [[VN]], <4 x half> [[VM]])
// CHECK-NEXT:    ret <4 x half> [[FAMIN2_I]]
//
float16x4_t test_vamin_f16(float16x4_t vn, float16x4_t vm) {
  return vamin_f16(vn, vm);
}

// CHECK-LABEL: define dso_local <8 x half> @test_vaminq_f16(
// CHECK-SAME: <8 x half> noundef [[VN:%.*]], <8 x half> noundef [[VM:%.*]]) local_unnamed_addr #[[ATTR0]] {
// CHECK-NEXT:  [[ENTRY:.*:]]
// CHECK-NEXT:    [[FAMIN2_I:%.*]] = tail call <8 x half> @llvm.aarch64.neon.famin.v8f16(<8 x half> [[VN]], <8 x half> [[VM]])
// CHECK-NEXT:    ret <8 x half> [[FAMIN2_I]]
//
float16x8_t test_vaminq_f16(float16x8_t vn, float16x8_t vm) {
  return vaminq_f16(vn, vm);
}

// CHECK-LABEL: define dso_local <2 x float> @test_vamin_f32(
// CHECK-SAME: <2 x float> noundef [[VN:%.*]], <2 x float> noundef [[VM:%.*]]) local_unnamed_addr #[[ATTR0]] {
// CHECK-NEXT:  [[ENTRY:.*:]]
// CHECK-NEXT:    [[FAMIN2_I:%.*]] = tail call <2 x float> @llvm.aarch64.neon.famin.v2f32(<2 x float> [[VN]], <2 x float> [[VM]])
// CHECK-NEXT:    ret <2 x float> [[FAMIN2_I]]
//
float32x2_t test_vamin_f32(float32x2_t vn, float32x2_t vm) {
  return vamin_f32(vn, vm);
}

// CHECK-LABEL: define dso_local <4 x float> @test_vaminq_f32(
// CHECK-SAME: <4 x float> noundef [[VN:%.*]], <4 x float> noundef [[VM:%.*]]) local_unnamed_addr #[[ATTR0]] {
// CHECK-NEXT:  [[ENTRY:.*:]]
// CHECK-NEXT:    [[FAMIN2_I:%.*]] = tail call <4 x float> @llvm.aarch64.neon.famin.v4f32(<4 x float> [[VN]], <4 x float> [[VM]])
// CHECK-NEXT:    ret <4 x float> [[FAMIN2_I]]
//
float32x4_t test_vaminq_f32(float32x4_t vn, float32x4_t vm) {
  return vaminq_f32(vn, vm);
}

// CHECK-LABEL: define dso_local <2 x double> @test_vaminq_f64(
// CHECK-SAME: <2 x double> noundef [[VN:%.*]], <2 x double> noundef [[VM:%.*]]) local_unnamed_addr #[[ATTR0]] {
// CHECK-NEXT:  [[ENTRY:.*:]]
// CHECK-NEXT:    [[FAMIN2_I:%.*]] = tail call <2 x double> @llvm.aarch64.neon.famin.v2f64(<2 x double> [[VN]], <2 x double> [[VM]])
// CHECK-NEXT:    ret <2 x double> [[FAMIN2_I]]
//
float64x2_t test_vaminq_f64(float64x2_t vn, float64x2_t vm) {
  return vaminq_f64(vn, vm);
}

// CHECK-LABEL: define dso_local <4 x half> @test_vamax_f16(
// CHECK-SAME: <4 x half> noundef [[VN:%.*]], <4 x half> noundef [[VM:%.*]]) local_unnamed_addr #[[ATTR0]] {
// CHECK-NEXT:  [[ENTRY:.*:]]
// CHECK-NEXT:    [[FAMAX2_I:%.*]] = tail call <4 x half> @llvm.aarch64.neon.famax.v4f16(<4 x half> [[VN]], <4 x half> [[VM]])
// CHECK-NEXT:    ret <4 x half> [[FAMAX2_I]]
//
float16x4_t test_vamax_f16(float16x4_t vn, float16x4_t vm) {
  return vamax_f16(vn, vm);
}

// CHECK-LABEL: define dso_local <8 x half> @test_vamaxq_f16(
// CHECK-SAME: <8 x half> noundef [[VN:%.*]], <8 x half> noundef [[VM:%.*]]) local_unnamed_addr #[[ATTR0]] {
// CHECK-NEXT:  [[ENTRY:.*:]]
// CHECK-NEXT:    [[FAMAX2_I:%.*]] = tail call <8 x half> @llvm.aarch64.neon.famax.v8f16(<8 x half> [[VN]], <8 x half> [[VM]])
// CHECK-NEXT:    ret <8 x half> [[FAMAX2_I]]
//
float16x8_t test_vamaxq_f16(float16x8_t vn, float16x8_t vm) {
  return vamaxq_f16(vn, vm);
}

// CHECK-LABEL: define dso_local <2 x float> @test_vamax_f32(
// CHECK-SAME: <2 x float> noundef [[VN:%.*]], <2 x float> noundef [[VM:%.*]]) local_unnamed_addr #[[ATTR0]] {
// CHECK-NEXT:  [[ENTRY:.*:]]
// CHECK-NEXT:    [[FAMAX2_I:%.*]] = tail call <2 x float> @llvm.aarch64.neon.famax.v2f32(<2 x float> [[VN]], <2 x float> [[VM]])
// CHECK-NEXT:    ret <2 x float> [[FAMAX2_I]]
//
float32x2_t test_vamax_f32(float32x2_t vn, float32x2_t vm) {
  return vamax_f32(vn, vm);
}

// CHECK-LABEL: define dso_local <4 x float> @test_vamaxq_f32(
// CHECK-SAME: <4 x float> noundef [[VN:%.*]], <4 x float> noundef [[VM:%.*]]) local_unnamed_addr #[[ATTR0]] {
// CHECK-NEXT:  [[ENTRY:.*:]]
// CHECK-NEXT:    [[FAMAX2_I:%.*]] = tail call <4 x float> @llvm.aarch64.neon.famax.v4f32(<4 x float> [[VN]], <4 x float> [[VM]])
// CHECK-NEXT:    ret <4 x float> [[FAMAX2_I]]
//
float32x4_t test_vamaxq_f32(float32x4_t vn, float32x4_t vm) {
  return vamaxq_f32(vn, vm);
}

// CHECK-LABEL: define dso_local <2 x double> @test_vamaxq_f64(
// CHECK-SAME: <2 x double> noundef [[VN:%.*]], <2 x double> noundef [[VM:%.*]]) local_unnamed_addr #[[ATTR0]] {
// CHECK-NEXT:  [[ENTRY:.*:]]
// CHECK-NEXT:    [[FAMAX2_I:%.*]] = tail call <2 x double> @llvm.aarch64.neon.famax.v2f64(<2 x double> [[VN]], <2 x double> [[VM]])
// CHECK-NEXT:    ret <2 x double> [[FAMAX2_I]]
//
float64x2_t test_vamaxq_f64(float64x2_t vn, float64x2_t vm) {
  return vamaxq_f64(vn, vm);
}