void binary_operation(VarType type, R (*binaryFunction)(T const &, T const &)) { auto left = popVariable(); auto right = popVariable(); T leftValue, rightValue; if (type == VT_DOUBLE) { leftValue = left.getDoubleValue(); rightValue = right.getDoubleValue(); } else { leftValue = left.getIntValue(); rightValue = right.getIntValue(); } pushVariable(binaryFunction(leftValue, rightValue)); }
static void MIN(State &state, const ControlFlowInst &cf, const AluInst &alu) { binaryFunction(state, cf, alu, "min"); }