aboutsummaryrefslogtreecommitdiffhomepage
path: root/ptx/src/test/spirv_run/func_ptr.ptx
diff options
context:
space:
mode:
Diffstat (limited to 'ptx/src/test/spirv_run/func_ptr.ptx')
-rw-r--r--ptx/src/test/spirv_run/func_ptr.ptx31
1 files changed, 31 insertions, 0 deletions
diff --git a/ptx/src/test/spirv_run/func_ptr.ptx b/ptx/src/test/spirv_run/func_ptr.ptx
new file mode 100644
index 0000000..aa94f2b
--- /dev/null
+++ b/ptx/src/test/spirv_run/func_ptr.ptx
@@ -0,0 +1,31 @@
+.version 6.5
+.target sm_30
+.address_size 64
+
+.func (.reg .f32 out) foobar(.reg .f32 x, .reg .f32 y)
+{
+ add.f32 out, x, y;
+ ret;
+}
+
+.visible .entry func_ptr(
+ .param .u64 input,
+ .param .u64 output
+)
+{
+ .reg .u64 in_addr;
+ .reg .u64 out_addr;
+ .reg .u64 temp;
+ .reg .u64 temp2;
+ .reg .u64 f_addr;
+
+ ld.param.u64 in_addr, [input];
+ ld.param.u64 out_addr, [output];
+
+ ld.u64 temp, [in_addr];
+ add.u64 temp2, temp, 1;
+ mov.u64 f_addr, foobar;
+ add.u64 temp2, temp2, f_addr;
+ st.u64 [out_addr], temp2;
+ ret;
+}