1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-apple-darwin -mattr=+avx512fp16 | FileCheck %s
4 declare <8 x half> @llvm.ceil.v8f16(<8 x half>)
5 declare <16 x half> @llvm.ceil.v16f16(<16 x half>)
6 declare <32 x half> @llvm.ceil.v32f16(<32 x half>)
8 define <8 x half> @ceil_v8f16(<8 x half> %p) {
9 ; CHECK-LABEL: ceil_v8f16:
11 ; CHECK-NEXT: vrndscaleph $10, %xmm0, %xmm0
13 %t = call <8 x half> @llvm.ceil.v8f16(<8 x half> %p)
17 define <16 x half> @ceil_v16f16(<16 x half> %p) {
18 ; CHECK-LABEL: ceil_v16f16:
20 ; CHECK-NEXT: vrndscaleph $10, %ymm0, %ymm0
22 %t = call <16 x half> @llvm.ceil.v16f16(<16 x half> %p)
26 define <32 x half> @ceil_v32f16(<32 x half> %p) {
27 ; CHECK-LABEL: ceil_v32f16:
29 ; CHECK-NEXT: vrndscaleph $10, %zmm0, %zmm0
31 %t = call <32 x half> @llvm.ceil.v32f16(<32 x half> %p)
35 declare <8 x half> @llvm.floor.v8f16(<8 x half>)
36 declare <16 x half> @llvm.floor.v16f16(<16 x half>)
37 declare <32 x half> @llvm.floor.v32f16(<32 x half>)
39 define <8 x half> @floor_v8f16(<8 x half> %p) {
40 ; CHECK-LABEL: floor_v8f16:
42 ; CHECK-NEXT: vrndscaleph $9, %xmm0, %xmm0
44 %t = call <8 x half> @llvm.floor.v8f16(<8 x half> %p)
48 define <16 x half> @floor_v16f16(<16 x half> %p) {
49 ; CHECK-LABEL: floor_v16f16:
51 ; CHECK-NEXT: vrndscaleph $9, %ymm0, %ymm0
53 %t = call <16 x half> @llvm.floor.v16f16(<16 x half> %p)
57 define <32 x half> @floor_v32f16(<32 x half> %p) {
58 ; CHECK-LABEL: floor_v32f16:
60 ; CHECK-NEXT: vrndscaleph $9, %zmm0, %zmm0
62 %t = call <32 x half> @llvm.floor.v32f16(<32 x half> %p)
66 declare <8 x half> @llvm.trunc.v8f16(<8 x half>)
67 declare <16 x half> @llvm.trunc.v16f16(<16 x half>)
68 declare <32 x half> @llvm.trunc.v32f16(<32 x half>)
70 define <8 x half> @trunc_v8f16(<8 x half> %p) {
71 ; CHECK-LABEL: trunc_v8f16:
73 ; CHECK-NEXT: vrndscaleph $11, %xmm0, %xmm0
75 %t = call <8 x half> @llvm.trunc.v8f16(<8 x half> %p)
79 define <16 x half> @trunc_v16f16(<16 x half> %p) {
80 ; CHECK-LABEL: trunc_v16f16:
82 ; CHECK-NEXT: vrndscaleph $11, %ymm0, %ymm0
84 %t = call <16 x half> @llvm.trunc.v16f16(<16 x half> %p)
88 define <32 x half> @trunc_v32f16(<32 x half> %p) {
89 ; CHECK-LABEL: trunc_v32f16:
91 ; CHECK-NEXT: vrndscaleph $11, %zmm0, %zmm0
93 %t = call <32 x half> @llvm.trunc.v32f16(<32 x half> %p)
97 declare <8 x half> @llvm.nearbyint.v8f16(<8 x half>)
98 declare <16 x half> @llvm.nearbyint.v16f16(<16 x half>)
99 declare <32 x half> @llvm.nearbyint.v32f16(<32 x half>)
101 define <8 x half> @nearbyint_v8f16(<8 x half> %p) {
102 ; CHECK-LABEL: nearbyint_v8f16:
104 ; CHECK-NEXT: vrndscaleph $12, %xmm0, %xmm0
106 %t = call <8 x half> @llvm.nearbyint.v8f16(<8 x half> %p)
110 define <16 x half> @nearbyint_v16f16(<16 x half> %p) {
111 ; CHECK-LABEL: nearbyint_v16f16:
113 ; CHECK-NEXT: vrndscaleph $12, %ymm0, %ymm0
115 %t = call <16 x half> @llvm.nearbyint.v16f16(<16 x half> %p)
119 define <32 x half> @nearbyint_v32f16(<32 x half> %p) {
120 ; CHECK-LABEL: nearbyint_v32f16:
122 ; CHECK-NEXT: vrndscaleph $12, %zmm0, %zmm0
124 %t = call <32 x half> @llvm.nearbyint.v32f16(<32 x half> %p)
128 declare <8 x half> @llvm.rint.v8f16(<8 x half>)
129 declare <16 x half> @llvm.rint.v16f16(<16 x half>)
130 declare <32 x half> @llvm.rint.v32f16(<32 x half>)
132 define <8 x half> @rint_v8f16(<8 x half> %p) {
133 ; CHECK-LABEL: rint_v8f16:
135 ; CHECK-NEXT: vrndscaleph $4, %xmm0, %xmm0
137 %t = call <8 x half> @llvm.rint.v8f16(<8 x half> %p)
141 define <16 x half> @rint_v16f16(<16 x half> %p) {
142 ; CHECK-LABEL: rint_v16f16:
144 ; CHECK-NEXT: vrndscaleph $4, %ymm0, %ymm0
146 %t = call <16 x half> @llvm.rint.v16f16(<16 x half> %p)
150 define <32 x half> @rint_v32f16(<32 x half> %p) {
151 ; CHECK-LABEL: rint_v32f16:
153 ; CHECK-NEXT: vrndscaleph $4, %zmm0, %zmm0
155 %t = call <32 x half> @llvm.rint.v32f16(<32 x half> %p)