aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/AMDGPU/llvm.amdgcn.cos.f16.ll
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-01-02 19:17:04 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-01-02 19:17:04 +0000
commitb915e9e0fc85ba6f398b3fab0db6a81a8913af94 (patch)
tree98b8f811c7aff2547cab8642daf372d6c59502fb /test/CodeGen/AMDGPU/llvm.amdgcn.cos.f16.ll
parent6421cca32f69ac849537a3cff78c352195e99f1b (diff)
downloadsrc-b915e9e0fc85ba6f398b3fab0db6a81a8913af94.tar.gz
src-b915e9e0fc85ba6f398b3fab0db6a81a8913af94.zip
Vendor import of llvm trunk r290819:vendor/llvm/llvm-trunk-r290819
Notes
Notes: svn path=/vendor/llvm/dist/; revision=311116 svn path=/vendor/llvm/llvm-trunk-r290819/; revision=311117; tag=vendor/llvm/llvm-trunk-r290819
Diffstat (limited to 'test/CodeGen/AMDGPU/llvm.amdgcn.cos.f16.ll')
-rw-r--r--test/CodeGen/AMDGPU/llvm.amdgcn.cos.f16.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/CodeGen/AMDGPU/llvm.amdgcn.cos.f16.ll b/test/CodeGen/AMDGPU/llvm.amdgcn.cos.f16.ll
new file mode 100644
index 000000000000..5d9f1b824a69
--- /dev/null
+++ b/test/CodeGen/AMDGPU/llvm.amdgcn.cos.f16.ll
@@ -0,0 +1,18 @@
+; RUN: llc -march=amdgcn -mcpu=fiji -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=VI %s
+
+declare half @llvm.amdgcn.cos.f16(half %a)
+
+; GCN-LABEL: {{^}}cos_f16
+; GCN: buffer_load_ushort v[[A_F16:[0-9]+]]
+; VI: v_cos_f16_e32 v[[R_F16:[0-9]+]], v[[A_F16]]
+; GCN: buffer_store_short v[[R_F16]]
+; GCN: s_endpgm
+define void @cos_f16(
+ half addrspace(1)* %r,
+ half addrspace(1)* %a) {
+entry:
+ %a.val = load half, half addrspace(1)* %a
+ %r.val = call half @llvm.amdgcn.cos.f16(half %a.val)
+ store half %r.val, half addrspace(1)* %r
+ ret void
+}