aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.cos.bf16.ll
blob: 091859f3c9bf34dcc8836e29fd8ca18b3e991713 (plain)
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
; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx1250 < %s | FileCheck -check-prefixes=GCN %s
; xUN: llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx1250 < %s | FileCheck -check-prefix=GCN %s

; FIXME: GlobalISel does not work with bf16

declare bfloat @llvm.amdgcn.cos.bf16(bfloat) #0

; GCN-LABEL: {{^}}cos_bf16:
; GCN: v_cos_bf16_e32 {{v[0-9]+}}, {{s[0-9]+}}
define amdgpu_kernel void @cos_bf16(ptr addrspace(1) %out, bfloat %src) #1 {
  %cos = call bfloat @llvm.amdgcn.cos.bf16(bfloat %src) #0
  store bfloat %cos, ptr addrspace(1) %out, align 2
  ret void
}

; GCN-LABEL: {{^}}cos_bf16_constant_4
; GCN: v_cos_bf16_e32 v0, 4.0
define amdgpu_kernel void @cos_bf16_constant_4(ptr addrspace(1) %out) #1 {
  %cos = call bfloat @llvm.amdgcn.cos.bf16(bfloat 4.0) #0
  store bfloat %cos, ptr addrspace(1) %out, align 2
  ret void
}

; GCN-LABEL: {{^}}cos_bf16_constant_100
; GCN: v_cos_bf16_e32 {{v[0-9]+}}, 0x42c8
define amdgpu_kernel void @cos_bf16_constant_100(ptr addrspace(1) %out) #1 {
  %cos = call bfloat @llvm.amdgcn.cos.bf16(bfloat 100.0) #0
  store bfloat %cos, ptr addrspace(1) %out, align 2
  ret void
}

attributes #0 = { nounwind readnone }
attributes #1 = { nounwind }