summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZoltan Varga <vargaz@gmail.com>2013-03-01 20:27:07 +0100
committerZoltan Varga <vargaz@gmail.com>2013-03-01 20:27:07 +0100
commita2b380c30f8e12e508d9b761b9b049d17dff3617 (patch)
treef73bd87df79262990fa9796bf77aa6220f6edf19
parentddee8bb5125ad07f673a5f9a45ddc629dec8c126 (diff)
downloadffts-a2b380c30f8e12e508d9b761b9b049d17dff3617.zip
ffts-a2b380c30f8e12e508d9b761b9b049d17dff3617.tar.gz
Remove the unmaintained and incomplete alpha backend.
-rw-r--r--Makefile.am2
-rw-r--r--alpha/.gitignore4
-rw-r--r--alpha/Makefile.am8
-rw-r--r--alpha/alpha-codegen.h576
-rw-r--r--alpha/test.c156
-rw-r--r--alpha/tramp.c380
6 files changed, 1 insertions, 1125 deletions
diff --git a/Makefile.am b/Makefile.am
index 2cfec09..0bedf77 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-DIST_SUBDIRS = x86 ppc sparc arm s390 s390x alpha amd64 ia64 mips
+DIST_SUBDIRS = x86 ppc sparc arm s390 s390x amd64 ia64 mips
AM_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)
diff --git a/alpha/.gitignore b/alpha/.gitignore
deleted file mode 100644
index 6abcd22..0000000
--- a/alpha/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-/Makefile.in
-/Makefile
-/.deps
-/.cvsignore
diff --git a/alpha/Makefile.am b/alpha/Makefile.am
deleted file mode 100644
index 86cbcb6..0000000
--- a/alpha/Makefile.am
+++ /dev/null
@@ -1,8 +0,0 @@
-
-AM_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)
-
-noinst_LTLIBRARIES = libmonoarch-alpha.la
-
-libmonoarch_alpha_la_SOURCES = tramp.c alpha-codegen.h
-
-noinst_PROGRAMS = test
diff --git a/alpha/alpha-codegen.h b/alpha/alpha-codegen.h
deleted file mode 100644
index 46f95e1..0000000
--- a/alpha/alpha-codegen.h
+++ /dev/null
@@ -1,576 +0,0 @@
-#ifndef __ALPHA_CODEGEN_H__
-#define __ALPHA_CODEGEN_H__
-
-/*
- http://ftp.digital.com/pub/Digital/info/semiconductor/literature/alphaahb.pdf
-*/
-
-typedef enum {
- alpha_r0 = 0,
- alpha_r1 = 1,
- alpha_r2 = 2,
- alpha_r3 = 3,
- alpha_r4 = 4,
- alpha_r5 = 5,
- alpha_r6 = 6,
- alpha_r7 = 7,
- alpha_r8 = 8,
- alpha_r9 = 9,
- alpha_r10 = 10,
- alpha_r11 = 11,
- alpha_r12 = 12,
- alpha_r13 = 13,
- alpha_r14 = 14,
- alpha_r15 = 15,
- alpha_r16 = 16,
- alpha_r17 = 17,
- alpha_r18 = 18,
- alpha_r19 = 19,
- alpha_r20 = 20,
- alpha_r21 = 21,
- alpha_r22 = 22,
- alpha_r23 = 23,
- alpha_r24 = 24,
- alpha_r25 = 25,
- alpha_r26 = 26,
- alpha_r27 = 27,
- alpha_r28 = 28,
- alpha_r29 = 29,
- alpha_r30 = 30,
- alpha_r31 = 31, alpha_zero = 31,
- /* aliases */
- alpha_v0 = 0, /* return value */
-
- alpha_t0 = 1, /* temporaries */
- alpha_t1 = 2,
- alpha_t2 = 3,
- alpha_t3 = 4,
- alpha_t4 = 5,
- alpha_t5 = 6,
- alpha_t6 = 7,
- alpha_t7 = 8,
-
- alpha_s0 = 9, /* saved registers */
- alpha_s1 = 10,
- alpha_s2 = 11,
- alpha_s3 = 12,
- alpha_s4 = 13,
- alpha_s5 = 14,
- alpha_s6 = 15,
-
- alpha_fp = 15, /* frame pointer */
-
- alpha_a0 = 16, /* argument registers */
- alpha_a1 = 17,
- alpha_a2 = 18,
- alpha_a3 = 19,
- alpha_a4 = 20,
- alpha_a5 = 21,
-
- alpha_t8 = 22, /* temporaries */
- alpha_t9 = 23,
- alpha_t10 = 24,
- alpha_t11 = 25,
-
- alpha_ra = 26, /* Return Address */
-
- alpha_pv = 27, /* pv current procedure */
- alpha_t12 = 27, /* temp 12 */
-
- alpha_altreg = 28,
- alpha_at = 28,
-
- alpha_gp = 29, /* Global Pointer */
- alpha_sp = 30, /* Stack Pointer */
-} AlphaRegister;
-
-typedef enum {
- /* floating point registers */
- alpha_f0 = 0,
- alpha_f1 = 1,
- alpha_f2 = 2,
- alpha_f3 = 3,
- alpha_f4 = 4,
- alpha_f5 = 5,
- alpha_f6 = 6,
- alpha_f7 = 7,
- alpha_f8 = 8,
- alpha_f9 = 9,
- alpha_f10 = 10,
- alpha_f11 = 11,
- alpha_f12 = 12,
- alpha_f13 = 13,
- alpha_f14 = 14,
- alpha_f15 = 15,
- alpha_f16 = 16,
- alpha_f17 = 17,
- alpha_f18 = 18,
- alpha_f19 = 19,
- alpha_f20 = 20,
- alpha_f21 = 21,
- alpha_f22 = 22,
- alpha_f23 = 23,
- alpha_f24 = 24,
- alpha_f25 = 25,
- alpha_f26 = 26,
- alpha_f27 = 27,
- alpha_f28 = 28,
- alpha_f29 = 29,
- alpha_f30 = 30,
- alpha_f31 = 31, alpha_fzero = 31,
- /* aliases */
- alpha_fv0 = 0, /* return value */
- alpha_fv1 = 1,
-
- alpha_fs0 = 2, /* saved registers */
- alpha_fs1 = 3,
- alpha_fs2 = 4,
- alpha_fs3 = 5,
- alpha_fs4 = 6,
- alpha_fs5 = 7,
- alpha_fs6 = 8,
- alpha_fs7 = 9,
-
- alpha_ft0 = 10, /* temporary */
- alpha_ft1 = 11,
- alpha_ft2 = 12,
- alpha_ft3 = 13,
- alpha_ft4 = 14,
- alpha_ft5 = 15,
-
- alpha_fa0 = 16, /* args */
- alpha_fa1 = 17,
- alpha_fa2 = 18,
- alpha_fa3 = 19,
- alpha_fa4 = 20,
- alpha_fa5 = 21,
-
- alpha_ft6 = 22,
- alpha_ft7 = 23,
- alpha_ft8 = 24,
- alpha_ft9 = 25,
- alpha_ft10 = 26,
- alpha_ft11 = 27,
- alpha_ft12 = 28,
- alpha_ft13 = 29,
- alpha_ft14 = 30
-} AlphaFPRegister;
-
-/***************************************/
-
-#define __alpha_int_32 unsigned int
-
-/***************************************/
-#define AXP_OFF26_MASK 0x03ffffff
-#define AXP_OFF21_MASK 0x01fffff
-#define AXP_OFF16_MASK 0x0ffff
-#define AXP_OFF14_MASK 0x03fff
-#define AXP_OFF13_MASK 0x01fff
-#define AXP_OFF11_MASK 0x07ff
-#define AXP_OFF8_MASK 0x0ff
-#define AXP_OFF7_MASK 0x07f
-#define AXP_OFF6_MASK 0x03f
-#define AXP_OFF5_MASK 0x01f
-#define AXP_OFF4_MASK 0x0f
-#define AXP_OFF2_MASK 0x03
-#define AXP_OFF1_MASK 0x01
-
-
-#define AXP_REG_MASK AXP_OFF5_MASK
-#define AXP_REGSIZE 5
-
-#define AXP_OP_SHIFT 26
-#define AXP_REG1_SHIFT 21
-#define AXP_REG2_SHIFT 16
-#define AXP_MEM_BR_SHIFT 14
-#define AXP_LIT_SHIFT 13
-
-/* encode registers */
-#define alpha_opcode( op ) \
- ((op&AXP_OFF6_MASK) << AXP_OP_SHIFT)
-
-/* encode registers */
-#define alpha_reg_a( reg ) \
- ((reg & AXP_REG_MASK) << AXP_REG1_SHIFT)
-
-#define alpha_reg_b( reg ) \
- ((reg & AXP_REG_MASK) << AXP_REG2_SHIFT)
-
-#define alpha_reg_c( reg ) \
- (reg & AXP_REG_MASK)
-
-
-
-/* encode function codes */
-#define alpha_fp_func( func ) \
- ((func & AXP_OFF11_MASK) << AXP_REGSIZE)
-
-#define alpha_op_func( func ) \
- ((func & AXP_OFF7_MASK) << AXP_REGSIZE)
-
-#define alpha_op_literal( lit ) \
- ((lit & AXP_OFF8_MASK) << AXP_LIT_SHIFT)
-
-#define alpha_mem_br_func( func, hint ) \
- (((func & AXP_OFF2_MASK ) << AXP_MEM_BR_SHIFT ) | (hint&AXP_OFF14_MASK))
-
-#define alpha_mem_fc_func( func ) \
- (func && AXP_OFF16_MASK)
-
-
-#define alpha_encode_hw4_mem( op, func ) \
- (alpha_opcode( op ) | (( func & 0x0f ) << 12))
-
-#define alpha_encode_hw5_mem( op, func ) \
- (alpha_opcode( op ) | (( func & 0x3f ) << 10))
-
-#define alpha_encode_hw6mem( op, func ) \
- (alpha_opcode( op ) | (( func & 0x0f ) << 12))
-
-#define alpha_encode_hw6mem_br( op, func ) \
- (alpha_opcode( op ) | (( func & 0x07 ) << 13))
-
-
-/*****************************************/
-
-
-#define alpha_encode_palcall( ins, op, func ) \
- *((__alpha_int_32*)(ins)) = ( 0 |\
- alpha_opcode( op ) | ( func & AXP_OFF26_MASK )),\
- ((__alpha_int_32*)(ins))++
-
-#define alpha_encode_mem( ins, op, Rdest, Rsrc, offset ) \
- *((__alpha_int_32*)(ins)) = ( 0 |\
- alpha_opcode( op ) | alpha_reg_a( Rdest ) | \
- alpha_reg_b( Rsrc ) | (offset & AXP_OFF16_MASK )),\
- ((__alpha_int_32*)(ins))++
-
-#define alpha_encode_mem_fc( ins, op, func, Rdest, Rsrc, offset ) \
- *((__alpha_int_32*)(ins)) = ( 0 |\
- alpha_opcode( op ) | alpha_reg_a( Rdest ) | \
- alpha_reg_b( Rsrc ) | alpha_mem_fc_func( func )),\
- *((__alpha_int_32*)(ins))++
-
-#define alpha_encode_mem_br( ins, op, func, Rdest, Rsrc, hint ) \
- *((__alpha_int_32*)(ins)) = ( 0 |\
- alpha_opcode( op ) | alpha_reg_a( Rdest ) | \
- alpha_reg_b( Rsrc ) | alpha_mem_br_func( func, hint ) ),\
- ((__alpha_int_32*)(ins))++
-
-#define alpha_encode_branch( ins, op, Reg, offset ) \
- *((__alpha_int_32*)(ins)) = ( 0 |\
- alpha_opcode( op ) | alpha_reg_a( Reg ) | \
- (offset & AXP_OFF21_MASK )),\
- ((__alpha_int_32*)(ins))++
-
-#define alpha_encode_op( ins, op, func, Rsrc1, Rsrc2, Rdest ) \
- *((__alpha_int_32*)(ins)) = ( 0 |\
- alpha_opcode( op ) | alpha_reg_a( Rsrc1 ) | \
- alpha_reg_b( Rsrc2 ) | alpha_op_func( func ) | \
- alpha_reg_c( Rdest )),\
- ((__alpha_int_32*)(ins))++
-
-
-#define alpha_encode_opl( ins, op, func, Rsrc, lit, Rdest ) \
- *((__alpha_int_32*)(ins)) = ( 0 |\
- alpha_opcode( op ) | alpha_reg_a( Rsrc ) | \
- alpha_op_literal(lit) | ( 1 << 12 ) | \
- alpha_op_func( func ) | alpha_reg_c( Rdest ) ),\
- ((__alpha_int_32*)(ins))++
-
-
-#define alpha_encode_fpop( ins, op, func, Rsrc1, Rsrc2, Rdest ) \
- *((__alpha_int_32*)(ins)) = ( 0 |\
- alpha_opcode( op ) | alpha_reg_a( Rsrc1 ) | \
- alpha_reg_b( Rsrc2 ) | alpha_fp_func( func ) | \
- alpha_reg_c( Rdest )),\
- ((__alpha_int_32*)(ins))++
-
-
-/***************************************/
-
-/* pal calls */
-/* #define alpha_halt( ins ) alpha_encode_palcall( ins, 0, 0 ) */
-
-#define alpha_call_pal( ins, func ) alpha_encode_palcall( ins, 0, func )
-
-/*memory*/
-#define alpha_lda( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x08, Rdest, Rsrc, offset )
-#define alpha_ldah( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x09, Rdest, Rsrc, offset )
-#define alpha_ldbu( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x0a, Rdest, Rsrc, offset )
-#define alpha_ldq_u( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x0b, Rdest, Rsrc, offset )
-#define alpha_ldwu( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x0c, Rdest, Rsrc, offset )
-#define alpha_stw( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x0d, Rdest, Rsrc, offset )
-#define alpha_stb( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x0e, Rdest, Rsrc, offset )
-#define alpha_stq_u( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x0f, Rdest, Rsrc, offset )
-
-#ifdef __VAX__
-#define alpha_ldf( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x20, Rdest, Rsrc, offset )
-#define alpha_ldg( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x21, Rdest, Rsrc, offset )
-#define alpha_stf( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x24, Rdest, Rsrc, offset )
-#define alpha_stg( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x25, Rdest, Rsrc, offset )
-#endif
-
-#define alpha_lds( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x22, Rdest, Rsrc, offset )
-#define alpha_ldt( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x23, Rdest, Rsrc, offset )
-#define alpha_ldqf( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x23, Rdest, Rsrc, offset )
-
-#define alpha_sts( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x26, Rdest, Rsrc, offset )
-#define alpha_stt( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x27, Rdest, Rsrc, offset )
-#define alpha_stqf( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x27, Rdest, Rsrc, offset )
-
-
-#define alpha_ldl( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x28, Rdest, Rsrc, offset )
-#define alpha_ldq( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x29, Rdest, Rsrc, offset )
-#define alpha_ldl_l( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x2A, Rdest, Rsrc, offset )
-#define alpha_ldq_l( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x2B, Rdest, Rsrc, offset )
-#define alpha_stl( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x2C, Rdest, Rsrc, offset )
-#define alpha_stq( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x2D, Rdest, Rsrc, offset )
-#define alpha_stl_c( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x2E, Rdest, Rsrc, offset )
-#define alpha_stq_c( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x2F, Rdest, Rsrc, offset )
-
-
-/* branch*/
-#define alpha_jmp( ins, Rdest, Rsrc, hint ) alpha_encode_mem_br( ins, 0x1A, 0x0, Rdest, Rsrc, hint )
-#define alpha_jsr( ins, Rdest, Rsrc, hint ) alpha_encode_mem_br( ins, 0x1A, 0x1, Rdest, Rsrc, hint )
-#define alpha_ret( ins, Rsrc, hint ) alpha_encode_mem_br( ins, 0x1A, 0x2, alpha_zero, Rsrc, hint )
-#define alpha_jsrco( ins, Rdest, Rsrc, hint ) alpha_encode_mem_br( ins, 0x1A, 0x3, Rdest, Rsrc, hint )
-
-#define alpha_br( ins, Reg, offset ) alpha_encode_branch( ins, 0x30, Reg, offset )
-#define alpha_fbeq( ins, Reg, offset ) alpha_encode_branch( ins, 0x31, Reg, offset )
-#define alpha_fblt( ins, Reg, offset ) alpha_encode_branch( ins, 0x32, Reg, offset )
-#define alpha_fble( ins, Reg, offset ) alpha_encode_branch( ins, 0x33, Reg, offset )
-#define alpha_bsr( ins, Reg, offset ) alpha_encode_branch( ins, 0x34, Reg, offset )
-#define alpha_fbne( ins, Reg, offset ) alpha_encode_branch( ins, 0x35, Reg, offset )
-#define alpha_fbge( ins, Reg, offset ) alpha_encode_branch( ins, 0x36, Reg, offset )
-#define alpha_fbgt( ins, Reg, offset ) alpha_encode_branch( ins, 0x37, Reg, offset )
-#define alpha_blbc( ins, Reg, offset ) alpha_encode_branch( ins, 0x38, Reg, offset )
-#define alpha_beq( ins, Reg, offset ) alpha_encode_branch( ins, 0x39, Reg, offset )
-#define alpha_blt( ins, Reg, offset ) alpha_encode_branch( ins, 0x3A, Reg, offset )
-#define alpha_ble( ins, Reg, offset ) alpha_encode_branch( ins, 0x3B, Reg, offset )
-#define alpha_blbs( ins, Reg, offset ) alpha_encode_branch( ins, 0x3C, Reg, offset )
-#define alpha_bne( ins, Reg, offset ) alpha_encode_branch( ins, 0x3D, Reg, offset )
-#define alpha_bge( ins, Reg, offset ) alpha_encode_branch( ins, 0x3E, Reg, offset )
-#define alpha_bgt( ins, Reg, offset ) alpha_encode_branch( ins, 0x3F, Reg, offset )
-
-
-/* integer */
-/*//#define alpha_sextl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x00, Rsrc1, Rsrc2, Rdest )
-//#define alpha_sextl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x00, Rsrc1, lit, Rdest )
-*/
-#define alpha_addl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x00, Rsrc1, Rsrc2, Rdest )
-#define alpha_addl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x00, Rsrc1, lit, Rdest )
-#define alpha_s4addl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x02, Rsrc1, Rsrc2, Rdest )
-#define alpha_s4addl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x02, Rsrc1, lit, Rdest )
-//#define alpha_negl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x09, Rsrc1, Rsrc2, Rdest )
-//#define alpha_negl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x09, Rsrc1, lit, Rdest )
-#define alpha_subl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x09, Rsrc1, Rsrc2, Rdest )
-#define alpha_subl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x09, Rsrc1, lit, Rdest )
-#define alpha_s4subl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x0B, Rsrc1, Rsrc2, Rdest )
-#define alpha_s4subl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x0B, Rsrc1, lit, Rdest )
-#define alpha_cmpbge( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x0F, Rsrc1, Rsrc2, Rdest )
-#define alpha_cmpbge_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x0F, Rsrc1, lit, Rdest )
-#define alpha_s8addl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x12, Rsrc1, Rsrc2, Rdest )
-#define alpha_s8addl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x12, Rsrc1, lit, Rdest )
-#define alpha_s8subl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x1B, Rsrc1, Rsrc2, Rdest )
-#define alpha_s8subl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x1B, Rsrc1, lit, Rdest )
-#define alpha_cmpult( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x1d, Rsrc1, Rsrc2, Rdest )
-#define alpha_cmpult_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x1d, Rsrc1, lit, Rdest )
-#define alpha_addq( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x20, Rsrc1, Rsrc2, Rdest )
-#define alpha_addq_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x20, Rsrc1, lit, Rdest )
-#define alpha_s4addq( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x22, Rsrc1, Rsrc2, Rdest )
-#define alpha_s4addq_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x22, Rsrc1, lit, Rdest )
-//#define alpha_negq( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x29, Rsrc1, Rsrc2, Rdest )
-//#define alpha_negq_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x29, Rsrc1, lit, Rdest )
-#define alpha_subq( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x29, Rsrc1, Rsrc2, Rdest )
-#define alpha_subq_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x29, Rsrc1, lit, Rdest )
-#define alpha_s4subq( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x2B, Rsrc1, Rsrc2, Rdest )
-#define alpha_s4subq_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x2B, Rsrc1, lit, Rdest )
-#define alpha_cmpeq( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x2D, Rsrc1, Rsrc2, Rdest )
-#define alpha_cmpeq_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x2D, Rsrc1, lit, Rdest )
-#define alpha_s8addq( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x32, Rsrc1, Rsrc2, Rdest )
-#define alpha_s8addq_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x32, Rsrc1, lit, Rdest )
-#define alpha_s8subq( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x3B, Rsrc1, Rsrc2, Rdest )
-#define alpha_s8subq_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x3B, Rsrc1, lit, Rdest )
-#define alpha_cmpule( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x3D, Rsrc1, Rsrc2, Rdest )
-#define alpha_cmpule_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x3D, Rsrc1, lit, Rdest )
-#define alpha_addlv( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x40, Rsrc1, Rsrc2, Rdest )
-#define alpha_addlv_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x40, Rsrc1, lit, Rdest )
-//#define alpha_neglv( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x49, Rsrc1, Rsrc2, Rdest )
-//#define alpha_neglv_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x49, Rsrc1, lit, Rdest )
-#define alpha_sublv( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x49, Rsrc1, Rsrc2, Rdest )
-#define alpha_sublv_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x49, Rsrc1, lit, Rdest )
-#define alpha_cmplt( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x4D, Rsrc1, Rsrc2, Rdest )
-#define alpha_cmplt_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x4D, Rsrc1, lit, Rdest )
-#define alpha_addqv( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x60, Rsrc1, Rsrc2, Rdest )
-#define alpha_addqv_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x60, Rsrc1, lit, Rdest )
-//#define alpha_negqv( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x69, Rsrc1, Rsrc2, Rdest )
-//#define alpha_negqv_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x69, Rsrc1, lit, Rdest )
-#define alpha_subqv( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x69, Rsrc1, Rsrc2, Rdest )
-#define alpha_subqv_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x69, Rsrc1, lit, Rdest )
-#define alpha_cmple( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x6D, Rsrc1, Rsrc2, Rdest )
-#define alpha_cmple_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x6D, Rsrc1, lit, Rdest )
-
-#define alpha_and( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x00, Rsrc1, Rsrc2, Rdest )
-#define alpha_and_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x00, Rsrc1, lit, Rdest )
-//#define alpha_andnot( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x08, Rsrc1, Rsrc2, Rdest )
-//#define alpha_andnot_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x08, Rsrc1, lit, Rdest )
-#define alpha_bic( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x08, Rsrc1, Rsrc2, Rdest )
-#define alpha_bic_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x08, Rsrc1, lit, Rdest )
-#define alpha_cmovlbs( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x14, Rsrc1, Rsrc2, Rdest )
-#define alpha_cmovlbs_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x14, Rsrc1, lit, Rdest )
-#define alpha_cmovlbc( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x16, Rsrc1, Rsrc2, Rdest )
-#define alpha_cmovlbc_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x16, Rsrc1, lit, Rdest )
-#define alpha_nop( ins ) alpha_encode_op( ins, 0x11, 0x20, alpha_zero, alpha_zero, alpha_zero )
-#define alpha_clr( ins, Rdest ) alpha_encode_op( ins, 0x11, 0x20, alpha_zero, alpha_zero, Rdest )
-#define alpha_mov1( ins, Rsrc, Rdest ) alpha_encode_op( ins, 0x11, 0x20, alpha_zero, Rsrc, Rdest )
-#define alpha_mov2( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x20, Rsrc1, Rsrc2, Rdest )
-#define alpha_mov_( ins, lit, Rdest ) alpha_encode_op( ins, 0x11, 0x20, alpha_zero, lit, Rdest )
-//#define alpha_or( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x20, Rsrc1, Rsrc2, Rdest )
-//#define alpha_or_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x20, Rsrc1, lit, Rdest )
-#define alpha_bis( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x20, Rsrc1, Rsrc2, Rdest )
-#define alpha_bis_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x20, Rsrc1, lit, Rdest )
-#define alpha_cmoveq( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x24, Rsrc1, Rsrc2, Rdest )
-#define alpha_cmoveq_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x24, Rsrc1, lit, Rdest )
-#define alpha_cmovne( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x26, Rsrc1, Rsrc2, Rdest )
-#define alpha_cmovne_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x26, Rsrc1, lit, Rdest )
-#define alpha_not( ins, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x28, alpha_zero, Rsrc2, Rdest )
-#define alpha_not_( ins, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x28, alpha_zero, lit, Rdest )
-#define alpha_ornot( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x28, Rsrc1, Rsrc2, Rdest )
-#define alpha_ornot_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x28, Rsrc1, lit, Rdest )
-#define alpha_xor( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x40, Rsrc1, Rsrc2, Rdest )
-#define alpha_xor_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x40, Rsrc1, lit, Rdest )
-#define alpha_cmovlt( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x44, Rsrc1, Rsrc2, Rdest )
-#define alpha_cmovlt_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x44, Rsrc1, lit, Rdest )
-#define alpha_cmovge( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x46, Rsrc1, Rsrc2, Rdest )
-#define alpha_cmovge_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x46, Rsrc1, lit, Rdest )
-#define alpha_eqv( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x48, Rsrc1, Rsrc2, Rdest )
-#define alpha_eqv_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x48, Rsrc1, lit, Rdest )
-//#define alpha_xornot( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x48, Rsrc1, Rsrc2, Rdest )
-//#define alpha_xornot_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x48, Rsrc1, lit, Rdest )
-#define alpha_ev56b_amask( ins, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x61, alpha_zero, Rsrc2, Rdest )
-#define alpha_ev56b_amask_( ins, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x61, alpha_zero, lit, Rdest )
-#define alpha_cmovle( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x64, Rsrc1, Rsrc2, Rdest )
-#define alpha_cmovle_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x64, Rsrc1, lit, Rdest )
-#define alpha_cmovgt( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x66, Rsrc1, Rsrc2, Rdest )
-#define alpha_cmovgt_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x66, Rsrc1, lit, Rdest )
-//#define alpha_implver_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x6C, Rsrc1, lit, Rdest )
-#define alpha_cmovgt( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x66, Rsrc1, Rsrc2, Rdest )
-#define alpha_cmovgt_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x66, Rsrc1, lit, Rdest )
-
-#define alpha_mskbl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x02, Rsrc1, Rsrc2, Rdest )
-#define alpha_mskbl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x02, Rsrc1, lit, Rdest )
-#define alpha_extbl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x06, Rsrc1, Rsrc2, Rdest )
-#define alpha_extbl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x06, Rsrc1, lit, Rdest )
-#define alpha_insbl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x0B, Rsrc1, Rsrc2, Rdest )
-#define alpha_insbl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x0B, Rsrc1, lit, Rdest )
-#define alpha_mskwl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x12, Rsrc1, Rsrc2, Rdest )
-#define alpha_mskwl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x12, Rsrc1, lit, Rdest )
-#define alpha_extwl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x16, Rsrc1, Rsrc2, Rdest )
-#define alpha_extwl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x16, Rsrc1, lit, Rdest )
-#define alpha_inswl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x1b, Rsrc1, Rsrc2, Rdest )
-#define alpha_inswl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x1b, Rsrc1, lit, Rdest )
-#define alpha_mskll( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x22, Rsrc1, Rsrc2, Rdest )
-#define alpha_mskll_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x22, Rsrc1, lit, Rdest )
-#define alpha_extll( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x26, Rsrc1, Rsrc2, Rdest )
-#define alpha_extll_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x26, Rsrc1, lit, Rdest )
-#define alpha_insll( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x2b, Rsrc1, Rsrc2, Rdest )
-#define alpha_insll_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x2b, Rsrc1, lit, Rdest )
-#define alpha_zap( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x30, Rsrc1, Rsrc2, Rdest )
-#define alpha_zap_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x30, Rsrc1, lit, Rdest )
-#define alpha_zapnot( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x31, Rsrc1, Rsrc2, Rdest )
-#define alpha_zapnot_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x31, Rsrc1, lit, Rdest )
-#define alpha_mskql( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x32, Rsrc1, Rsrc2, Rdest )
-#define alpha_mskql_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x32, Rsrc1, lit, Rdest )
-#define alpha_srl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x34, Rsrc1, Rsrc2, Rdest )
-#define alpha_srl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x34, Rsrc1, lit, Rdest )
-#define alpha_extql( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x36, Rsrc1, Rsrc2, Rdest )
-#define alpha_extql_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x36, Rsrc1, lit, Rdest )
-#define alpha_sll( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x39, Rsrc1, Rsrc2, Rdest )
-#define alpha_sll_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x39, Rsrc1, lit, Rdest )
-#define alpha_insql( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x3b, Rsrc1, Rsrc2, Rdest )
-#define alpha_insql_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x3b, Rsrc1, lit, Rdest )
-#define alpha_sra( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x3c, Rsrc1, Rsrc2, Rdest )
-#define alpha_sra_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x3c, Rsrc1, lit, Rdest )
-#define alpha_mskwh( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x52, Rsrc1, Rsrc2, Rdest )
-#define alpha_mskwh_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x52, Rsrc1, lit, Rdest )
-#define alpha_inswh( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x57, Rsrc1, Rsrc2, Rdest )
-#define alpha_inswh_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x57, Rsrc1, lit, Rdest )
-#define alpha_extwh( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x5a, Rsrc1, Rsrc2, Rdest )
-#define alpha_extwh_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x5a, Rsrc1, lit, Rdest )
-#define alpha_msklh( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x62, Rsrc1, Rsrc2, Rdest )
-#define alpha_msklh_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x62, Rsrc1, lit, Rdest )
-#define alpha_inslh( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x67, Rsrc1, Rsrc2, Rdest )
-#define alpha_inslh_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x67, Rsrc1, lit, Rdest )
-#define alpha_extlh( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x6a, Rsrc1, Rsrc2, Rdest )
-#define alpha_extlh_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x6a, Rsrc1, lit, Rdest )
-#define alpha_mskqh( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x72, Rsrc1, Rsrc2, Rdest )
-#define alpha_mskqh_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x72, Rsrc1, lit, Rdest )
-#define alpha_insqh( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x77, Rsrc1, Rsrc2, Rdest )
-#define alpha_insqh_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x77, Rsrc1, lit, Rdest )
-#define alpha_extqh( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x7a, Rsrc1, Rsrc2, Rdest )
-#define alpha_extqh_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x7a, Rsrc1, lit, Rdest )
-
-#define alpha_mull(ins, Rsrc1, Rsrc2, Rdest) alpha_encode_op( ins, 0x13, 0x00, Rsrc1, Rsrc2, Rdest )
-#define alpha_mull_(ins, Rsrc1, lit, Rdest) alpha_encode_op( ins, 0x13, 0x00, Rsrc1, lit, Rdest )
-#define alpha_mulq(ins, Rsrc1, Rsrc2, Rdest) alpha_encode_op( ins, 0x13, 0x20, Rsrc1, Rsrc2, Rdest )
-#define alpha_mulq_(ins, Rsrc1, lit, Rdest) alpha_encode_op( ins, 0x13, 0x20, Rsrc1, lit, Rdest )
-
-#define alpha_sextb(ins, Rsrc2, Rdest) alpha_encode_op( ins, 0x1c, 0x00, alpha_zero, Rsrc2, Rdest )
-#define alpha_sextw(ins, Rsrc2, Rdest) alpha_encode_op( ins, 0x1c, 0x01, alpha_zero, Rsrc2, Rdest )
-
-// For 264
-#define alpha_ftois( ins, RFsrc, Rdest ) alpha_encode_fpop( ins, 0x1c, 0x078, RFsrc, alpha_zero, Rdest )
-#define alpha_ftoit( ins, RFsrc, Rdest ) alpha_encode_fpop( ins, 0x1c, 0x070, RFsrc, alpha_zero, Rdest )
-#define alpha_ftoi_qf( ins, RFsrc, Rdest ) alpha_encode_fpop( ins, 0x1c, 0x070, RFsrc, alpha_zero, Rdest )
-// For 264
-#define alpha_itofs( ins, Rsrc, RFdest ) alpha_encode_fpop( ins, 0x14, 0x004, Rsrc, alpha_zero, RFdest )
-#define alpha_itoff( ins, Rsrc, RFdest ) alpha_encode_fpop( ins, 0x14, 0x014, Rsrc, alpha_zero, RFdest )
-#define alpha_itoft( ins, Rsrc, RFdest ) alpha_encode_fpop( ins, 0x14, 0x024, Rsrc, alpha_zero, RFdest )
-#define alpha_itof_qf( ins, Rsrc, RFdest ) alpha_encode_fpop( ins, 0x14, 0x024, Rsrc, alpha_zero, RFdest )
-
-#define alpha_cvtts_c(ins, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x2C, alpha_fzero, Rsrc2, Rdest )
-#define alpha_cvttq_c(ins, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x2F, alpha_fzero, Rsrc2, Rdest )
-#define alpha_cvtqs_c(ins, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x3C, alpha_fzero, Rsrc2, Rdest )
-#define alpha_cvtqt_c(ins, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x3E, alpha_fzero, Rsrc2, Rdest )
-
-
-#define alpha_adds(ins, Rsrc1, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x080, Rsrc1, Rsrc2, Rdest )
-#define alpha_subs(ins, Rsrc1, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x081, Rsrc1, Rsrc2, Rdest )
-#define alpha_addt(ins, Rsrc1, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x0A0, Rsrc1, Rsrc2, Rdest )
-#define alpha_subt(ins, Rsrc1, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x0A1, Rsrc1, Rsrc2, Rdest )
-#define alpha_mult(ins, Rsrc1, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x0A2, Rsrc1, Rsrc2, Rdest )
-#define alpha_divt(ins, Rsrc1, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x0A3, Rsrc1, Rsrc2, Rdest )
-
-#define alpha_cmptun(ins, Rsrc1, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x0A4, Rsrc1, Rsrc2, Rdest )
-#define alpha_cmpteq(ins, Rsrc1, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x0A5, Rsrc1, Rsrc2, Rdest )
-#define alpha_cmptlt(ins, Rsrc1, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x0A6, Rsrc1, Rsrc2, Rdest )
-#define alpha_cmptle(ins, Rsrc1, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x0A7, Rsrc1, Rsrc2, Rdest )
-
-#define alpha_addt_su(ins, Rsrc1, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x5A0, Rsrc1, Rsrc2, Rdest )
-#define alpha_subt_su(ins, Rsrc1, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x5A1, Rsrc1, Rsrc2, Rdest )
-
-
-#define alpha_cmptun_su(ins, Rsrc1, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x5A4, Rsrc1, Rsrc2, Rdest )
-#define alpha_cmpteq_su(ins, Rsrc1, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x5A5, Rsrc1, Rsrc2, Rdest )
-#define alpha_cmptlt_su(ins, Rsrc1, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x5A6, Rsrc1, Rsrc2, Rdest )
-#define alpha_cmptle_su(ins, Rsrc1, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x5A7, Rsrc1, Rsrc2, Rdest )
-
-#define alpha_cvtts(ins, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x0AC, alpha_fzero, Rsrc2, Rdest )
-#define alpha_cvttq(ins, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x0AF, alpha_fzero, Rsrc2, Rdest )
-#define alpha_cvtqs(ins, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x0BC, alpha_fzero, Rsrc2, Rdest )
-#define alpha_cvtqt(ins, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x0BE, alpha_fzero, Rsrc2, Rdest )
-
-#define alpha_divt_su(ins, Rsrc1, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x5A3, Rsrc1, Rsrc2, Rdest )
-
-#define alpha_cvtts_su(ins, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x16, 0x5AC, alpha_fzero, Rsrc2, Rdest )
-
-#define alpha_cpys(ins, Rsrc1, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x17, 0x020, Rsrc1, Rsrc2, Rdest )
-#define alpha_cpysn(ins, Rsrc1, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x17, 0x021, Rsrc1, Rsrc2, Rdest )
-#define alpha_cpyse(ins, Rsrc1, Rsrc2, Rdest) alpha_encode_fpop( ins, 0x17, 0x022, Rsrc1, Rsrc2, Rdest )
-
-#define alpha_trapb(ins) alpha_encode_mem_fc( ins, 0x18, 0x0000, 0, 0, 0 )
-#define alpha_mb(ins) alpha_encode_mem_fc( ins, 0x18, 0x4000, 0, 0, 0 )
-
-#endif
-
diff --git a/alpha/test.c b/alpha/test.c
deleted file mode 100644
index b922750..0000000
--- a/alpha/test.c
+++ /dev/null
@@ -1,156 +0,0 @@
-#include "alpha-codegen.h"
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-/* A typical Alpha stack frame looks like this */
-/*
-fun: // called from outside the module.
- ldgp gp,0(pv) // load the global pointer
-fun..ng: // called from inside the module.
- lda sp, -SIZE( sp ) // grow the stack downwards.
-
- stq ra, 0(sp) // save the return address.
-
- stq s0, 8(sp) // callee-saved registers.
- stq s1, 16(sp) // ...
-
- // Move the arguments to the argument registers...
-
- mov addr, pv // Load the callee address
- jsr ra, (pv) // call the method.
- ldgp gp, 0(ra) // restore gp
-
- // return value is in v0
-
- ldq ra, 0(sp) // free stack frame
- ldq s0, 8(sp) // restore callee-saved registers.
- ldq s1, 16(sp)
- ldq sp, 32(sp) // restore stack pointer
-
- ret zero, (ra), 1 // return.
-*/
-
-
-
-//
-// Simple function which returns 10.
-//
-static int testfunc(void)
-{
- return 10;
-}
-
-// Write it using the known asm bytecodes.
-static unsigned int * write_testfunc_1(unsigned int * p )
-{
-//
-// ldah gp, 0(pv)
-// lda gp, 0(gp)
-//00000001200004d0 <testfunc>:
-// 1200004d0: f0 ff de 23 lda sp,-16(sp)
-// 1200004d4: 00 00 5e b7 stq ra,0(sp)
-// 1200004d8: 08 00 fe b5 stq fp,8(sp)
-// 1200004dc: 0f 04 fe 47 mov sp,fp
-// 1200004e0: 0a 00 3f 20 lda t0,10
-// 1200004e4: 00 04 e1 47 mov t0,v0
-// 1200004e8: 1e 04 ef 47 mov fp,sp
-// 1200004ec: 00 00 5e a7 ldq ra,0(sp)
-// 1200004f0: 08 00 fe a5 ldq fp,8(sp)
-// 1200004f4: 10 00 de 23 lda sp,16(sp)
-// 1200004f8: 01 80 fa 6b ret
-
-int _func_code[] = {
- 0x23defff0,
- 0xb75e0000,
- 0xb5fe0008,
- 0x47fe040f,
- 0x203f000a,
- 0x47e10400,
- 0x47ef041e,
- 0xa75e0000,
- 0xa5fe0008,
- 0x23de0010,
- 0x6bfa8001 };
-
- memcpy( p , _func_code, 4 * 11 );
- return p + ( 4 * 11 );
-}
-
-// The same function encoded with alpha-codegen.h
-unsigned int * write_testfunc_2( unsigned int * p )
-{
- alpha_ldah( p, alpha_gp, alpha_pv, 0 ); // start the gp load
- alpha_lda( p, alpha_sp, alpha_sp, -16 ); // allocate the stack
- alpha_lda( p, alpha_gp, alpha_gp, 0 ); // finish the gp load
- alpha_stq( p, alpha_ra, alpha_sp, 0 ); // start param save.
- alpha_stq( p, alpha_fp, alpha_sp, 8 );
- alpha_mov1( p, alpha_sp, alpha_fp );
- alpha_lda( p, alpha_t0, alpha_zero, 10 );
- alpha_mov1( p, alpha_t0, alpha_v0 );
- alpha_mov1( p, alpha_fp, alpha_sp );
- alpha_ldq( p, alpha_ra, alpha_sp, 0 );
- alpha_ldq( p, alpha_fp, alpha_sp, 8 );
- alpha_lda( p, alpha_sp, alpha_sp, 16 );
-
- alpha_ret( p, alpha_ra, 1 );
-
- return p;
-}
-
-
-void output( char * p, int len )
-{
- char * maxp = p + len;
- char * cp = p;
-
- printf (".text\n.align 4\n.globl main\n.type main,@function\nmain:\n");
- for ( ; cp < maxp; cp++ )
- {
- printf (".byte 0x%0.2x\n", (*cp&0x00ff) );
- }
-
- int fd = open( "bad.out", O_CREAT | O_TRUNC );
- write( fd, p, len );
- close( fd );
-}
-
-unsigned int code [16000/4];
-
-int main( int argc, char ** argv ) {
-// unsigned int code [16000/4];
- unsigned int *p = code;
- unsigned int * cp;
-
- int (*x)() = 0;
- int y = 0;
- int z = 10;
-
- // so, `test blah` gets you the byte-encoded function.
- // and `test` gets you the alpha-codegen.h encoded function.
-
- if( argc > 1 )
- {
- p = write_testfunc_1( p );
- }
- else
- {
- p = write_testfunc_2( p );
- }
-
- // output( code, p-code );
-
- // call the procedure.
- x = (int(*)())code;
-
- while( z-- > 0 )
- y = x();
-
- return 0;
-}
-
diff --git a/alpha/tramp.c b/alpha/tramp.c
deleted file mode 100644
index 23c3846..0000000
--- a/alpha/tramp.c
+++ /dev/null
@@ -1,380 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Create trampolines to invoke arbitrary functions.
- *
- * Copyright (C) Ximian Inc.
- *
- * Authors: Laramie Leavitt (lar@leavitt.us)
- *
- *
- */
-
-/* A typical Alpha stack frame looks like this */
-/*
-fun: // called from outside the module.
- ldgp gp,0(pv) // load the global pointer
-fun..ng: // called from inside the module.
- lda sp, -SIZE( sp ) // grow the stack downwards.
-
- stq ra, 0(sp) // save the return address.
-
- stq s0, 8(sp) // callee-saved registers.
- stq s1, 16(sp) // ...
-
- // Move the arguments to the argument registers...
-
- mov addr, pv // Load the callee address
- jsr ra, (pv) // call the method.
- ldgp gp, 0(ra) // restore gp
-
- // return value is in v0
-
- ldq ra, 0(sp) // free stack frame
- ldq s0, 8(sp) // restore callee-saved registers.
- ldq s1, 16(sp)
- ldq sp, 32(sp) // restore stack pointer
-
- ret zero, (ra), 1 // return.
-
-// min SIZE = 48
-// our call must look like this.
-
-call_func:
- ldgp gp, 0(pv)
-call_func..ng:
- .prologue
- lda sp, -SIZE(sp) // grow stack SIZE bytes.
- stq ra, SIZE-48(sp) // store ra
- stq fp, SIZE-40(sp) // store fp (frame pointer)
- stq a0, SIZE-32(sp) // store args. a0 = func
- stq a1, SIZE-24(sp) // a1 = retval
- stq a2, SIZE-16(sp) // a2 = this
- stq a3, SIZE-8(sp) // a3 = args
- mov sp, fp // set frame pointer
- mov pv, a0 // func
-
- .calling_arg_this
- mov a1, a2
-
- .calling_arg_6plus
- ldq t0, POS(a3)
- stq t0, 0(sp)
- ldq t1, POS(a3)
- stq t1, 8(sp)
- ... SIZE-56 ...
-
- mov zero,a1
- mov zero,a2
- mov zero,a3
- mov zero,a4
- mov zero,a5
-
- .do_call
- jsr ra, (pv) // call func
- ldgp gp, 0(ra) // restore gp.
- mov v0, t1 // move return value into t1
-
- .do_store_retval
- ldq t0, SIZE-24(fp) // load retval into t2
- stl t1, 0(t0) // store value.
-
- .finished
- mov fp,sp
- ldq ra,SIZE-48(sp)
- ldq fp,SIZE-40(sp)
- lda sp,SIZE(sp)
- ret zero,(ra),1
-
-
-*/
-/*****************************************************/
-
-#include "config.h"
-#include <stdlib.h>
-#include <string.h>
-
-#include "alpha-codegen.h"
-
-#include "mono/metadata/class.h"
-#include "mono/metadata/tabledefs.h"
-#include "mono/interpreter/interp.h"
-#include "mono/metadata/appdomain.h"
-#include "mono/metadata/debug-helpers.h"
-
-#define AXP_GENERAL_REGS 6
-#define AXP_MIN_STACK_SIZE 24
-#define ARG_SIZE sizeof(stackval)
-#define ARG_LOC(x) (x * sizeof( stackval ) )
-
-/*****************************************************/
-
-/* */
-/* void func (void (*callme)(), void *retval, */
-/* void *this_obj, stackval *arguments); */
-static inline unsigned int *
-emit_prolog (unsigned int *pi, const gint SIZE, int hasthis )
-{
- unsigned int *p = (unsigned int *)pi;
- // 9 instructions.
- alpha_ldah( p, alpha_gp, alpha_pv, 0 );
- alpha_lda( p, alpha_gp, alpha_gp, 0 ); // ldgp gp, 0(pv)
- alpha_lda( p, alpha_sp, alpha_sp, -((SIZE & 8) ? (SIZE+8) : SIZE) ); // grow stack down SIZE (align to 16 bytes like gcc does)
-
- /* TODO: we really don't need to store everything.
- alpha_a1: We have to store this in order to return the retval.
-
- alpha_a0: func pointer can be moved directly to alpha_pv
- alpha_a3: don't need args after we are finished.
- alpha_a2: will be moved into alpha_a0... if hasthis is true.
- */
- /* store parameters on stack.*/
- alpha_stq( p, alpha_ra, alpha_sp, (SIZE-24) ); // ra
- alpha_stq( p, alpha_fp, alpha_sp, (SIZE-16) ); // fp
- alpha_stq( p, alpha_a1, alpha_sp, (SIZE-8) ); // retval
-
- /* set the frame pointer */
- alpha_mov1( p, alpha_sp, alpha_fp );
-
- /* move the args into t0, pv */
- alpha_mov1( p, alpha_a0, alpha_pv );
- alpha_mov1( p, alpha_a3, alpha_t0 );
-
- // Move the this pointer into a0.
- if( hasthis )
- alpha_mov1( p, alpha_a2, alpha_a0 );
- return p;
-}
-
-static inline unsigned int *
-emit_call( unsigned int *pi , const gint SIZE )
-{
- unsigned int *p = (unsigned int *)pi;
-
- // 3 instructions
- /* call func */
- alpha_jsr( p, alpha_ra, alpha_pv, 0 ); // jsr ra, 0(pv)
-
- /* reload the gp */
- alpha_ldah( p, alpha_gp, alpha_ra, 0 );
- alpha_lda( p, alpha_gp, alpha_gp, 0 ); // ldgp gp, 0(ra)
-
- return p;
-}
-
-static inline unsigned int *
-emit_store_return_default(unsigned int *pi, const gint SIZE )
-{
- // 2 instructions.
- unsigned int *p = (unsigned int *)pi;
-
- /* TODO: This probably do different stuff based on the value.
- you know, like stq/l/w. and s/f.
- */
- alpha_ldq( p, alpha_t0, alpha_fp, (SIZE-8) ); // load void * retval
- alpha_stq( p, alpha_v0, alpha_t0, 0 ); // store the result to *retval.
- return p;
-}
-
-
-static inline unsigned int *
-emit_epilog (unsigned int *pi, const gint SIZE )
-{
- unsigned int *p = (unsigned int *)pi;
-
- // 5 instructions.
- alpha_mov1( p, alpha_fp, alpha_sp );
-
- /* restore fp, ra, sp */
- alpha_ldq( p, alpha_ra, alpha_sp, (SIZE-24) );
- alpha_ldq( p, alpha_fp, alpha_sp, (SIZE-16) );
- alpha_lda( p, alpha_sp, alpha_sp, ((SIZE & 8) ? (SIZE+8) : SIZE) );
-
- /* return */
- alpha_ret( p, alpha_ra, 1 );
- return p;
-}
-
-static void calculate_size(MonoMethodSignature *sig, int * INSTRUCTIONS, int * STACK )
-{
- int alpharegs;
-
- alpharegs = AXP_GENERAL_REGS - (sig->hasthis?1:0);
-
- *STACK = AXP_MIN_STACK_SIZE;
- *INSTRUCTIONS = 20; // Base: 20 instructions.
-
- if( sig->param_count - alpharegs > 0 )
- {
- *STACK += ARG_SIZE * (sig->param_count - alpharegs );
- // plus 3 (potential) for each stack parameter.
- *INSTRUCTIONS += ( sig->param_count - alpharegs ) * 3;
- // plus 2 (potential) for each register parameter.
- *INSTRUCTIONS += ( alpharegs * 2 );
- }
- else
- {
- // plus 2 (potential) for each register parameter.
- *INSTRUCTIONS += ( sig->param_count * 2 );
- }
-}
-
-MonoPIFunc
-mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
-{
- unsigned int *p;
- unsigned int *buffer;
- MonoType* param;
-
- int i, pos;
- int alpharegs;
- int hasthis;
- int STACK_SIZE;
- int BUFFER_SIZE;
- int simple_type;
- int regbase;
-
- // Set up basic stuff. like has this.
- hasthis = !!sig->hasthis;
- alpharegs = AXP_GENERAL_REGS - hasthis;
- regbase = hasthis?alpha_a1:alpha_a0 ;
-
- // Make a ballpark estimate for now.
- calculate_size( sig, &BUFFER_SIZE, &STACK_SIZE );
-
- // convert to the correct number of bytes.
- BUFFER_SIZE = BUFFER_SIZE * 4;
-
-
- // allocate.
- buffer = p = (unsigned int *)malloc(BUFFER_SIZE);
- memset( buffer, 0, BUFFER_SIZE );
- pos = 8 * (sig->param_count - alpharegs - 1);
-
- // Ok, start creating this thing.
- p = emit_prolog( p, STACK_SIZE, hasthis );
-
- // copy everything into the correct register/stack space
- for (i = sig->param_count; --i >= 0; )
- {
- param = sig->params [i];
-
- if( param->byref )
- {
- if( i >= alpharegs )
- {
- // load into temp register, then store on the stack
- alpha_ldq( p, alpha_t1, alpha_t0, ARG_LOC( i ));
- alpha_stq( p, alpha_t1, alpha_sp, pos );
- pos -= 8;
- }
- else
- {
- // load into register
- alpha_ldq( p, (regbase + i), alpha_t0, ARG_LOC( i ) );
- }
- }
- else
- {
- simple_type = param->type;
- if( simple_type == MONO_TYPE_VALUETYPE )
- {
- if (param->data.klass->enumtype)
- simple_type = param->data.klass->enum_basetype->type;
- }
-
- switch (simple_type)
- {
- case MONO_TYPE_VOID:
- break;
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_CHAR:
- case MONO_TYPE_I1:
- case MONO_TYPE_U1:
- case MONO_TYPE_I2:
- case MONO_TYPE_U2:
- case MONO_TYPE_I4:
- case MONO_TYPE_U4:
- // 4 bytes - need to sign-extend (stackvals are not extended)
- if( i >= alpharegs )
- {
- // load into temp register, then store on the stack
- alpha_ldl( p, alpha_t1, alpha_t0, ARG_LOC( i ) );
- alpha_stq( p, alpha_t1, alpha_sp, pos );
- pos -= 8;
- }
- else
- {
- // load into register
- alpha_ldl( p, (regbase + i), alpha_t0, (ARG_LOC(i)) );
- }
- break;
- case MONO_TYPE_I:
- case MONO_TYPE_U:
- case MONO_TYPE_PTR:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_STRING:
- case MONO_TYPE_I8:
- // 8 bytes
- if( i >= alpharegs )
- {
- // load into temp register, then store on the stack
- alpha_ldq( p, alpha_t1, alpha_t0, ARG_LOC( i ) );
- alpha_stq( p, alpha_t1, alpha_sp, pos );
- pos -= 8;
- }
- else
- {
- // load into register
- alpha_ldq( p, (regbase + i), alpha_t0, ARG_LOC(i) );
- }
- break;
- case MONO_TYPE_R4:
- case MONO_TYPE_R8:
- /*
- // floating point... Maybe this does the correct thing.
- if( i > alpharegs )
- {
- alpha_ldq( p, alpha_t1, alpha_t0, ARG_LOC( i ) );
- alpha_cpys( p, alpha_ft1, alpha_ft1, alpha_ft2 );
- alpha_stt( p, alpha_ft2, alpha_sp, pos );
- pos -= 8;
- }
- else
- {
- alpha_ldq( p, alpha_t1, alpha_t0, ARG_LOC(i) );
- alpha_cpys( p, alpha_ft1, alpha_ft1, alpha_fa0 + i + hasthis );
- }
- break;
- */
- case MONO_TYPE_VALUETYPE:
- g_error ("Not implemented: ValueType as parameter to delegate." );
- break;
- default:
- g_error( "Not implemented: 0x%x.", simple_type );
- break;
- }
- }
- }
-
- // Now call the function and store the return parameter.
- p = emit_call( p, STACK_SIZE );
- p = emit_store_return_default( p, STACK_SIZE );
- p = emit_epilog( p, STACK_SIZE );
-
- if( p > buffer + BUFFER_SIZE )
- g_error( "Buffer overflow: got 0x%lx, expected <=0x%x.", (long)(p-buffer), BUFFER_SIZE );
-
- /* flush instruction cache to see trampoline code */
- asm volatile("imb":::"memory");
-
- return (MonoPIFunc)buffer;
-}
-
-void *
-mono_arch_create_method_pointer (MonoMethod *method)
-{
- g_error ("Unsupported arch");
- return NULL;
-}
OpenPOWER on IntegriCloud