From 74991dfe3f3449df65de930f008e6797a9312d9b Mon Sep 17 00:00:00 2001 From: deesix Date: Sat, 1 Feb 2020 21:23:49 +0100 Subject: [PATCH] aarch64: M1 definitions --- test/common_aarch64/aarch64_defs.M1 | 140 ++++++++++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 test/common_aarch64/aarch64_defs.M1 diff --git a/test/common_aarch64/aarch64_defs.M1 b/test/common_aarch64/aarch64_defs.M1 new file mode 100644 index 0000000..edd181c --- /dev/null +++ b/test/common_aarch64/aarch64_defs.M1 @@ -0,0 +1,140 @@ +## Copyright (C) 2020 deesix +## This file is part of M2-Planet. +## +## M2-Planet is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## M2-Planet is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with M2-Planet. If not, see . + +DEFINE NULL 0000000000000000 + +# Stack (SP-based, 128 bits per element) +DEFINE PUSH_X0 e00f1ff8 +DEFINE PUSH_X1 e10f1ff8 +DEFINE PUSH_X16 f00f1ff8 +DEFINE PUSH_BP f10f1ff8 +DEFINE PUSH_LR fe0f1ff8 + +DEFINE POP_X0 e00741f8 +DEFINE POP_X1 e10741f8 +DEFINE POP_X16 f00741f8 +DEFINE POP_BP f10741f8 +DEFINE POP_LR fe0741f8 + + +# Jump/branch/call/return +DEFINE BR_X16 00021fd6 +DEFINE BLR_X16 00023fd6 +DEFINE RETURN c0035fd6 + +DEFINE CBZ_X0_PAST_BR a00000b4 +DEFINE CBNZ_X0_PAST_BR a00000b5 + +DEFINE SKIP_INST_EQ 40000054 +DEFINE SKIP_INST_NE 41000054 +DEFINE SKIP_INST_LT 4b000054 +DEFINE SKIP_INST_LE 4d000054 +DEFINE SKIP_INST_GT 4c000054 +DEFINE SKIP_INST_GE 4a000054 + +DEFINE SKIP_32_DATA 02000014 + + +# Load literals (PC-relative) +DEFINE LOAD_W0_AHEAD 40000098 +DEFINE LOAD_W1_AHEAD 41000018 +DEFINE LOAD_W2_AHEAD 42000018 +DEFINE LOAD_W16_AHEAD 50000018 + + +# Load/store/dereference +DEFINE LDR_X0_[SP] e00340f9 +DEFINE STR_X0_[X1] 200000f9 +DEFINE STR_BYTE_W0_[X1] 20000039 +DEFINE DEREF_X0 000040f9 +DEFINE DEREF_X0_BYTE 00004039 + + +# Move data between registers +DEFINE SET_X0_FROM_BP e00311aa +DEFINE SET_X1_FROM_X0 e10300aa +DEFINE SET_X1_FROM_SP e1030091 +DEFINE SET_X2_FROM_X0 e20300aa +DEFINE SET_X3_FROM_X0 e30300aa +DEFINE SET_X4_FROM_X0 e40300aa +DEFINE SET_X5_FROM_X0 e50300aa +DEFINE SET_X6_FROM_X0 e60300aa +DEFINE SET_X16_FROM_X0 f00300aa +DEFINE SET_X16_FROM_SP f0030091 +DEFINE SET_BP_FROM_X16 f10310aa +DEFINE SET_BP_FROM_SP f1030091 + + +# Move constant to register +DEFINE SET_X0_TO_0 000080d2 +DEFINE SET_X0_TO_1 200080d2 +DEFINE SET_X0_TO_17 200280d2 +DEFINE SET_X0_TO_MINUS_1 00008092 +DEFINE SET_W0_TO_MINUS_1 00008012 +DEFINE SET_X1_TO_0 010080d2 +DEFINE SET_X1_TO_2 410080d2 +DEFINE SET_X1_TO_8 010180d2 +DEFINE SET_X2_TO_1 220080d2 +DEFINE SET_X0_TO_FCNTL_H_AT_FDCWD 600c8092 + + +# Arith/logic/relational +DEFINE ADD_X0_X1_X0 2000008b +DEFINE ADD_X0_BP_X0 2002008b +DEFINE ADD_X1_SP_8 e1230091 + +DEFINE SUB_X0_X1_X0 200000cb +DEFINE SUB_X0_X0_X1 000001cb +DEFINE SUB_X0_16 004000d1 +DEFINE SUB_X0_32 008000d1 +DEFINE SUB_X0_48 00c000d1 +DEFINE MSUB_X0_X0_X2_X1 0084029b + +DEFINE MUL_X0_X1_X0 207c009b +DEFINE SDIV_X0_X1_X0 200cc09a +DEFINE SDIV_X2_X1_X0 220cc09a +DEFINE UDIV_X0_X1_X0 2008c09a +DEFINE UDIV_X2_X1_X0 2208c09a + +DEFINE LSHIFT_X0_X0_X2 0020c29a +DEFINE LSHIFT_X0_X1_X0 2020c09a +DEFINE RSHIFT_X0_X1_X0 2024c09a + +DEFINE MVN_X0 e00320aa +DEFINE AND_X0_X1_X0 2000008a +DEFINE OR_X0_X1_X0 200000aa +DEFINE XOR_X0_X1_X0 000001ca + +DEFINE CMP_X1_X0 3f0000eb + + +# Syscall +DEFINE SET_X8_TO_SYS_BRK c81a80d2 +DEFINE SET_X8_TO_SYS_CHDIR 280680d2 +DEFINE SET_X8_TO_SYS_CLONE 881b80d2 +DEFINE SET_X8_TO_SYS_CLOSE 280780d2 +DEFINE SET_X8_TO_SYS_EXECVE a81b80d2 +DEFINE SET_X8_TO_SYS_EXIT a80b80d2 +DEFINE SET_X8_TO_SYS_FACCESSAT 080680d2 +DEFINE SET_X8_TO_SYS_FCHDIR 480680d2 +DEFINE SET_X8_TO_SYS_FCHMODAT a80680d2 +DEFINE SET_X8_TO_SYS_GETCWD 280280d2 +DEFINE SET_X8_TO_SYS_OPENAT 080780d2 +DEFINE SET_X8_TO_SYS_READ e80780d2 +DEFINE SET_X8_TO_SYS_UNAME 081480d2 +DEFINE SET_X8_TO_SYS_WAIT4 882080d2 +DEFINE SET_X8_TO_SYS_WRITE 080880d2 +DEFINE SYSCALL 010000d4