[llvm] cf39dea - [AArch64] Add a fminnum/fmaxnum test. NFC
David Green via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 30 09:27:10 PDT 2023
Author: David Green
Date: 2023-07-30T17:27:05+01:00
New Revision: cf39dea58d8dbc8b5ad7bd7f34534eeeb989e327
URL: https://github.com/llvm/llvm-project/commit/cf39dea58d8dbc8b5ad7bd7f34534eeeb989e327
DIFF: https://github.com/llvm/llvm-project/commit/cf39dea58d8dbc8b5ad7bd7f34534eeeb989e327.diff
LOG: [AArch64] Add a fminnum/fmaxnum test. NFC
See D156171.
Added:
llvm/test/CodeGen/AArch64/fminmax.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/AArch64/fminmax.ll b/llvm/test/CodeGen/AArch64/fminmax.ll
new file mode 100644
index 00000000000000..b4d0db5d0e7e88
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/fminmax.ll
@@ -0,0 +1,966 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
+; RUN: llc -mtriple=aarch64-none-eabi -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-NOFP16
+; RUN: llc -mtriple=aarch64-none-eabi -mattr=+fullfp16 -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-FP16
+
+define double @min_f64(double %a, double %b) {
+; CHECK-LABEL: min_f64:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: fminnm d0, d0, d1
+; CHECK-NEXT: ret
+entry:
+ %c = call double @llvm.minnum.f64(double %a, double %b)
+ ret double %c
+}
+
+define double @max_f64(double %a, double %b) {
+; CHECK-LABEL: max_f64:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: fmaxnm d0, d0, d1
+; CHECK-NEXT: ret
+entry:
+ %c = call double @llvm.maxnum.f64(double %a, double %b)
+ ret double %c
+}
+
+define float @min_f32(float %a, float %b) {
+; CHECK-LABEL: min_f32:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: fminnm s0, s0, s1
+; CHECK-NEXT: ret
+entry:
+ %c = call float @llvm.minnum.f32(float %a, float %b)
+ ret float %c
+}
+
+define float @max_f32(float %a, float %b) {
+; CHECK-LABEL: max_f32:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: fmaxnm s0, s0, s1
+; CHECK-NEXT: ret
+entry:
+ %c = call float @llvm.maxnum.f32(float %a, float %b)
+ ret float %c
+}
+
+define half @min_f16(half %a, half %b) {
+; CHECK-NOFP16-LABEL: min_f16:
+; CHECK-NOFP16: // %bb.0: // %entry
+; CHECK-NOFP16-NEXT: fcvt s1, h1
+; CHECK-NOFP16-NEXT: fcvt s0, h0
+; CHECK-NOFP16-NEXT: fminnm s0, s0, s1
+; CHECK-NOFP16-NEXT: fcvt h0, s0
+; CHECK-NOFP16-NEXT: ret
+;
+; CHECK-FP16-LABEL: min_f16:
+; CHECK-FP16: // %bb.0: // %entry
+; CHECK-FP16-NEXT: fminnm h0, h0, h1
+; CHECK-FP16-NEXT: ret
+entry:
+ %c = call half @llvm.minnum.f16(half %a, half %b)
+ ret half %c
+}
+
+define half @max_f16(half %a, half %b) {
+; CHECK-NOFP16-LABEL: max_f16:
+; CHECK-NOFP16: // %bb.0: // %entry
+; CHECK-NOFP16-NEXT: fcvt s1, h1
+; CHECK-NOFP16-NEXT: fcvt s0, h0
+; CHECK-NOFP16-NEXT: fmaxnm s0, s0, s1
+; CHECK-NOFP16-NEXT: fcvt h0, s0
+; CHECK-NOFP16-NEXT: ret
+;
+; CHECK-FP16-LABEL: max_f16:
+; CHECK-FP16: // %bb.0: // %entry
+; CHECK-FP16-NEXT: fmaxnm h0, h0, h1
+; CHECK-FP16-NEXT: ret
+entry:
+ %c = call half @llvm.maxnum.f16(half %a, half %b)
+ ret half %c
+}
+
+define <2 x double> @min_v2f64(<2 x double> %a, <2 x double> %b) {
+; CHECK-LABEL: min_v2f64:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: fminnm v0.2d, v0.2d, v1.2d
+; CHECK-NEXT: ret
+entry:
+ %c = call <2 x double> @llvm.minnum.v2f64(<2 x double> %a, <2 x double> %b)
+ ret <2 x double> %c
+}
+
+define <2 x double> @max_v2f64(<2 x double> %a, <2 x double> %b) {
+; CHECK-LABEL: max_v2f64:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: fmaxnm v0.2d, v0.2d, v1.2d
+; CHECK-NEXT: ret
+entry:
+ %c = call <2 x double> @llvm.maxnum.v2f64(<2 x double> %a, <2 x double> %b)
+ ret <2 x double> %c
+}
+
+define <3 x double> @min_v3f64(<3 x double> %a, <3 x double> %b) {
+; CHECK-LABEL: min_v3f64:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: // kill: def $d3 killed $d3 def $q3
+; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
+; CHECK-NEXT: // kill: def $d4 killed $d4 def $q4
+; CHECK-NEXT: // kill: def $d1 killed $d1 def $q1
+; CHECK-NEXT: // kill: def $d2 killed $d2 def $q2
+; CHECK-NEXT: // kill: def $d5 killed $d5 def $q5
+; CHECK-NEXT: mov v3.d[1], v4.d[0]
+; CHECK-NEXT: mov v0.d[1], v1.d[0]
+; CHECK-NEXT: fminnm v2.2d, v2.2d, v5.2d
+; CHECK-NEXT: // kill: def $d2 killed $d2 killed $q2
+; CHECK-NEXT: fminnm v0.2d, v0.2d, v3.2d
+; CHECK-NEXT: ext v1.16b, v0.16b, v0.16b, #8
+; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
+; CHECK-NEXT: // kill: def $d1 killed $d1 killed $q1
+; CHECK-NEXT: ret
+entry:
+ %c = call <3 x double> @llvm.minnum.v3f64(<3 x double> %a, <3 x double> %b)
+ ret <3 x double> %c
+}
+
+define <3 x double> @max_v3f64(<3 x double> %a, <3 x double> %b) {
+; CHECK-LABEL: max_v3f64:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: // kill: def $d3 killed $d3 def $q3
+; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
+; CHECK-NEXT: // kill: def $d4 killed $d4 def $q4
+; CHECK-NEXT: // kill: def $d1 killed $d1 def $q1
+; CHECK-NEXT: // kill: def $d2 killed $d2 def $q2
+; CHECK-NEXT: // kill: def $d5 killed $d5 def $q5
+; CHECK-NEXT: mov v3.d[1], v4.d[0]
+; CHECK-NEXT: mov v0.d[1], v1.d[0]
+; CHECK-NEXT: fmaxnm v2.2d, v2.2d, v5.2d
+; CHECK-NEXT: // kill: def $d2 killed $d2 killed $q2
+; CHECK-NEXT: fmaxnm v0.2d, v0.2d, v3.2d
+; CHECK-NEXT: ext v1.16b, v0.16b, v0.16b, #8
+; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
+; CHECK-NEXT: // kill: def $d1 killed $d1 killed $q1
+; CHECK-NEXT: ret
+entry:
+ %c = call <3 x double> @llvm.maxnum.v3f64(<3 x double> %a, <3 x double> %b)
+ ret <3 x double> %c
+}
+
+define <4 x double> @min_v4f64(<4 x double> %a, <4 x double> %b) {
+; CHECK-LABEL: min_v4f64:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: fminnm v0.2d, v0.2d, v2.2d
+; CHECK-NEXT: fminnm v1.2d, v1.2d, v3.2d
+; CHECK-NEXT: ret
+entry:
+ %c = call <4 x double> @llvm.minnum.v4f64(<4 x double> %a, <4 x double> %b)
+ ret <4 x double> %c
+}
+
+define <4 x double> @max_v4f64(<4 x double> %a, <4 x double> %b) {
+; CHECK-LABEL: max_v4f64:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: fmaxnm v0.2d, v0.2d, v2.2d
+; CHECK-NEXT: fmaxnm v1.2d, v1.2d, v3.2d
+; CHECK-NEXT: ret
+entry:
+ %c = call <4 x double> @llvm.maxnum.v4f64(<4 x double> %a, <4 x double> %b)
+ ret <4 x double> %c
+}
+
+define <2 x float> @min_v2f32(<2 x float> %a, <2 x float> %b) {
+; CHECK-LABEL: min_v2f32:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: fminnm v0.2s, v0.2s, v1.2s
+; CHECK-NEXT: ret
+entry:
+ %c = call <2 x float> @llvm.minnum.v2f32(<2 x float> %a, <2 x float> %b)
+ ret <2 x float> %c
+}
+
+define <2 x float> @max_v2f32(<2 x float> %a, <2 x float> %b) {
+; CHECK-LABEL: max_v2f32:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: fmaxnm v0.2s, v0.2s, v1.2s
+; CHECK-NEXT: ret
+entry:
+ %c = call <2 x float> @llvm.maxnum.v2f32(<2 x float> %a, <2 x float> %b)
+ ret <2 x float> %c
+}
+
+define <3 x float> @min_v3f32(<3 x float> %a, <3 x float> %b) {
+; CHECK-LABEL: min_v3f32:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: fminnm v0.4s, v0.4s, v1.4s
+; CHECK-NEXT: ret
+entry:
+ %c = call <3 x float> @llvm.minnum.v3f32(<3 x float> %a, <3 x float> %b)
+ ret <3 x float> %c
+}
+
+define <3 x float> @max_v3f32(<3 x float> %a, <3 x float> %b) {
+; CHECK-LABEL: max_v3f32:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: fmaxnm v0.4s, v0.4s, v1.4s
+; CHECK-NEXT: ret
+entry:
+ %c = call <3 x float> @llvm.maxnum.v3f32(<3 x float> %a, <3 x float> %b)
+ ret <3 x float> %c
+}
+
+define <4 x float> @min_v4f32(<4 x float> %a, <4 x float> %b) {
+; CHECK-LABEL: min_v4f32:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: fminnm v0.4s, v0.4s, v1.4s
+; CHECK-NEXT: ret
+entry:
+ %c = call <4 x float> @llvm.minnum.v4f32(<4 x float> %a, <4 x float> %b)
+ ret <4 x float> %c
+}
+
+define <4 x float> @max_v4f32(<4 x float> %a, <4 x float> %b) {
+; CHECK-LABEL: max_v4f32:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: fmaxnm v0.4s, v0.4s, v1.4s
+; CHECK-NEXT: ret
+entry:
+ %c = call <4 x float> @llvm.maxnum.v4f32(<4 x float> %a, <4 x float> %b)
+ ret <4 x float> %c
+}
+
+define <7 x float> @min_v7f32(<7 x float> %a, <7 x float> %b) {
+; CHECK-LABEL: min_v7f32:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: mov x8, sp
+; CHECK-NEXT: // kill: def $s7 killed $s7 def $q7
+; CHECK-NEXT: // kill: def $s0 killed $s0 def $q0
+; CHECK-NEXT: // kill: def $s1 killed $s1 def $q1
+; CHECK-NEXT: add x9, sp, #32
+; CHECK-NEXT: mov v0.s[1], v1.s[0]
+; CHECK-NEXT: ldr s1, [sp, #24]
+; CHECK-NEXT: // kill: def $s4 killed $s4 def $q4
+; CHECK-NEXT: // kill: def $s5 killed $s5 def $q5
+; CHECK-NEXT: // kill: def $s2 killed $s2 def $q2
+; CHECK-NEXT: // kill: def $s6 killed $s6 def $q6
+; CHECK-NEXT: // kill: def $s3 killed $s3 def $q3
+; CHECK-NEXT: ld1 { v7.s }[1], [x8]
+; CHECK-NEXT: add x8, sp, #8
+; CHECK-NEXT: ld1 { v1.s }[1], [x9]
+; CHECK-NEXT: mov v0.s[2], v2.s[0]
+; CHECK-NEXT: mov v4.s[1], v5.s[0]
+; CHECK-NEXT: ld1 { v7.s }[2], [x8]
+; CHECK-NEXT: add x8, sp, #16
+; CHECK-NEXT: mov v0.s[3], v3.s[0]
+; CHECK-NEXT: mov v4.s[2], v6.s[0]
+; CHECK-NEXT: ld1 { v7.s }[3], [x8]
+; CHECK-NEXT: add x8, sp, #40
+; CHECK-NEXT: ld1 { v1.s }[2], [x8]
+; CHECK-NEXT: fminnm v0.4s, v0.4s, v7.4s
+; CHECK-NEXT: fminnm v4.4s, v4.4s, v1.4s
+; CHECK-NEXT: mov s1, v0.s[1]
+; CHECK-NEXT: mov s2, v0.s[2]
+; CHECK-NEXT: mov s3, v0.s[3]
+; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
+; CHECK-NEXT: mov s5, v4.s[1]
+; CHECK-NEXT: mov s6, v4.s[2]
+; CHECK-NEXT: // kill: def $s4 killed $s4 killed $q4
+; CHECK-NEXT: ret
+entry:
+ %c = call <7 x float> @llvm.minnum.v7f32(<7 x float> %a, <7 x float> %b)
+ ret <7 x float> %c
+}
+
+define <7 x float> @max_v7f32(<7 x float> %a, <7 x float> %b) {
+; CHECK-LABEL: max_v7f32:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: mov x8, sp
+; CHECK-NEXT: // kill: def $s7 killed $s7 def $q7
+; CHECK-NEXT: // kill: def $s0 killed $s0 def $q0
+; CHECK-NEXT: // kill: def $s1 killed $s1 def $q1
+; CHECK-NEXT: add x9, sp, #32
+; CHECK-NEXT: mov v0.s[1], v1.s[0]
+; CHECK-NEXT: ldr s1, [sp, #24]
+; CHECK-NEXT: // kill: def $s4 killed $s4 def $q4
+; CHECK-NEXT: // kill: def $s5 killed $s5 def $q5
+; CHECK-NEXT: // kill: def $s2 killed $s2 def $q2
+; CHECK-NEXT: // kill: def $s6 killed $s6 def $q6
+; CHECK-NEXT: // kill: def $s3 killed $s3 def $q3
+; CHECK-NEXT: ld1 { v7.s }[1], [x8]
+; CHECK-NEXT: add x8, sp, #8
+; CHECK-NEXT: ld1 { v1.s }[1], [x9]
+; CHECK-NEXT: mov v0.s[2], v2.s[0]
+; CHECK-NEXT: mov v4.s[1], v5.s[0]
+; CHECK-NEXT: ld1 { v7.s }[2], [x8]
+; CHECK-NEXT: add x8, sp, #16
+; CHECK-NEXT: mov v0.s[3], v3.s[0]
+; CHECK-NEXT: mov v4.s[2], v6.s[0]
+; CHECK-NEXT: ld1 { v7.s }[3], [x8]
+; CHECK-NEXT: add x8, sp, #40
+; CHECK-NEXT: ld1 { v1.s }[2], [x8]
+; CHECK-NEXT: fmaxnm v0.4s, v0.4s, v7.4s
+; CHECK-NEXT: fmaxnm v4.4s, v4.4s, v1.4s
+; CHECK-NEXT: mov s1, v0.s[1]
+; CHECK-NEXT: mov s2, v0.s[2]
+; CHECK-NEXT: mov s3, v0.s[3]
+; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
+; CHECK-NEXT: mov s5, v4.s[1]
+; CHECK-NEXT: mov s6, v4.s[2]
+; CHECK-NEXT: // kill: def $s4 killed $s4 killed $q4
+; CHECK-NEXT: ret
+entry:
+ %c = call <7 x float> @llvm.maxnum.v7f32(<7 x float> %a, <7 x float> %b)
+ ret <7 x float> %c
+}
+
+define <8 x float> @min_v8f32(<8 x float> %a, <8 x float> %b) {
+; CHECK-LABEL: min_v8f32:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: fminnm v0.4s, v0.4s, v2.4s
+; CHECK-NEXT: fminnm v1.4s, v1.4s, v3.4s
+; CHECK-NEXT: ret
+entry:
+ %c = call <8 x float> @llvm.minnum.v8f32(<8 x float> %a, <8 x float> %b)
+ ret <8 x float> %c
+}
+
+define <8 x float> @max_v8f32(<8 x float> %a, <8 x float> %b) {
+; CHECK-LABEL: max_v8f32:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: fmaxnm v0.4s, v0.4s, v2.4s
+; CHECK-NEXT: fmaxnm v1.4s, v1.4s, v3.4s
+; CHECK-NEXT: ret
+entry:
+ %c = call <8 x float> @llvm.maxnum.v8f32(<8 x float> %a, <8 x float> %b)
+ ret <8 x float> %c
+}
+
+define <4 x half> @min_v4f16(<4 x half> %a, <4 x half> %b) {
+; CHECK-NOFP16-LABEL: min_v4f16:
+; CHECK-NOFP16: // %bb.0: // %entry
+; CHECK-NOFP16-NEXT: // kill: def $d1 killed $d1 def $q1
+; CHECK-NOFP16-NEXT: // kill: def $d0 killed $d0 def $q0
+; CHECK-NOFP16-NEXT: mov h2, v1.h[1]
+; CHECK-NOFP16-NEXT: mov h3, v0.h[1]
+; CHECK-NOFP16-NEXT: fcvt s4, h1
+; CHECK-NOFP16-NEXT: fcvt s5, h0
+; CHECK-NOFP16-NEXT: mov h6, v1.h[2]
+; CHECK-NOFP16-NEXT: mov h7, v0.h[2]
+; CHECK-NOFP16-NEXT: mov h1, v1.h[3]
+; CHECK-NOFP16-NEXT: fcvt s2, h2
+; CHECK-NOFP16-NEXT: fcvt s3, h3
+; CHECK-NOFP16-NEXT: fminnm s4, s5, s4
+; CHECK-NOFP16-NEXT: fcvt s5, h7
+; CHECK-NOFP16-NEXT: fcvt s1, h1
+; CHECK-NOFP16-NEXT: fminnm s2, s3, s2
+; CHECK-NOFP16-NEXT: fcvt s3, h6
+; CHECK-NOFP16-NEXT: mov h6, v0.h[3]
+; CHECK-NOFP16-NEXT: fcvt h0, s4
+; CHECK-NOFP16-NEXT: fcvt h2, s2
+; CHECK-NOFP16-NEXT: fminnm s3, s5, s3
+; CHECK-NOFP16-NEXT: fcvt s4, h6
+; CHECK-NOFP16-NEXT: mov v0.h[1], v2.h[0]
+; CHECK-NOFP16-NEXT: fcvt h2, s3
+; CHECK-NOFP16-NEXT: fminnm s1, s4, s1
+; CHECK-NOFP16-NEXT: mov v0.h[2], v2.h[0]
+; CHECK-NOFP16-NEXT: fcvt h1, s1
+; CHECK-NOFP16-NEXT: mov v0.h[3], v1.h[0]
+; CHECK-NOFP16-NEXT: // kill: def $d0 killed $d0 killed $q0
+; CHECK-NOFP16-NEXT: ret
+;
+; CHECK-FP16-LABEL: min_v4f16:
+; CHECK-FP16: // %bb.0: // %entry
+; CHECK-FP16-NEXT: fminnm v0.4h, v0.4h, v1.4h
+; CHECK-FP16-NEXT: ret
+entry:
+ %c = call <4 x half> @llvm.minnum.v4f16(<4 x half> %a, <4 x half> %b)
+ ret <4 x half> %c
+}
+
+define <4 x half> @max_v4f16(<4 x half> %a, <4 x half> %b) {
+; CHECK-NOFP16-LABEL: max_v4f16:
+; CHECK-NOFP16: // %bb.0: // %entry
+; CHECK-NOFP16-NEXT: // kill: def $d1 killed $d1 def $q1
+; CHECK-NOFP16-NEXT: // kill: def $d0 killed $d0 def $q0
+; CHECK-NOFP16-NEXT: mov h2, v1.h[1]
+; CHECK-NOFP16-NEXT: mov h3, v0.h[1]
+; CHECK-NOFP16-NEXT: fcvt s4, h1
+; CHECK-NOFP16-NEXT: fcvt s5, h0
+; CHECK-NOFP16-NEXT: mov h6, v1.h[2]
+; CHECK-NOFP16-NEXT: mov h7, v0.h[2]
+; CHECK-NOFP16-NEXT: mov h1, v1.h[3]
+; CHECK-NOFP16-NEXT: fcvt s2, h2
+; CHECK-NOFP16-NEXT: fcvt s3, h3
+; CHECK-NOFP16-NEXT: fmaxnm s4, s5, s4
+; CHECK-NOFP16-NEXT: fcvt s5, h7
+; CHECK-NOFP16-NEXT: fcvt s1, h1
+; CHECK-NOFP16-NEXT: fmaxnm s2, s3, s2
+; CHECK-NOFP16-NEXT: fcvt s3, h6
+; CHECK-NOFP16-NEXT: mov h6, v0.h[3]
+; CHECK-NOFP16-NEXT: fcvt h0, s4
+; CHECK-NOFP16-NEXT: fcvt h2, s2
+; CHECK-NOFP16-NEXT: fmaxnm s3, s5, s3
+; CHECK-NOFP16-NEXT: fcvt s4, h6
+; CHECK-NOFP16-NEXT: mov v0.h[1], v2.h[0]
+; CHECK-NOFP16-NEXT: fcvt h2, s3
+; CHECK-NOFP16-NEXT: fmaxnm s1, s4, s1
+; CHECK-NOFP16-NEXT: mov v0.h[2], v2.h[0]
+; CHECK-NOFP16-NEXT: fcvt h1, s1
+; CHECK-NOFP16-NEXT: mov v0.h[3], v1.h[0]
+; CHECK-NOFP16-NEXT: // kill: def $d0 killed $d0 killed $q0
+; CHECK-NOFP16-NEXT: ret
+;
+; CHECK-FP16-LABEL: max_v4f16:
+; CHECK-FP16: // %bb.0: // %entry
+; CHECK-FP16-NEXT: fmaxnm v0.4h, v0.4h, v1.4h
+; CHECK-FP16-NEXT: ret
+entry:
+ %c = call <4 x half> @llvm.maxnum.v4f16(<4 x half> %a, <4 x half> %b)
+ ret <4 x half> %c
+}
+
+define <7 x half> @min_v7f16(<7 x half> %a, <7 x half> %b) {
+; CHECK-NOFP16-LABEL: min_v7f16:
+; CHECK-NOFP16: // %bb.0: // %entry
+; CHECK-NOFP16-NEXT: mov h2, v1.h[1]
+; CHECK-NOFP16-NEXT: mov h3, v0.h[1]
+; CHECK-NOFP16-NEXT: fcvt s4, h1
+; CHECK-NOFP16-NEXT: fcvt s5, h0
+; CHECK-NOFP16-NEXT: mov h6, v1.h[2]
+; CHECK-NOFP16-NEXT: mov h7, v0.h[2]
+; CHECK-NOFP16-NEXT: mov h16, v1.h[3]
+; CHECK-NOFP16-NEXT: mov h17, v0.h[3]
+; CHECK-NOFP16-NEXT: fcvt s2, h2
+; CHECK-NOFP16-NEXT: fcvt s3, h3
+; CHECK-NOFP16-NEXT: fminnm s4, s5, s4
+; CHECK-NOFP16-NEXT: fcvt s5, h6
+; CHECK-NOFP16-NEXT: fcvt s6, h7
+; CHECK-NOFP16-NEXT: fcvt s7, h16
+; CHECK-NOFP16-NEXT: fcvt s16, h17
+; CHECK-NOFP16-NEXT: fminnm s3, s3, s2
+; CHECK-NOFP16-NEXT: fcvt h2, s4
+; CHECK-NOFP16-NEXT: fminnm s4, s6, s5
+; CHECK-NOFP16-NEXT: mov h5, v1.h[4]
+; CHECK-NOFP16-NEXT: mov h6, v0.h[4]
+; CHECK-NOFP16-NEXT: fminnm s7, s16, s7
+; CHECK-NOFP16-NEXT: fcvt h3, s3
+; CHECK-NOFP16-NEXT: mov h16, v0.h[5]
+; CHECK-NOFP16-NEXT: fcvt s5, h5
+; CHECK-NOFP16-NEXT: fcvt s6, h6
+; CHECK-NOFP16-NEXT: fcvt h7, s7
+; CHECK-NOFP16-NEXT: mov v2.h[1], v3.h[0]
+; CHECK-NOFP16-NEXT: fcvt h3, s4
+; CHECK-NOFP16-NEXT: mov h4, v1.h[5]
+; CHECK-NOFP16-NEXT: fminnm s5, s6, s5
+; CHECK-NOFP16-NEXT: mov h6, v1.h[6]
+; CHECK-NOFP16-NEXT: mov v2.h[2], v3.h[0]
+; CHECK-NOFP16-NEXT: mov h1, v1.h[7]
+; CHECK-NOFP16-NEXT: fcvt s3, h4
+; CHECK-NOFP16-NEXT: fcvt s4, h16
+; CHECK-NOFP16-NEXT: mov h16, v0.h[6]
+; CHECK-NOFP16-NEXT: mov h0, v0.h[7]
+; CHECK-NOFP16-NEXT: mov v2.h[3], v7.h[0]
+; CHECK-NOFP16-NEXT: fcvt s1, h1
+; CHECK-NOFP16-NEXT: fminnm s3, s4, s3
+; CHECK-NOFP16-NEXT: fcvt h4, s5
+; CHECK-NOFP16-NEXT: fcvt s5, h6
+; CHECK-NOFP16-NEXT: fcvt s6, h16
+; CHECK-NOFP16-NEXT: fcvt s0, h0
+; CHECK-NOFP16-NEXT: mov v2.h[4], v4.h[0]
+; CHECK-NOFP16-NEXT: fcvt h3, s3
+; CHECK-NOFP16-NEXT: fminnm s4, s6, s5
+; CHECK-NOFP16-NEXT: fminnm s0, s0, s1
+; CHECK-NOFP16-NEXT: mov v2.h[5], v3.h[0]
+; CHECK-NOFP16-NEXT: fcvt h3, s4
+; CHECK-NOFP16-NEXT: fcvt h0, s0
+; CHECK-NOFP16-NEXT: mov v2.h[6], v3.h[0]
+; CHECK-NOFP16-NEXT: mov v2.h[7], v0.h[0]
+; CHECK-NOFP16-NEXT: mov v0.16b, v2.16b
+; CHECK-NOFP16-NEXT: ret
+;
+; CHECK-FP16-LABEL: min_v7f16:
+; CHECK-FP16: // %bb.0: // %entry
+; CHECK-FP16-NEXT: fminnm v0.8h, v0.8h, v1.8h
+; CHECK-FP16-NEXT: ret
+entry:
+ %c = call <7 x half> @llvm.minnum.v7f16(<7 x half> %a, <7 x half> %b)
+ ret <7 x half> %c
+}
+
+define <7 x half> @max_v7f16(<7 x half> %a, <7 x half> %b) {
+; CHECK-NOFP16-LABEL: max_v7f16:
+; CHECK-NOFP16: // %bb.0: // %entry
+; CHECK-NOFP16-NEXT: mov h2, v1.h[1]
+; CHECK-NOFP16-NEXT: mov h3, v0.h[1]
+; CHECK-NOFP16-NEXT: fcvt s4, h1
+; CHECK-NOFP16-NEXT: fcvt s5, h0
+; CHECK-NOFP16-NEXT: mov h6, v1.h[2]
+; CHECK-NOFP16-NEXT: mov h7, v0.h[2]
+; CHECK-NOFP16-NEXT: mov h16, v1.h[3]
+; CHECK-NOFP16-NEXT: mov h17, v0.h[3]
+; CHECK-NOFP16-NEXT: fcvt s2, h2
+; CHECK-NOFP16-NEXT: fcvt s3, h3
+; CHECK-NOFP16-NEXT: fmaxnm s4, s5, s4
+; CHECK-NOFP16-NEXT: fcvt s5, h6
+; CHECK-NOFP16-NEXT: fcvt s6, h7
+; CHECK-NOFP16-NEXT: fcvt s7, h16
+; CHECK-NOFP16-NEXT: fcvt s16, h17
+; CHECK-NOFP16-NEXT: fmaxnm s3, s3, s2
+; CHECK-NOFP16-NEXT: fcvt h2, s4
+; CHECK-NOFP16-NEXT: fmaxnm s4, s6, s5
+; CHECK-NOFP16-NEXT: mov h5, v1.h[4]
+; CHECK-NOFP16-NEXT: mov h6, v0.h[4]
+; CHECK-NOFP16-NEXT: fmaxnm s7, s16, s7
+; CHECK-NOFP16-NEXT: fcvt h3, s3
+; CHECK-NOFP16-NEXT: mov h16, v0.h[5]
+; CHECK-NOFP16-NEXT: fcvt s5, h5
+; CHECK-NOFP16-NEXT: fcvt s6, h6
+; CHECK-NOFP16-NEXT: fcvt h7, s7
+; CHECK-NOFP16-NEXT: mov v2.h[1], v3.h[0]
+; CHECK-NOFP16-NEXT: fcvt h3, s4
+; CHECK-NOFP16-NEXT: mov h4, v1.h[5]
+; CHECK-NOFP16-NEXT: fmaxnm s5, s6, s5
+; CHECK-NOFP16-NEXT: mov h6, v1.h[6]
+; CHECK-NOFP16-NEXT: mov v2.h[2], v3.h[0]
+; CHECK-NOFP16-NEXT: mov h1, v1.h[7]
+; CHECK-NOFP16-NEXT: fcvt s3, h4
+; CHECK-NOFP16-NEXT: fcvt s4, h16
+; CHECK-NOFP16-NEXT: mov h16, v0.h[6]
+; CHECK-NOFP16-NEXT: mov h0, v0.h[7]
+; CHECK-NOFP16-NEXT: mov v2.h[3], v7.h[0]
+; CHECK-NOFP16-NEXT: fcvt s1, h1
+; CHECK-NOFP16-NEXT: fmaxnm s3, s4, s3
+; CHECK-NOFP16-NEXT: fcvt h4, s5
+; CHECK-NOFP16-NEXT: fcvt s5, h6
+; CHECK-NOFP16-NEXT: fcvt s6, h16
+; CHECK-NOFP16-NEXT: fcvt s0, h0
+; CHECK-NOFP16-NEXT: mov v2.h[4], v4.h[0]
+; CHECK-NOFP16-NEXT: fcvt h3, s3
+; CHECK-NOFP16-NEXT: fmaxnm s4, s6, s5
+; CHECK-NOFP16-NEXT: fmaxnm s0, s0, s1
+; CHECK-NOFP16-NEXT: mov v2.h[5], v3.h[0]
+; CHECK-NOFP16-NEXT: fcvt h3, s4
+; CHECK-NOFP16-NEXT: fcvt h0, s0
+; CHECK-NOFP16-NEXT: mov v2.h[6], v3.h[0]
+; CHECK-NOFP16-NEXT: mov v2.h[7], v0.h[0]
+; CHECK-NOFP16-NEXT: mov v0.16b, v2.16b
+; CHECK-NOFP16-NEXT: ret
+;
+; CHECK-FP16-LABEL: max_v7f16:
+; CHECK-FP16: // %bb.0: // %entry
+; CHECK-FP16-NEXT: fmaxnm v0.8h, v0.8h, v1.8h
+; CHECK-FP16-NEXT: ret
+entry:
+ %c = call <7 x half> @llvm.maxnum.v7f16(<7 x half> %a, <7 x half> %b)
+ ret <7 x half> %c
+}
+
+define <8 x half> @min_v8f16(<8 x half> %a, <8 x half> %b) {
+; CHECK-NOFP16-LABEL: min_v8f16:
+; CHECK-NOFP16: // %bb.0: // %entry
+; CHECK-NOFP16-NEXT: mov h2, v1.h[1]
+; CHECK-NOFP16-NEXT: mov h3, v0.h[1]
+; CHECK-NOFP16-NEXT: fcvt s4, h1
+; CHECK-NOFP16-NEXT: fcvt s5, h0
+; CHECK-NOFP16-NEXT: mov h6, v1.h[2]
+; CHECK-NOFP16-NEXT: mov h7, v0.h[2]
+; CHECK-NOFP16-NEXT: mov h16, v1.h[3]
+; CHECK-NOFP16-NEXT: mov h17, v0.h[3]
+; CHECK-NOFP16-NEXT: fcvt s2, h2
+; CHECK-NOFP16-NEXT: fcvt s3, h3
+; CHECK-NOFP16-NEXT: fminnm s4, s5, s4
+; CHECK-NOFP16-NEXT: fcvt s5, h6
+; CHECK-NOFP16-NEXT: fcvt s6, h7
+; CHECK-NOFP16-NEXT: fcvt s7, h16
+; CHECK-NOFP16-NEXT: fcvt s16, h17
+; CHECK-NOFP16-NEXT: fminnm s3, s3, s2
+; CHECK-NOFP16-NEXT: fcvt h2, s4
+; CHECK-NOFP16-NEXT: fminnm s4, s6, s5
+; CHECK-NOFP16-NEXT: mov h5, v1.h[4]
+; CHECK-NOFP16-NEXT: mov h6, v0.h[4]
+; CHECK-NOFP16-NEXT: fminnm s7, s16, s7
+; CHECK-NOFP16-NEXT: fcvt h3, s3
+; CHECK-NOFP16-NEXT: mov h16, v0.h[5]
+; CHECK-NOFP16-NEXT: fcvt s5, h5
+; CHECK-NOFP16-NEXT: fcvt s6, h6
+; CHECK-NOFP16-NEXT: fcvt h7, s7
+; CHECK-NOFP16-NEXT: mov v2.h[1], v3.h[0]
+; CHECK-NOFP16-NEXT: fcvt h3, s4
+; CHECK-NOFP16-NEXT: mov h4, v1.h[5]
+; CHECK-NOFP16-NEXT: fminnm s5, s6, s5
+; CHECK-NOFP16-NEXT: mov h6, v1.h[6]
+; CHECK-NOFP16-NEXT: mov v2.h[2], v3.h[0]
+; CHECK-NOFP16-NEXT: mov h1, v1.h[7]
+; CHECK-NOFP16-NEXT: fcvt s3, h4
+; CHECK-NOFP16-NEXT: fcvt s4, h16
+; CHECK-NOFP16-NEXT: mov h16, v0.h[6]
+; CHECK-NOFP16-NEXT: mov h0, v0.h[7]
+; CHECK-NOFP16-NEXT: mov v2.h[3], v7.h[0]
+; CHECK-NOFP16-NEXT: fcvt s1, h1
+; CHECK-NOFP16-NEXT: fminnm s3, s4, s3
+; CHECK-NOFP16-NEXT: fcvt h4, s5
+; CHECK-NOFP16-NEXT: fcvt s5, h6
+; CHECK-NOFP16-NEXT: fcvt s6, h16
+; CHECK-NOFP16-NEXT: fcvt s0, h0
+; CHECK-NOFP16-NEXT: mov v2.h[4], v4.h[0]
+; CHECK-NOFP16-NEXT: fcvt h3, s3
+; CHECK-NOFP16-NEXT: fminnm s4, s6, s5
+; CHECK-NOFP16-NEXT: fminnm s0, s0, s1
+; CHECK-NOFP16-NEXT: mov v2.h[5], v3.h[0]
+; CHECK-NOFP16-NEXT: fcvt h3, s4
+; CHECK-NOFP16-NEXT: fcvt h0, s0
+; CHECK-NOFP16-NEXT: mov v2.h[6], v3.h[0]
+; CHECK-NOFP16-NEXT: mov v2.h[7], v0.h[0]
+; CHECK-NOFP16-NEXT: mov v0.16b, v2.16b
+; CHECK-NOFP16-NEXT: ret
+;
+; CHECK-FP16-LABEL: min_v8f16:
+; CHECK-FP16: // %bb.0: // %entry
+; CHECK-FP16-NEXT: fminnm v0.8h, v0.8h, v1.8h
+; CHECK-FP16-NEXT: ret
+entry:
+ %c = call <8 x half> @llvm.minnum.v8f16(<8 x half> %a, <8 x half> %b)
+ ret <8 x half> %c
+}
+
+define <8 x half> @max_v8f16(<8 x half> %a, <8 x half> %b) {
+; CHECK-NOFP16-LABEL: max_v8f16:
+; CHECK-NOFP16: // %bb.0: // %entry
+; CHECK-NOFP16-NEXT: mov h2, v1.h[1]
+; CHECK-NOFP16-NEXT: mov h3, v0.h[1]
+; CHECK-NOFP16-NEXT: fcvt s4, h1
+; CHECK-NOFP16-NEXT: fcvt s5, h0
+; CHECK-NOFP16-NEXT: mov h6, v1.h[2]
+; CHECK-NOFP16-NEXT: mov h7, v0.h[2]
+; CHECK-NOFP16-NEXT: mov h16, v1.h[3]
+; CHECK-NOFP16-NEXT: mov h17, v0.h[3]
+; CHECK-NOFP16-NEXT: fcvt s2, h2
+; CHECK-NOFP16-NEXT: fcvt s3, h3
+; CHECK-NOFP16-NEXT: fmaxnm s4, s5, s4
+; CHECK-NOFP16-NEXT: fcvt s5, h6
+; CHECK-NOFP16-NEXT: fcvt s6, h7
+; CHECK-NOFP16-NEXT: fcvt s7, h16
+; CHECK-NOFP16-NEXT: fcvt s16, h17
+; CHECK-NOFP16-NEXT: fmaxnm s3, s3, s2
+; CHECK-NOFP16-NEXT: fcvt h2, s4
+; CHECK-NOFP16-NEXT: fmaxnm s4, s6, s5
+; CHECK-NOFP16-NEXT: mov h5, v1.h[4]
+; CHECK-NOFP16-NEXT: mov h6, v0.h[4]
+; CHECK-NOFP16-NEXT: fmaxnm s7, s16, s7
+; CHECK-NOFP16-NEXT: fcvt h3, s3
+; CHECK-NOFP16-NEXT: mov h16, v0.h[5]
+; CHECK-NOFP16-NEXT: fcvt s5, h5
+; CHECK-NOFP16-NEXT: fcvt s6, h6
+; CHECK-NOFP16-NEXT: fcvt h7, s7
+; CHECK-NOFP16-NEXT: mov v2.h[1], v3.h[0]
+; CHECK-NOFP16-NEXT: fcvt h3, s4
+; CHECK-NOFP16-NEXT: mov h4, v1.h[5]
+; CHECK-NOFP16-NEXT: fmaxnm s5, s6, s5
+; CHECK-NOFP16-NEXT: mov h6, v1.h[6]
+; CHECK-NOFP16-NEXT: mov v2.h[2], v3.h[0]
+; CHECK-NOFP16-NEXT: mov h1, v1.h[7]
+; CHECK-NOFP16-NEXT: fcvt s3, h4
+; CHECK-NOFP16-NEXT: fcvt s4, h16
+; CHECK-NOFP16-NEXT: mov h16, v0.h[6]
+; CHECK-NOFP16-NEXT: mov h0, v0.h[7]
+; CHECK-NOFP16-NEXT: mov v2.h[3], v7.h[0]
+; CHECK-NOFP16-NEXT: fcvt s1, h1
+; CHECK-NOFP16-NEXT: fmaxnm s3, s4, s3
+; CHECK-NOFP16-NEXT: fcvt h4, s5
+; CHECK-NOFP16-NEXT: fcvt s5, h6
+; CHECK-NOFP16-NEXT: fcvt s6, h16
+; CHECK-NOFP16-NEXT: fcvt s0, h0
+; CHECK-NOFP16-NEXT: mov v2.h[4], v4.h[0]
+; CHECK-NOFP16-NEXT: fcvt h3, s3
+; CHECK-NOFP16-NEXT: fmaxnm s4, s6, s5
+; CHECK-NOFP16-NEXT: fmaxnm s0, s0, s1
+; CHECK-NOFP16-NEXT: mov v2.h[5], v3.h[0]
+; CHECK-NOFP16-NEXT: fcvt h3, s4
+; CHECK-NOFP16-NEXT: fcvt h0, s0
+; CHECK-NOFP16-NEXT: mov v2.h[6], v3.h[0]
+; CHECK-NOFP16-NEXT: mov v2.h[7], v0.h[0]
+; CHECK-NOFP16-NEXT: mov v0.16b, v2.16b
+; CHECK-NOFP16-NEXT: ret
+;
+; CHECK-FP16-LABEL: max_v8f16:
+; CHECK-FP16: // %bb.0: // %entry
+; CHECK-FP16-NEXT: fmaxnm v0.8h, v0.8h, v1.8h
+; CHECK-FP16-NEXT: ret
+entry:
+ %c = call <8 x half> @llvm.maxnum.v8f16(<8 x half> %a, <8 x half> %b)
+ ret <8 x half> %c
+}
+
+define <16 x half> @min_v16f16(<16 x half> %a, <16 x half> %b) {
+; CHECK-NOFP16-LABEL: min_v16f16:
+; CHECK-NOFP16: // %bb.0: // %entry
+; CHECK-NOFP16-NEXT: mov h4, v2.h[1]
+; CHECK-NOFP16-NEXT: mov h5, v0.h[1]
+; CHECK-NOFP16-NEXT: fcvt s6, h2
+; CHECK-NOFP16-NEXT: fcvt s7, h0
+; CHECK-NOFP16-NEXT: mov h16, v2.h[2]
+; CHECK-NOFP16-NEXT: mov h17, v0.h[2]
+; CHECK-NOFP16-NEXT: mov h18, v3.h[1]
+; CHECK-NOFP16-NEXT: mov h19, v1.h[1]
+; CHECK-NOFP16-NEXT: fcvt s4, h4
+; CHECK-NOFP16-NEXT: fcvt s5, h5
+; CHECK-NOFP16-NEXT: fminnm s6, s7, s6
+; CHECK-NOFP16-NEXT: fcvt s20, h1
+; CHECK-NOFP16-NEXT: fcvt s7, h16
+; CHECK-NOFP16-NEXT: fcvt s16, h17
+; CHECK-NOFP16-NEXT: mov h17, v2.h[3]
+; CHECK-NOFP16-NEXT: fcvt s18, h18
+; CHECK-NOFP16-NEXT: fminnm s5, s5, s4
+; CHECK-NOFP16-NEXT: fcvt s19, h19
+; CHECK-NOFP16-NEXT: fcvt h4, s6
+; CHECK-NOFP16-NEXT: mov h6, v0.h[3]
+; CHECK-NOFP16-NEXT: fminnm s7, s16, s7
+; CHECK-NOFP16-NEXT: fcvt s16, h3
+; CHECK-NOFP16-NEXT: mov h21, v0.h[4]
+; CHECK-NOFP16-NEXT: fcvt s17, h17
+; CHECK-NOFP16-NEXT: fcvt h5, s5
+; CHECK-NOFP16-NEXT: fminnm s18, s19, s18
+; CHECK-NOFP16-NEXT: fcvt s6, h6
+; CHECK-NOFP16-NEXT: mov h19, v3.h[2]
+; CHECK-NOFP16-NEXT: fminnm s16, s20, s16
+; CHECK-NOFP16-NEXT: mov h20, v1.h[2]
+; CHECK-NOFP16-NEXT: fcvt s21, h21
+; CHECK-NOFP16-NEXT: mov v4.h[1], v5.h[0]
+; CHECK-NOFP16-NEXT: fcvt h5, s7
+; CHECK-NOFP16-NEXT: mov h7, v2.h[4]
+; CHECK-NOFP16-NEXT: fminnm s6, s6, s17
+; CHECK-NOFP16-NEXT: mov h17, v3.h[3]
+; CHECK-NOFP16-NEXT: fcvt s19, h19
+; CHECK-NOFP16-NEXT: fcvt s20, h20
+; CHECK-NOFP16-NEXT: mov v4.h[2], v5.h[0]
+; CHECK-NOFP16-NEXT: fcvt h5, s16
+; CHECK-NOFP16-NEXT: fcvt s7, h7
+; CHECK-NOFP16-NEXT: fcvt h16, s18
+; CHECK-NOFP16-NEXT: mov h18, v1.h[3]
+; CHECK-NOFP16-NEXT: fcvt h6, s6
+; CHECK-NOFP16-NEXT: fminnm s7, s21, s7
+; CHECK-NOFP16-NEXT: mov v5.h[1], v16.h[0]
+; CHECK-NOFP16-NEXT: fcvt s16, h17
+; CHECK-NOFP16-NEXT: fminnm s17, s20, s19
+; CHECK-NOFP16-NEXT: fcvt s18, h18
+; CHECK-NOFP16-NEXT: mov h19, v3.h[4]
+; CHECK-NOFP16-NEXT: mov h20, v1.h[4]
+; CHECK-NOFP16-NEXT: mov v4.h[3], v6.h[0]
+; CHECK-NOFP16-NEXT: fcvt h6, s7
+; CHECK-NOFP16-NEXT: fminnm s7, s18, s16
+; CHECK-NOFP16-NEXT: fcvt h16, s17
+; CHECK-NOFP16-NEXT: fcvt s17, h19
+; CHECK-NOFP16-NEXT: fcvt s18, h20
+; CHECK-NOFP16-NEXT: mov v4.h[4], v6.h[0]
+; CHECK-NOFP16-NEXT: mov h19, v1.h[5]
+; CHECK-NOFP16-NEXT: mov v5.h[2], v16.h[0]
+; CHECK-NOFP16-NEXT: fcvt h6, s7
+; CHECK-NOFP16-NEXT: fminnm s7, s18, s17
+; CHECK-NOFP16-NEXT: mov h16, v2.h[5]
+; CHECK-NOFP16-NEXT: mov h17, v0.h[5]
+; CHECK-NOFP16-NEXT: mov h18, v3.h[5]
+; CHECK-NOFP16-NEXT: mov v5.h[3], v6.h[0]
+; CHECK-NOFP16-NEXT: fcvt h6, s7
+; CHECK-NOFP16-NEXT: fcvt s7, h16
+; CHECK-NOFP16-NEXT: fcvt s16, h17
+; CHECK-NOFP16-NEXT: fcvt s17, h18
+; CHECK-NOFP16-NEXT: fcvt s18, h19
+; CHECK-NOFP16-NEXT: mov h19, v2.h[6]
+; CHECK-NOFP16-NEXT: mov h2, v2.h[7]
+; CHECK-NOFP16-NEXT: mov v5.h[4], v6.h[0]
+; CHECK-NOFP16-NEXT: mov h6, v0.h[6]
+; CHECK-NOFP16-NEXT: fminnm s7, s16, s7
+; CHECK-NOFP16-NEXT: fminnm s16, s18, s17
+; CHECK-NOFP16-NEXT: mov h17, v3.h[6]
+; CHECK-NOFP16-NEXT: mov h18, v1.h[6]
+; CHECK-NOFP16-NEXT: fcvt s19, h19
+; CHECK-NOFP16-NEXT: fcvt s6, h6
+; CHECK-NOFP16-NEXT: mov h0, v0.h[7]
+; CHECK-NOFP16-NEXT: mov h3, v3.h[7]
+; CHECK-NOFP16-NEXT: mov h1, v1.h[7]
+; CHECK-NOFP16-NEXT: fcvt s17, h17
+; CHECK-NOFP16-NEXT: fcvt h7, s7
+; CHECK-NOFP16-NEXT: fcvt s18, h18
+; CHECK-NOFP16-NEXT: fcvt s2, h2
+; CHECK-NOFP16-NEXT: fminnm s6, s6, s19
+; CHECK-NOFP16-NEXT: fcvt s0, h0
+; CHECK-NOFP16-NEXT: fcvt s3, h3
+; CHECK-NOFP16-NEXT: fcvt s1, h1
+; CHECK-NOFP16-NEXT: fcvt h16, s16
+; CHECK-NOFP16-NEXT: fminnm s17, s18, s17
+; CHECK-NOFP16-NEXT: mov v4.h[5], v7.h[0]
+; CHECK-NOFP16-NEXT: fcvt h6, s6
+; CHECK-NOFP16-NEXT: fminnm s0, s0, s2
+; CHECK-NOFP16-NEXT: fminnm s1, s1, s3
+; CHECK-NOFP16-NEXT: mov v5.h[5], v16.h[0]
+; CHECK-NOFP16-NEXT: fcvt h2, s17
+; CHECK-NOFP16-NEXT: mov v4.h[6], v6.h[0]
+; CHECK-NOFP16-NEXT: fcvt h0, s0
+; CHECK-NOFP16-NEXT: fcvt h1, s1
+; CHECK-NOFP16-NEXT: mov v5.h[6], v2.h[0]
+; CHECK-NOFP16-NEXT: mov v4.h[7], v0.h[0]
+; CHECK-NOFP16-NEXT: mov v5.h[7], v1.h[0]
+; CHECK-NOFP16-NEXT: mov v0.16b, v4.16b
+; CHECK-NOFP16-NEXT: mov v1.16b, v5.16b
+; CHECK-NOFP16-NEXT: ret
+;
+; CHECK-FP16-LABEL: min_v16f16:
+; CHECK-FP16: // %bb.0: // %entry
+; CHECK-FP16-NEXT: fminnm v0.8h, v0.8h, v2.8h
+; CHECK-FP16-NEXT: fminnm v1.8h, v1.8h, v3.8h
+; CHECK-FP16-NEXT: ret
+entry:
+ %c = call <16 x half> @llvm.minnum.v16f16(<16 x half> %a, <16 x half> %b)
+ ret <16 x half> %c
+}
+
+define <16 x half> @max_v16f16(<16 x half> %a, <16 x half> %b) {
+; CHECK-NOFP16-LABEL: max_v16f16:
+; CHECK-NOFP16: // %bb.0: // %entry
+; CHECK-NOFP16-NEXT: mov h4, v2.h[1]
+; CHECK-NOFP16-NEXT: mov h5, v0.h[1]
+; CHECK-NOFP16-NEXT: fcvt s6, h2
+; CHECK-NOFP16-NEXT: fcvt s7, h0
+; CHECK-NOFP16-NEXT: mov h16, v2.h[2]
+; CHECK-NOFP16-NEXT: mov h17, v0.h[2]
+; CHECK-NOFP16-NEXT: mov h18, v3.h[1]
+; CHECK-NOFP16-NEXT: mov h19, v1.h[1]
+; CHECK-NOFP16-NEXT: fcvt s4, h4
+; CHECK-NOFP16-NEXT: fcvt s5, h5
+; CHECK-NOFP16-NEXT: fmaxnm s6, s7, s6
+; CHECK-NOFP16-NEXT: fcvt s20, h1
+; CHECK-NOFP16-NEXT: fcvt s7, h16
+; CHECK-NOFP16-NEXT: fcvt s16, h17
+; CHECK-NOFP16-NEXT: mov h17, v2.h[3]
+; CHECK-NOFP16-NEXT: fcvt s18, h18
+; CHECK-NOFP16-NEXT: fmaxnm s5, s5, s4
+; CHECK-NOFP16-NEXT: fcvt s19, h19
+; CHECK-NOFP16-NEXT: fcvt h4, s6
+; CHECK-NOFP16-NEXT: mov h6, v0.h[3]
+; CHECK-NOFP16-NEXT: fmaxnm s7, s16, s7
+; CHECK-NOFP16-NEXT: fcvt s16, h3
+; CHECK-NOFP16-NEXT: mov h21, v0.h[4]
+; CHECK-NOFP16-NEXT: fcvt s17, h17
+; CHECK-NOFP16-NEXT: fcvt h5, s5
+; CHECK-NOFP16-NEXT: fmaxnm s18, s19, s18
+; CHECK-NOFP16-NEXT: fcvt s6, h6
+; CHECK-NOFP16-NEXT: mov h19, v3.h[2]
+; CHECK-NOFP16-NEXT: fmaxnm s16, s20, s16
+; CHECK-NOFP16-NEXT: mov h20, v1.h[2]
+; CHECK-NOFP16-NEXT: fcvt s21, h21
+; CHECK-NOFP16-NEXT: mov v4.h[1], v5.h[0]
+; CHECK-NOFP16-NEXT: fcvt h5, s7
+; CHECK-NOFP16-NEXT: mov h7, v2.h[4]
+; CHECK-NOFP16-NEXT: fmaxnm s6, s6, s17
+; CHECK-NOFP16-NEXT: mov h17, v3.h[3]
+; CHECK-NOFP16-NEXT: fcvt s19, h19
+; CHECK-NOFP16-NEXT: fcvt s20, h20
+; CHECK-NOFP16-NEXT: mov v4.h[2], v5.h[0]
+; CHECK-NOFP16-NEXT: fcvt h5, s16
+; CHECK-NOFP16-NEXT: fcvt s7, h7
+; CHECK-NOFP16-NEXT: fcvt h16, s18
+; CHECK-NOFP16-NEXT: mov h18, v1.h[3]
+; CHECK-NOFP16-NEXT: fcvt h6, s6
+; CHECK-NOFP16-NEXT: fmaxnm s7, s21, s7
+; CHECK-NOFP16-NEXT: mov v5.h[1], v16.h[0]
+; CHECK-NOFP16-NEXT: fcvt s16, h17
+; CHECK-NOFP16-NEXT: fmaxnm s17, s20, s19
+; CHECK-NOFP16-NEXT: fcvt s18, h18
+; CHECK-NOFP16-NEXT: mov h19, v3.h[4]
+; CHECK-NOFP16-NEXT: mov h20, v1.h[4]
+; CHECK-NOFP16-NEXT: mov v4.h[3], v6.h[0]
+; CHECK-NOFP16-NEXT: fcvt h6, s7
+; CHECK-NOFP16-NEXT: fmaxnm s7, s18, s16
+; CHECK-NOFP16-NEXT: fcvt h16, s17
+; CHECK-NOFP16-NEXT: fcvt s17, h19
+; CHECK-NOFP16-NEXT: fcvt s18, h20
+; CHECK-NOFP16-NEXT: mov v4.h[4], v6.h[0]
+; CHECK-NOFP16-NEXT: mov h19, v1.h[5]
+; CHECK-NOFP16-NEXT: mov v5.h[2], v16.h[0]
+; CHECK-NOFP16-NEXT: fcvt h6, s7
+; CHECK-NOFP16-NEXT: fmaxnm s7, s18, s17
+; CHECK-NOFP16-NEXT: mov h16, v2.h[5]
+; CHECK-NOFP16-NEXT: mov h17, v0.h[5]
+; CHECK-NOFP16-NEXT: mov h18, v3.h[5]
+; CHECK-NOFP16-NEXT: mov v5.h[3], v6.h[0]
+; CHECK-NOFP16-NEXT: fcvt h6, s7
+; CHECK-NOFP16-NEXT: fcvt s7, h16
+; CHECK-NOFP16-NEXT: fcvt s16, h17
+; CHECK-NOFP16-NEXT: fcvt s17, h18
+; CHECK-NOFP16-NEXT: fcvt s18, h19
+; CHECK-NOFP16-NEXT: mov h19, v2.h[6]
+; CHECK-NOFP16-NEXT: mov h2, v2.h[7]
+; CHECK-NOFP16-NEXT: mov v5.h[4], v6.h[0]
+; CHECK-NOFP16-NEXT: mov h6, v0.h[6]
+; CHECK-NOFP16-NEXT: fmaxnm s7, s16, s7
+; CHECK-NOFP16-NEXT: fmaxnm s16, s18, s17
+; CHECK-NOFP16-NEXT: mov h17, v3.h[6]
+; CHECK-NOFP16-NEXT: mov h18, v1.h[6]
+; CHECK-NOFP16-NEXT: fcvt s19, h19
+; CHECK-NOFP16-NEXT: fcvt s6, h6
+; CHECK-NOFP16-NEXT: mov h0, v0.h[7]
+; CHECK-NOFP16-NEXT: mov h3, v3.h[7]
+; CHECK-NOFP16-NEXT: mov h1, v1.h[7]
+; CHECK-NOFP16-NEXT: fcvt s17, h17
+; CHECK-NOFP16-NEXT: fcvt h7, s7
+; CHECK-NOFP16-NEXT: fcvt s18, h18
+; CHECK-NOFP16-NEXT: fcvt s2, h2
+; CHECK-NOFP16-NEXT: fmaxnm s6, s6, s19
+; CHECK-NOFP16-NEXT: fcvt s0, h0
+; CHECK-NOFP16-NEXT: fcvt s3, h3
+; CHECK-NOFP16-NEXT: fcvt s1, h1
+; CHECK-NOFP16-NEXT: fcvt h16, s16
+; CHECK-NOFP16-NEXT: fmaxnm s17, s18, s17
+; CHECK-NOFP16-NEXT: mov v4.h[5], v7.h[0]
+; CHECK-NOFP16-NEXT: fcvt h6, s6
+; CHECK-NOFP16-NEXT: fmaxnm s0, s0, s2
+; CHECK-NOFP16-NEXT: fmaxnm s1, s1, s3
+; CHECK-NOFP16-NEXT: mov v5.h[5], v16.h[0]
+; CHECK-NOFP16-NEXT: fcvt h2, s17
+; CHECK-NOFP16-NEXT: mov v4.h[6], v6.h[0]
+; CHECK-NOFP16-NEXT: fcvt h0, s0
+; CHECK-NOFP16-NEXT: fcvt h1, s1
+; CHECK-NOFP16-NEXT: mov v5.h[6], v2.h[0]
+; CHECK-NOFP16-NEXT: mov v4.h[7], v0.h[0]
+; CHECK-NOFP16-NEXT: mov v5.h[7], v1.h[0]
+; CHECK-NOFP16-NEXT: mov v0.16b, v4.16b
+; CHECK-NOFP16-NEXT: mov v1.16b, v5.16b
+; CHECK-NOFP16-NEXT: ret
+;
+; CHECK-FP16-LABEL: max_v16f16:
+; CHECK-FP16: // %bb.0: // %entry
+; CHECK-FP16-NEXT: fmaxnm v0.8h, v0.8h, v2.8h
+; CHECK-FP16-NEXT: fmaxnm v1.8h, v1.8h, v3.8h
+; CHECK-FP16-NEXT: ret
+entry:
+ %c = call <16 x half> @llvm.maxnum.v16f16(<16 x half> %a, <16 x half> %b)
+ ret <16 x half> %c
+}
+
+declare <16 x half> @llvm.maxnum.v16f16(<16 x half>, <16 x half>)
+declare <16 x half> @llvm.minnum.v16f16(<16 x half>, <16 x half>)
+declare <2 x double> @llvm.maxnum.v2f64(<2 x double>, <2 x double>)
+declare <2 x double> @llvm.minnum.v2f64(<2 x double>, <2 x double>)
+declare <2 x float> @llvm.maxnum.v2f32(<2 x float>, <2 x float>)
+declare <2 x float> @llvm.minnum.v2f32(<2 x float>, <2 x float>)
+declare <3 x double> @llvm.maxnum.v3f64(<3 x double>, <3 x double>)
+declare <3 x double> @llvm.minnum.v3f64(<3 x double>, <3 x double>)
+declare <3 x float> @llvm.maxnum.v3f32(<3 x float>, <3 x float>)
+declare <3 x float> @llvm.minnum.v3f32(<3 x float>, <3 x float>)
+declare <4 x double> @llvm.maxnum.v4f64(<4 x double>, <4 x double>)
+declare <4 x double> @llvm.minnum.v4f64(<4 x double>, <4 x double>)
+declare <4 x float> @llvm.maxnum.v4f32(<4 x float>, <4 x float>)
+declare <4 x float> @llvm.minnum.v4f32(<4 x float>, <4 x float>)
+declare <4 x half> @llvm.maxnum.v4f16(<4 x half>, <4 x half>)
+declare <4 x half> @llvm.minnum.v4f16(<4 x half>, <4 x half>)
+declare <7 x float> @llvm.maxnum.v7f32(<7 x float>, <7 x float>)
+declare <7 x float> @llvm.minnum.v7f32(<7 x float>, <7 x float>)
+declare <7 x half> @llvm.maxnum.v7f16(<7 x half>, <7 x half>)
+declare <7 x half> @llvm.minnum.v7f16(<7 x half>, <7 x half>)
+declare <8 x float> @llvm.maxnum.v8f32(<8 x float>, <8 x float>)
+declare <8 x float> @llvm.minnum.v8f32(<8 x float>, <8 x float>)
+declare <8 x half> @llvm.maxnum.v8f16(<8 x half>, <8 x half>)
+declare <8 x half> @llvm.minnum.v8f16(<8 x half>, <8 x half>)
+declare double @llvm.maxnum.f64(double, double)
+declare double @llvm.minnum.f64(double, double)
+declare float @llvm.maxnum.f32(float, float)
+declare float @llvm.minnum.f32(float, float)
+declare half @llvm.maxnum.f16(half, half)
+declare half @llvm.minnum.f16(half, half)
More information about the llvm-commits
mailing list