| OLD | NEW |
| 1 //===- subzero/src/IceInstX8632.def - X-macros for x86-32 insts -*- C++ -*-===// | 1 //===- subzero/src/IceInstX8632.def - X-macros for x86-32 insts -*- C++ -*-===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This file defines properties of lowered x86-32 instructions in the | 10 // This file defines properties of lowered x86-32 instructions in the |
| 11 // form of x-macros. | 11 // form of x-macros. |
| 12 // | 12 // |
| 13 //===----------------------------------------------------------------------===// | 13 //===----------------------------------------------------------------------===// |
| 14 | 14 |
| 15 #ifndef SUBZERO_SRC_ICEINSTX8632_DEF | 15 #ifndef SUBZERO_SRC_ICEINSTX8632_DEF |
| 16 #define SUBZERO_SRC_ICEINSTX8632_DEF | 16 #define SUBZERO_SRC_ICEINSTX8632_DEF |
| 17 | 17 |
| 18 // NOTE: esp is not considered isInt, to avoid register allocating it. | 18 // NOTE: esp is not considered isInt, to avoid register allocating it. |
| 19 #define REGX8632_GPR_TABLE \ | 19 #define REGX8632_GPR_TABLE \ |
| 20 /* val, encode, name, name16, name8, scratch, preserved, stackptr, \ | 20 /* val, encode, name, name16, name8, scratch, preserved, stackptr, \ |
| 21 frameptr, isI8, isInt, isFP */ \ | 21 frameptr, isI8, isInt, isFP */ \ |
| 22 X(Reg_eax, = 0, "eax", "ax", "al", 1, 0, 0, 0, 1, 1, 0) \ | 22 X(Reg_eax, 0, "eax", "ax", "al", 1, 0, 0, 0, 1, 1, 0) \ |
| 23 X(Reg_ecx, = Reg_eax + 1, "ecx", "cx", "cl", 1, 0, 0, 0, 1, 1, 0) \ | 23 X(Reg_ecx, 1, "ecx", "cx", "cl", 1, 0, 0, 0, 1, 1, 0) \ |
| 24 X(Reg_edx, = Reg_eax + 2, "edx", "dx", "dl", 1, 0, 0, 0, 1, 1, 0) \ | 24 X(Reg_edx, 2, "edx", "dx", "dl", 1, 0, 0, 0, 1, 1, 0) \ |
| 25 X(Reg_ebx, = Reg_eax + 3, "ebx", "bx", "bl", 0, 1, 0, 0, 1, 1, 0) \ | 25 X(Reg_ebx, 3, "ebx", "bx", "bl", 0, 1, 0, 0, 1, 1, 0) \ |
| 26 X(Reg_esp, = Reg_eax + 4, "esp", "sp", "" , 0, 0, 1, 0, 0, 0, 0) \ | 26 X(Reg_esp, 4, "esp", "sp", "" , 0, 0, 1, 0, 0, 0, 0) \ |
| 27 X(Reg_ebp, = Reg_eax + 5, "ebp", "bp", "" , 0, 1, 0, 1, 0, 1, 0) \ | 27 X(Reg_ebp, 5, "ebp", "bp", "" , 0, 1, 0, 1, 0, 1, 0) \ |
| 28 X(Reg_esi, = Reg_eax + 6, "esi", "si", "" , 0, 1, 0, 0, 0, 1, 0) \ | 28 X(Reg_esi, 6, "esi", "si", "" , 0, 1, 0, 0, 0, 1, 0) \ |
| 29 X(Reg_edi, = Reg_eax + 7, "edi", "di", "" , 0, 1, 0, 0, 0, 1, 0) | 29 X(Reg_edi, 7, "edi", "di", "" , 0, 1, 0, 0, 0, 1, 0) |
| 30 | 30 |
| 31 #define REGX8632_XMM_TABLE \ | 31 #define REGX8632_XMM_TABLE \ |
| 32 X(Reg_xmm0, = 0, "xmm0", "" , "" , 1, 0, 0, 0, 0, 0, 1) \ | 32 X(Reg_xmm0, 0, "xmm0", "" , "" , 1, 0, 0, 0, 0, 0, 1) \ |
| 33 X(Reg_xmm1, = Reg_xmm0 + 1, "xmm1", "" , "" , 1, 0, 0, 0, 0, 0, 1) \ | 33 X(Reg_xmm1, 1, "xmm1", "" , "" , 1, 0, 0, 0, 0, 0, 1) \ |
| 34 X(Reg_xmm2, = Reg_xmm0 + 2, "xmm2", "" , "" , 1, 0, 0, 0, 0, 0, 1) \ | 34 X(Reg_xmm2, 2, "xmm2", "" , "" , 1, 0, 0, 0, 0, 0, 1) \ |
| 35 X(Reg_xmm3, = Reg_xmm0 + 3, "xmm3", "" , "" , 1, 0, 0, 0, 0, 0, 1) \ | 35 X(Reg_xmm3, 3, "xmm3", "" , "" , 1, 0, 0, 0, 0, 0, 1) \ |
| 36 X(Reg_xmm4, = Reg_xmm0 + 4, "xmm4", "" , "" , 1, 0, 0, 0, 0, 0, 1) \ | 36 X(Reg_xmm4, 4, "xmm4", "" , "" , 1, 0, 0, 0, 0, 0, 1) \ |
| 37 X(Reg_xmm5, = Reg_xmm0 + 5, "xmm5", "" , "" , 1, 0, 0, 0, 0, 0, 1) \ | 37 X(Reg_xmm5, 5, "xmm5", "" , "" , 1, 0, 0, 0, 0, 0, 1) \ |
| 38 X(Reg_xmm6, = Reg_xmm0 + 6, "xmm6", "" , "" , 1, 0, 0, 0, 0, 0, 1) \ | 38 X(Reg_xmm6, 6, "xmm6", "" , "" , 1, 0, 0, 0, 0, 0, 1) \ |
| 39 X(Reg_xmm7, = Reg_xmm0 + 7, "xmm7", "" , "" , 1, 0, 0, 0, 0, 0, 1) \ | 39 X(Reg_xmm7, 7, "xmm7", "" , "" , 1, 0, 0, 0, 0, 0, 1) \ |
| 40 //#define X(val, encode, name, name16, name8, scratch, preserved, stackptr, | 40 //#define X(val, encode, name, name16, name8, scratch, preserved, stackptr, |
| 41 // frameptr, isI8, isInt, isFP) | 41 // frameptr, isI8, isInt, isFP) |
| 42 | 42 |
| 43 // We also provide a combined table, so that there is a namespace where | 43 // We also provide a combined table, so that there is a namespace where |
| 44 // all of the registers are considered and have distinct numberings. | 44 // all of the registers are considered and have distinct numberings. |
| 45 // This is in contrast to the above, where the "encode" is based on how | 45 // This is in contrast to the above, where the "encode" is based on how |
| 46 // the register numbers will be encoded in binaries and values can overlap. | 46 // the register numbers will be encoded in binaries and values can overlap. |
| 47 // Note that the isI8 attributed of Reg_ah is not set. In general we | 47 // Note that the isI8 attributed of Reg_ah is not set. In general we |
| 48 // don't want the register allocator choosing Reg_ah, in particular | 48 // don't want the register allocator choosing Reg_ah, in particular |
| 49 // for lowering insertelement to pinsrb where internally we use an | 49 // for lowering insertelement to pinsrb where internally we use an |
| 50 // 8-bit operand but externally pinsrb uses a 32-bit register, in | 50 // 8-bit operand but externally pinsrb uses a 32-bit register, in |
| 51 // which Reg_ah doesn't map to eax. | 51 // which Reg_ah doesn't map to eax. |
| 52 #define REGX8632_TABLE \ | 52 #define REGX8632_TABLE \ |
| 53 /* val, encode, name, name16, name8, scratch, preserved, stackptr, \ | 53 /* val, encode, name, name16, name8, scratch, preserved, stackptr, \ |
| 54 frameptr, isI8, isInt, isFP */ \ | 54 frameptr, isI8, isInt, isFP */ \ |
| 55 REGX8632_GPR_TABLE \ | 55 REGX8632_GPR_TABLE \ |
| 56 X(Reg_ah, = Reg_eax + 4, "???", "" , "ah", 0, 0, 0, 0, 0, 0, 0) \ | 56 X(Reg_ah, 4, "???", "" , "ah", 0, 0, 0, 0, 0, 0, 0) \ |
| 57 REGX8632_XMM_TABLE | 57 REGX8632_XMM_TABLE |
| 58 //#define X(val, encode, name, name16, name8, scratch, preserved, stackptr, | 58 //#define X(val, encode, name, name16, name8, scratch, preserved, stackptr, |
| 59 // frameptr, isI8, isInt, isFP) | 59 // frameptr, isI8, isInt, isFP) |
| 60 | 60 |
| 61 #define REGX8632_TABLE_BOUNDS \ | 61 #define REGX8632_TABLE_BOUNDS \ |
| 62 /* val, init */ \ | 62 /* val, init */ \ |
| 63 X(Reg_GPR_First, = Reg_eax) \ | 63 X(Reg_GPR_First, = Reg_eax) \ |
| 64 X(Reg_GPR_Last, = Reg_edi) \ | 64 X(Reg_GPR_Last, = Reg_edi) \ |
| 65 X(Reg_XMM_First, = Reg_xmm0) \ | 65 X(Reg_XMM_First, = Reg_xmm0) \ |
| 66 X(Reg_XMM_Last, = Reg_xmm7) \ | 66 X(Reg_XMM_Last, = Reg_xmm7) \ |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 X(IceType_v4i1, IceType_i32 , "?" , "" , "d", "", "") \ | 148 X(IceType_v4i1, IceType_i32 , "?" , "" , "d", "", "") \ |
| 149 X(IceType_v8i1, IceType_i16 , "?" , "" , "w", "", "") \ | 149 X(IceType_v8i1, IceType_i16 , "?" , "" , "w", "", "") \ |
| 150 X(IceType_v16i1, IceType_i8 , "?" , "" , "b", "", "") \ | 150 X(IceType_v16i1, IceType_i8 , "?" , "" , "b", "", "") \ |
| 151 X(IceType_v16i8, IceType_i8 , "?" , "" , "b", "", "") \ | 151 X(IceType_v16i8, IceType_i8 , "?" , "" , "b", "", "") \ |
| 152 X(IceType_v8i16, IceType_i16 , "?" , "" , "w", "", "") \ | 152 X(IceType_v8i16, IceType_i16 , "?" , "" , "w", "", "") \ |
| 153 X(IceType_v4i32, IceType_i32 , "dq", "" , "d", "", "") \ | 153 X(IceType_v4i32, IceType_i32 , "dq", "" , "d", "", "") \ |
| 154 X(IceType_v4f32, IceType_f32 , "ps", "" , "d", "", "") \ | 154 X(IceType_v4f32, IceType_f32 , "ps", "" , "d", "", "") \ |
| 155 //#define X(tag, elementty, cvt, sdss, pack, width, fld) | 155 //#define X(tag, elementty, cvt, sdss, pack, width, fld) |
| 156 | 156 |
| 157 #endif // SUBZERO_SRC_ICEINSTX8632_DEF | 157 #endif // SUBZERO_SRC_ICEINSTX8632_DEF |
| OLD | NEW |