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"
122 #define OPF cat4(REAL,TYPE_BITS,_,ALT1_)
123 #define DEF(type) DEFINE_FIXED_REAL_UNARY_OPCODE(REAL_, type, op)
124 #include "ipret-b1.inc"
128 #define OPF cat4(REAL,TYPE_BITS,_,ALT2_)
129 #define DEF(type) DEFINE_FIXED_REAL_UNARY_OPCODE(REAL_, type, op)
130 #include "ipret-b1.inc"
134 #define OPF cat4(REAL,TYPE_BITS,_,ALT1_)
135 #define DEF(type) DEFINE_FIXED_REAL_UNARY_OPCODE(REAL_, type, op)
136 #include "ipret-b1.inc"
140 #define OPF cat4(REAL,TYPE_BITS,_,ALT2_)
141 #define DEF(type) DEFINE_FIXED_REAL_UNARY_OPCODE(REAL_, type, op)
142 #include "ipret-b1.inc"
145 #define orig_op to_int
146 #define op to_int_alt1
147 #define OPF cat4(REAL,TYPE_BITS,_,ALT1_)
148 #define DEF(type) DEFINE_REAL_TO_INT(type, op)
149 #include "ipret-b1.inc"
152 #define orig_op to_int
153 #define op to_int_alt2
154 #define OPF cat4(REAL,TYPE_BITS,_,ALT2_)
155 #define DEF(type) DEFINE_REAL_TO_INT(type, op)
156 #include "ipret-b1.inc"
159 #define orig_op from_int
160 #define op from_int_alt1
161 #define OPF cat4(REAL,TYPE_BITS,_,ALT1_)
162 #define DEF(type) DEFINE_REAL_FROM_INT(type, op)
163 #include "ipret-b1.inc"
166 #define orig_op from_int
167 #define op from_int_alt2
168 #define OPF cat4(REAL,TYPE_BITS,_,ALT2_)
169 #define DEF(type) DEFINE_REAL_FROM_INT(type, op)
170 #include "ipret-b1.inc"
174 #define orig_op is_exception
175 #define op is_exception_alt1
176 #define OPF cat4(REAL,TYPE_BITS,_,ALT1_)
177 #define DEF(type) DEFINE_FIXED_REAL_UNARY_OPCODE(REAL_, type, op)
178 #include "ipret-b1.inc"
180 #define orig_op is_exception
181 #define op is_exception_alt2
182 #define OPF cat4(REAL,TYPE_BITS,_,ALT2_)
183 #define DEF(type) DEFINE_FIXED_REAL_UNARY_OPCODE(REAL_, type, op)
184 #include "ipret-b1.inc"