Alien-LibJIT

 view release on metacpan or  search on metacpan

libjit/attic/jit-gen-alpha.h  view on Meta::CPAN

/*
 * jit-gen-alpha.h - Code generation macros for the alpha processor.
 *
 * Copyright (C) 2006  Southern Storm Software, Pty Ltd.
 *
 * This file is part of the libjit library.
 *
 * The libjit library is free software: you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation, either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * The libjit library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with the libjit library.  If not, see
 * <http://www.gnu.org/licenses/>.
 */

#ifndef	_JIT_GEN_ALPHA_H
#define	_JIT_GEN_ALPHA_H

#include "jit-rules.h"

#ifdef __cplusplus
extern "C" {
#endif

/*
 *  enumerate the 32 integer registers.
 *
 *  See JIT_REG_INFO in jit-rules-alpha.h for details about registers
 */
typedef enum {
	ALPHA_R0 = 0,	ALPHA_V0 = ALPHA_R0,	/* Function result */

	ALPHA_R1 = 1,	ALPHA_T0 = ALPHA_R1,	/* Temp registers */
	ALPHA_R2 = 2,	ALPHA_T1 = ALPHA_R2,
	ALPHA_R3 = 3,	ALPHA_T2 = ALPHA_R3,
	ALPHA_R4 = 4,	ALPHA_T3 = ALPHA_R4,
	ALPHA_R5 = 5,	ALPHA_T4 = ALPHA_R5,
	ALPHA_R6 = 6,	ALPHA_T5 = ALPHA_R6,
	ALPHA_R7 = 7,	ALPHA_T6 = ALPHA_R7,
	ALPHA_R8 = 8,	ALPHA_T7 = ALPHA_R8,

	ALPHA_R9 = 9,	ALPHA_S0 = ALPHA_R9,	/* Saved registers */
	ALPHA_R10 = 10,	ALPHA_S1 = ALPHA_R10,
	ALPHA_R11 = 11,	ALPHA_S2 = ALPHA_R11,
	ALPHA_R12 = 12,	ALPHA_S3 = ALPHA_R12,
	ALPHA_R13 = 13,	ALPHA_S4 = ALPHA_R13,
	ALPHA_R14 = 14,	ALPHA_S5 = ALPHA_R14,

	ALPHA_R15 = 15,	ALPHA_S6 = ALPHA_R15,   /* ALPHA_R15 can hold either a saved value */
			ALPHA_FP = ALPHA_R15,   /* or the frame pointer                    */

	ALPHA_R16 = 16, ALPHA_A0 = ALPHA_R16,	/* First 6 arguments */
	ALPHA_R17 = 17,	ALPHA_A1 = ALPHA_R17,
	ALPHA_R18 = 18,	ALPHA_A2 = ALPHA_R18,
	ALPHA_R19 = 19,	ALPHA_A3 = ALPHA_R19,
	ALPHA_R20 = 20,	ALPHA_A4 = ALPHA_R20,
	ALPHA_R21 = 21,	ALPHA_A5 = ALPHA_R21,

	ALPHA_R22 = 22,	ALPHA_T8  = ALPHA_R22,	/* More temp registers */
	ALPHA_R23 = 23,	ALPHA_T9  = ALPHA_R23,
	ALPHA_R24 = 24,	ALPHA_T10 = ALPHA_R24,
	ALPHA_R25 = 25,	ALPHA_T11 = ALPHA_R25,

	ALPHA_R26 = 26,	ALPHA_RA = ALPHA_R26,	/* Return address */

	ALPHA_R27 = 27,	ALPHA_T12 = ALPHA_R27,	/* ALPHA_R27 can hold either a temp value */
			ALPHA_PV  = ALPHA_R27,  /* or the procedure value                 */

	ALPHA_R28 = 28, ALPHA_AT = ALPHA_R28,	/* Reeserved for the assembler */

	ALPHA_R29 = 29,	ALPHA_GP = ALPHA_R29,	/* Global pointer */

	ALPHA_R30 = 30,	ALPHA_SP = ALPHA_R30,	/* Stack pointer */

	ALPHA_R31 = 31,	ALPHA_ZERO = ALPHA_R31	/* Contains the value 0 */
} ALPHA_REG;

/*
 *  enumerate the 32 floating-point registers.
 *
 *  See JIT_REG_INFO in jit-rules-alpha.h for details about registers
 */
typedef enum {
						/* Function result */
	ALPHA_F0 = 0,	ALPHA_FV0 = ALPHA_F0,	/* real part       */
	ALPHA_F1 = 1,	ALPHA_FV1 = ALPHA_F1,	/* complex part    */

	ALPHA_F2 = 2,	ALPHA_FS0 = ALPHA_F2,	/* Saved registers */
	ALPHA_F3 = 3,	ALPHA_FS1 = ALPHA_F3,
	ALPHA_F4 = 4,	ALPHA_FS2 = ALPHA_F4,
	ALPHA_F5 = 5,	ALPHA_FS3 = ALPHA_F5,
	ALPHA_F6 = 6,	ALPHA_FS4 = ALPHA_F6,
	ALPHA_F7 = 7,	ALPHA_FS5 = ALPHA_F7,
	ALPHA_F8 = 8,	ALPHA_FS6 = ALPHA_F8,
	ALPHA_F9 = 9,	ALPHA_FS7 = ALPHA_F9,

	ALPHA_F10 = 10,	ALPHA_FT0 = ALPHA_F10,	/* Temp registers */
	ALPHA_F11 = 11,	ALPHA_FT1 = ALPHA_F11,
	ALPHA_F12 = 12,	ALPHA_FT2 = ALPHA_F12,
	ALPHA_F13 = 13,	ALPHA_FT3 = ALPHA_F13,
	ALPHA_F14 = 14,	ALPHA_FT4 = ALPHA_F14,
	ALPHA_F15 = 15,	ALPHA_FT5 = ALPHA_F15,

	ALPHA_F16 = 16,	ALPHA_FA0 = ALPHA_F16,	/* First 6 arguments */
	ALPHA_F17 = 17,	ALPHA_FA1 = ALPHA_F17,
	ALPHA_F18 = 18,	ALPHA_FA2 = ALPHA_F18,
	ALPHA_F19 = 19,	ALPHA_FA3 = ALPHA_F19,
	ALPHA_F20 = 20,	ALPHA_FA4 = ALPHA_F20,
	ALPHA_F21 = 21,	ALPHA_FA5 = ALPHA_F21,



( run in 0.547 second using v1.01-cache-2.11-cpan-df04353d9ac )