s37table.c

来自「开放源码的编译器open watcom 1.6.0版的源代码」· C语言 代码 · 共 818 行 · 第 1/3 页

C
818
字号

opcode_entry    Mod4G[] = {
/************************/
/*       op1   op2   res   eq      verify          gen           reg*/
_DivMod4G,
};

static  opcode_entry    DivFS[] = {
/************************/
_MoveOp1IfOp2One,
_BinPP(   R,    C,    R,    NONE ), V_OP2TWO,      G_HER,  RG_SINGLE,FU_NO,\
_GenBinary( DE, SINGLE, PP ),
_BinNoCommute( SINGLE )
};

static  opcode_entry    DivFD[] = {
/************************/
_MoveOp1IfOp2One,
_BinPP(   R,    C,    R,    NONE ), V_OP2TWO,      G_HDR,  RG_DOUBLE,FU_NO,\
_GenBinary( DD, DOUBLE, PP ),
_BinNoCommute( DOUBLE )
};

/**************************************************************************/
/**************************************************************************/
/*                             SHIFTS                                     */
/**************************************************************************/
/**************************************************************************/

#define _Shift( op, cc ) \
_Bin##cc( R,  C,    R,    EQ_R1),  V_OP2SMALL,  G_##op,          RG_SHIFT,FU_NO,\
_Bin##cc( R,  R,    R,    EQ_R1),  V_NO,        G_##op,          RG_SHIFT,FU_NO,\
_Bin(   M,    R,    M,    EQ_R1 ), V_NO,        R_USEREGISTER,   RG_SHIFT,FU_NO,\
_Bin(   M,    C,    M,    EQ_R1 ), V_OP2SMALL,  R_USEREGISTER,   RG_SHIFT,FU_NO,\
_Bin(   ANY,  C,    ANY,  EQ_R1 ), V_OP2SMALL,  G_UNKNOWN,       RG_SHIFT_NEED,FU_NO,\
_Bin(   ANY,  R,    ANY,  EQ_R1 ), V_NO,        G_UNKNOWN,       RG_SHIFT_NEED,FU_NO,\
_Bin(   ANY,  ANY,  ANY,  EQ_R1 ), V_NO,        R_LOADOP2,       RG_SHIFT,FU_NO,\
_Bin(   R|M|C,R|M|C,R|M,  NONE ),  V_NO,        R_USEREGISTER,   RG_SHIFT,FU_NO,\
_Bin(   ANY,  ANY,  ANY,  NONE ),  V_NO,        G_UNKNOWN,       RG_SHIFT_NEED,FU_NO

static  opcode_entry    RShiftU4[] = {
/********************************/
_Shift( SRL, PP )
};

static  opcode_entry    RShiftI4[] = {
/********************************/
_Shift( SRA, CC )
};

static  opcode_entry    LShiftU4[] = {
/********************************/
_Shift( SLL, PP )
};

static  opcode_entry    LShiftI4[] = {
/********************************/
_Shift( SLL, PP )
};


/**************************************************************************/
/**************************************************************************/
/*                             BITWISE                                    */
/**************************************************************************/
/**************************************************************************/

#define _BitWise1( op ) \
/*       op1   op2   res   eq      verify          gen        reg*/\
_Bin(   M,    M,    M,    EQ_R1),  V_NO,           R_XC,      RG_,FU_NO,\
_BinSC( M,    C,    M,    EQ_R1),  V_NO,           G_##op##I, RG_,FU_NO,\
_Bin(   M|U,  M|C|U,M|U,  EQ_R1),  V_NO,           G_UNKNOWN, RG__NEED_WORD,FU_NO,\
_Bin(   ANY,  ANY,  ANY,  NONE ),  V_NO,           R_BIN2INT, RG_,FU_NO

#define _BitWise2( op ) \
/*       op1   op2   res   eq      verify          gen        reg*/\
_Bin(   M,    M,    M,    EQ_R1),  V_NO,           R_XC,      RG_,FU_NO,\
_Bin(   M|U,  M|U,  M|U,  EQ_R1),  V_NO,           G_UNKNOWN, RG__NEED_WORD,FU_NO,\
_Bin(   ANY,  ANY,  ANY,  NONE ),  V_NO,           R_BIN2INT, RG_,FU_NO

#define _BitWise4( op ) \
/*       op1   op2   res   eq      verify          gen        reg*/\
_Bin(   M,    M,    M,    EQ_R1),  V_NO,           R_XC,      RG_,FU_NO,\
_BinSC( R,    R,    R,    EQ_R1),  V_NO,           G_##op##R, RG_WORD,FU_NO,\
_BinSC( R,    M|C,  R,    EQ_R1),  V_NO,           G_##op,    RG_WORD,FU_NO,\
_BinSC( M,    M|C,  M,    EQ_R1),  V_NO,           G_##op##C, RG_WORD,FU_NO,\
_BinCommutes( WORD )

static  opcode_entry    And1[] = {
/********************************/
_BitWise1( N )
};

static  opcode_entry    And2[] = {
/********************************/
_BitWise2( N )
};

static  opcode_entry    And4[] = {
/********************************/
_BitWise4( N )
};

opcode_entry    NC[] = { /* this is a kludge to reserve an extra index reg */
/*       op1   op2   res   eq      verify          gen        reg*/\
_BinSC(  M,    M,    M,    EQ_R1),  V_NO,          G_NC,     RG_INDEX_NEED,FU_NO,\
_Bin(    ANY,  ANY,  ANY,  NONE ),  V_NO,          G_UNKNOWN,RG_,FU_NO
};

static  opcode_entry    Or1[] =  {
/********************************/
_BitWise1( O )
};

static  opcode_entry    Or2[] =  {
/********************************/
_BitWise2( O )
};

static  opcode_entry    Or4[] =  {
/********************************/
_BitWise4( O )
};

opcode_entry    OC[] = { /* this is a kludge to reserve an extra index reg */
/***********************/
/*       op1   op2   res   eq      verify          gen        reg*/\
_BinSC(  M,    M,    M,    EQ_R1),  V_NO,          G_OC,     RG_INDEX_NEED,FU_NO,\
_Bin(    ANY,  ANY,  ANY,  NONE ),  V_NO,          G_UNKNOWN,RG_,FU_NO
};

static  opcode_entry    Xor1[] = {
/********************************/
_BitWise1( X )
};

static  opcode_entry    Xor2[] = {
/********************************/
_BitWise2( X )
};

static  opcode_entry    Xor4[] = {
/********************************/
_BitWise4( X )
};

opcode_entry    XC[] = { /* this is a kludge to reserve an extra index reg */
/***********************/
/*       op1   op2   res   eq      verify          gen        reg*/\
_BinSC(  M,    M,    M,    EQ_R1),  V_NO,          G_XC,     RG_INDEX_NEED,FU_NO,\
_Bin(    ANY,  ANY,  ANY,  NONE ),  V_NO,          G_UNKNOWN,RG_,FU_NO
};

/**************************************************************************/
/*                             CMP                                        */
/**************************************************************************/

static  opcode_entry    CmpU1[] = {
/*********************************/
/*       op1   op2      verify          gen             reg*/
_SidCC( C,    M    ),   V_NO,           R_SWAPCMP,      RG_,FU_NO,
_SidCC( M,    C    ),   V_NO,           G_CLI,          RG_,FU_NO,
_Side(  M,    M    ),   V_NO,           R_CLC,          RG_,FU_NO,
_Side(  ANY,  ANY   ),  V_NO,           G_UNKNOWN,      RG_,FU_NO
};

static  opcode_entry    CmpU4[] = {
/*********************************/
/*       op1   op2      verify          gen             reg*/
_SidCC( R,    C    ),   V_CMPEQ_OP2ZERO,G_LTZ,          RG_WORD,FU_NO,
_SidCC( R,    R    ),   V_NO,           G_CLR,          RG_WORD,FU_NO,
_SidCC( R,    M    ),   V_NO,           G_CL,           RG_WORD,FU_NO,
_SidCC( R,    C    ),   V_NO,           G_CL,           RG_WORD,FU_NO,
_Side(  M,    M    ),   V_NO,           R_CLC,          RG_,FU_NO,
_Side(  C,    R|M  ),   V_NO,           R_SWAPCMP,      RG_WORD,FU_NO,
_Side(  R|M|C,R|M|C),   V_NO,           R_MOVOP1REG,    RG_WORD,FU_NO,
_Side(  ANY,  ANY   ),  V_NO,           G_UNKNOWN,      RG_WORD_NEED,FU_NO
};

static  opcode_entry    CmpI4[] = {
/*********************************/
/*       op1   op2      verify          gen             reg*/
_SidCC( R,    C    ),   V_OP2ZERO,      G_LTZ,          RG_WORD,FU_NO,
_SidCC( R,    R    ),   V_NO,           G_CR,           RG_WORD,FU_NO,
_SidCC( R,    M    ),   V_OP2I2,        G_CH,           RG_WORD,FU_NO,
_SidCC( R,    C    ),   V_OP2I2CON,     G_CH,           RG_WORD,FU_NO,
_SidCC( R,    M    ),   V_NO,           G_C,            RG_WORD,FU_NO,
_SidCC( R,    C    ),   V_NO,           G_C,            RG_WORD,FU_NO,
_SidCC( M,    M    ),   V_CMPEQ,        R_CLC,          RG_,FU_NO,
_Side(  C,    R|M  ),   V_NO,           R_SWAPCMP,      RG_WORD,FU_NO,
_Side(  R|M|C,R|M|C),   V_NO,           R_MOVOP1REG,    RG_WORD,FU_NO,
_Side(  ANY,  ANY   ),  V_NO,           G_UNKNOWN,      RG_WORD_NEED,FU_NO
};

#define _FloatCompare( op, type ) \
/*       op1   op2      verify          gen             reg*/ \
_SidCC( R,    C    ),   V_OP2ZERO,      G_LT##op##Z,    RG_##type,FU_NO,\
_SidCC( R,    R    ),   V_NO,           G_C##op##R,     RG_##type,FU_NO,\
_SidCC( R,    M|C  ),   V_NO,           G_C##op,        RG_##type,FU_NO,\
_SidCC( M,    M    ),   V_CMPEQ,        R_CLC,          RG_,FU_NO,\
_Side(  C,    R|M  ),   V_NO,           R_SWAPCMP,      RG_##type,FU_NO,\
_Side(  R|M|C,R|M|C),   V_NO,           R_MOVOP1REG,    RG_##type,FU_NO,\
_Side(  ANY,  ANY   ),  V_NO,           G_UNKNOWN,      RG_##type##_NEED,FU_NO

static  opcode_entry    CmpFS[] = {
/*********************************/
_FloatCompare( E, SINGLE )
};

static  opcode_entry    CmpFD[] = {
/*********************************/
_FloatCompare( D, DOUBLE )
};

opcode_entry    CLC[] = { /* this is a kludge to reserve an extra index reg */
/***********************/
/*      op1    op2      verify          gen           reg*/
_SidCC(  M,    M ),     V_NO,           G_CLC,        RG_INDEX_NEED,FU_NO,
_Side(   ANY,  ANY),    V_NO,           G_UNKNOWN,    RG_,FU_NO,
};

/**************************************************************************/
/*                             TEST                                       */
/**************************************************************************/

static  opcode_entry    Test1[] = {
/*********************************/
/*       op1   op2      verify          gen             reg*/
_SidCC( M,    C    ),   V_NO,           G_TM,           RG_,FU_NO,
_SidCC( R|M|C,R|M|C),   V_NO,           R_MAKEAND,      RG_,FU_NO,
_SidCC( ANY,  ANY  ),   V_NO,           G_UNKNOWN,      RG__NEED_WORD,FU_NO
};

static  opcode_entry    Test2[] = {
/*********************************/
/*       op1   op2      verify          gen             reg*/
_SidCC( M,    C    ),   V_OP2BYTE2CONS, R_TEST1,        RG_,FU_NO,
_SidCC( R|M|C,R|M|C),   V_NO,           R_MAKEAND,      RG_,FU_NO,
_SidCC( ANY,  ANY  ),   V_NO,           G_UNKNOWN,      RG__NEED_WORD,FU_NO,
};

static  opcode_entry    Test4[] = {
/*********************************/
/*       op1   op2      verify          gen             reg*/
_SidCC( M,    C    ),   V_OP2BYTE4CONS, R_TEST1,        RG_,FU_NO,
_SidCC( R|M|C,R|M|C),   V_NO,           R_MAKEAND,      RG_WORD,FU_NO,
_SidCC( ANY,  ANY  ),   V_NO,           G_UNKNOWN,      RG_WORD_NEED,FU_NO,
};

/**************************************************************************/
/*                             MOV                                        */
/**************************************************************************/

static  opcode_entry    Move1[] = {
/*************************/
/*       op1   op2                 verify          gen           reg*/
_UnPP(  M,    M,    NONE  ),       V_SAME_LOCN,    G_NO,         RG_,FU_NO,
_UnPP(  M,    M,    NONE ),        V_NO,           R_MVC,        RG_,FU_NO,
_UnPP(  C,    M,    NONE ),        V_NO,           G_MVI,        RG_,FU_NO,
_Un(    ANY,  ANY,  NONE ),        V_NO,           G_UNKNOWN,    RG_,FU_NO
};

#define _MoveP1( tipe, l, lr, st ) \
_UnPP(  ANY,  ANY,  EQ_R1 ),       V_NO,           G_NO,         RG_,FU_NO,\
_UnPP(  M,    M,    NONE  ),       V_SAME_LOCN,    G_NO,         RG_,FU_NO,\
_Un(    C,    R,    NONE ),        V_OP1ZERO,      G_CLRR,       RG_##tipe,FU_NO,

#define _MoveP2( tipe, l, lr, st ) \
_UnPP(  C,    M,    NONE ),        V_NO,           G_MVC,        RG_##tipe,FU_NO,\
_UnPP(  C,    R,    NONE ),        V_NO,           G_##l,        RG_##tipe,FU_NO,\
_UnPP(  R,    R,    NONE ),        V_NO,           G_##lr,       RG_##tipe,FU_NO,\
_UnPP(  R,    M,    NONE ),        V_NO,           G_##st,       RG_##tipe,FU_NO,\
_UnPP(  M,    R,    NONE ),        V_NO,           G_##l,        RG_##tipe,FU_NO,\

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?