| OLD | NEW |
| 1 //===- subzero/src/IceInstARM32.def - X-Macros for ARM32 insts --*- C++ -*-===// | 1 //===- subzero/src/IceInstARM32.def - X-Macros for ARM32 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 ARM32 instructions in the form of x-macros. | 10 // This file defines properties of ARM32 instructions in the form of x-macros. |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 // S registers 0-15 are scratch, but 16-31 are preserved. | 108 // S registers 0-15 are scratch, but 16-31 are preserved. |
| 109 // Regenerate this with the following python script: | 109 // Regenerate this with the following python script: |
| 110 // | 110 // |
| 111 // def print_sregs(): | 111 // def print_sregs(): |
| 112 // for i in xrange(0, 32): | 112 // for i in xrange(0, 32): |
| 113 // is_scratch = 1 if i < 16 else 0 | 113 // is_scratch = 1 if i < 16 else 0 |
| 114 // is_preserved = 1 if i >= 16 else 0 | 114 // is_preserved = 1 if i >= 16 else 0 |
| 115 // print (' X(Reg_s{regnum:<2}, {regnum:<2}, "s{regnum}", ' + | 115 // print (' X(Reg_s{regnum:<2}, {regnum:<2}, "s{regnum}", ' + |
| 116 // '{scratch}, {preserved}, 0, 0, 0, 0, 1, 0, 0, ' + | 116 // '{scratch}, {preserved}, 0, 0, 0, 0, 1, 0, 0, ' + |
| 117 // 'ALIASES(Reg_s{regnum_s:<2}, Reg_d{regnum:<2}, ' + | 117 // 'ALIASES(Reg_s{regnum_s:<2}, Reg_d{regnum:<2}, ' + |
| 118 // 'Reg_q{regnum_q:<2})) \\').format( | 118 // 'Reg_q{regnum_q:<2})) \\').format( |
| 119 // regnum=i, regnum_d=i>>1, | 119 // regnum=i, regnum_d=i>>1, |
| 120 // regnum_q=i>>2, scratch=is_scratch, preserved=is_preserved) | 120 // regnum_q=i>>2, scratch=is_scratch, preserved=is_preserved) |
| 121 // | 121 // |
| 122 // print_sregs() | 122 // print_sregs() |
| 123 // | 123 // |
| 124 #define REGARM32_FP32_TABLE \ | 124 #define REGARM32_FP32_TABLE \ |
| 125 /* val, encode, name, scratch, preserved, stackptr, frameptr, \ | 125 /* val, encode, name, scratch, preserved, stackptr, frameptr, \ |
| 126 isInt, isI64Pair, isFP32, isFP64, isVec128, aliases_init */ \ | 126 isInt, isI64Pair, isFP32, isFP64, isVec128, aliases_init */ \ |
| 127 X(Reg_s0 , 0 , "s0" , 1, 0, 0, 0, 0, 0, 1, 0, 0, \ | 127 X(Reg_s0 , 0 , "s0" , 1, 0, 0, 0, 0, 0, 1, 0, 0, \ |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 ALIASES3(Reg_s26, Reg_d13, Reg_q6)) \ | 180 ALIASES3(Reg_s26, Reg_d13, Reg_q6)) \ |
| 181 X(Reg_s27, 27, "s27", 0, 1, 0, 0, 0, 0, 1, 0, 0, \ | 181 X(Reg_s27, 27, "s27", 0, 1, 0, 0, 0, 0, 1, 0, 0, \ |
| 182 ALIASES3(Reg_s27, Reg_d13, Reg_q6)) \ | 182 ALIASES3(Reg_s27, Reg_d13, Reg_q6)) \ |
| 183 X(Reg_s28, 28, "s28", 0, 1, 0, 0, 0, 0, 1, 0, 0, \ | 183 X(Reg_s28, 28, "s28", 0, 1, 0, 0, 0, 0, 1, 0, 0, \ |
| 184 ALIASES3(Reg_s28, Reg_d14, Reg_q7)) \ | 184 ALIASES3(Reg_s28, Reg_d14, Reg_q7)) \ |
| 185 X(Reg_s29, 29, "s29", 0, 1, 0, 0, 0, 0, 1, 0, 0, \ | 185 X(Reg_s29, 29, "s29", 0, 1, 0, 0, 0, 0, 1, 0, 0, \ |
| 186 ALIASES3(Reg_s29, Reg_d14, Reg_q7)) \ | 186 ALIASES3(Reg_s29, Reg_d14, Reg_q7)) \ |
| 187 X(Reg_s30, 30, "s30", 0, 1, 0, 0, 0, 0, 1, 0, 0, \ | 187 X(Reg_s30, 30, "s30", 0, 1, 0, 0, 0, 0, 1, 0, 0, \ |
| 188 ALIASES3(Reg_s30, Reg_d15, Reg_q7)) \ | 188 ALIASES3(Reg_s30, Reg_d15, Reg_q7)) \ |
| 189 X(Reg_s31, 31, "s31", 0, 1, 0, 0, 0, 0, 1, 0, 0, \ | 189 X(Reg_s31, 31, "s31", 0, 1, 0, 0, 0, 0, 1, 0, 0, \ |
| 190 ALIASES3(Reg_s31, Reg_d15, Reg_q7)) | 190 ALIASES3(Reg_s31, Reg_d15, Reg_q7)) |
| 191 //#define X(val, encode, name, scratch, preserved, stackptr, frameptr, | 191 //#define X(val, encode, name, scratch, preserved, stackptr, frameptr, |
| 192 // isInt, isI64Pair, isFP32,isFP64, isVec128, aliases_init) | 192 // isInt, isI64Pair, isFP32,isFP64, isVec128, aliases_init) |
| 193 | 193 |
| 194 // D registers 0-7 are scratch, 8-15 are preserved, and 16-31 are also scratch | 194 // D registers 0-7 are scratch, 8-15 are preserved, and 16-31 are also scratch |
| 195 // (if supported by the D32 feature vs D16). D registers are defined in reverse | 195 // (if supported by the D32 feature vs D16). D registers are defined in reverse |
| 196 // order so that, during register allocation, Subzero will prefer higher D | 196 // order so that, during register allocation, Subzero will prefer higher D |
| 197 // registers. In processors supporting the D32 feature this will effectively | 197 // registers. In processors supporting the D32 feature this will effectively |
| 198 // cause double allocation to bias towards allocating "high" D registers, which | 198 // cause double allocation to bias towards allocating "high" D registers, which |
| 199 // do not alias any S registers. | 199 // do not alias any S registers. |
| 200 // | 200 // |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 ALIASES4(Reg_s10, Reg_s11, Reg_d5 , Reg_q2)) \ | 279 ALIASES4(Reg_s10, Reg_s11, Reg_d5 , Reg_q2)) \ |
| 280 X(Reg_d4 , 4 , "d4", 1, 0, 0, 0, 0, 0, 0, 1, 0, \ | 280 X(Reg_d4 , 4 , "d4", 1, 0, 0, 0, 0, 0, 0, 1, 0, \ |
| 281 ALIASES4(Reg_s8 , Reg_s9 , Reg_d4 , Reg_q2)) \ | 281 ALIASES4(Reg_s8 , Reg_s9 , Reg_d4 , Reg_q2)) \ |
| 282 X(Reg_d3 , 3 , "d3", 1, 0, 0, 0, 0, 0, 0, 1, 0, \ | 282 X(Reg_d3 , 3 , "d3", 1, 0, 0, 0, 0, 0, 0, 1, 0, \ |
| 283 ALIASES4(Reg_s6 , Reg_s7 , Reg_d3 , Reg_q1)) \ | 283 ALIASES4(Reg_s6 , Reg_s7 , Reg_d3 , Reg_q1)) \ |
| 284 X(Reg_d2 , 2 , "d2", 1, 0, 0, 0, 0, 0, 0, 1, 0, \ | 284 X(Reg_d2 , 2 , "d2", 1, 0, 0, 0, 0, 0, 0, 1, 0, \ |
| 285 ALIASES4(Reg_s4 , Reg_s5 , Reg_d2 , Reg_q1)) \ | 285 ALIASES4(Reg_s4 , Reg_s5 , Reg_d2 , Reg_q1)) \ |
| 286 X(Reg_d1 , 1 , "d1", 1, 0, 0, 0, 0, 0, 0, 1, 0, \ | 286 X(Reg_d1 , 1 , "d1", 1, 0, 0, 0, 0, 0, 0, 1, 0, \ |
| 287 ALIASES4(Reg_s2 , Reg_s3 , Reg_d1 , Reg_q0)) \ | 287 ALIASES4(Reg_s2 , Reg_s3 , Reg_d1 , Reg_q0)) \ |
| 288 X(Reg_d0 , 0 , "d0", 1, 0, 0, 0, 0, 0, 0, 1, 0, \ | 288 X(Reg_d0 , 0 , "d0", 1, 0, 0, 0, 0, 0, 0, 1, 0, \ |
| 289 ALIASES4(Reg_s0 , Reg_s1 , Reg_d0 , Reg_q0)) | 289 ALIASES4(Reg_s0 , Reg_s1 , Reg_d0 , Reg_q0)) |
| 290 //#define X(val, encode, name, scratch, preserved, stackptr, frameptr, | 290 //#define X(val, encode, name, scratch, preserved, stackptr, frameptr, |
| 291 // isInt, isI64Pair, isFP32, isFP64, isVec128, aliases_init) | 291 // isInt, isI64Pair, isFP32, isFP64, isVec128, aliases_init) |
| 292 | 292 |
| 293 // Q registers 0-3 are scratch, 4-7 are preserved, and 8-15 are also scratch | 293 // Q registers 0-3 are scratch, 4-7 are preserved, and 8-15 are also scratch |
| 294 // (if supported by the D32 feature). Q registers are defined in reverse order | 294 // (if supported by the D32 feature). Q registers are defined in reverse order |
| 295 // for the same reason as D registers. | 295 // for the same reason as D registers. |
| 296 // | 296 // |
| 297 // Regenerate this with the following python script: | 297 // Regenerate this with the following python script: |
| 298 // def print_qregs(): | 298 // def print_qregs(): |
| 299 // for i in xrange(15, 7, -1): | 299 // for i in xrange(15, 7, -1): |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 ALIASES7(Reg_s20, Reg_s21, Reg_s22, Reg_s23, Reg_d10, Reg_d11, Reg_q5)) \ | 347 ALIASES7(Reg_s20, Reg_s21, Reg_s22, Reg_s23, Reg_d10, Reg_d11, Reg_q5)) \ |
| 348 X(Reg_q4 , 4 , "q4", 0, 1, 0, 0, 0, 0, 0, 0, 1, \ | 348 X(Reg_q4 , 4 , "q4", 0, 1, 0, 0, 0, 0, 0, 0, 1, \ |
| 349 ALIASES7(Reg_s16, Reg_s17, Reg_s18, Reg_s19, Reg_d8 , Reg_d9 , Reg_q4)) \ | 349 ALIASES7(Reg_s16, Reg_s17, Reg_s18, Reg_s19, Reg_d8 , Reg_d9 , Reg_q4)) \ |
| 350 X(Reg_q3 , 3 , "q3", 1, 0, 0, 0, 0, 0, 0, 0, 1, \ | 350 X(Reg_q3 , 3 , "q3", 1, 0, 0, 0, 0, 0, 0, 0, 1, \ |
| 351 ALIASES7(Reg_s12, Reg_s13, Reg_s14, Reg_s15, Reg_d6 , Reg_d7 , Reg_q3)) \ | 351 ALIASES7(Reg_s12, Reg_s13, Reg_s14, Reg_s15, Reg_d6 , Reg_d7 , Reg_q3)) \ |
| 352 X(Reg_q2 , 2 , "q2", 1, 0, 0, 0, 0, 0, 0, 0, 1, \ | 352 X(Reg_q2 , 2 , "q2", 1, 0, 0, 0, 0, 0, 0, 0, 1, \ |
| 353 ALIASES7(Reg_s8 , Reg_s9 , Reg_s10, Reg_s11, Reg_d4 , Reg_d5 , Reg_q2)) \ | 353 ALIASES7(Reg_s8 , Reg_s9 , Reg_s10, Reg_s11, Reg_d4 , Reg_d5 , Reg_q2)) \ |
| 354 X(Reg_q1 , 1 , "q1", 1, 0, 0, 0, 0, 0, 0, 0, 1, \ | 354 X(Reg_q1 , 1 , "q1", 1, 0, 0, 0, 0, 0, 0, 0, 1, \ |
| 355 ALIASES7(Reg_s4 , Reg_s5 , Reg_s6 , Reg_s7 , Reg_d2 , Reg_d3 , Reg_q1)) \ | 355 ALIASES7(Reg_s4 , Reg_s5 , Reg_s6 , Reg_s7 , Reg_d2 , Reg_d3 , Reg_q1)) \ |
| 356 X(Reg_q0 , 0 , "q0", 1, 0, 0, 0, 0, 0, 0, 0, 1, \ | 356 X(Reg_q0 , 0 , "q0", 1, 0, 0, 0, 0, 0, 0, 0, 1, \ |
| 357 ALIASES7(Reg_s0 , Reg_s1 , Reg_s2 , Reg_s3 , Reg_d0 , Reg_d1 , Reg_q0)) | 357 ALIASES7(Reg_s0 , Reg_s1 , Reg_s2 , Reg_s3 , Reg_d0 , Reg_d1 , Reg_q0)) |
| 358 //#define X(val, encode, name, scratch, preserved, stackptr, frameptr, | 358 //#define X(val, encode, name, scratch, preserved, stackptr, frameptr, |
| 359 // isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init) | 359 // isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init) |
| 360 #undef ALIASES | 360 #undef ALIASES |
| 361 | 361 |
| 362 // We also provide a combined table, so that there is a namespace where all of | 362 // We also provide a combined table, so that there is a namespace where all of |
| 363 // the registers are considered and have distinct numberings. This is in | 363 // the registers are considered and have distinct numberings. This is in |
| 364 // contrast to the above, where the "encode" is based on how the register | 364 // contrast to the above, where the "encode" is based on how the register |
| 365 // numbers will be encoded in binaries and values can overlap. | 365 // numbers will be encoded in binaries and values can overlap. |
| 366 #define REGARM32_TABLE \ | 366 #define REGARM32_TABLE \ |
| 367 /* val, encode, name, scratch, preserved, stackptr, frameptr, isInt, \ | 367 /* val, encode, name, scratch, preserved, stackptr, frameptr, isInt, \ |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 X(LS, 9 , HI, "ls") /* unsigned lower or same */ \ | 438 X(LS, 9 , HI, "ls") /* unsigned lower or same */ \ |
| 439 X(GE, 10, LT, "ge") /* signed greater than or equal */ \ | 439 X(GE, 10, LT, "ge") /* signed greater than or equal */ \ |
| 440 X(LT, 11, GE, "lt") /* signed less than */ \ | 440 X(LT, 11, GE, "lt") /* signed less than */ \ |
| 441 X(GT, 12, LE, "gt") /* signed greater than */ \ | 441 X(GT, 12, LE, "gt") /* signed greater than */ \ |
| 442 X(LE, 13, GT, "le") /* signed less than or equal */ \ | 442 X(LE, 13, GT, "le") /* signed less than or equal */ \ |
| 443 X(AL, 14, kNone, "") /* always (unconditional) */ \ | 443 X(AL, 14, kNone, "") /* always (unconditional) */ \ |
| 444 X(kNone, 15, kNone, "??") /* special condition / none */ | 444 X(kNone, 15, kNone, "??") /* special condition / none */ |
| 445 //#define X(tag, encode, opp, emit) | 445 //#define X(tag, encode, opp, emit) |
| 446 | 446 |
| 447 #endif // SUBZERO_SRC_ICEINSTARM32_DEF | 447 #endif // SUBZERO_SRC_ICEINSTARM32_DEF |
| OLD | NEW |