2 * Copyright (C) 2024 Mikulas Patocka
4 * This file is part of Ajla.
6 * Ajla is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, either version 3 of the License, or (at your option) any later
11 * Ajla is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along with
16 * Ajla. If not, see <https://www.gnu.org/licenses/>.
19 #define OPC(op) (OPCODE_REAL_OP + cat(OPCODE_REAL_OP_,op) * OPCODE_REAL_OP_MULT + cat(OPCODE_REAL_TYPE_,type) * OPCODE_REAL_TYPE_MULT)
21 #if cat3(REAL,TYPE_BITS,_ALT1_TYPES) & TYPE_MASK
25 #define OPF cat4(REAL,TYPE_BITS,_,ALT1_)
26 #define DEF(type) DEFINE_FIXED_REAL_BINARY_OPCODE(REAL_, type, op)
27 #include "ipret-b1.inc"
31 #define OPF cat4(REAL,TYPE_BITS,_,ALT2_)
32 #define DEF(type) DEFINE_FIXED_REAL_BINARY_OPCODE(REAL_, type, op)
33 #include "ipret-b1.inc"
35 #define orig_op subtract
36 #define op subtract_alt1
37 #define OPF cat4(REAL,TYPE_BITS,_,ALT1_)
38 #define DEF(type) DEFINE_FIXED_REAL_BINARY_OPCODE(REAL_, type, op)
39 #include "ipret-b1.inc"
41 #define orig_op subtract
42 #define op subtract_alt2
43 #define OPF cat4(REAL,TYPE_BITS,_,ALT2_)
44 #define DEF(type) DEFINE_FIXED_REAL_BINARY_OPCODE(REAL_, type, op)
45 #include "ipret-b1.inc"
47 #define orig_op multiply
48 #define op multiply_alt1
49 #define OPF cat4(REAL,TYPE_BITS,_,ALT1_)
50 #define DEF(type) DEFINE_FIXED_REAL_BINARY_OPCODE(REAL_, type, op)
51 #include "ipret-b1.inc"
53 #define orig_op multiply
54 #define op multiply_alt2
55 #define OPF cat4(REAL,TYPE_BITS,_,ALT2_)
56 #define DEF(type) DEFINE_FIXED_REAL_BINARY_OPCODE(REAL_, type, op)
57 #include "ipret-b1.inc"
59 #define orig_op divide
60 #define op divide_alt1
61 #define OPF cat4(REAL,TYPE_BITS,_,ALT1_)
62 #define DEF(type) DEFINE_FIXED_REAL_BINARY_OPCODE(REAL_, type, op)
63 #include "ipret-b1.inc"
65 #define orig_op divide
66 #define op divide_alt2
67 #define OPF cat4(REAL,TYPE_BITS,_,ALT2_)
68 #define DEF(type) DEFINE_FIXED_REAL_BINARY_OPCODE(REAL_, type, op)
69 #include "ipret-b1.inc"
73 #define OPF cat4(REAL,TYPE_BITS,_,ALT1_)
74 #define DEF(type) DEFINE_FIXED_REAL_BINARY_OPCODE(REAL_, type, op)
75 #include "ipret-b1.inc"
79 #define OPF cat4(REAL,TYPE_BITS,_,ALT2_)
80 #define DEF(type) DEFINE_FIXED_REAL_BINARY_OPCODE(REAL_, type, op)
81 #include "ipret-b1.inc"
83 #define orig_op not_equal
84 #define op not_equal_alt1
85 #define OPF cat4(REAL,TYPE_BITS,_,ALT1_)
86 #define DEF(type) DEFINE_FIXED_REAL_BINARY_OPCODE(REAL_, type, op)
87 #include "ipret-b1.inc"
89 #define orig_op not_equal
90 #define op not_equal_alt2
91 #define OPF cat4(REAL,TYPE_BITS,_,ALT2_)
92 #define DEF(type) DEFINE_FIXED_REAL_BINARY_OPCODE(REAL_, type, op)
93 #include "ipret-b1.inc"
97 #define OPF cat4(REAL,TYPE_BITS,_,ALT1_)
98 #define DEF(type) DEFINE_FIXED_REAL_BINARY_OPCODE(REAL_, type, op)
99 #include "ipret-b1.inc"
103 #define OPF cat4(REAL,TYPE_BITS,_,ALT2_)
104 #define DEF(type) DEFINE_FIXED_REAL_BINARY_OPCODE(REAL_, type, op)
105 #include "ipret-b1.inc"
107 #define orig_op less_equal
108 #define op less_equal_alt1
109 #define OPF cat4(REAL,TYPE_BITS,_,ALT1_)
110 #define DEF(type) DEFINE_FIXED_REAL_BINARY_OPCODE(REAL_, type, op)
111 #include "ipret-b1.inc"
113 #define orig_op less_equal
114 #define op less_equal_alt2
115 #define OPF cat4(REAL,TYPE_BITS,_,ALT2_)
116 #define DEF(type) DEFINE_FIXED_REAL_BINARY_OPCODE(REAL_, type, op)
117 #include "ipret-b1.inc"
119 #define orig_op greater
120 #define op greater_alt1
121 #define OPF cat4(REAL,TYPE_BITS,_,ALT1_)
122 #define DEF(type) DEFINE_FIXED_REAL_BINARY_OPCODE(REAL_, type, op)
123 #include "ipret-b1.inc"
125 #define orig_op greater
126 #define op greater_alt2
127 #define OPF cat4(REAL,TYPE_BITS,_,ALT2_)
128 #define DEF(type) DEFINE_FIXED_REAL_BINARY_OPCODE(REAL_, type, op)
129 #include "ipret-b1.inc"
131 #define orig_op greater_equal
132 #define op greater_equal_alt1
133 #define OPF cat4(REAL,TYPE_BITS,_,ALT1_)
134 #define DEF(type) DEFINE_FIXED_REAL_BINARY_OPCODE(REAL_, type, op)
135 #include "ipret-b1.inc"
137 #define orig_op greater_equal
138 #define op greater_equal_alt2
139 #define OPF cat4(REAL,TYPE_BITS,_,ALT2_)
140 #define DEF(type) DEFINE_FIXED_REAL_BINARY_OPCODE(REAL_, type, op)
141 #include "ipret-b1.inc"
146 #define OPF cat4(REAL,TYPE_BITS,_,ALT1_)
147 #define DEF(type) DEFINE_FIXED_REAL_UNARY_OPCODE(REAL_, type, op)
148 #include "ipret-b1.inc"
152 #define OPF cat4(REAL,TYPE_BITS,_,ALT2_)
153 #define DEF(type) DEFINE_FIXED_REAL_UNARY_OPCODE(REAL_, type, op)
154 #include "ipret-b1.inc"
158 #define OPF cat4(REAL,TYPE_BITS,_,ALT1_)
159 #define DEF(type) DEFINE_FIXED_REAL_UNARY_OPCODE(REAL_, type, op)
160 #include "ipret-b1.inc"
164 #define OPF cat4(REAL,TYPE_BITS,_,ALT2_)
165 #define DEF(type) DEFINE_FIXED_REAL_UNARY_OPCODE(REAL_, type, op)
166 #include "ipret-b1.inc"
169 #define orig_op to_int
170 #define op to_int_alt1
171 #define OPF cat4(REAL,TYPE_BITS,_,ALT1_)
172 #define DEF(type) DEFINE_REAL_TO_INT(type, op)
173 #include "ipret-b1.inc"
176 #define orig_op to_int
177 #define op to_int_alt2
178 #define OPF cat4(REAL,TYPE_BITS,_,ALT2_)
179 #define DEF(type) DEFINE_REAL_TO_INT(type, op)
180 #include "ipret-b1.inc"
183 #define orig_op from_int
184 #define op from_int_alt1
185 #define OPF cat4(REAL,TYPE_BITS,_,ALT1_)
186 #define DEF(type) DEFINE_REAL_FROM_INT(type, op)
187 #include "ipret-b1.inc"
190 #define orig_op from_int
191 #define op from_int_alt2
192 #define OPF cat4(REAL,TYPE_BITS,_,ALT2_)
193 #define DEF(type) DEFINE_REAL_FROM_INT(type, op)
194 #include "ipret-b1.inc"
198 #define orig_op is_exception
199 #define op is_exception_alt1
200 #define OPF cat4(REAL,TYPE_BITS,_,ALT1_)
201 #define DEF(type) DEFINE_FIXED_REAL_UNARY_OPCODE(REAL_, type, op)
202 #include "ipret-b1.inc"
204 #define orig_op is_exception
205 #define op is_exception_alt2
206 #define OPF cat4(REAL,TYPE_BITS,_,ALT2_)
207 #define DEF(type) DEFINE_FIXED_REAL_UNARY_OPCODE(REAL_, type, op)
208 #include "ipret-b1.inc"