github.com/goccy/go-jit@v0.0.0-20200514131505-ff78d45cf6af/internal/ccall/jit-rules-interp.h (about) 1 /* 2 * jit-rules-interp.h - Rules that define the interpreter characteristics. 3 * 4 * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 * 6 * This file is part of the libjit library. 7 * 8 * The libjit library is free software: you can redistribute it and/or 9 * modify it under the terms of the GNU Lesser General Public License 10 * as published by the Free Software Foundation, either version 2.1 of 11 * the License, or (at your option) any later version. 12 * 13 * The libjit library is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with the libjit library. If not, see 20 * <http://www.gnu.org/licenses/>. 21 */ 22 23 #ifndef _JIT_RULES_INTERP_H 24 #define _JIT_RULES_INTERP_H 25 26 #include "jit-interp.h" 27 28 #ifdef __cplusplus 29 extern "C" { 30 #endif 31 32 /* 33 * Information about all of the registers, in allocation order. 34 */ 35 #define JIT_REG_INFO \ 36 {"r0", 0, -1, JIT_REG_ALL | JIT_REG_CALL_USED}, \ 37 {"r1", 1, -1, JIT_REG_ALL | JIT_REG_CALL_USED}, \ 38 {"r2", 2, -1, JIT_REG_ALL | JIT_REG_CALL_USED}, 39 #define JIT_NUM_REGS 3 40 #define JIT_NUM_GLOBAL_REGS 0 41 42 /* 43 * Define to 1 if we should always load values into registers 44 * before operating on them. i.e. the CPU does not have reg-mem 45 * and mem-reg addressing modes. 46 */ 47 #define JIT_ALWAYS_REG_REG 1 48 49 /* 50 * The maximum number of bytes to allocate for the prolog. 51 * This may be shortened once we know the true prolog size. 52 */ 53 #define JIT_PROLOG_SIZE jit_function_interp_size 54 55 /* 56 * Preferred alignment for the start of functions. 57 */ 58 #define JIT_FUNCTION_ALIGNMENT (sizeof(void *)) 59 60 /* 61 * Define this to 1 if the platform allows reads and writes on 62 * any byte boundary. Define to 0 if only properly-aligned 63 * memory accesses are allowed. 64 */ 65 #define JIT_ALIGN_OVERRIDES 0 66 67 /* 68 * Extra state information that is added to the "jit_gencode" structure. 69 */ 70 #define jit_extra_gen_state \ 71 int working_area; \ 72 int max_working_area; \ 73 int extra_working_space 74 #define jit_extra_gen_init(gen) \ 75 do { \ 76 (gen)->working_area = 0; \ 77 (gen)->max_working_area = 0; \ 78 (gen)->extra_working_space = 0; \ 79 } while (0) 80 #define jit_extra_gen_cleanup(gen) do { ; } while (0) 81 82 #ifdef __cplusplus 83 }; 84 #endif 85 86 #endif /* _JIT_RULES_INTERP_H */