Back to index

plt-scheme  4.2.1
asm.h
Go to the documentation of this file.
00001 /******************************** -*- C -*- ****************************
00002  *
00003  *     Run-time assembler for the PowerPC
00004  *
00005  ***********************************************************************/
00006 
00007 
00008 /***********************************************************************
00009  *
00010  * Copyright 1999, 2000, 2001, 2002 Ian Piumarta
00011  *
00012  * This file is part of GNU lightning.
00013  *
00014  * GNU lightning is free software; you can redistribute it and/or modify it
00015  * under the terms of the GNU Lesser General Public License as published
00016  * by the Free Software Foundation; either version 2.1, or (at your option)
00017  * any later version.
00018  * 
00019  * GNU lightning is distributed in the hope that it will be useful, but 
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00021  * or  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
00022  * License for more details.
00023  * 
00024  * You should have received a copy of the GNU Lesser General Public License
00025  * along with GNU lightning; see the file COPYING.LESSER; if not, write to the
00026  * Free Software Foundation, 59 Temple Place - Suite 330, Boston,
00027  * MA 02111-1307, USA.
00028  *
00029  ***********************************************************************/
00030 
00031 #ifndef __lightning_asm_h
00032 #define __lightning_asm_h
00033 
00034 /* <imm> = [0-9]+ | (.+)    -> add i, one parameter (imm)
00035  * <reg> = r<imm>           -> add r, one parameter (imm)
00036  * <mem> = <imm>(<reg>)            -> add m, two parameters (imm,reg)
00037  * <idx> = <reg>(<reg>)            -> add x, two parameters (reg,reg)
00038  *
00039  * `x' operands have two forms. For example `stwu source, rega(regb)'
00040  * could be written as either
00041  *     STWUrx(source, rega, regb)
00042  * or
00043  *     STWUXrrr(source, rega, regb)
00044  */
00045 
00046 
00047 
00048 /*** a brief NOTE about halfwords and "shifted" operands
00049  *
00050  * LOGICAL insns require UNSIGNED args in 0..65535, whether or not shifted
00051  *
00052  * ARITHMETIC insns require SIGNED args in -32768..32767, even when shifted
00053  * 
00054  * as a special case: "lis/addis" also accepts UNSIGNED arguments in
00055  * 0..65535 since it is often used immediately before "ori" to load a 32-bit
00056  * constant (this is consistent with the GNU rs/6000 and PowerPC assemblers)
00057  * 
00058  * thus:      lis    rD, expression@hi
00059  *            ori    rD, rD, expression@lo       ; load 32-bit constant
00060  */
00061 
00062 typedef unsigned int jit_insn;
00063 
00064 #ifndef LIGHTNING_DEBUG
00065 #define _cr0  0
00066 #define _cr1  1
00067 #define _cr2  2
00068 #define _cr3  3
00069 #define _cr4  4
00070 #define _cr5  5
00071 #define _cr6  6
00072 #define _cr7  7
00073 
00074 #define _lt   0
00075 #define _gt   1
00076 #define _eq   2
00077 #define _so   3
00078 #define _un   3
00079 
00080 #define _d16(D)             (_ck_d(16,(_jit_UL(D)-_jit_UL(_jit.x.pc))) & ~3)
00081 #define _d26(D)             (_ck_d(26,(_jit_UL(D)-_jit_UL(_jit.x.pc))) & ~3)
00082 
00083 /* primitive instruction forms [1, Section A.4] */
00084 
00085 #define _FB(  OP,         BD,AA,LK )    (_jit_I_noinc((_u6(OP)<<26)|                                            _d26(BD)|     (_u1(AA)<<1)|_u1(LK)), _jit.x.pc++, 0)
00086 #define _FBA( OP,         BD,AA,LK )      _jit_I((_u6(OP)<<26)|                                           (_u26(BD)&~3)| (_u1(AA)<<1)|_u1(LK))
00087 #define _BB(   OP,BO,BI,   BD,AA,LK )   (_jit_I_noinc((_u6(OP)<<26)|(_u5(BO)<<21)|(_u5(BI)<<16)|                _d16(BD)|     (_u1(AA)<<1)|_u1(LK)), _jit.x.pc++, 0)
00088 #define _D(   OP,RD,RA,         DD )      _jit_I((_u6(OP)<<26)|(_u5(RD)<<21)|(_u5(RA)<<16)|                _s16(DD)                          )
00089 #define _Du(  OP,RD,RA,         DD )      _jit_I((_u6(OP)<<26)|(_u5(RD)<<21)|(_u5(RA)<<16)|                _u16(DD)                          )
00090 #define _Ds(  OP,RD,RA,         DD )      _jit_I((_u6(OP)<<26)|(_u5(RD)<<21)|(_u5(RA)<<16)|                _su16(DD)                         )
00091 #define _X(   OP,RD,RA,RB,   XO,RC )      _jit_I((_u6(OP)<<26)|(_u5(RD)<<21)|(_u5(RA)<<16)|( _u5(RB)<<11)|              (_u10(XO)<<1)|_u1(RC))
00092 #define _XL(  OP,BO,BI,      XO,LK )      _jit_I((_u6(OP)<<26)|(_u5(BO)<<21)|(_u5(BI)<<16)|( _u5(00)<<11)|              (_u10(XO)<<1)|_u1(LK))
00093 #define _XFX( OP,RD,         SR,XO )      _jit_I((_u6(OP)<<26)|(_u5(RD)<<21)|              (_u10(SR)<<11)|              (_u10(XO)<<1)|_u1(00))
00094 #define _XO(  OP,RD,RA,RB,OE,XO,RC )      _jit_I((_u6(OP)<<26)|(_u5(RD)<<21)|(_u5(RA)<<16)|( _u5(RB)<<11)|(_u1(OE)<<10)|( _u9(XO)<<1)|_u1(RC))
00095 #define _M(   OP,RS,RA,SH,MB,ME,RC )      _jit_I((_u6(OP)<<26)|(_u5(RS)<<21)|(_u5(RA)<<16)|( _u5(SH)<<11)|(_u5(MB)<< 6)|( _u5(ME)<<1)|_u1(RC))
00096 
00097 
00098 /* special purpose registers (form XFX) [1, Section 8.2, page 8-138] */
00099 
00100 #define SPR_LR              ((8<<5)|(0))
00101 
00102 /* +++ intrinsic instructions */
00103 
00104 #define ADDrrr(RD, RA, RB)         _XO    (31, RD, RA, RB, 0, 266, 0)
00105 #define ADD_rrr(RD, RA, RB)        _XO    (31, RD, RA, RB, 0, 266, 1)
00106 #define ADDCrrr(RD, RA, RB)        _XO    (31, RD, RA, RB, 0, 10, 0)
00107 #define ADDC_rrr(RD, RA, RB)              _XO    (31, RD, RA, RB, 0, 10, 1)
00108 #define ADDErrr(RD, RA, RB)        _XO    (31, RD, RA, RB, 0, 138, 0)
00109 #define ADDE_rrr(RD, RA, RB)              _XO    (31, RD, RA, RB, 0, 138, 1)
00110 #define ADDOrrr(RD, RA, RB)        _XO    (31, RD, RA, RB, 1, 266, 0)
00111 #define ADDO_rrr(RD, RA, RB)              _XO    (31, RD, RA, RB, 1, 266, 1)
00112 #define ADDIrri(RD, RA, IMM)              _D     (14, RD, RA, IMM)
00113 #define ADDICrri(RD, RA, IMM)             _D     (12, RD, RA, IMM)
00114 #define ADDIC_rri(RD, RA, IMM)            _D     (13, RD, RA, IMM)
00115 #define ADDISrri(RD, RA, IMM)             _Ds    (15, RD, RA, IMM)
00116 
00117 #define ANDrrr(RA, RS, RB)         _X     (31, RS, RA, RB,  28, 0)
00118 #define AND_rrr(RA, RS, RB)        _X     (31, RS, RA, RB,  28, 1)
00119 #define ANDCrrr(RA, RS, RB)        _X     (31, RS, RA, RB,  60, 0)
00120 #define ANDC_rrr(RA, RS, RB)              _X     (31, RS, RA, RB,  60, 1)
00121 #define ANDI_rri(RA, RS, IMM)             _Du    (28, RS, RA, IMM)
00122 #define ANDIS_rri(RA, RS, IMM)            _Du    (29, RS, RA, IMM)
00123 
00124 #define Bi(BD)                            _FB    (18, BD, 0, 0)
00125 #define BAi(BD)                           _FBA   (18, BD, 1, 0)
00126 #define BLi(BD)                           _FB     (18, BD, 0, 1)
00127 #define BLAi(BD)                   _FBA   (18, BD, 1, 1)
00128 
00129 #define BCiii(BO,BI,BD)                   _BB    (16, BO, BI, BD, 0, 0)
00130 #define BCAiii(BO,BI,BD)           _BB    (16, BO, BI, BD, 1, 0)
00131 #define BCLiii(BO,BI,BD)           _BB    (16, BO, BI, BD, 0, 1)
00132 #define BCLAiii(BO,BI,BD)          _BB    (16, BO, BI, BD, 1, 1)
00133 
00134 #define BCCTRii(BO,BI)                    _XL    (19, BO, BI, 528, 0)
00135 #define BCCTRLii(BO,BI)                   _XL    (19, BO, BI, 528, 1)
00136 
00137 #define BCLRii(BO,BI)                     _XL    (19, BO, BI,  16, 0)
00138 #define BCLRLii(BO,BI)                    _XL    (19, BO, BI,  16, 1)
00139 
00140 #define CMPiirr(CR, LL, RA, RB)           _X     (31, ((CR)<<2)|(LL), RA, RB, 0, 0)
00141 #define CMPIiiri(CR, LL, RA, IMM)  _D     (11, ((CR)<<2)|(LL), RA, IMM)
00142 
00143 #define CMPLiirr(CR, LL, RA, RB)   _X     (31, ((CR)<<2)|(LL), RA, RB, 32, 0)
00144 #define CMPLIiiri(CR, LL, RA, IMM) _D     (10, ((CR)<<2)|(LL), RA, IMM)
00145 
00146 #define CRANDiii(CRD,CRA,CRB)             _X     (19, CRD, CRA, CRB, 257, 0)
00147 #define CRANDCiii(CRD,CRA,CRB)            _X     (19, CRD, CRA, CRB, 129, 0)
00148 #define CREQViii(CRD,CRA,CRB)             _X     (19, CRD, CRA, CRB, 289, 0)
00149 #define CRNANDiii(CRD,CRA,CRB)            _X     (19, CRD, CRA, CRB, 225, 0)
00150 #define CRNORiii(CRD,CRA,CRB)             _X     (19, CRD, CRA, CRB,  33, 0)
00151 #define CRORiii(CRD,CRA,CRB)              _X     (19, CRD, CRA, CRB, 449, 0)
00152 #define CRORCiii(CRD,CRA,CRB)             _X     (19, CRD, CRA, CRB, 417, 0)
00153 #define CRXORiii(CRD,CRA,CRB)             _X     (19, CRD, CRA, CRB, 193, 0)
00154 
00155 #define DCBSTrr(RA,RB)                    _X     (31, 00, RA, RB,  54, 0)
00156 
00157 #define DIVWrrr(RD, RA, RB)        _XO    (31, RD, RA, RB, 0, 491, 0)
00158 #define DIVW_rrr(RD, RA, RB)              _XO    (31, RD, RA, RB, 0, 491, 1)
00159 #define DIVWOrrr(RD, RA, RB)              _XO    (31, RD, RA, RB, 1, 491, 0)
00160 #define DIVWO_rrr(RD, RA, RB)             _XO    (31, RD, RA, RB, 1, 491, 1)
00161 
00162 #define DIVWUrrr(RD, RA, RB)              _XO    (31, RD, RA, RB, 0, 459, 0)
00163 #define DIVWU_rrr(RD, RA, RB)             _XO    (31, RD, RA, RB, 0, 459, 1)
00164 #define DIVWUOrrr(RD, RA, RB)             _XO    (31, RD, RA, RB, 1, 459, 0)
00165 #define DIVWUO_rrr(RD, RA, RB)            _XO    (31, RD, RA, RB, 1, 459, 1)
00166 
00167 #define EQVrrr(Ra,RS,RB)           _X     (31, RS, RA, RB, 284, 0)
00168 #define EQV_rrr(Ra,RS,RB)          _X     (31, RS, RA, RB, 284, 1)
00169 
00170 #define EXTSBrr(RA,RS)                    _X     (31, RS, RA,  0, 954, 0)
00171 #define EXTSB_rr(RA,RS)                   _X     (31, RS, RA,  0, 954, 1)
00172 
00173 #define EXTSHrr(RA,RS)                    _X     (31, RS, RA,  0, 922, 0)
00174 #define EXTSH_rr(RA,RS)                   _X     (31, RS, RA,  0, 922, 1)
00175 
00176 #define ICBIrr(RA,RB)                     _X     (31, 00, RA, RB, 982, 0)
00177 
00178 #define ISYNC()                           _X     (19, 00, 00, 00, 150, 0)
00179 
00180 #define LBZrm(RD,ID,RA)                   _D     (34, RD, RA, ID)
00181 #define LBZUrm(RD,ID,RA)           _D     (35, RD, RA, ID)
00182 #define LBZUXrrr(RD,RA,RB)         _X     (31, RD, RA, RB, 119, 0)
00183 #define LBZXrrr(RD,RA,RB)          _X     (31, RD, RA, RB,  87, 0)
00184 
00185 #define LHArm(RD,ID,RA)                   _D     (42, RD, RA, ID)
00186 #define LHAUrm(RD,ID,RA)           _D     (43, RD, RA, ID)
00187 #define LHAUXrrr(RD,RA,RB)         _X     (31, RD, RA, RB, 375, 0)
00188 #define LHAXrrr(RD,RA,RB)          _X     (31, RD, RA, RB, 343, 0)
00189 #define LHBRXrrr(RD,RA,RB)         _X     (31, RD, RA, RB, 790, 0)
00190 
00191 #define LHZrm(RD,ID,RA)                   _D     (40, RD, RA, ID)
00192 #define LHZUrm(RD,ID,RA)           _D     (41, RD, RA, ID)
00193 #define LHZUXrrr(RD,RA,RB)         _X     (31, RD, RA, RB, 311, 0)
00194 #define LHZXrrr(RD,RA,RB)          _X     (31, RD, RA, RB, 279, 0)
00195 
00196 #define LMWrm(RD,ID,RA)                   _D     (46, RD, RA, ID)
00197 
00198 #define LWBRXrrr(RD,RA,RB)         _X     (31, RD, RA, RB, 534, 0)
00199 
00200 #define LWZrm(RD, DISP, RA)        _D     (32, RD, RA, DISP)
00201 #define LWZUrm(RD, DISP, RA)              _D     (33, RD, RA, DISP)
00202 #define LWZUXrrr(RD, RA, RB)              _X     (31, RD, RA, RB,  56, 0)
00203 #define LWZXrrr(RD, RA, RB)        _X     (31, RD, RA, RB,  23, 0)
00204 
00205 #define MCRFii(CD,CS)                     _X     (19, ((CD)<<2), ((CS)<<2), 0, 0, 0)
00206 
00207 #define MFCRr(RD)                  _X     (31, RD, 0, 0, 19, 0)
00208 #define MCRXRi(RD)                 _XFX   (31, (RD)<<2,   0, 512)
00209 
00210 #define MFSPRri(RD, SPR)           _XFX   (31, RD, (SPR)<<5, 339)
00211 #define MTSPRir(SPR, RS)           _XFX   (31, RS, (SPR)<<5, 467)
00212 
00213 #define MULHWrrr(RD,RA,RB)         _XO    (31, RD, RA, RB, 0,  75, 0)
00214 #define MULHW_rrr(RD,RA,RB)        _XO    (31, RD, RA, RB, 0,  75, 1)
00215 #define MULHWUrrr(RD,RA,RB)        _XO    (31, RD, RA, RB, 0,  11, 0)
00216 #define MULHWU_rrr(RD,RA,RB)              _XO    (31, RD, RA, RB, 0,  11, 1)
00217 
00218 #define MULLIrri(RD,RA,IM)         _D     (07, RD, RA, IM)
00219 
00220 #define MULLWrrr(RD,RA,RB)         _XO    (31, RD, RA, RB, 0, 235, 0)
00221 #define MULLW_rrr(RD,RA,RB)        _XO    (31, RD, RA, RB, 0, 235, 1)
00222 #define MULLWOrrr(RD,RA,RB)        _XO    (31, RD, RA, RB, 1, 235, 0)
00223 #define MULLWO_rrr(RD,RA,RB)              _XO    (31, RD, RA, RB, 1, 235, 1)
00224 
00225 #define NANDrrr(RA,RS,RB)          _X     (31, RS, RA, RB, 476, 0)
00226 #define NAND_rrr(RA,RS,RB)         _X     (31, RS, RA, RB, 476, 1)
00227 
00228 #define NEGrr(RD,RA)               _XO    (31, RD, RA, 0, 0, 104, 0)
00229 #define NEG_rr(RD,RA)                     _XO    (31, RD, RA, 0, 0, 104, 1)
00230 #define NEGOrr(RD,RA)                     _XO    (31, RD, RA, 0, 1, 104, 0)
00231 #define NEGO_rr(RD,RA)                    _XO    (31, RD, RA, 0, 1, 104, 1)
00232 
00233 #define NORrrr(RA,RS,RB)           _X     (31, RS, RA, RB, 124, 0)
00234 #define NOR_rrr(RA,RS,RB)          _X     (31, RS, RA, RB, 124, 1)
00235 
00236 #define ORrrr(RA,RS,RB)                   _X     (31, RS, RA, RB, 444, 0)
00237 #define OR_rrr(RA,RS,RB)           _X     (31, RS, RA, RB, 444, 1)
00238 #define ORCrrr(RA,RS,RB)           _X     (31, RS, RA, RB, 412, 0)
00239 #define ORC_rrr(RA,RS,RB)          _X     (31, RS, RA, RB, 412, 1)
00240 #define ORIrri(RA,RS,IM)           _Du    (24, RS, RA, IM)
00241 #define ORISrri(RA,RS,IM)          _Du    (25, RS, RA, IM)
00242 
00243 #define RLWIMIrriii(RA,RS,SH,MB,ME)       _M     (20, RS, RA, SH, MB, ME, 0)
00244 #define RLWIMI_rriii(RA,RS,SH,MB,ME)      _M     (20, RS, RA, SH, MB, ME, 1)
00245 
00246 #define RLWINMrriii(RA,RS,SH,MB,ME)       _M     (21, RS, RA, SH, MB, ME, 0)
00247 #define RLWINM_rriii(RA,RS,SH,MB,ME)      _M     (21, RS, RA, SH, MB, ME, 1)
00248 
00249 #define RLWNMrrrii(RA,RS,RB,MB,ME) _M     (23, RS, RA, RB, MB, ME, 0)
00250 #define RLWNM_rrrii(RA,RS,RB,MB,ME)       _M     (23, RS, RA, RB, MB, ME, 1)
00251 
00252 #define SLWrrr(RA,RS,RB)           _X     (31, RS, RA, RB,  24, 0)
00253 #define SLW_rrr(RA,RS,RB)          _X     (31, RS, RA, RB,  24, 1)
00254 
00255 #define SRAWrrr(RA,RS,RB)          _X     (31, RS, RA, RB, 792, 0)
00256 #define SRAW_rrr(RA,RS,RB)         _X     (31, RS, RA, RB, 792, 1)
00257 
00258 #define SRAWIrri(RD, RS, SH)              _X     (31, RS, RD, SH, 824, 0)
00259 #define SRAWI_rri(RD, RS, SH)             _X     (31, RS, RD, SH, 824, 1)
00260 
00261 #define SRWrrr(RA,RS,RB)           _X     (31, RS, RA, RB, 536, 0)
00262 #define SRW_rrr(RA,RS,RB)          _X     (31, RS, RA, RB, 536, 1)
00263 
00264 #define STBrm(RS,ID,RA)                   _D     (38, RS, RA, ID)
00265 #define STBUrm(RS,ID,RA)           _D     (39, RS, RA, ID)
00266 #define STBUXrrr(RS,RA,RB)         _X     (31, RS, RA, RB, 247, 0)
00267 #define STBXrrr(RS,RA,RB)          _X     (31, RS, RA, RB, 215, 0)
00268 
00269 #define STHrm(RS,ID,RA)                   _D     (44, RS, RA, ID)
00270 #define STHUrm(RS,ID,RA)           _D     (45, RS, RA, ID)
00271 #define STHBRXrrr(RS,RA,RB)        _X     (31, RS, RA, RB, 918, 0)
00272 #define STHUXrrr(RS,RA,RB)         _X     (31, RS, RA, RB, 439, 0)
00273 #define STHXrrr(RS,RA,RB)          _X     (31, RS, RA, RB, 407, 0)
00274 
00275 #define STMWrm(RS,ID,RA)           _D     (47, RS, RA, ID)
00276 
00277 #define STWrm(RS,ID,RA)                   _D     (36, RS, RA, ID)
00278 #define STWBRXrrr(RS,RA,RB)        _X     (31, RS, RA, RB, 662, 0)
00279 #define STWCXrrr(RS,RA,RB)         _X     (31, RS, RA, RB, 150, 0)
00280 #define STWCX_rrr(RS,RA,RB)        _X     (31, RS, RA, RB, 150, 1)
00281 #define STWUrm(RS,ID,RA)           _D     (37, RS, RA, ID)
00282 #define STWUXrrr(RS,RA,RB)         _X     (31, RS, RA, RB, 183, 0)
00283 #define STWXrrr(RS,RA,RB)          _X     (31, RS, RA, RB, 151, 0)
00284 
00285 #define SUBFrrr(RD, RA, RB)        _XO    (31, RD, RA, RB, 0, 40, 0)
00286 #define SUBF_rrr(RD, RA, RB)              _XO    (31, RD, RA, RB, 0, 40, 1)
00287 #define SUBFrrr(RD, RA, RB)        _XO    (31, RD, RA, RB, 0, 40, 0)
00288 #define SUBF_rrr(RD, RA, RB)              _XO    (31, RD, RA, RB, 0, 40, 1)
00289 #define SUBFErrr(RD, RA, RB)              _XO    (31, RD, RA, RB, 1, 136, 0)
00290 #define SUBFE_rrr(RD, RA, RB)             _XO    (31, RD, RA, RB, 1, 136, 1)
00291 #define SUBFCrrr(RD, RA, RB)              _XO    (31, RD, RA, RB, 0,  8, 0)
00292 #define SUBFC_rrr(RD, RA, RB)             _XO    (31, RD, RA, RB, 0,  8, 1)
00293 #define SUBFCOrrr(RD, RA, RB)             _XO    (31, RD, RA, RB, 1,  8, 0)
00294 #define SUBFCO_rrr(RD, RA, RB)            _XO    (31, RD, RA, RB, 1,  8, 1)
00295 #define SUBFICrri(RD, RA, IMM)            _D     (8, RD, RA, IMM)
00296 
00297 #define ADDrrr(RD, RA, RB)         _XO    (31, RD, RA, RB, 0, 266, 0)
00298 #define ADDOrrr(RD, RA, RB)        _XO    (31, RD, RA, RB, 1, 266, 0)
00299 #define ADDIrri(RD, RA, IMM)              _D     (14, RD, RA, IMM)
00300 #define ADDISrri(RD, RA, IMM)             _Ds    (15, RD, RA, IMM)
00301 
00302 #define SYNC()                            _X     (31, 00, 00, 00, 598, 0)
00303 
00304 #define TWirr(TO,RA,RB)                   _X     (31, TO, RA, RB,   4, 0)
00305 #define TWIiri(TO,RA,IM)           _D     (03, TO, RA, IM)
00306 
00307 #define XORrrr(RA,RS,RB)           _X     (31, RS, RA, RB, 316, 0)
00308 #define XOR_rrr(RA,RS,RB)          _X     (31, RS, RA, RB, 316, 1)
00309 #define XORIrri(RA,RS,IM)          _Du    (26, RS, RA, IM)
00310 #define XORISrri(RA,RS,IM)         _Du    (27, RS, RA, IM)
00311 
00312 /* simplified mnemonics [1, Appendix F] */
00313 
00314 #define MOVEIri2(R,H,L)                   (LISri(R,H), (L ? ORIrri(R,R,L) : 0))
00315 #define MOVEIri(R,I)               (_siP(16,I) ? LIri(R,I) :   \
00316                                    MOVEIri2(R, _HI(I), _LO(I)) )
00317 
00318 #define SUBIrri(RD,RA,IM)          ADDIrri(RD,RA,-_LO((IM)))   /* [1, Section F.2.1] */
00319 #define SUBISrri(RD,RA,IM)         ADDISrri(RD,RA,-_LO((IM)))
00320 #define SUBICrri(RD,RA,IM)         ADDICrri(RD,RA,-_LO((IM)))
00321 #define SUBIC_rri(RD,RA,IM)        ADDIC_rri(RD,RA,-_LO((IM)))
00322 
00323 #define SUBrrr(RD,RA,RB)           SUBFrrr(RD,RB,RA)    /* [1, Section F.2.2] */
00324 #define SUBOrrr(RD,RA,RB)          SUBFOrrr(RD,RB,RA)
00325 #define SUB_rrr(RD,RA,RB)          SUBF_rrr(RD,RB,RA)
00326 #define SUBCrrr(RD,RA,RB)          SUBFCrrr(RD,RB,RA)
00327 #define SUBCOrrr(RD,RA,RB)         SUBFCOrrr(RD,RB,RA)
00328 #define SUBC_rrr(RD,RA,RB)         SUBFC_rrr(RD,RB,RA)
00329 #define SUBErrr(RD,RA,RB)          SUBFErrr(RD,RB,RA)
00330 #define SUBE_rrr(RD,RA,RB)         SUBFE_rrr(RD,RB,RA)
00331 
00332 #define CMPWIiri(C,RA,IM)          CMPIiiri(C,0,RA,IM)  /* [1, Table F-2] */
00333 #define CMPWirr(C,RA,RB)           CMPiirr(C,0,RA,RB)
00334 #define CMPLWIiri(C,RA,IM)         CMPLIiiri(C,0,RA,IM)
00335 #define CMPLWirr(C,RA,RB)          CMPLiirr(C,0,RA,RB)
00336 
00337 #define CMPWIri(RA,IM)                    CMPWIiri(0,RA,IM)    /* with implicit _cr0 */
00338 #define CMPWrr(RA,RB)                     CMPWirr(0,RA,RB)
00339 #define CMPLWIri(RA,IM)                   CMPLWIiri(0,RA,IM)
00340 #define CMPLWrr(RA,RB)                    CMPLWirr(0,RA,RB)
00341 
00342 #define EXTLWIrrii(RA,RS,N,B)             RLWINMrriii(RA, RS,            B,  0,     (N)-1) /* [1, Table F-3] */
00343 #define EXTRWIrrii(RA,RS,N,B)             RLWINMrriii(RA, RS,      (B)+(N),  32-(N),        31)
00344 #define INSLWIrrii(RA,RS,N,B)             RLWIMIrriii(RA, RS,       32-(B),  B, (B)+(N)-1)
00345 #define INSRWIrrii(RA,RS,N,B)             RLWIMIrriii(RA, RS, 32-((B)+(N)),  B, (B)+(N)-1)
00346 #define ROTLWIrri(RA,RS,N)         RLWINMrriii(RA, RS,            N,  0,        31)
00347 #define ROTRWIrri(RA,RS,N)         RLWINMrriii(RA, RS,       32-(N),  0,        31)
00348 #define ROTLWrrr(RA,RS,RB)         RLWNMrrrii( RA, RS,           RB,  0,        31)
00349 #define SLWIrri(RA,RS,N)           RLWINMrriii(RA, RS,            N,  0,    31-(N))
00350 #define SRWIrri(RA,RS,N)           RLWINMrriii(RA, RS,       32-(N),  N,        31)
00351 #define CLRLWIrri(RA,RS,N)         RLWINMrriii(RA, RS,            0,  N,        31)
00352 #define CLRRWIrri(RA,RS,N)         RLWINMrriii(RA, RS,            0,  0,    31-(N))
00353 #define CLRLSLWIrrii(RA,RS,B,N)           RLWINMrriii(RA, RS,            N, (B)-(N),    31-(N))
00354 
00355 #if 0
00356 static int bad_short_jump()
00357 {
00358   scheme_signal_error("bad short jump");
00359   return 1;
00360 }
00361 # define NOT_SHORT_JUMPS() (_jitl.long_jumps ? 0 : bad_short_jump()) ,
00362 #else
00363 # define NOT_SHORT_JUMPS() /* empty */
00364 #endif
00365 
00366 /* 9 below inverts the branch condition and the branch prediction.
00367  * This has an incestuous knowledge of JIT_AUX */
00368 #define BC_EXT(A, C, D)  ((_siP(16, _jit_UL(D)-_jit_UL(_jit.x.pc)) && !_jitl.long_jumps) \
00369   ? BCiii((A), (C), (D)) \
00370   : (NOT_SHORT_JUMPS() \
00371      BCiii((A)^9, (C), _jit.x.pc+5), \
00372      LISri(JIT_AUX,_HI(D)), \
00373      ORIrri(JIT_AUX,JIT_AUX,_LO(D)), \
00374      MTLRr(JIT_AUX), BLR() ))
00375 
00376 #define B_EXT(D)         ((_siP(16, _jit_UL(D)-_jit_UL(_jit.x.pc)) && !_jitl.long_jumps) \
00377   ? Bi((D)) \
00378   : (NOT_SHORT_JUMPS() \
00379      LISri(JIT_AUX,_HI(D)), \
00380      ORIrri(JIT_AUX,JIT_AUX,_LO(D)), \
00381      MTLRr(JIT_AUX), BLR()) )
00382 
00383 #define BTii(C,D)                  BC_EXT(12, C, D)            /* [1, Table F-5] */
00384 #define BFii(C,D)                  BC_EXT( 4, C, D)
00385 #define BDNZi(D)                   BCiii(16, 0, D)
00386 #define BDNZTii(C,D)               BC_EXT( 8, C, D)
00387 #define BDNZFii(C,D)               BC_EXT( 0, C, D)
00388 #define BDZi(D)                           BCiii(18, 0, D)
00389 #define BDZTii(C,D)                BC_EXT(10, C, D)
00390 #define BDZFii(C,D)                BC_EXT( 2, C, D)
00391               
00392 #define BCTR()                            BCCTRii(20, 0)              /* [1, Table F-6] */
00393 #define BCTRL()                           BCCTRLii(20, 0)
00394               
00395 #define BLR()                      BCLRii(20, 0)        /* [1, Table F-6] */
00396 #define BLRL()                            BCLRLii(20, 0)
00397               
00398 
00399 #define BLTLRi(CR)                 BCLRii(12, ((CR)<<2)+0)     /* [1, Table F-10] */
00400 #define BLELRi(CR)                 BCLRii( 4, ((CR)<<2)+1)
00401 #define BEQLRi(CR)                 BCLRii(12, ((CR)<<2)+2)
00402 #define BGELRi(CR)                 BCLRii( 4, ((CR)<<2)+0)
00403 #define BGTLRi(CR)                 BCLRii(12, ((CR)<<2)+1)
00404 #define BNLLRi(CR)                 BCLRii( 4, ((CR)<<2)+0)
00405 #define BNELRi(CR)                 BCLRii( 4, ((CR)<<2)+2)
00406 #define BNGLRi(CR)                 BCLRii( 4, ((CR)<<2)+1)
00407 #define BSOLRi(CR)                 BCLRii(12, ((CR)<<2)+3)
00408 #define BNSLRi(CR)                 BCLRii( 4, ((CR)<<2)+3)
00409 #define BUNLRi(CR)                 BCLRii(12, ((CR)<<2)+3)
00410 #define BNULRi(CR)                 BCLRii( 4, ((CR)<<2)+3)
00411               
00412 #define BLTLRLi(CR)                BCLRLii(12, ((CR)<<2)+0)    /* [1, Table F-10] */
00413 #define BLELRLi(CR)                BCLRLii( 4, ((CR)<<2)+1)
00414 #define BEQLRLi(CR)                BCLRLii(12, ((CR)<<2)+2)
00415 #define BGELRLi(CR)                BCLRLii( 4, ((CR)<<2)+0)
00416 #define BGTLRLi(CR)                BCLRLii(12, ((CR)<<2)+1)
00417 #define BNLLRLi(CR)                BCLRLii( 4, ((CR)<<2)+0)
00418 #define BNELRLi(CR)                BCLRLii( 4, ((CR)<<2)+2)
00419 #define BNGLRLi(CR)                BCLRLii( 4, ((CR)<<2)+1)
00420 #define BSOLRLi(CR)                BCLRLii(12, ((CR)<<2)+3)
00421 #define BNSLRLi(CR)                BCLRLii( 4, ((CR)<<2)+3)
00422 #define BUNLRLi(CR)                BCLRLii(12, ((CR)<<2)+3)
00423 #define BNULRLi(CR)                BCLRLii( 4, ((CR)<<2)+3)
00424               
00425 #define BLTCTRi(CR)                BCCTRii(12, ((CR)<<2)+0)    /* [1, Table F-10] */
00426 #define BLECTRi(CR)                BCCTRii( 4, ((CR)<<2)+1)
00427 #define BEQCTRi(CR)                BCCTRii(12, ((CR)<<2)+2)
00428 #define BGECTRi(CR)                BCCTRii( 4, ((CR)<<2)+0)
00429 #define BGTCTRi(CR)                BCCTRii(12, ((CR)<<2)+1)
00430 #define BNLCTRi(CR)                BCCTRii( 4, ((CR)<<2)+0)
00431 #define BNECTRi(CR)                BCCTRii( 4, ((CR)<<2)+2)
00432 #define BNGCTRi(CR)                BCCTRii( 4, ((CR)<<2)+1)
00433 #define BSOCTRi(CR)                BCCTRii(12, ((CR)<<2)+3)
00434 #define BNSCTRi(CR)                BCCTRii( 4, ((CR)<<2)+3)
00435 #define BUNCTRi(CR)                BCCTRii(12, ((CR)<<2)+3)
00436 #define BNUCTRi(CR)                BCCTRii( 4, ((CR)<<2)+3)
00437               
00438 #define BLTCTRLi(CR)               BCCTRLii(12, ((CR)<<2)+0)   /* [1, Table F-10] */
00439 #define BLECTRLi(CR)               BCCTRLii( 4, ((CR)<<2)+1)
00440 #define BEQCTRLi(CR)               BCCTRLii(12, ((CR)<<2)+2)
00441 #define BGECTRLi(CR)               BCCTRLii( 4, ((CR)<<2)+0)
00442 #define BGTCTRLi(CR)               BCCTRLii(12, ((CR)<<2)+1)
00443 #define BNLCTRLi(CR)               BCCTRLii( 4, ((CR)<<2)+0)
00444 #define BNECTRLi(CR)               BCCTRLii( 4, ((CR)<<2)+2)
00445 #define BNGCTRLi(CR)               BCCTRLii( 4, ((CR)<<2)+1)
00446 #define BSOCTRLi(CR)               BCCTRLii(12, ((CR)<<2)+3)
00447 #define BNSCTRLi(CR)               BCCTRLii( 4, ((CR)<<2)+3)
00448 #define BUNCTRLi(CR)               BCCTRLii(12, ((CR)<<2)+3)
00449 #define BNUCTRLi(CR)               BCCTRLii( 4, ((CR)<<2)+3)
00450               
00451 
00452 #define BLTLR()                           BLTLRi(0)     /* with implicit _cr0 */
00453 #define BLELR()                           BLELRi(0)  
00454 #define BEQLR()                           BEQLRi(0)  
00455 #define BGELR()                           BGELRi(0)  
00456 #define BGTLR()                           BGTLRi(0)  
00457 #define BNLLR()                           BNLLRi(0)  
00458 #define BNELR()                           BNELRi(0)  
00459 #define BNGLR()                           BNGLRi(0)  
00460 #define BSOLR()                           BSOLRi(0)  
00461 #define BNSLR()                           BNSLRi(0)  
00462 #define BUNLR()                           BUNLRi(0)  
00463 #define BNULR()                           BNULRi(0)  
00464                                                
00465 #define BLTLRL()                   BLTLRLi(0) 
00466 #define BLELRL()                   BLELRLi(0) 
00467 #define BEQLRL()                   BEQLRLi(0) 
00468 #define BGELRL()                   BGELRLi(0) 
00469 #define BGTLRL()                   BGTLRLi(0) 
00470 #define BNLLRL()                   BNLLRLi(0) 
00471 #define BNELRL()                   BNELRLi(0) 
00472 #define BNGLRL()                   BNGLRLi(0) 
00473 #define BSOLRL()                   BSOLRLi(0) 
00474 #define BNSLRL()                   BNSLRLi(0) 
00475 #define BUNLRL()                   BUNLRLi(0) 
00476 #define BNULRL()                   BNULRLi(0) 
00477                                                
00478 #define BLTCTR()                   BLTCTRi(0) 
00479 #define BLECTR()                   BLECTRi(0) 
00480 #define BEQCTR()                   BEQCTRi(0) 
00481 #define BGECTR()                   BGECTRi(0) 
00482 #define BGTCTR()                   BGTCTRi(0) 
00483 #define BNLCTR()                   BNLCTRi(0) 
00484 #define BNECTR()                   BNECTRi(0) 
00485 #define BNGCTR()                   BNGCTRi(0) 
00486 #define BSOCTR()                   BSOCTRi(0) 
00487 #define BNSCTR()                   BNSCTRi(0) 
00488 #define BUNCTR()                   BUNCTRi(0) 
00489 #define BNUCTR()                   BNUCTRi(0) 
00490                                                
00491 #define BLTCTRL()                  BLTCTRLi(0)
00492 #define BLECTRL()                  BLECTRLi(0)
00493 #define BEQCTRL()                  BEQCTRLi(0)
00494 #define BGECTRL()                  BGECTRLi(0)
00495 #define BGTCTRL()                  BGTCTRLi(0)
00496 #define BNLCTRL()                  BNLCTRLi(0)
00497 #define BNECTRL()                  BNECTRLi(0)
00498 #define BNGCTRL()                  BNGCTRLi(0)
00499 #define BSOCTRL()                  BSOCTRLi(0)
00500 #define BNSCTRL()                  BNSCTRLi(0)
00501 #define BUNCTRL()                  BUNCTRLi(0)
00502 #define BNUCTRL()                  BNUCTRLi(0)
00503 
00504 
00505 #define BLTii(C,D)                 BC_EXT(12, ((C)<<2)+0, D)   /* [1, Table F-11] */
00506 #define BNLii(C,D)                 BC_EXT( 4, ((C)<<2)+0, D)
00507 #define BGEii(C,D)                 BC_EXT( 4, ((C)<<2)+0, D)
00508 #define BGTii(C,D)                 BC_EXT(12, ((C)<<2)+1, D)
00509 #define BNGii(C,D)                 BC_EXT( 4, ((C)<<2)+1, D)
00510 #define BLEii(C,D)                 BC_EXT( 4, ((C)<<2)+1, D)
00511 #define BEQii(C,D)                 BC_EXT(12, ((C)<<2)+2, D)
00512 #define BNEii(C,D)                 BC_EXT( 4, ((C)<<2)+2, D)
00513 #define BSOii(C,D)                 BC_EXT(12, ((C)<<2)+3, D)
00514 #define BNSii(C,D)                 BC_EXT( 4, ((C)<<2)+3, D)
00515 #define BUNii(C,D)                 BC_EXT(12, ((C)<<2)+3, D)
00516 #define BNUii(C,D)                 BC_EXT( 4, ((C)<<2)+3, D)
00517 
00518 #define BLTi(D)                           BLTii(0,D)    /* with implicit _cr0 */
00519 #define BLEi(D)                           BLEii(0,D)
00520 #define BEQi(D)                           BEQii(0,D)
00521 #define BGEi(D)                           BGEii(0,D)
00522 #define BGTi(D)                           BGTii(0,D)
00523 #define BNLi(D)                           BNLii(0,D)
00524 #define BNEi(D)                           BNEii(0,D)
00525 #define BNGi(D)                           BNGii(0,D)
00526 #define BSOi(D)                           BSOii(0,D)
00527 #define BNSi(D)                           BNSii(0,D)
00528 #define BUNi(D)                           BUNii(0,D)
00529 #define BNUi(D)                           BNUii(0,D)
00530 
00531 #define BLTLii(C,D)                BCLiii(12, ((C)<<2)+0, D)   /* [1, Table F-??] */
00532 #define BLELii(C,D)                BCLiii( 4, ((C)<<2)+1, D)
00533 #define BEQLii(C,D)                BCLiii(12, ((C)<<2)+2, D)
00534 #define BGELii(C,D)                BCLiii( 4, ((C)<<2)+0, D)
00535 #define BGTLii(C,D)                BCLiii(12, ((C)<<2)+1, D)
00536 #define BNLLii(C,D)                BCLiii( 4, ((C)<<2)+0, D)
00537 #define BNELii(C,D)                BCLiii( 4, ((C)<<2)+2, D)
00538 #define BNGLii(C,D)                BCLiii( 4, ((C)<<2)+1, D)
00539 #define BSOLii(C,D)                BCLiii(12, ((C)<<2)+3, D)
00540 #define BNSLii(C,D)                BCLiii( 4, ((C)<<2)+3, D)
00541 #define BUNLii(C,D)                BCLiii(12, ((C)<<2)+3, D)
00542 #define BNULii(C,D)                BCLiii( 4, ((C)<<2)+3, D)
00543 
00544 #define BLTLi(D)                   BLTLii(0,D)   /* with implicit _cr0 */
00545 #define BLELi(D)                   BLELii(0,D)
00546 #define BEQLi(D)                   BEQLii(0,D)
00547 #define BGELi(D)                   BGELii(0,D)
00548 #define BGTLi(D)                   BGTLii(0,D)
00549 #define BNLLi(D)                   BNLLii(0,D)
00550 #define BNELi(D)                   BNELii(0,D)
00551 #define BNGLi(D)                   BNGLii(0,D)
00552 #define BSOLi(D)                   BSOLii(0,D)
00553 #define BNSLi(D)                   BNSLii(0,D)
00554 #define BUNLi(D)                   BUNLii(0,D)
00555 #define BNULi(D)                   BNULii(0,D)
00556 
00557 /* Note: there are many tens of other simplified branches that are not (yet?) defined here */
00558 
00559 #define CRSETi(BX)                 CREQViii(BX, BX, BX) /* [1, Table F-15] */
00560 #define CRCLRi(BX)                 CRXORiii(BX, BX, BX)
00561 #define CRMOVEii(BX,BY)                   CRORiii(BX, BY, BY)
00562 #define CRNOTii(BX,BY)                    CRNORiii(BX, BY, BY)
00563               
00564 #define MTLRr(RS)                  MTSPRir(8, RS)              /* [1, Table F-20] */
00565 #define MFLRr(RD)                  MFSPRri(RD, 8)
00566 #define MTCTRr(RS)                 MTSPRir(9, RS)
00567 #define MFCTRr(RD)                 MFSPRri(RD, 9)
00568 #define MTXERr(RS)                 MTSPRir(1, RS)
00569 #define MFXERr(RD)                 MFSPRri(RD, 1)
00570               
00571 #define NOP()                      ORIrri(0, 0, 0)             /* [1, Section F.9] */
00572 #define LIri(RD,IM)                ADDIrri(RD, 0, IM)
00573 #define LISri(RD,IM)               ADDISrri(RD, 0, IM)
00574 #define LArm(RD,D,RA)                     ADDIrri(RD, RA, D)
00575 #define LArrr(RD,RB,RA)                   ADDIrrr(RD, RA, RB)
00576 #define MRrr(RA,RS)                ORrrr(RA, RS, RS)
00577 #define NOTrr(RA,RS)               NORrrr(RA, RS, RS)
00578 
00579 /* alternative parenthesised forms of extended indexed load/store insns */
00580 
00581 #define LBZUrx(RD,RA,RB)           LBZUXrrr(RD,RA,RB)
00582 #define LBZrx(RD,RA,RB)                   LBZXrrr(RD,RA,RB)
00583 #define LHAUrx(RD,RA,RB)           LHAUXrrr(RD,RA,RB)
00584 #define LHArx(RD,RA,RB)                   LHAXrrr(RD,RA,RB)
00585 #define LHBRrx(RD,RA,RB)           LHBRXrrr(RD,RA,RB)
00586 #define LHZUrx(RD,RA,RB)           LHZUXrrr(RD,RA,RB)
00587 #define LHZrx(RD,RA,RB)                   LHZXrrr(RD,RA,RB)
00588 #define LWBRrx(RD,RA,RB)           LWBRXrrr(RD,RA,RB)
00589 #define LWZUrx(RD, RA, RB)         LWZUXrrr(RD, RA, RB)
00590 #define LWZrx(RD, RA, RB)          LWZXrrr(RD, RA, RB)
00591 #define STBUrx(RD,RA,RB)           STBUXrrr(RD,RA,RB)
00592 #define STBrx(RD,RA,RB)                   STBXrrr(RD,RA,RB)
00593 #define STHBRrx(RS,RA,RB)          STHBRXrrr(RS,RA,RB)
00594 #define STHUrx(RS,RA,RB)           STHUXrrr(RS,RA,RB)
00595 #define STHrx(RS,RA,RB)                   STHXrrr(RS,RA,RB)
00596 #define STWBRrx(RS,RA,RB)          STWBRXrrr(RS,RA,RB)
00597 #define STWCrx(RS,RA,RB)           STWCXrrr(RS,RA,RB)
00598 #define STWCX_rx(RS,RA,RB)         STWCX_rrr(RS,RA,RB)
00599 #define STWUrx(RS,RA,RB)           STWUXrrr(RS,RA,RB)
00600 #define STWrx(RS,RA,RB)                   STWXrrr(RS,RA,RB)
00601 #define LArx(RD,RB,RA)                    LArrr(RD,RB,RA)      
00602 
00603 
00604 #define _LO(I)          (_jit_UL(I) & _MASK(16))
00605 #define _HI(I)          (_jit_UL(I) >>     (16))
00606 
00607 #define _A(OP,RD,RA,RB,RC,XO,RCx)    _jit_I((_u6(OP)<<26)|(_u5(RD)<<21)|(_u5(RA)<<16)|( _u5(RB)<<11)|_u5(RC)<<6|(_u5(XO)<<1)|_u1(RCx))
00608 
00609 #define LFDrri(RD,RA,imm)       _D(50,RD,RA,imm)
00610 #define LFDUrri(RD,RA,imm)      _D(51,RD,RA,imm)
00611 #define LFDUxrrr(RD,RA,RB)      _X(31,RD,RA,RB,631,0)
00612 #define LFDxrrr(RD,RA,RB)       _X(31,RD,RA,RB,599,0)
00613 
00614 #define LFSrri(RD,RA,imm)       _D(48,RD,RA,imm)
00615 #define LFSUrri(RD,RA,imm)      _D(49,RD,RA,imm)
00616 #define LFSUxrrr(RD,RA,RB)      _X(31,RD,RA,RB,567,0)
00617 #define LFSxrrr(RD,RA,RB)       _X(31,RD,RA,RB,535,0)
00618 
00619 #define STFDrri(RS,RA,imm)      _D(54,RS,RA,imm)
00620 #define STFDUrri(RS,RA,imm)     _D(55,RS,RA,imm)
00621 #define STFDUxrrr(RS,RA,RB)     _X(31,RS,RA,RB,759,0)
00622 #define STFDxrrr(RS,RA,RB)      _X(31,RS,RA,RB,727,0)
00623 
00624 #define STFSrri(RS,RA,imm)      _D(52,RS,RA,imm)
00625 #define STFSUrri(RS,RA,imm)     _D(53,RS,RA,imm)
00626 #define STFSUxrrr(RS,RA,RB)     _X(31,RS,RA,RB,695,0)
00627 #define STFSxrrr(RS,RA,RB)      _X(31,RS,RA,RB,663,0)
00628 #define STFIWXrrr(RS,RA,RB)     _X(31,RS,RA,RB,983,0)
00629 
00630 #define FADDDrrr(RD,RA,RB)       _A(63,RD,RA,RB,0,21,0)
00631 #define FADDSrrr(RD,RA,RB)       _A(59,RD,RA,RB,0,21,0)
00632 #define FSUBDrrr(RD,RA,RB)       _A(63,RD,RA,RB,0,20,0)
00633 #define FSUBSrrr(RD,RA,RB)       _A(59,RD,RA,RB,0,20,0)
00634 #define FMULDrrr(RD,RA,RC)       _A(63,RD,RA,0,RC,25,0)
00635 #define FMULSrrr(RD,RA,RC)       _A(59,RD,RA,0,RC,25,0)
00636 #define FDIVDrrr(RD,RA,RB)       _A(63,RD,RA,RB,0,18,0)
00637 #define FDIVSrrr(RD,RA,RB)       _A(59,RD,RA,RB,0,25,0)
00638 #define FSQRTDrr(RD,RB)          _A(63,RD,0,RB,0,22,0)
00639 #define FSQRTSrr(RD,RB)          _A(59,RD,0,RB,0,22,0)
00640 #define FSELrrrr(RD,RA,RB,RC)    _A(63,RD,RA,RB,RC,23,0)
00641 #define FCTIWrr(RD,RB)           _X(63,RD,0,RB,14,0)
00642 #define FCTIWZrr(RD,RB)          _X(63,RD,0,RB,15,0)
00643 #define FRSPrr(RD,RB)            _X(63,RD,0,RB,12,0)
00644 #define FABSrr(RD,RB)            _X(63,RD,0,RB,264,0)
00645 #define FNABSrr(RD,RB)           _X(63,RD,0,RB,136,0)
00646 #define FNEGrr(RD,RB)            _X(63,RD,0,RB,40,0)
00647 #define FMOVErr(RD,RB)           _X(63,RD,0,RB,72,0)
00648 #define FCMPOrrr(CR,RA,RB)       _X(63,_u3((CR)<<2),RA,RB,32,0)
00649 #define FCMPUrrr(CR,RA,RB)       _X(63,_u3((CR)<<2),RA,RB,0,0)
00650 #define MTFSFIri(CR,IMM)          _X(63,_u5((CR)<<2),0,_u5((IMM)<<1),134,0)
00651 
00652 /*** References:
00653  *
00654  * [1] "PowerPC Microprocessor Family: The Programming Environments For 32-Bit Microprocessors", Motorola, 1997.
00655  */
00656 
00657 
00658 #endif
00659 #endif /* __ccg_asm_ppc_h */