Search
lxdream.org :: lxdream/src/sh4/x86op.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/x86op.h
changeset 527:14c9489f647e
prev394:7eb172bfeefe
next539:75f3e594d4a7
author nkeynes
date Sun Nov 18 11:12:44 2007 +0000 (12 years ago)
permissions -rw-r--r--
last change x86-64 translator work-in-progress
file annotate diff log raw
nkeynes@359
     1
/**
nkeynes@394
     2
 * $Id: x86op.h,v 1.10 2007-09-19 09:15:18 nkeynes Exp $
nkeynes@359
     3
 * 
nkeynes@359
     4
 * Definitions of x86 opcodes for use by the translator.
nkeynes@359
     5
 *
nkeynes@359
     6
 * Copyright (c) 2007 Nathan Keynes.
nkeynes@359
     7
 *
nkeynes@359
     8
 * This program is free software; you can redistribute it and/or modify
nkeynes@359
     9
 * it under the terms of the GNU General Public License as published by
nkeynes@359
    10
 * the Free Software Foundation; either version 2 of the License, or
nkeynes@359
    11
 * (at your option) any later version.
nkeynes@359
    12
 *
nkeynes@359
    13
 * This program is distributed in the hope that it will be useful,
nkeynes@359
    14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
nkeynes@359
    15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
nkeynes@359
    16
 * GNU General Public License for more details.
nkeynes@359
    17
 */
nkeynes@359
    18
nkeynes@359
    19
#ifndef __lxdream_x86op_H
nkeynes@359
    20
#define __lxdream_x86op_H
nkeynes@359
    21
nkeynes@359
    22
#define R_NONE -1
nkeynes@359
    23
#define R_EAX 0
nkeynes@359
    24
#define R_ECX 1
nkeynes@359
    25
#define R_EDX 2
nkeynes@359
    26
#define R_EBX 3
nkeynes@359
    27
#define R_ESP 4
nkeynes@359
    28
#define R_EBP 5
nkeynes@359
    29
#define R_ESI 6 
nkeynes@359
    30
#define R_EDI 7 
nkeynes@359
    31
nkeynes@359
    32
#define R_AL 0
nkeynes@359
    33
#define R_CL 1
nkeynes@359
    34
#define R_DL 2
nkeynes@359
    35
#define R_BL 3
nkeynes@359
    36
#define R_AH 4
nkeynes@359
    37
#define R_CH 5
nkeynes@359
    38
#define R_DH 6
nkeynes@359
    39
#define R_BH 7
nkeynes@359
    40
nkeynes@380
    41
#ifdef DEBUG_JUMPS
nkeynes@380
    42
#define MARK_JMP(n,x) uint8_t *_mark_jmp_##x = xlat_output + n
nkeynes@380
    43
#define JMP_TARGET(x) assert( _mark_jmp_##x == xlat_output )
nkeynes@380
    44
#else
nkeynes@380
    45
#define MARK_JMP(n, x)
nkeynes@380
    46
#define JMP_TARGET(x)
nkeynes@380
    47
#endif
nkeynes@380
    48
nkeynes@380
    49
nkeynes@380
    50
nkeynes@380
    51
nkeynes@359
    52
nkeynes@361
    53
#define OP(x) *xlat_output++ = (x)
nkeynes@361
    54
#define OP32(x) *((uint32_t *)xlat_output) = (x); xlat_output+=4
nkeynes@527
    55
#define OP64(x) *((uint64_t *)xlat_output) = (x); xlat_output+=8
nkeynes@527
    56
#if SH4_TRANSLATOR == TARGET_X86_64
nkeynes@527
    57
#define OPPTR(x) OP64((uint64_t)(x))
nkeynes@527
    58
#else
nkeynes@527
    59
#define OPPTR(x) OP32((uint32_t)(x))
nkeynes@527
    60
#endif
nkeynes@359
    61
nkeynes@359
    62
/* Offset of a reg relative to the sh4r structure */
nkeynes@359
    63
#define REG_OFFSET(reg)  (((char *)&sh4r.reg) - ((char *)&sh4r))
nkeynes@359
    64
nkeynes@359
    65
#define R_T   REG_OFFSET(t)
nkeynes@361
    66
#define R_Q   REG_OFFSET(q)
nkeynes@361
    67
#define R_S   REG_OFFSET(s)
nkeynes@361
    68
#define R_M   REG_OFFSET(m)
nkeynes@368
    69
#define R_SR  REG_OFFSET(sr)
nkeynes@359
    70
#define R_GBR REG_OFFSET(gbr)
nkeynes@359
    71
#define R_SSR REG_OFFSET(ssr)
nkeynes@359
    72
#define R_SPC REG_OFFSET(spc)
nkeynes@359
    73
#define R_VBR REG_OFFSET(vbr)
nkeynes@359
    74
#define R_MACH REG_OFFSET(mac)+4
nkeynes@359
    75
#define R_MACL REG_OFFSET(mac)
nkeynes@359
    76
#define R_PR REG_OFFSET(pr)
nkeynes@359
    77
#define R_SGR REG_OFFSET(sgr)
nkeynes@359
    78
#define R_FPUL REG_OFFSET(fpul)
nkeynes@359
    79
#define R_FPSCR REG_OFFSET(fpscr)
nkeynes@359
    80
#define R_DBR REG_OFFSET(dbr)
nkeynes@359
    81
nkeynes@359
    82
/**************** Basic X86 operations *********************/
nkeynes@359
    83
/* Note: operands follow SH4 convention (source, dest) rather than x86 
nkeynes@359
    84
 * conventions (dest, source)
nkeynes@359
    85
 */
nkeynes@359
    86
nkeynes@359
    87
/* Two-reg modrm form - first arg is the r32 reg, second arg is the r/m32 reg */
nkeynes@359
    88
#define MODRM_r32_rm32(r1,r2) OP(0xC0 | (r1<<3) | r2)
nkeynes@359
    89
#define MODRM_rm32_r32(r1,r2) OP(0xC0 | (r2<<3) | r1)
nkeynes@359
    90
nkeynes@359
    91
/* ebp+disp8 modrm form */
nkeynes@359
    92
#define MODRM_r32_ebp8(r1,disp) OP(0x45 | (r1<<3)); OP(disp)
nkeynes@359
    93
nkeynes@359
    94
/* ebp+disp32 modrm form */
nkeynes@359
    95
#define MODRM_r32_ebp32(r1,disp) OP(0x85 | (r1<<3)); OP32(disp)
nkeynes@359
    96
nkeynes@374
    97
#define MODRM_r32_sh4r(r1,disp) if(disp>127){ MODRM_r32_ebp32(r1,disp);}else{ MODRM_r32_ebp8(r1,(unsigned char)disp); }
nkeynes@368
    98
nkeynes@527
    99
#define REXW() OP(0x48)
nkeynes@527
   100
nkeynes@359
   101
/* Major opcodes */
nkeynes@374
   102
#define ADD_sh4r_r32(disp,r1) OP(0x03); MODRM_r32_sh4r(r1,disp)
nkeynes@386
   103
#define ADD_r32_sh4r(r1,disp) OP(0x01); MODRM_r32_sh4r(r1,disp)
nkeynes@359
   104
#define ADD_r32_r32(r1,r2) OP(0x03); MODRM_rm32_r32(r1,r2)
nkeynes@359
   105
#define ADD_imm8s_r32(imm,r1) OP(0x83); MODRM_rm32_r32(r1, 0); OP(imm)
nkeynes@386
   106
#define ADD_imm8s_sh4r(imm,disp) OP(0x83); MODRM_r32_sh4r(0,disp); OP(imm)
nkeynes@368
   107
#define ADD_imm32_r32(imm32,r1) OP(0x81); MODRM_rm32_r32(r1,0); OP32(imm32)
nkeynes@359
   108
#define ADC_r32_r32(r1,r2)    OP(0x13); MODRM_rm32_r32(r1,r2)
nkeynes@386
   109
#define ADC_sh4r_r32(disp,r1) OP(0x13); MODRM_r32_sh4r(r1,disp)
nkeynes@386
   110
#define ADC_r32_sh4r(r1,disp) OP(0x11); MODRM_r32_sh4r(r1,disp)
nkeynes@359
   111
#define AND_r32_r32(r1,r2)    OP(0x23); MODRM_rm32_r32(r1,r2)
nkeynes@368
   112
#define AND_imm8_r8(imm8, r1) OP(0x80); MODRM_rm32_r32(r1,4); OP(imm8)
nkeynes@374
   113
#define AND_imm8s_r32(imm8,r1) OP(0x83); MODRM_rm32_r32(r1,4); OP(imm8)
nkeynes@359
   114
#define AND_imm32_r32(imm,r1) OP(0x81); MODRM_rm32_r32(r1,4); OP32(imm)
nkeynes@368
   115
#define CALL_r32(r1)          OP(0xFF); MODRM_rm32_r32(r1,2)
nkeynes@374
   116
#define CLC()                 OP(0xF8)
nkeynes@359
   117
#define CMC()                 OP(0xF5)
nkeynes@374
   118
#define CMP_sh4r_r32(disp,r1)  OP(0x3B); MODRM_r32_sh4r(r1,disp)
nkeynes@359
   119
#define CMP_r32_r32(r1,r2)    OP(0x3B); MODRM_rm32_r32(r1,r2)
nkeynes@368
   120
#define CMP_imm32_r32(imm32, r1) OP(0x81); MODRM_rm32_r32(r1,7); OP32(imm32)
nkeynes@359
   121
#define CMP_imm8s_r32(imm,r1) OP(0x83); MODRM_rm32_r32(r1,7); OP(imm)
nkeynes@374
   122
#define CMP_imm8s_sh4r(imm,disp) OP(0x83); MODRM_r32_sh4r(7,disp) OP(imm)
nkeynes@368
   123
#define DEC_r32(r1)           OP(0x48+r1)
nkeynes@368
   124
#define IMUL_r32(r1)          OP(0xF7); MODRM_rm32_r32(r1,5)
nkeynes@368
   125
#define INC_r32(r1)           OP(0x40+r1)
nkeynes@380
   126
#define JMP_rel8(rel, label)  OP(0xEB); OP(rel); MARK_JMP(rel,label)
nkeynes@368
   127
#define MOV_r32_r32(r1,r2)    OP(0x89); MODRM_r32_rm32(r1,r2)
nkeynes@374
   128
#define MOV_r32_sh4r(r1,disp) OP(0x89); MODRM_r32_sh4r(r1,disp)
nkeynes@527
   129
#define MOV_moff32_EAX(off)   OP(0xA1); OPPTR(off)
nkeynes@374
   130
#define MOV_sh4r_r32(disp, r1)  OP(0x8B); MODRM_r32_sh4r(r1,disp)
nkeynes@388
   131
#define MOV_r32ind_r32(r1,r2) OP(0x8B); OP(0 + (r2<<3) + r1 )
nkeynes@359
   132
#define MOVSX_r8_r32(r1,r2)   OP(0x0F); OP(0xBE); MODRM_rm32_r32(r1,r2)
nkeynes@359
   133
#define MOVSX_r16_r32(r1,r2)  OP(0x0F); OP(0xBF); MODRM_rm32_r32(r1,r2)
nkeynes@359
   134
#define MOVZX_r8_r32(r1,r2)   OP(0x0F); OP(0xB6); MODRM_rm32_r32(r1,r2)
nkeynes@359
   135
#define MOVZX_r16_r32(r1,r2)  OP(0x0F); OP(0xB7); MODRM_rm32_r32(r1,r2)
nkeynes@368
   136
#define MUL_r32(r1)           OP(0xF7); MODRM_rm32_r32(r1,4)
nkeynes@359
   137
#define NEG_r32(r1)           OP(0xF7); MODRM_rm32_r32(r1,3)
nkeynes@359
   138
#define NOT_r32(r1)           OP(0xF7); MODRM_rm32_r32(r1,2)
nkeynes@359
   139
#define OR_r32_r32(r1,r2)     OP(0x0B); MODRM_rm32_r32(r1,r2)
nkeynes@388
   140
#define OR_imm8_r8(imm,r1)    OP(0x80); MODRM_rm32_r32(r1,1); OP(imm)
nkeynes@359
   141
#define OR_imm32_r32(imm,r1)  OP(0x81); MODRM_rm32_r32(r1,1); OP32(imm)
nkeynes@374
   142
#define OR_sh4r_r32(disp,r1)  OP(0x0B); MODRM_r32_sh4r(r1,disp)
nkeynes@368
   143
#define POP_r32(r1)           OP(0x58 + r1)
nkeynes@361
   144
#define PUSH_r32(r1)          OP(0x50 + r1)
nkeynes@368
   145
#define PUSH_imm32(imm)       OP(0x68); OP32(imm)
nkeynes@359
   146
#define RCL1_r32(r1)          OP(0xD1); MODRM_rm32_r32(r1,2)
nkeynes@359
   147
#define RCR1_r32(r1)          OP(0xD1); MODRM_rm32_r32(r1,3)
nkeynes@359
   148
#define RET()                 OP(0xC3)
nkeynes@359
   149
#define ROL1_r32(r1)          OP(0xD1); MODRM_rm32_r32(r1,0)
nkeynes@359
   150
#define ROR1_r32(r1)          OP(0xD1); MODRM_rm32_r32(r1,1)
nkeynes@359
   151
#define SAR1_r32(r1)          OP(0xD1); MODRM_rm32_r32(r1,7)
nkeynes@359
   152
#define SAR_imm8_r32(imm,r1)  OP(0xC1); MODRM_rm32_r32(r1,7); OP(imm)
nkeynes@368
   153
#define SAR_r32_CL(r1)        OP(0xD3); MODRM_rm32_r32(r1,7)
nkeynes@359
   154
#define SBB_r32_r32(r1,r2)    OP(0x1B); MODRM_rm32_r32(r1,r2)
nkeynes@359
   155
#define SHL1_r32(r1)          OP(0xD1); MODRM_rm32_r32(r1,4)
nkeynes@368
   156
#define SHL_r32_CL(r1)        OP(0xD3); MODRM_rm32_r32(r1,4)
nkeynes@359
   157
#define SHL_imm8_r32(imm,r1)  OP(0xC1); MODRM_rm32_r32(r1,4); OP(imm)
nkeynes@359
   158
#define SHR1_r32(r1)          OP(0xD1); MODRM_rm32_r32(r1,5)
nkeynes@368
   159
#define SHR_r32_CL(r1)        OP(0xD3); MODRM_rm32_r32(r1,5)
nkeynes@359
   160
#define SHR_imm8_r32(imm,r1)  OP(0xC1); MODRM_rm32_r32(r1,5); OP(imm)
nkeynes@374
   161
#define STC()                 OP(0xF9)
nkeynes@359
   162
#define SUB_r32_r32(r1,r2)    OP(0x2B); MODRM_rm32_r32(r1,r2)
nkeynes@374
   163
#define SUB_sh4r_r32(disp,r1)  OP(0x2B); MODRM_r32_sh4r(r1, disp)
nkeynes@368
   164
#define TEST_r8_r8(r1,r2)     OP(0x84); MODRM_r32_rm32(r1,r2)
nkeynes@359
   165
#define TEST_r32_r32(r1,r2)   OP(0x85); MODRM_rm32_r32(r1,r2)
nkeynes@368
   166
#define TEST_imm8_r8(imm8,r1) OP(0xF6); MODRM_rm32_r32(r1,0); OP(imm8)
nkeynes@359
   167
#define TEST_imm32_r32(imm,r1) OP(0xF7); MODRM_rm32_r32(r1,0); OP32(imm)
nkeynes@368
   168
#define XCHG_r8_r8(r1,r2)     OP(0x86); MODRM_rm32_r32(r1,r2)
nkeynes@386
   169
#define XOR_r8_r8(r1,r2)      OP(0x32); MODRM_rm32_r32(r1,r2)
nkeynes@386
   170
#define XOR_imm8s_r32(imm,r1)   OP(0x83); MODRM_rm32_r32(r1,6); OP(imm)
nkeynes@359
   171
#define XOR_r32_r32(r1,r2)    OP(0x33); MODRM_rm32_r32(r1,r2)
nkeynes@374
   172
#define XOR_sh4r_r32(disp,r1)    OP(0x33); MODRM_r32_sh4r(r1,disp)
nkeynes@359
   173
#define XOR_imm32_r32(imm,r1) OP(0x81); MODRM_rm32_r32(r1,6); OP32(imm)
nkeynes@359
   174
nkeynes@359
   175
nkeynes@374
   176
/* Floating point ops */
nkeynes@374
   177
#define FABS_st0() OP(0xD9); OP(0xE1)
nkeynes@374
   178
#define FADDP_st(st) OP(0xDE); OP(0xC0+st)
nkeynes@374
   179
#define FCHS_st0() OP(0xD9); OP(0xE0)
nkeynes@377
   180
#define FCOMIP_st(st) OP(0xDF); OP(0xF0+st)
nkeynes@374
   181
#define FDIVP_st(st) OP(0xDE); OP(0xF8+st)
nkeynes@377
   182
#define FILD_sh4r(disp) OP(0xDB); MODRM_r32_sh4r(0, disp)
nkeynes@388
   183
#define FILD_r32ind(r32) OP(0xDB); OP(0x00+r32)
nkeynes@388
   184
#define FISTP_sh4r(disp) OP(0xDB); MODRM_r32_sh4r(3, disp)
nkeynes@377
   185
#define FLD0_st0() OP(0xD9); OP(0xEE);
nkeynes@377
   186
#define FLD1_st0() OP(0xD9); OP(0xE8);
nkeynes@394
   187
#define FLDCW_r32ind(r32) OP(0xD9); OP(0x28+r32)
nkeynes@374
   188
#define FMULP_st(st) OP(0xDE); OP(0xC8+st)
nkeynes@394
   189
#define FNSTCW_r32ind(r32) OP(0xD9); OP(0x38+r32)
nkeynes@377
   190
#define FPOP_st()  OP(0xDD); OP(0xC0); OP(0xD9); OP(0xF7)
nkeynes@388
   191
#define FSUBP_st(st) OP(0xDE); OP(0xE8+st)
nkeynes@374
   192
#define FSQRT_st0() OP(0xD9); OP(0xFA)
nkeynes@374
   193
nkeynes@359
   194
/* Conditional branches */
nkeynes@380
   195
#define JE_rel8(rel,label)   OP(0x74); OP(rel); MARK_JMP(rel,label)
nkeynes@380
   196
#define JA_rel8(rel,label)   OP(0x77); OP(rel); MARK_JMP(rel,label)
nkeynes@380
   197
#define JAE_rel8(rel,label)  OP(0x73); OP(rel); MARK_JMP(rel,label)
nkeynes@380
   198
#define JG_rel8(rel,label)   OP(0x7F); OP(rel); MARK_JMP(rel,label)
nkeynes@380
   199
#define JGE_rel8(rel,label)  OP(0x7D); OP(rel); MARK_JMP(rel,label)
nkeynes@380
   200
#define JC_rel8(rel,label)   OP(0x72); OP(rel); MARK_JMP(rel,label)
nkeynes@380
   201
#define JO_rel8(rel,label)   OP(0x70); OP(rel); MARK_JMP(rel,label)
nkeynes@380
   202
#define JNE_rel8(rel,label)  OP(0x75); OP(rel); MARK_JMP(rel,label)
nkeynes@380
   203
#define JNA_rel8(rel,label)  OP(0x76); OP(rel); MARK_JMP(rel,label)
nkeynes@380
   204
#define JNAE_rel8(rel,label) OP(0x72); OP(rel); MARK_JMP(rel,label)
nkeynes@380
   205
#define JNG_rel8(rel,label)  OP(0x7E); OP(rel); MARK_JMP(rel,label)
nkeynes@380
   206
#define JNGE_rel8(rel,label) OP(0x7C); OP(rel); MARK_JMP(rel,label)
nkeynes@380
   207
#define JNC_rel8(rel,label)  OP(0x73); OP(rel); MARK_JMP(rel,label)
nkeynes@380
   208
#define JNO_rel8(rel,label)  OP(0x71); OP(rel); MARK_JMP(rel,label)
nkeynes@386
   209
#define JNS_rel8(rel,label)  OP(0x79); OP(rel); MARK_JMP(rel,label)
nkeynes@386
   210
#define JS_rel8(rel,label)   OP(0x78); OP(rel); MARK_JMP(rel,label)
nkeynes@386
   211
nkeynes@359
   212
nkeynes@368
   213
/* 32-bit long forms w/ backpatching to an exit routine */
nkeynes@386
   214
#define JMP_exit(rel)  OP(0xE9); sh4_x86_add_backpatch(xlat_output); OP32(rel)
nkeynes@368
   215
#define JE_exit(rel)  OP(0x0F); OP(0x84); sh4_x86_add_backpatch(xlat_output); OP32(rel)
nkeynes@368
   216
#define JA_exit(rel)  OP(0x0F); OP(0x87); sh4_x86_add_backpatch(xlat_output); OP32(rel)
nkeynes@368
   217
#define JAE_exit(rel) OP(0x0F); OP(0x83); sh4_x86_add_backpatch(xlat_output); OP32(rel)
nkeynes@368
   218
#define JG_exit(rel)  OP(0x0F); OP(0x8F); sh4_x86_add_backpatch(xlat_output); OP32(rel)
nkeynes@368
   219
#define JGE_exit(rel) OP(0x0F); OP(0x8D); sh4_x86_add_backpatch(xlat_output); OP32(rel)
nkeynes@368
   220
#define JC_exit(rel)  OP(0x0F); OP(0x82); sh4_x86_add_backpatch(xlat_output); OP32(rel)
nkeynes@368
   221
#define JO_exit(rel)  OP(0x0F); OP(0x80); sh4_x86_add_backpatch(xlat_output); OP32(rel)
nkeynes@368
   222
#define JNE_exit(rel) OP(0x0F); OP(0x85); sh4_x86_add_backpatch(xlat_output); OP32(rel)
nkeynes@368
   223
#define JNA_exit(rel) OP(0x0F); OP(0x86); sh4_x86_add_backpatch(xlat_output); OP32(rel)
nkeynes@368
   224
#define JNAE_exit(rel) OP(0x0F);OP(0x82); sh4_x86_add_backpatch(xlat_output); OP32(rel)
nkeynes@368
   225
#define JNG_exit(rel) OP(0x0F); OP(0x8E); sh4_x86_add_backpatch(xlat_output); OP32(rel)
nkeynes@368
   226
#define JNGE_exit(rel) OP(0x0F);OP(0x8C); sh4_x86_add_backpatch(xlat_output); OP32(rel)
nkeynes@368
   227
#define JNC_exit(rel) OP(0x0F); OP(0x83); sh4_x86_add_backpatch(xlat_output); OP32(rel)
nkeynes@368
   228
#define JNO_exit(rel) OP(0x0F); OP(0x81); sh4_x86_add_backpatch(xlat_output); OP32(rel)
nkeynes@368
   229
nkeynes@368
   230
nkeynes@368
   231
/* Conditional moves ebp-rel */
nkeynes@368
   232
#define CMOVE_r32_r32(r1,r2)  OP(0x0F); OP(0x44); MODRM_rm32_r32(r1,r2)
nkeynes@368
   233
#define CMOVA_r32_r32(r1,r2)  OP(0x0F); OP(0x47); MODRM_rm32_r32(r1,r2)
nkeynes@368
   234
#define CMOVAE_r32_r32(r1,r2) OP(0x0F); OP(0x43); MODRM_rm32_r32(r1,r2)
nkeynes@368
   235
#define CMOVG_r32_r32(r1,r2)  OP(0x0F); OP(0x4F); MODRM_rm32_r32(r1,r2)
nkeynes@368
   236
#define CMOVGE_r32_r32(r1,r2)  OP(0x0F); OP(0x4D); MODRM_rm32_r32(r1,r2)
nkeynes@368
   237
#define CMOVC_r32_r32(r1,r2)  OP(0x0F); OP(0x42); MODRM_rm32_r32(r1,r2)
nkeynes@368
   238
#define CMOVO_r32_r32(r1,r2)  OP(0x0F); OP(0x40); MODRM_rm32_r32(r1,r2)
nkeynes@368
   239
nkeynes@368
   240
nkeynes@359
   241
/* Conditional setcc - writeback to sh4r.t */
nkeynes@374
   242
#define SETE_sh4r(disp)    OP(0x0F); OP(0x94); MODRM_r32_sh4r(0, disp);
nkeynes@374
   243
#define SETA_sh4r(disp)    OP(0x0F); OP(0x97); MODRM_r32_sh4r(0, disp);
nkeynes@374
   244
#define SETAE_sh4r(disp)   OP(0x0F); OP(0x93); MODRM_r32_sh4r(0, disp);
nkeynes@374
   245
#define SETG_sh4r(disp)    OP(0x0F); OP(0x9F); MODRM_r32_sh4r(0, disp);
nkeynes@374
   246
#define SETGE_sh4r(disp)   OP(0x0F); OP(0x9D); MODRM_r32_sh4r(0, disp);
nkeynes@374
   247
#define SETC_sh4r(disp)    OP(0x0F); OP(0x92); MODRM_r32_sh4r(0, disp);
nkeynes@374
   248
#define SETO_sh4r(disp)    OP(0x0F); OP(0x90); MODRM_r32_sh4r(0, disp);
nkeynes@359
   249
nkeynes@374
   250
#define SETNE_sh4r(disp)   OP(0x0F); OP(0x95); MODRM_r32_sh4r(0, disp);
nkeynes@374
   251
#define SETNA_sh4r(disp)   OP(0x0F); OP(0x96); MODRM_r32_sh4r(0, disp);
nkeynes@374
   252
#define SETNAE_sh4r(disp)  OP(0x0F); OP(0x92); MODRM_r32_sh4r(0, disp);
nkeynes@374
   253
#define SETNG_sh4r(disp)   OP(0x0F); OP(0x9E); MODRM_r32_sh4r(0, disp);
nkeynes@374
   254
#define SETNGE_sh4r(disp)  OP(0x0F); OP(0x9C); MODRM_r32_sh4r(0, disp);
nkeynes@374
   255
#define SETNC_sh4r(disp)   OP(0x0F); OP(0x93); MODRM_r32_sh4r(0, disp);
nkeynes@374
   256
#define SETNO_sh4r(disp)   OP(0x0F); OP(0x91); MODRM_r32_sh4r(0, disp);
nkeynes@368
   257
nkeynes@374
   258
#define SETE_t() SETE_sh4r(R_T)
nkeynes@374
   259
#define SETA_t() SETA_sh4r(R_T)
nkeynes@374
   260
#define SETAE_t() SETAE_sh4r(R_T)
nkeynes@374
   261
#define SETG_t() SETG_sh4r(R_T)
nkeynes@374
   262
#define SETGE_t() SETGE_sh4r(R_T)
nkeynes@374
   263
#define SETC_t() SETC_sh4r(R_T)
nkeynes@374
   264
#define SETO_t() SETO_sh4r(R_T)
nkeynes@386
   265
#define SETNE_t() SETNE_sh4r(R_T)
nkeynes@374
   266
nkeynes@386
   267
#define SETC_r8(r1)      OP(0x0F); OP(0x92); MODRM_rm32_r32(r1, 0)
nkeynes@359
   268
nkeynes@359
   269
/* Pseudo-op Load carry from T: CMP [EBP+t], #01 ; CMC */
nkeynes@374
   270
#define LDC_t()     OP(0x83); MODRM_r32_sh4r(7,R_T); OP(0x01); CMC()
nkeynes@359
   271
nkeynes@359
   272
#endif /* !__lxdream_x86op_H */
.