blob: af70959a1045b6c27aa40ba9da6d0f11e403387e [file] [log] [blame]
Tom Stellard75aadc22012-12-11 21:25:42 +00001//===-- AMDGPUIntrinsics.td - Common intrinsics -*- tablegen -*-----------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file defines intrinsics that are used by all hw codegen targets.
11//
12//===----------------------------------------------------------------------===//
13
14let TargetPrefix = "AMDGPU", isTarget = 1 in {
Matt Arsenault5d47d4a2014-06-12 21:15:44 +000015 def int_AMDGPU_clamp : Intrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>], [IntrNoMem]>;
Matt Arsenault257d48d2014-06-24 22:13:39 +000016
Tom Stellard75aadc22012-12-11 21:25:42 +000017 def int_AMDGPU_kill : Intrinsic<[], [llvm_float_ty], []>;
18 def int_AMDGPU_kilp : Intrinsic<[], [], []>;
Matt Arsenault364a6742014-06-11 17:50:44 +000019 def int_AMDGPU_cvt_f32_ubyte0 : Intrinsic<[llvm_float_ty], [llvm_i32_ty], [IntrNoMem]>;
20 def int_AMDGPU_cvt_f32_ubyte1 : Intrinsic<[llvm_float_ty], [llvm_i32_ty], [IntrNoMem]>;
21 def int_AMDGPU_cvt_f32_ubyte2 : Intrinsic<[llvm_float_ty], [llvm_i32_ty], [IntrNoMem]>;
22 def int_AMDGPU_cvt_f32_ubyte3 : Intrinsic<[llvm_float_ty], [llvm_i32_ty], [IntrNoMem]>;
Matt Arsenault051d6f92016-01-26 04:29:56 +000023 def int_AMDGPU_flbit_i32 : Intrinsic<[llvm_i32_ty], [llvm_i32_ty], [IntrNoMem]>;
24
25 // Deprecated in favor of separate int_amdgcn_cube* intrinsics.
Tom Stellard75aadc22012-12-11 21:25:42 +000026 def int_AMDGPU_cube : Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
Matt Arsenault051d6f92016-01-26 04:29:56 +000027
28 // Deprecated in favor of expanded bit operations
Matt Arsenault4c537172014-03-31 18:21:18 +000029 def int_AMDGPU_bfe_i32 : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
30 def int_AMDGPU_bfe_u32 : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
Matt Arsenaultbef34e22016-01-22 21:30:34 +000031
Matt Arsenault0c3e2332016-01-26 04:14:16 +000032 def int_AMDGPU_rsq_clamped : Intrinsic<
33 [llvm_anyfloat_ty], [LLVMMatchType<0>], [IntrNoMem]
34 >;
35
36 // Deprecated in favor of llvm.amdgcn.rsq
37 def int_AMDGPU_rsq : Intrinsic<
38 [llvm_anyfloat_ty], [LLVMMatchType<0>], [IntrNoMem]
39 >;
40
Matt Arsenaultbef34e22016-01-22 21:30:34 +000041 // Deprecated in favor of llvm.bitreverse
42 def int_AMDGPU_brev : Intrinsic<[llvm_i32_ty], [llvm_i32_ty], [IntrNoMem]>;
43
44 // Deprecated in favor of llvm.amdgcn.s.barrier
Matt Arsenault2aed6ca2015-12-19 01:46:41 +000045 def int_AMDGPU_barrier_local : Intrinsic<[], [], [IntrConvergent]>;
Matt Arsenaultbef34e22016-01-22 21:30:34 +000046 def int_AMDGPU_barrier_global : Intrinsic<[], [], [IntrConvergent]>;
47
48 // Deprecated in favor of llvm.amdgcn.read.workdim
49 def int_AMDGPU_read_workdim : Intrinsic<[llvm_i32_ty], [], [IntrNoMem]>;
Tom Stellard75aadc22012-12-11 21:25:42 +000050}
51
Alp Toker1d099d92014-06-19 19:41:26 +000052// Legacy names for compatibility.
Matt Arsenault5d47d4a2014-06-12 21:15:44 +000053let TargetPrefix = "AMDIL", isTarget = 1 in {
Matt Arsenault5d47d4a2014-06-12 21:15:44 +000054 def int_AMDIL_clamp : Intrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>], [IntrNoMem]>;
55 def int_AMDIL_exp : Intrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>], [IntrNoMem]>;
Matt Arsenault5d47d4a2014-06-12 21:15:44 +000056}
57
Tom Stellard75aadc22012-12-11 21:25:42 +000058include "SIIntrinsics.td"