| 1 |
include "alldifferent.mzn"; |
| 2 |
include "cumulative.mzn"; |
| 3 |
%uint128_t x80 = x78 + x44; |
| 4 |
%uint64_t x81 = x80 >> 0x33; |
| 5 |
%uint64_t x82 = x80 & 0x7ffffffffffff; |
| 6 |
%uint64_t x83 = 0x13 * x81; |
| 7 |
%uint64_t x84 = x70 + x83; |
| 8 |
%uint64_t x85 = x84 >> 0x33; |
| 9 |
%uint64_t x86 = x84 & 0x7ffffffffffff; |
| 10 |
%uint64_t x87 = x85 + x73; |
| 11 |
%uint64_t x88 = x87 >> 0x33; |
| 12 |
%uint64_t x89 = x87 & 0x7ffffffffffff; |
| 13 |
%uint64_t x90 = x88 + x76; |
| 14 |
set of int: INSTRUCTIONS = 1..21; |
| 15 |
INSTRUCTIONS: x10 = 1; INSTRUCTIONS: x11 = 2; INSTRUCTIONS: x9 = 3; INSTRUCTIONS: x7 = 4; INSTRUCTIONS: x5 = 5; INSTRUCTIONS: x18 = 6; INSTRUCTIONS: x19 = 7; INSTRUCTIONS: x17 = 8; INSTRUCTIONS: x15 = 9; INSTRUCTIONS: x13 = 10; INSTRUCTIONS: x80 = 11; INSTRUCTIONS: x81 = 12; INSTRUCTIONS: x82 = 13; INSTRUCTIONS: x83 = 14; INSTRUCTIONS: x84 = 15; INSTRUCTIONS: x85 = 16; INSTRUCTIONS: x86 = 17; INSTRUCTIONS: x87 = 18; INSTRUCTIONS: x88 = 19; INSTRUCTIONS: x89 = 20; INSTRUCTIONS: x90 = 21; array[INSTRUCTIONS] of string: INSTRUCTIONS_NAMES = ["x10", "x11", "x9", "x7", "x5", "x18", "x19", "x17", "x15", "x13", "x80", "x81", "x82", "x83", "x84", "x85", "x86", "x87", "x88", "x89", "x90"]; |
| 16 |
|
| 17 |
int: MAX_LOC = 87; |
| 18 |
|
| 19 |
set of int: LOCATIONS = 1..MAX_LOC; |
| 20 |
array[INSTRUCTIONS] of var LOCATIONS: output_locations; |
| 21 |
array[INSTRUCTIONS] of var LOCATIONS: live_duration; |
| 22 |
array[INSTRUCTIONS] of int: output_register_count = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; |
| 23 |
var LOCATIONS: RET_loc; |
| 24 |
constraint cumulative(output_locations, live_duration, output_register_count, 16); |
| 25 |
|
| 26 |
|
| 27 |
constraint alldifferent(output_locations); |
| 28 |
|
| 29 |
constraint output_locations[x83] + live_duration[x83] == max([output_locations[x84]]); |
| 30 |
constraint output_locations[x81] + live_duration[x81] == max([output_locations[x83]]); |
| 31 |
constraint output_locations[x44] + live_duration[x44] == max([output_locations[x80]]); |
| 32 |
constraint output_locations[x87] + live_duration[x87] == max([output_locations[x88], output_locations[x89]]); |
| 33 |
constraint output_locations[x85] + live_duration[x85] == max([output_locations[x87]]); |
| 34 |
constraint output_locations[x78] + live_duration[x78] == max([output_locations[x80]]); |
| 35 |
constraint output_locations[x84] + live_duration[x84] == max([output_locations[x85], output_locations[x86]]); |
| 36 |
constraint output_locations[x76] + live_duration[x76] == max([output_locations[x90]]); |
| 37 |
constraint output_locations[x88] + live_duration[x88] == max([output_locations[x90]]); |
| 38 |
constraint output_locations[x73] + live_duration[x73] == max([output_locations[x87]]); |
| 39 |
constraint output_locations[x70] + live_duration[x70] == max([output_locations[x84]]); |
| 40 |
constraint output_locations[x80] + live_duration[x80] == max([output_locations[x81], output_locations[x82]]); |
| 41 |
|
| 42 |
|
| 43 |
constraint output_locations[x78] + 1 <= output_locations[x80]; |
| 44 |
constraint output_locations[x44] + 1 <= output_locations[x80]; |
| 45 |
constraint output_locations[x80] + 1 <= output_locations[x81]; |
| 46 |
constraint output_locations[x80] + 1 <= output_locations[x82]; |
| 47 |
constraint output_locations[x81] + 1 <= output_locations[x83]; |
| 48 |
constraint output_locations[x70] + 1 <= output_locations[x84]; |
| 49 |
constraint output_locations[x83] + 1 <= output_locations[x84]; |
| 50 |
constraint output_locations[x84] + 1 <= output_locations[x85]; |
| 51 |
constraint output_locations[x84] + 1 <= output_locations[x86]; |
| 52 |
constraint output_locations[x85] + 1 <= output_locations[x87]; |
| 53 |
constraint output_locations[x73] + 1 <= output_locations[x87]; |
| 54 |
constraint output_locations[x87] + 1 <= output_locations[x88]; |
| 55 |
constraint output_locations[x87] + 1 <= output_locations[x89]; |
| 56 |
constraint output_locations[x88] + 1 <= output_locations[x90]; |
| 57 |
constraint output_locations[x76] + 1 <= output_locations[x90]; |
| 58 |
|
| 59 |
constraint max([ output_locations[i] + 1 | i in INSTRUCTIONS ]) <= RET_loc; |
| 60 |
|
| 61 |
|
| 62 |
solve minimize RET_loc; |
| 63 |
|
| 64 |
output [ "(" ++ show(INSTRUCTIONS_NAMES[i]) ++ ", " ++ show(output_locations[i]) ++ ", " ++ show(live_duration[i]) ++ ") ,\n" |
| 65 |
| i in INSTRUCTIONS ]; |
| 66 |
output [ "RET_loc: " ++ show(RET_loc) ]; |