omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / src / aarch64_target.h
| 1 | /* SPDX-License-Identifier: Apache-2.0 |
| 2 | * Copyright 2026 Drake Stapleton (AIEN / aien-dev) |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | /* ========================================================================= |
| 18 | * BOOTSTRAP REPRESENTATION - NOT PERMANENT SEMANTIC DEFINITION |
| 19 | * AArch64 Target Profile for Milestone 5 (OMEGA_AARCH64) |
| 20 | * ========================================================================= */ |
| 21 | |
| 22 | #ifndef AARCH64_TARGET_H |
| 23 | #define AARCH64_TARGET_H |
| 24 | |
| 25 | #include <stdint.h> |
| 26 | #include <stdbool.h> |
| 27 | |
| 28 | #define AARCH64_PROFILE_V8A_BAREMETAL 0x01 |
| 29 | #define AARCH64_MAX_CODE_BYTES 4096 |
| 30 | |
| 31 | typedef enum { |
| 32 | REG_X0 = 0, REG_X1 = 1, REG_X2 = 2, REG_X3 = 3, |
| 33 | REG_X4 = 4, REG_X5 = 5, REG_X6 = 6, REG_X7 = 7, |
| 34 | REG_X8 = 8, REG_X9 = 9, REG_X10 = 10, REG_X11 = 11, |
| 35 | REG_X12 = 12, REG_X13 = 13, REG_X14 = 14, REG_X15 = 15, |
| 36 | REG_X16 = 16, REG_X17 = 17, REG_X18 = 18, REG_X19 = 19, |
| 37 | REG_X20 = 20, REG_X21 = 21, REG_X22 = 22, REG_X23 = 23, |
| 38 | REG_X24 = 24, REG_X25 = 25, REG_X26 = 26, REG_X27 = 27, |
| 39 | REG_X28 = 28, REG_X29 = 29, REG_X30 = 30, REG_XZR = 31, |
| 40 | REG_SP = 31 |
| 41 | } Aarch64Reg; |
| 42 | |
| 43 | typedef enum { |
| 44 | COND_EQ = 0, /* Equal */ |
| 45 | COND_NE = 1, /* Not equal */ |
| 46 | COND_CS = 2, /* Carry set (identical to HS) */ |
| 47 | COND_CC = 3, /* Carry clear (identical to LO) */ |
| 48 | COND_MI = 4, /* Minus / negative */ |
| 49 | COND_PL = 5, /* Plus / positive or zero */ |
| 50 | COND_VS = 6, /* Overflow */ |
| 51 | COND_VC = 7, /* No overflow */ |
| 52 | COND_HI = 8, /* Unsigned higher */ |
| 53 | COND_LS = 9, /* Unsigned lower or same */ |
| 54 | COND_GE = 10, /* Signed greater than or equal */ |
| 55 | COND_LT = 11, /* Signed less than */ |
| 56 | COND_GT = 12, /* Signed greater than */ |
| 57 | COND_LE = 13, /* Signed less than or equal */ |
| 58 | COND_AL = 14 /* Always */ |
| 59 | } Aarch64Cond; |
| 60 | |
| 61 | typedef struct { |
| 62 | uint8_t profile_id; |
| 63 | uint8_t abi_version; |
| 64 | uint8_t default_reg_width; |
| 65 | } Aarch64TargetProfile; |
| 66 | |
| 67 | #endif /* AARCH64_TARGET_H */ |