mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-04 03:00:20 +02:00
First pass at aarch64 assembler port
This commit is contained in:
parent
fc9b474da6
commit
19e7712358
4 changed files with 3648 additions and 4586 deletions
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
1664
lightening/aarch64.c
1664
lightening/aarch64.c
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2013-2017 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2013-2017, 2019 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNU lightning.
|
||||
*
|
||||
|
@ -20,70 +20,161 @@
|
|||
#ifndef _jit_aarch64_h
|
||||
#define _jit_aarch64_h
|
||||
|
||||
#define JIT_HASH_CONSTS 0
|
||||
#define JIT_NUM_OPERANDS 3
|
||||
|
||||
/*
|
||||
* Types
|
||||
*/
|
||||
#define JIT_FP _R29
|
||||
typedef enum {
|
||||
#define jit_r(i) (_R9 + (i))
|
||||
#define jit_r_num() 7
|
||||
#define jit_v(i) (_R19 + (i))
|
||||
#define jit_v_num() 10
|
||||
#define jit_f(i) (_V8 + (i))
|
||||
#define jit_f_num() 8
|
||||
#define JIT_R0 _R9
|
||||
#define JIT_R1 _R10
|
||||
#define JIT_R2 _R11
|
||||
#define JIT_R3 _R12
|
||||
#define JIT_R4 _R13
|
||||
#define JIT_R5 _R14
|
||||
#define JIT_R6 _R15
|
||||
_R8, /* indirect result */
|
||||
_R18, /* platform register */
|
||||
_R17, /* IP1 */
|
||||
_R16, /* IP0 */
|
||||
_R9, _R10, _R11, _R12, /* temporaries */
|
||||
_R13, _R14, _R15,
|
||||
#define JIT_V0 _R19
|
||||
#define JIT_V1 _R20
|
||||
#define JIT_V2 _R21
|
||||
#define JIT_V3 _R22
|
||||
#define JIT_V4 _R23
|
||||
#define JIT_V5 _R24
|
||||
#define JIT_V6 _R25
|
||||
#define JIT_V7 _R26
|
||||
#define JIT_V8 _R27
|
||||
#define JIT_V9 _R28
|
||||
_R19, _R20, _R21, _R22, /* callee save */
|
||||
_R23, _R24, _R25, _R26,
|
||||
_R27, _R28,
|
||||
_SP, /* stack pointer */
|
||||
_R30, /* link register */
|
||||
_R29, /* frame pointer */
|
||||
_R7, _R6, _R5, _R4,
|
||||
_R3, _R2, _R1, _R0,
|
||||
#define JIT_F0 _V8
|
||||
#define JIT_F1 _V9
|
||||
#define JIT_F2 _V10
|
||||
#define JIT_F3 _V11
|
||||
#define JIT_F4 _V12
|
||||
#define JIT_F5 _V13
|
||||
#define JIT_F6 _V14
|
||||
#define JIT_F7 _V15
|
||||
_V31, _V30, _V29, _V28, /* temporaries */
|
||||
_V27, _V26, _V25, _V24,
|
||||
_V23, _V22, _V21, _V20,
|
||||
_V19, _V18, _V17, _V16,
|
||||
/* callee save */
|
||||
_V8, _V9, _V10, _V11,
|
||||
_V12, _V13, _V14, _V15,
|
||||
_V7, _V6, _V5, _V4, /* arguments */
|
||||
_V3, _V2, _V1, _V0,
|
||||
_NOREG,
|
||||
#define JIT_NOREG _NOREG
|
||||
} jit_reg_t;
|
||||
#define JIT_NEEDS_LITERAL_POOL 1
|
||||
|
||||
#define _X0 JIT_GPR(0)
|
||||
#define _X1 JIT_GPR(1)
|
||||
#define _X2 JIT_GPR(2)
|
||||
#define _X3 JIT_GPR(3)
|
||||
#define _X4 JIT_GPR(4)
|
||||
#define _X5 JIT_GPR(5)
|
||||
#define _X6 JIT_GPR(6)
|
||||
#define _X7 JIT_GPR(7)
|
||||
#define _X8 JIT_GPR(8)
|
||||
#define _X9 JIT_GPR(9)
|
||||
#define _X10 JIT_GPR(10)
|
||||
#define _X11 JIT_GPR(11)
|
||||
#define _X12 JIT_GPR(12)
|
||||
#define _X13 JIT_GPR(13)
|
||||
#define _X14 JIT_GPR(14)
|
||||
#define _X15 JIT_GPR(15)
|
||||
#define _X16 JIT_GPR(16)
|
||||
#define _X17 JIT_GPR(17)
|
||||
#define _X18 JIT_GPR(18)
|
||||
#define _X19 JIT_GPR(19)
|
||||
#define _X20 JIT_GPR(20)
|
||||
#define _X21 JIT_GPR(21)
|
||||
#define _X22 JIT_GPR(22)
|
||||
#define _X23 JIT_GPR(23)
|
||||
#define _X24 JIT_GPR(24)
|
||||
#define _X25 JIT_GPR(25)
|
||||
#define _X26 JIT_GPR(26)
|
||||
#define _X27 JIT_GPR(27)
|
||||
#define _X28 JIT_GPR(28)
|
||||
#define _X29 JIT_GPR(29)
|
||||
#define _X30 JIT_GPR(30)
|
||||
#define _X31 JIT_GPR(31)
|
||||
|
||||
#define _D0 JIT_FPR(0)
|
||||
#define _D1 JIT_FPR(1)
|
||||
#define _D2 JIT_FPR(2)
|
||||
#define _D3 JIT_FPR(3)
|
||||
#define _D4 JIT_FPR(4)
|
||||
#define _D5 JIT_FPR(5)
|
||||
#define _D6 JIT_FPR(6)
|
||||
#define _D7 JIT_FPR(7)
|
||||
#define _D8 JIT_FPR(8)
|
||||
#define _D9 JIT_FPR(9)
|
||||
#define _D10 JIT_FPR(10)
|
||||
#define _D11 JIT_FPR(11)
|
||||
#define _D12 JIT_FPR(12)
|
||||
#define _D13 JIT_FPR(13)
|
||||
#define _D14 JIT_FPR(14)
|
||||
#define _D15 JIT_FPR(15)
|
||||
#define _D16 JIT_FPR(16)
|
||||
#define _D17 JIT_FPR(17)
|
||||
#define _D18 JIT_FPR(18)
|
||||
#define _D19 JIT_FPR(19)
|
||||
#define _D20 JIT_FPR(20)
|
||||
#define _D21 JIT_FPR(21)
|
||||
#define _D22 JIT_FPR(22)
|
||||
#define _D23 JIT_FPR(23)
|
||||
#define _D24 JIT_FPR(24)
|
||||
#define _D25 JIT_FPR(25)
|
||||
#define _D26 JIT_FPR(26)
|
||||
#define _D27 JIT_FPR(27)
|
||||
#define _D28 JIT_FPR(28)
|
||||
#define _D29 JIT_FPR(29)
|
||||
#define _D30 JIT_FPR(30)
|
||||
#define _D31 JIT_FPR(31)
|
||||
|
||||
static inline jit_bool_t
|
||||
jit_gpr_is_callee_save (jit_gpr_t reg)
|
||||
{
|
||||
// x19 to x28 are callee-save, and x29 is the frame pointer.
|
||||
return 19 <= jit_gpr_regno (reg) && jit_gpr_regno (reg) <= 29;
|
||||
}
|
||||
|
||||
static inline jit_bool_t
|
||||
jit_fpr_is_callee_save (jit_fpr_t reg)
|
||||
{
|
||||
// v8 to v15 are callee-save.
|
||||
return 8 <= jit_fpr_regno (reg) && jit_fpr_regno (reg) <= 15;
|
||||
}
|
||||
|
||||
#define JIT_R0 _X0
|
||||
#define JIT_R1 _X1
|
||||
#define JIT_R2 _X2
|
||||
#define JIT_R3 _X3
|
||||
#define JIT_R4 _X4
|
||||
#define JIT_R5 _X5
|
||||
#define JIT_R6 _X6
|
||||
#define JIT_R7 _X7
|
||||
#define JIT_R8 _X8
|
||||
#define JIT_R9 _X9
|
||||
#define JIT_R10 _X10
|
||||
#define JIT_R11 _X11
|
||||
#define JIT_R12 _X12
|
||||
#define JIT_R13 _X13
|
||||
#define JIT_R14 _X14
|
||||
#define JIT_R15 _X15
|
||||
#define JIT_R16 _X16
|
||||
#define JIT_R17 _X17
|
||||
#define JIT_RTMP _X18
|
||||
#define JIT_V0 _X19
|
||||
#define JIT_V1 _X20
|
||||
#define JIT_V2 _X21
|
||||
#define JIT_V3 _X22
|
||||
#define JIT_V4 _X23
|
||||
#define JIT_V5 _X24
|
||||
#define JIT_V6 _X25
|
||||
#define JIT_V7 _X26
|
||||
#define JIT_V8 _X27
|
||||
#define JIT_V9 _X28
|
||||
// x29 is frame pointer
|
||||
// x30 is link register
|
||||
// x31 is stack pointer
|
||||
|
||||
#define JIT_SP _X31
|
||||
|
||||
#define JIT_F0 _D0
|
||||
#define JIT_F1 _D1
|
||||
#define JIT_F2 _D2
|
||||
#define JIT_F3 _D3
|
||||
#define JIT_F4 _D4
|
||||
#define JIT_F5 _D5
|
||||
#define JIT_F6 _D6
|
||||
#define JIT_F7 _D7
|
||||
#define JIT_F8 _D16
|
||||
#define JIT_F9 _D17
|
||||
#define JIT_F10 _D18
|
||||
#define JIT_F11 _D19
|
||||
#define JIT_F12 _D20
|
||||
#define JIT_F13 _D21
|
||||
#define JIT_F14 _D22
|
||||
#define JIT_F15 _D23
|
||||
#define JIT_F16 _D24
|
||||
#define JIT_F17 _D25
|
||||
#define JIT_F18 _D26
|
||||
#define JIT_F19 _D27
|
||||
#define JIT_F20 _D28
|
||||
#define JIT_F21 _D29
|
||||
#define JIT_F22 _D30
|
||||
#define JIT_FTMP _D31
|
||||
|
||||
#define JIT_VF0 _D8
|
||||
#define JIT_VF1 _D9
|
||||
#define JIT_VF2 _D10
|
||||
#define JIT_VF3 _D11
|
||||
#define JIT_VF4 _D12
|
||||
#define JIT_VF5 _D13
|
||||
#define JIT_VF6 _D14
|
||||
#define JIT_VF7 _D15
|
||||
|
||||
#define _FP _X29
|
||||
#define _LR _X30
|
||||
#define _SP _X31
|
||||
|
||||
|
||||
#endif /* _jit_aarch64_h */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue