|
| 1 | +% |
| 2 | +% This file is part of AtomVM. |
| 3 | +% |
| 4 | +% Copyright 2025 Paul Guyot <[email protected]> |
| 5 | +% |
| 6 | +% Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | +% you may not use this file except in compliance with the License. |
| 8 | +% You may obtain a copy of the License at |
| 9 | +% |
| 10 | +% http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +% |
| 12 | +% Unless required by applicable law or agreed to in writing, software |
| 13 | +% distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | +% See the License for the specific language governing permissions and |
| 16 | +% limitations under the License. |
| 17 | +% |
| 18 | +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later |
| 19 | +% |
| 20 | + |
| 21 | + |
| 22 | +-define(COMPACT_LITERAL, 0). |
| 23 | +-define(COMPACT_INTEGER, 1). |
| 24 | +-define(COMPACT_ATOM, 2). |
| 25 | +-define(COMPACT_XREG, 3). |
| 26 | +-define(COMPACT_YREG, 4). |
| 27 | +-define(COMPACT_LABEL, 5). |
| 28 | +-define(COMPACT_EXTENDED, 7). |
| 29 | +-define(COMPACT_LARGE_LITERAL, 8). |
| 30 | +-define(COMPACT_LARGE_INTEGER, 9). |
| 31 | +-define(COMPACT_LARGE_ATOM, 10). |
| 32 | +-define(COMPACT_LARGE_XREG, 11). |
| 33 | +-define(COMPACT_LARGE_YREG, 12). |
| 34 | + |
| 35 | +% OTP-20+ format |
| 36 | +-define(COMPACT_EXTENDED_LIST, 16#17). |
| 37 | +-define(COMPACT_EXTENDED_FP_REGISTER, 16#27). |
| 38 | +-define(COMPACT_EXTENDED_ALLOCATION_LIST, 16#37). |
| 39 | +-define(COMPACT_EXTENDED_LITERAL, 16#47). |
| 40 | +% https://github.com/erlang/otp/blob/master/lib/compiler/src/beam_asm.erl#L433 |
| 41 | +-define(COMPACT_EXTENDED_TYPED_REGISTER, 16#57). |
| 42 | + |
| 43 | +-define(COMPACT_EXTENDED_ALLOCATOR_LIST_TAG_WORDS, 0). |
| 44 | +-define(COMPACT_EXTENDED_ALLOCATOR_LIST_TAG_FLOATS, 1). |
| 45 | +-define(COMPACT_EXTENDED_ALLOCATOR_LIST_TAG_FUNS, 2). |
| 46 | + |
| 47 | +-define(COMPACT_LARGE_IMM_MASK, 16#18). |
| 48 | +-define(COMPACT_11BITS_VALUE, 16#8). |
| 49 | +-define(COMPACT_NBITS_VALUE, 16#18). |
| 50 | + |
| 51 | +-define(COMPACT_LARGE_INTEGER_11BITS, (?COMPACT_LARGE_INTEGER bor ?COMPACT_11BITS_VALUE)). |
| 52 | +-define(COMPACT_LARGE_INTEGER_NBITS, (?COMPACT_LARGE_INTEGER bor ?COMPACT_NBITS_VALUE)). |
0 commit comments