Commit af8e2f6
committed
Merge pull request #397 from pguyot/w45/add-missing-opcodes
Add missing FP opcodes
These opcodes are officially supported since R8. `fclearerror/0` and
`fcheckerror/1` are noops as they are no longer implemented in OTP24 and the
error is always checked by other OP_F* opcodes.
Compiler support for `STDC FENV_ACCESS` pragma is checked and it is assumed
that it means the compiler is conforming to C11 FENV support when the pragma
is accepted. In this case, exception are checked using C11 floating point
environment functions. If the pragma is unknown, `isfinite(3)` is used instead,
assuming a non finite result is an error. This is what BEAM does on Unix.
No `badarith` exception is raised on underflow divisions, to be compatible
with BEAM (which cannot check that as it uses `isfinite(3)`). The only checked
exceptions are overflow and division by zero.
The tests were updated to actually generate the FP opcodes with OTP21-24
compilers. A new test was added for div.
CI is updated to usually not use AVM_DISABLE_FP option. Only one
configuration is maintained shall we decide to keep the option.
Also assert types of operands at load time and ignore them at execution time.
Also simplify macros by getting rid of the duplicate last parameter.
These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).
SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-laterFile tree
17 files changed
+682
-51
lines changed- .github/workflows
- src/libAtomVM
- tests
- erlang_tests
17 files changed
+682
-51
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | 96 | | |
98 | 97 | | |
99 | 98 | | |
100 | | - | |
101 | 99 | | |
102 | 100 | | |
103 | | - | |
104 | | - | |
| 101 | + | |
105 | 102 | | |
106 | 103 | | |
107 | | - | |
108 | | - | |
| 104 | + | |
109 | 105 | | |
110 | 106 | | |
111 | 107 | | |
| |||
123 | 119 | | |
124 | 120 | | |
125 | 121 | | |
126 | | - | |
127 | | - | |
128 | | - | |
| 122 | + | |
| 123 | + | |
129 | 124 | | |
130 | 125 | | |
131 | 126 | | |
132 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
133 | 138 | | |
134 | 139 | | |
135 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
58 | 65 | | |
59 | 66 | | |
60 | 67 | | |
| |||
111 | 118 | | |
112 | 119 | | |
113 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
114 | 124 | | |
115 | 125 | | |
116 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
74 | 78 | | |
75 | 79 | | |
76 | 80 | | |
| |||
163 | 167 | | |
164 | 168 | | |
165 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
166 | 187 | | |
167 | 188 | | |
168 | 189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
90 | 99 | | |
91 | 100 | | |
92 | 101 | | |
| |||
0 commit comments