Search
lxdream.org :: lxdream/src/xlat/xir.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/xlat/xir.h
changeset 1012:0b8cc74ac83a
prev1011:fdd58619b760
author nkeynes
date Sun Apr 19 05:14:19 2009 +0000 (13 years ago)
branchxlat-refactor
permissions -rw-r--r--
last change Remove branch instructions and replace with direct modification of PC + EXIT
Add MIN/MAX instructions (for bound checks)
Implement x86_target_is_legal
Correct a few sh4 instructions
file annotate diff log raw
1.1 --- a/src/xlat/xir.h Sun Apr 12 07:24:45 2009 +0000
1.2 +++ b/src/xlat/xir.h Sun Apr 19 05:14:19 2009 +0000
1.3 @@ -58,6 +58,8 @@
1.4 #define REG_TMP2 2
1.5 #define REG_TMPQ0 3
1.6 #define REG_TMPQ1 4
1.7 +#define REG_TMPF0 5
1.8 +#define REG_TMPD0 6
1.9
1.10
1.11 /**
1.12 @@ -120,6 +122,7 @@
1.13 typedef enum {
1.14 // No operands
1.15 OP_NOP = 0,
1.16 + OP_EXIT,
1.17 OP_BARRIER, // Direction to register allocator - Ensure all state is committed
1.18
1.19 // One operand
1.20 @@ -129,8 +132,6 @@
1.21 OP_RESTFLAGS, /* Restore flags from register */
1.22 OP_SAVEFLAGS, /* Save flags into register */
1.23 OP_ENTER, // Block start - immediate operand is a bitmask of target registers used
1.24 - OP_BRREL,
1.25 - OP_BR,
1.26 OP_CALL0, // Call function with no arguments or return value
1.27 OP_OCBI,
1.28 OP_OCBP,
1.29 @@ -159,6 +160,10 @@
1.30 OP_CMP,
1.31 OP_DIV, /* Unsigned division */
1.32 OP_DIVS, /* Unsigned divison and update flags */
1.33 + OP_MAX,
1.34 + OP_MAXQ,
1.35 + OP_MIN,
1.36 + OP_MINQ,
1.37 OP_MUL,
1.38 OP_MULS,
1.39 OP_MULQ,
1.40 @@ -204,6 +209,12 @@
1.41 OP_DIVD,
1.42 OP_DIVF,
1.43 OP_DIVV,
1.44 + OP_MAXD,
1.45 + OP_MAXF,
1.46 + OP_MAXV,
1.47 + OP_MIND,
1.48 + OP_MINF,
1.49 + OP_MINV,
1.50 OP_MULD,
1.51 OP_MULF,
1.52 OP_MULV,
1.53 @@ -241,8 +252,6 @@
1.54 OP_STOREQ,
1.55 OP_STORELCA,
1.56
1.57 - OP_BRCOND,
1.58 - OP_BRCONDDEL, // Delayed branch - sets newpc rather than pc (and is not a terminator)
1.59 OP_RAISEME, // imm mask in, reg in - branch to exception if (reg & mask) == 0
1.60 OP_RAISEMNE, // imm mask in, reg in - branch to exception if (reg & mask) != 0
1.61
1.62 @@ -251,6 +260,7 @@
1.63 OP_CALLLUT, // Call indirect through base pointer (reg) + displacement
1.64 OP_CALL1, // Call function with single argument and no return value
1.65 OP_CALLR, // Call function with no arguments and a single return value
1.66 + OP_LOADPTRW, // Load 16-bit word from pointer and sign extend to 32-bits
1.67 OP_LOADPTRL,
1.68 OP_LOADPTRQ,
1.69 OP_XLAT,
1.70 @@ -278,14 +288,13 @@
1.71 * ADDSAT48 Rm, Rn - 64-bit Add Rm to Rn, saturating to 48-bits if S==1 (per SH4 MAC.L)
1.72 *
1.73 * if R_S == 0 ->
1.74 - * Rn += Rm
1.75 + * ADDQ Rm, Rn
1.76 * else ->
1.77 - * if( Rm + Rn > 0x00007FFFFFFFFFFF ) ->
1.78 - * Rn = 0x00007FFFFFFFFFFF
1.79 - * else if( Rm + Rn < 0x0000800000000000 ) ->
1.80 - * Rn = 0x0000800000000000
1.81 + * ADDQ Rm, Rn
1.82 + * if overflow ->
1.83 * else ->
1.84 - * Rn += Rm
1.85 + * MINQ 0x00007FFFFFFFFFFF, Rn
1.86 + * MAXQ 0xFFFF800000000000, Rn
1.87 */
1.88 OP_ADDQSAT48,
1.89
1.90 @@ -545,6 +554,7 @@
1.91 #define XOP1T( op, arg0 ) xir_append_op2(xbb, op, TEMP_OPERAND, arg0, NO_OPERAND, 0)
1.92 #define XOP1TCC( op, cc, arg0 ) xir_append_op2cc(xbb, op, cc, TEMP_OPERAND, arg0, NO_OPERAND, 0)
1.93 #define XOP2IS( op, arg0, arg1 ) xir_append_op2(xbb, op, IMMEDIATE_OPERAND, arg0, SOURCE_OPERAND, arg1)
1.94 +#define XOP2ISCC( op, cc, arg0, arg1 ) xir_append_op2cc(xbb, op, cc, IMMEDIATE_OPERAND, arg0, SOURCE_OPERAND, arg1)
1.95 #define XOP2IT( op, arg0, arg1 ) xir_append_op2(xbb, op, IMMEDIATE_OPERAND, arg0, TEMP_OPERAND, arg1)
1.96 #define XOP2II( op, arg0, arg1 ) xir_append_op2(xbb, op, IMMEDIATE_OPERAND, arg0, IMMEDIATE_OPERAND, arg1)
1.97 #define XOP2IICC( op, cc, arg0, arg1 ) xir_append_op2cc(xbb, op, cc, IMMEDIATE_OPERAND, arg0, IMMEDIATE_OPERAND, arg1)
.