Pushes the table to calculate the order of ordered pairs (a, b) satisfying the conditions a <= b and 0 <= a, b < 16
(stack: &mut StackTracker, delta: i32)
| 59 | |
| 60 | /// Pushes the table to calculate the order of ordered pairs (a, b) satisfying the conditions a <= b and 0 <= a, b < 16 |
| 61 | pub fn u4_push_from_depth_half_lookup(stack: &mut StackTracker, delta: i32) -> StackVariable { |
| 62 | for i in (1..17).rev() { |
| 63 | let diff = ((16 - i) * (16 - i + 1)) / 2; |
| 64 | let value = -diff + delta; |
| 65 | stack.numberi(value); |
| 66 | } |
| 67 | let lookup = stack.join_count(&mut stack.get_var_from_stack(15), 15); |
| 68 | stack.rename(lookup, "lookup"); |
| 69 | lookup |
| 70 | } |
| 71 | |
| 72 | /// Pushes the table to calculate the order of ordered pairs (a, b) satisfying the conditions a <= b and 0 <= a, b < 15 |
| 73 | pub fn u4_push_half_lookup_table_0_based_stack(stack: &mut StackTracker) -> StackVariable { |