blob: 77b0519422ec925656b9b366c6bf69b402b5471d [file] [log] [blame]
Viet-Hoa Doe1c3b462023-07-31 17:13:34 +01001/*
2* Copyright (c) 2023 Arm Limited.
3*
4* SPDX-License-Identifier: MIT
5*
6* Permission is hereby granted, free of charge, to any person obtaining a copy
7* of this software and associated documentation files (the "Software"), to
8* deal in the Software without restriction, including without limitation the
9* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10* sell copies of the Software, and to permit persons to whom the Software is
11* furnished to do so, subject to the following conditions:
12*
13* The above copyright notice and this permission notice shall be included in all
14* copies or substantial portions of the Software.
15*
16* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22* SOFTWARE.
23*/
24
25#ifndef CKW_INCLUDE_CKW_TYPES_OPERATORS_H
26#define CKW_INCLUDE_CKW_TYPES_OPERATORS_H
27
28#include <cstdint>
29
30namespace ckw
31{
32
33/** Unary operators and functions. */
34enum class UnaryOp : int32_t
35{
36 LogicalNot = 0x0000, // !
37 BitwiseNot = 0x0001, // ~
38
39 Exp = 0x0010,
40 Tanh = 0x0011,
41 Sqrt = 0x0012,
42 Erf = 0x0013,
43 Fabs = 0x0014,
44 Log = 0x0015,
45 Round = 0x0016,
Gunes Bayir2b9fa592024-01-17 16:07:03 +000046 Floor = 0x0017,
Viet-Hoa Doe1c3b462023-07-31 17:13:34 +010047};
48
49/** Assignment operators. */
50enum class AssignmentOp : int32_t
51{
52 Increment = 0x0000, // +=
53 Decrement = 0x0001, // -=
54};
55
Viet-Hoa Do34b6c3a2023-08-22 11:11:23 +010056/** Binary operators. */
57enum class BinaryOp : int32_t
58{
59 // Elementwise
60 Add = 0x0000, // +
61 Sub = 0x0001, // -
62 Mul = 0x0002, // *
63 Div = 0x0003, // /
64 Mod = 0x0004, // %
65
66 // Relational
67 Equal = 0x1000, // ==
68 Less = 0x1001, // <
69 LessEqual = 0x1002, // <=
70 Greater = 0x1003, // >
71 GreaterEqual = 0x1004, // >=
72
73 // Algebra
74 MatMul_Nt_Nt = 0x2000, // X
75 MatMul_Nt_T = 0x2001, // X
76 MatMul_T_Nt = 0x2002, // X
77 MatMul_T_T = 0x2003, // X
78 Dot = 0x2004, // .
79
80 // Logical
81 LogicalAnd = 0x3000, // &&
82 LogicalOr = 0x3001, // ||
83
84 // Bitwise
85 BitwiseXOR = 0x4000, // ^
86
87 // Functions
88 Min = 0x8000,
89 Max = 0x8001,
90};
91
92/** Ternary operators. */
93enum class TernaryOp : int32_t
94{
95 Select = 0x0000,
96 Clamp = 0x0001,
97};
98
Viet-Hoa Doe1c3b462023-07-31 17:13:34 +010099} // namespace ckw
100
101#endif // CKW_INCLUDE_CKW_TYPES_OPERATORS_H