| 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_TABLE \ | 19 #define REGX8632_GPR_TABLE \ |
| 20 /* val, init, 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, = Reg_eax + 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, = Reg_eax + 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, = Reg_eax + 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, = Reg_eax + 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, = Reg_eax + 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, = Reg_eax + 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, = Reg_eax + 7, "edi", "di", "" , 0, 1, 0, 0, 0, 1, 0) |
| 30 X(Reg_ah, = Reg_edi + 1, "???", "" , "ah", 0, 0, 0, 0, 1, 0, 0) \ | 30 |
| 31 X(Reg_xmm0, = Reg_ah + 1, "xmm0", "" , "" , 1, 0, 0, 0, 0, 0, 1) \ | 31 #define REGX8632_XMM_TABLE \ |
| 32 X(Reg_xmm0, = 0, "xmm0", "" , "" , 1, 0, 0, 0, 0, 0, 1) \ |
| 32 X(Reg_xmm1, = Reg_xmm0 + 1, "xmm1", "" , "" , 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_xmm2, = Reg_xmm0 + 2, "xmm2", "" , "" , 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_xmm3, = Reg_xmm0 + 3, "xmm3", "" , "" , 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_xmm4, = Reg_xmm0 + 4, "xmm4", "" , "" , 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_xmm5, = Reg_xmm0 + 5, "xmm5", "" , "" , 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_xmm6, = Reg_xmm0 + 6, "xmm6", "" , "" , 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_xmm7, = Reg_xmm0 + 7, "xmm7", "" , "" , 1, 0, 0, 0, 0, 0, 1) \ | 39 X(Reg_xmm7, = Reg_xmm0 + 7, "xmm7", "" , "" , 1, 0, 0, 0, 0, 0, 1) \ |
| 39 //#define X(val, init, name, name16, name8, scratch, preserved, stackptr, | 40 //#define X(val, encode, name, name16, name8, scratch, preserved, stackptr, |
| 40 // frameptr, isI8, isInt, isFP) | 41 // frameptr, isI8, isInt, isFP) |
| 41 | 42 |
| 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. |
| 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. |
| 47 #define REGX8632_TABLE \ |
| 48 /* val, encode, name, name16, name8, scratch, preserved, stackptr, \ |
| 49 frameptr, isI8, isInt, isFP */ \ |
| 50 REGX8632_GPR_TABLE \ |
| 51 X(Reg_ah, = Reg_eax + 4, "???", "" , "ah", 0, 0, 0, 0, 1, 0, 0) \ |
| 52 REGX8632_XMM_TABLE |
| 53 //#define X(val, encode, name, name16, name8, scratch, preserved, stackptr, |
| 54 // frameptr, isI8, isInt, isFP) |
| 55 |
| 56 // We also need the encodings for the Byte registers (other info overlaps |
| 57 // what is in the REGX8632_GPR_TABLE). |
| 58 #define REGX8632_BYTEREG_TABLE \ |
| 59 /* val, encode */ \ |
| 60 X(Reg_al, = 0) \ |
| 61 X(Reg_cl, = 1) \ |
| 62 X(Reg_dl, = 2) \ |
| 63 X(Reg_bl, = 3) \ |
| 64 X(Reg_ah, = 4) |
| 65 //#define X(val, encode) |
| 66 |
| 42 // X86 segment registers. | 67 // X86 segment registers. |
| 43 #define SEG_REGX8632_TABLE \ | 68 #define SEG_REGX8632_TABLE \ |
| 44 /* enum value, name */ \ | 69 /* enum value, name */ \ |
| 45 X(SegReg_CS, "cs") \ | 70 X(SegReg_CS, "cs") \ |
| 46 X(SegReg_DS, "ds") \ | 71 X(SegReg_DS, "ds") \ |
| 47 X(SegReg_ES, "es") \ | 72 X(SegReg_ES, "es") \ |
| 48 X(SegReg_SS, "ss") \ | 73 X(SegReg_SS, "ss") \ |
| 49 X(SegReg_FS, "fs") \ | 74 X(SegReg_FS, "fs") \ |
| 50 X(SegReg_GS, "gs") \ | 75 X(SegReg_GS, "gs") \ |
| 51 //#define X(val, name) | 76 //#define X(val, name) |
| 52 | 77 |
| 53 #define ICEINSTX8632BR_TABLE \ | 78 #define ICEINSTX8632BR_TABLE \ |
| 54 /* enum value, opposite, dump, emit */ \ | 79 /* enum value, encode, opposite, dump, emit */ \ |
| 55 X(Br_a, Br_be, "a", "ja") \ | 80 X(Br_o, = 0, Br_no, "o", "jo") \ |
| 56 X(Br_ae, Br_b, "ae", "jae") \ | 81 X(Br_no, = 1, Br_o, "no", "jno") \ |
| 57 X(Br_b, Br_ae, "b", "jb") \ | 82 X(Br_b, = 2, Br_ae, "b", "jb") \ |
| 58 X(Br_be, Br_a, "be", "jbe") \ | 83 X(Br_ae, = 3, Br_b, "ae", "jae") \ |
| 59 X(Br_e, Br_ne, "e", "je") \ | 84 X(Br_e, = 4, Br_ne, "e", "je") \ |
| 60 X(Br_g, Br_le, "g", "jg") \ | 85 X(Br_ne, = 5, Br_e, "ne", "jne") \ |
| 61 X(Br_ge, Br_l, "ge", "jge") \ | 86 X(Br_be, = 6, Br_a, "be", "jbe") \ |
| 62 X(Br_l, Br_ge, "l", "jl") \ | 87 X(Br_a, = 7, Br_be, "a", "ja") \ |
| 63 X(Br_le, Br_g, "le", "jle") \ | 88 X(Br_s, = 8, Br_ns, "s", "js") \ |
| 64 X(Br_ne, Br_e, "ne", "jne") \ | 89 X(Br_ns, = 9, Br_s, "ns", "jns") \ |
| 65 X(Br_np, Br_p, "np", "jnp") \ | 90 X(Br_p, = 10, Br_np, "p", "jp") \ |
| 66 X(Br_p, Br_np, "p", "jp") \ | 91 X(Br_np, = 11, Br_p, "np", "jnp") \ |
| 67 //#define X(tag, opp, dump, emit) | 92 X(Br_l, = 12, Br_ge, "l", "jl") \ |
| 93 X(Br_ge, = 13, Br_l, "ge", "jge") \ |
| 94 X(Br_le, = 14, Br_g, "le", "jle") \ |
| 95 X(Br_g, = 15, Br_le, "g", "jg") \ |
| 96 //#define X(tag, encode, opp, dump, emit) |
| 68 | 97 |
| 69 #define ICEINSTX8632CMPPS_TABLE \ | 98 #define ICEINSTX8632CMPPS_TABLE \ |
| 70 /* enum value, emit */ \ | 99 /* enum value, emit */ \ |
| 71 X(Cmpps_eq, "eq") \ | 100 X(Cmpps_eq, "eq") \ |
| 72 X(Cmpps_lt, "lt") \ | 101 X(Cmpps_lt, "lt") \ |
| 73 X(Cmpps_le, "le") \ | 102 X(Cmpps_le, "le") \ |
| 74 X(Cmpps_unord, "unord") \ | 103 X(Cmpps_unord, "unord") \ |
| 75 X(Cmpps_neq, "neq") \ | 104 X(Cmpps_neq, "neq") \ |
| 76 X(Cmpps_nlt, "nlt") \ | 105 X(Cmpps_nlt, "nlt") \ |
| 77 X(Cmpps_nle, "nle") \ | 106 X(Cmpps_nle, "nle") \ |
| (...skipping 13 matching lines...) Expand all Loading... |
| 91 X(IceType_v4i1, IceType_i32 , "?" , "" , "d", "xmmword ptr") \ | 120 X(IceType_v4i1, IceType_i32 , "?" , "" , "d", "xmmword ptr") \ |
| 92 X(IceType_v8i1, IceType_i16 , "?" , "" , "w", "xmmword ptr") \ | 121 X(IceType_v8i1, IceType_i16 , "?" , "" , "w", "xmmword ptr") \ |
| 93 X(IceType_v16i1, IceType_i8 , "?" , "" , "b", "xmmword ptr") \ | 122 X(IceType_v16i1, IceType_i8 , "?" , "" , "b", "xmmword ptr") \ |
| 94 X(IceType_v16i8, IceType_i8 , "?" , "" , "b", "xmmword ptr") \ | 123 X(IceType_v16i8, IceType_i8 , "?" , "" , "b", "xmmword ptr") \ |
| 95 X(IceType_v8i16, IceType_i16 , "?" , "" , "w", "xmmword ptr") \ | 124 X(IceType_v8i16, IceType_i16 , "?" , "" , "w", "xmmword ptr") \ |
| 96 X(IceType_v4i32, IceType_i32 , "dq", "" , "d", "xmmword ptr") \ | 125 X(IceType_v4i32, IceType_i32 , "dq", "" , "d", "xmmword ptr") \ |
| 97 X(IceType_v4f32, IceType_f32 , "ps", "" , "" , "xmmword ptr") \ | 126 X(IceType_v4f32, IceType_f32 , "ps", "" , "" , "xmmword ptr") \ |
| 98 //#define X(tag, elementty, cvt, sdss, width) | 127 //#define X(tag, elementty, cvt, sdss, width) |
| 99 | 128 |
| 100 #endif // SUBZERO_SRC_ICEINSTX8632_DEF | 129 #endif // SUBZERO_SRC_ICEINSTX8632_DEF |
| OLD | NEW |