diff options
author | Nicolai Haehnle <nhaehnle@gmail.com> | 2016-04-06 19:40:20 +0000 |
---|---|---|
committer | Nicolai Haehnle <nhaehnle@gmail.com> | 2016-04-06 19:40:20 +0000 |
commit | df3a20cd8068c732a0b26bdf8c1857c7d97104b4 (patch) | |
tree | 11974d0749ffa9d399f72a66fd5787d6ec248103 /llvm/test/CodeGen/AMDGPU/amdgpu-shader-calling-convention.ll | |
parent | 1b6188d2f865366ef94d65b65596f47c9196c20c (diff) | |
download | bcm5719-llvm-df3a20cd8068c732a0b26bdf8c1857c7d97104b4.tar.gz bcm5719-llvm-df3a20cd8068c732a0b26bdf8c1857c7d97104b4.zip |
AMDGPU: Add a shader calling convention
This makes it possible to distinguish between mesa shaders
and other kernels even in the presence of compute shaders.
Patch By: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Differential Revision: http://reviews.llvm.org/D18559
llvm-svn: 265589
Diffstat (limited to 'llvm/test/CodeGen/AMDGPU/amdgpu-shader-calling-convention.ll')
-rw-r--r-- | llvm/test/CodeGen/AMDGPU/amdgpu-shader-calling-convention.ll | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AMDGPU/amdgpu-shader-calling-convention.ll b/llvm/test/CodeGen/AMDGPU/amdgpu-shader-calling-convention.ll new file mode 100644 index 00000000000..dd16907b748 --- /dev/null +++ b/llvm/test/CodeGen/AMDGPU/amdgpu-shader-calling-convention.ll @@ -0,0 +1,21 @@ +; RUN: llc -march=amdgcn -mcpu=tahiti -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s +; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s + + +; GCN-LABEL: {{^}}shader_cc: +; GCN: v_add_i32_e32 v0, vcc, s8, v0 +define amdgpu_cs float @shader_cc(<4 x i32> inreg, <4 x i32> inreg, i32 inreg %w, float %v) { + %vi = bitcast float %v to i32 + %x = add i32 %vi, %w + %xf = bitcast i32 %x to float + ret float %xf +} + +; GCN-LABEL: {{^}}kernel_cc: +; GCN: s_endpgm +define float @kernel_cc(<4 x i32> inreg, <4 x i32> inreg, i32 inreg %w, float %v) { + %vi = bitcast float %v to i32 + %x = add i32 %vi, %w + %xf = bitcast i32 %x to float + ret float %xf +} |