Does the given logical operation with parameters
(
stack: &mut StackTracker,
lookup_table: StackVariable,
logic_table: StackVariable,
)
| 81 | |
| 82 | /// Does the given logical operation with parameters |
| 83 | pub fn u4_logic_with_table_stack( |
| 84 | stack: &mut StackTracker, |
| 85 | lookup_table: StackVariable, |
| 86 | logic_table: StackVariable, |
| 87 | ) -> StackVariable { |
| 88 | let use_full_table = logic_table.size() > 136; |
| 89 | if !use_full_table { |
| 90 | stack.custom(u4_sort(), 0, false, 0, "sort"); |
| 91 | } |
| 92 | stack.get_value_from_table(lookup_table, None); |
| 93 | stack.op_add(); |
| 94 | stack.get_value_from_table(logic_table, None) |
| 95 | } |
| 96 | |
| 97 | /// Calculates the bitwise AND of top 2 u4 values using XOR tables |
| 98 | /// Uses the formula (a and b) = ((a + b) - a XOR b) >> 1 |