1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+avx512fp16 --show-mc-encoding | FileCheck %s
4 declare half @llvm.ceil.f16(half)
5 declare half @llvm.floor.f16(half)
6 declare half @llvm.trunc.f16(half)
7 declare half @llvm.rint.f16(half)
8 declare half @llvm.nearbyint.f16(half)
10 define half @test_ceil(half %a) {
11 ; CHECK-LABEL: test_ceil:
13 ; CHECK-NEXT: vrndscalesh $10, %xmm0, %xmm0, %xmm0 ## encoding: [0x62,0xf3,0x7c,0x08,0x0a,0xc0,0x0a]
14 ; CHECK-NEXT: retq ## encoding: [0xc3]
15 %c = call half @llvm.ceil.f16(half %a)
19 define half @test_floor(half %a) {
20 ; CHECK-LABEL: test_floor:
22 ; CHECK-NEXT: vrndscalesh $9, %xmm0, %xmm0, %xmm0 ## encoding: [0x62,0xf3,0x7c,0x08,0x0a,0xc0,0x09]
23 ; CHECK-NEXT: retq ## encoding: [0xc3]
24 %c = call half @llvm.floor.f16(half %a)
28 define half @test_trunc(half %a) {
29 ; CHECK-LABEL: test_trunc:
31 ; CHECK-NEXT: vrndscalesh $11, %xmm0, %xmm0, %xmm0 ## encoding: [0x62,0xf3,0x7c,0x08,0x0a,0xc0,0x0b]
32 ; CHECK-NEXT: retq ## encoding: [0xc3]
33 %c = call half @llvm.trunc.f16(half %a)
37 define half @test_rint(half %a) {
38 ; CHECK-LABEL: test_rint:
40 ; CHECK-NEXT: vrndscalesh $4, %xmm0, %xmm0, %xmm0 ## encoding: [0x62,0xf3,0x7c,0x08,0x0a,0xc0,0x04]
41 ; CHECK-NEXT: retq ## encoding: [0xc3]
42 %c = call half @llvm.rint.f16(half %a)
46 define half @test_nearbyint(half %a) {
47 ; CHECK-LABEL: test_nearbyint:
49 ; CHECK-NEXT: vrndscalesh $12, %xmm0, %xmm0, %xmm0 ## encoding: [0x62,0xf3,0x7c,0x08,0x0a,0xc0,0x0c]
50 ; CHECK-NEXT: retq ## encoding: [0xc3]
51 %c = call half @llvm.nearbyint.f16(half %a)