[Mesa-dev] [PATCH 08/50] glsl: Add "built-in" functions to do mul(fp64, fp64) (v2)
Dave Airlie
airlied at gmail.com
Tue Mar 13 04:24:33 UTC 2018
From: Elie Tournier <tournier.elie at gmail.com>
v2: use mix
Signed-off-by: Elie Tournier <elie.tournier at collabora.com>
---
src/compiler/glsl/builtin_float64.h | 1348 +++++++++++++++++++++++++++++++
src/compiler/glsl/builtin_functions.cpp | 4 +
src/compiler/glsl/builtin_functions.h | 3 +
src/compiler/glsl/float64.glsl | 148 ++++
src/compiler/glsl/glcpp/glcpp-parse.y | 1 +
5 files changed, 1504 insertions(+)
diff --git a/src/compiler/glsl/builtin_float64.h b/src/compiler/glsl/builtin_float64.h
index 0ebfb42..ca56d3b 100644
--- a/src/compiler/glsl/builtin_float64.h
+++ b/src/compiler/glsl/builtin_float64.h
@@ -3726,3 +3726,1351 @@ fadd64(void *mem_ctx, builtin_available_predicate avail)
sig->replace_parameters(&sig_parameters);
return sig;
}
+ir_function_signature *
+mul32To64(void *mem_ctx, builtin_available_predicate avail)
+{
+ ir_function_signature *const sig =
+ new(mem_ctx) ir_function_signature(glsl_type::void_type, avail);
+ ir_factory body(&sig->body, mem_ctx);
+ sig->is_defined = true;
+
+ exec_list sig_parameters;
+
+ ir_variable *const r05FE = new(mem_ctx) ir_variable(glsl_type::uint_type, "a", ir_var_function_in);
+ sig_parameters.push_tail(r05FE);
+ ir_variable *const r05FF = new(mem_ctx) ir_variable(glsl_type::uint_type, "b", ir_var_function_in);
+ sig_parameters.push_tail(r05FF);
+ ir_variable *const r0600 = new(mem_ctx) ir_variable(glsl_type::uint_type, "z0Ptr", ir_var_function_inout);
+ sig_parameters.push_tail(r0600);
+ ir_variable *const r0601 = new(mem_ctx) ir_variable(glsl_type::uint_type, "z1Ptr", ir_var_function_inout);
+ sig_parameters.push_tail(r0601);
+ ir_variable *const r0602 = new(mem_ctx) ir_variable(glsl_type::uint_type, "z0", ir_var_auto);
+ body.emit(r0602);
+ ir_variable *const r0603 = new(mem_ctx) ir_variable(glsl_type::uint_type, "zMiddleA", ir_var_auto);
+ body.emit(r0603);
+ ir_variable *const r0604 = new(mem_ctx) ir_variable(glsl_type::uint_type, "z1", ir_var_auto);
+ body.emit(r0604);
+ ir_variable *const r0605 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0605, bit_and(r05FE, body.constant(65535u)), 0x01));
+
+ ir_variable *const r0606 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0606, rshift(r05FE, body.constant(int(16))), 0x01));
+
+ ir_variable *const r0607 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0607, bit_and(r05FF, body.constant(65535u)), 0x01));
+
+ ir_variable *const r0608 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0608, rshift(r05FF, body.constant(int(16))), 0x01));
+
+ ir_variable *const r0609 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0609, mul(r0606, r0607), 0x01));
+
+ ir_expression *const r060A = mul(r0605, r0608);
+ body.emit(assign(r0603, add(r060A, r0609), 0x01));
+
+ ir_expression *const r060B = mul(r0606, r0608);
+ ir_expression *const r060C = less(r0603, r0609);
+ ir_expression *const r060D = expr(ir_unop_b2i, r060C);
+ ir_expression *const r060E = expr(ir_unop_i2u, r060D);
+ ir_expression *const r060F = lshift(r060E, body.constant(int(16)));
+ ir_expression *const r0610 = rshift(r0603, body.constant(int(16)));
+ ir_expression *const r0611 = add(r060F, r0610);
+ body.emit(assign(r0602, add(r060B, r0611), 0x01));
+
+ body.emit(assign(r0603, lshift(r0603, body.constant(int(16))), 0x01));
+
+ ir_expression *const r0612 = mul(r0605, r0607);
+ body.emit(assign(r0604, add(r0612, r0603), 0x01));
+
+ ir_expression *const r0613 = less(r0604, r0603);
+ ir_expression *const r0614 = expr(ir_unop_b2i, r0613);
+ ir_expression *const r0615 = expr(ir_unop_i2u, r0614);
+ body.emit(assign(r0602, add(r0602, r0615), 0x01));
+
+ body.emit(assign(r0601, r0604, 0x01));
+
+ body.emit(assign(r0600, r0602, 0x01));
+
+ sig->replace_parameters(&sig_parameters);
+ return sig;
+}
+ir_function_signature *
+mul64To128(void *mem_ctx, builtin_available_predicate avail)
+{
+ ir_function_signature *const sig =
+ new(mem_ctx) ir_function_signature(glsl_type::void_type, avail);
+ ir_factory body(&sig->body, mem_ctx);
+ sig->is_defined = true;
+
+ exec_list sig_parameters;
+
+ ir_variable *const r0616 = new(mem_ctx) ir_variable(glsl_type::uint_type, "a0", ir_var_function_in);
+ sig_parameters.push_tail(r0616);
+ ir_variable *const r0617 = new(mem_ctx) ir_variable(glsl_type::uint_type, "a1", ir_var_function_in);
+ sig_parameters.push_tail(r0617);
+ ir_variable *const r0618 = new(mem_ctx) ir_variable(glsl_type::uint_type, "b0", ir_var_function_in);
+ sig_parameters.push_tail(r0618);
+ ir_variable *const r0619 = new(mem_ctx) ir_variable(glsl_type::uint_type, "b1", ir_var_function_in);
+ sig_parameters.push_tail(r0619);
+ ir_variable *const r061A = new(mem_ctx) ir_variable(glsl_type::uint_type, "z0Ptr", ir_var_function_inout);
+ sig_parameters.push_tail(r061A);
+ ir_variable *const r061B = new(mem_ctx) ir_variable(glsl_type::uint_type, "z1Ptr", ir_var_function_inout);
+ sig_parameters.push_tail(r061B);
+ ir_variable *const r061C = new(mem_ctx) ir_variable(glsl_type::uint_type, "z2Ptr", ir_var_function_inout);
+ sig_parameters.push_tail(r061C);
+ ir_variable *const r061D = new(mem_ctx) ir_variable(glsl_type::uint_type, "z3Ptr", ir_var_function_inout);
+ sig_parameters.push_tail(r061D);
+ ir_variable *const r061E = new(mem_ctx) ir_variable(glsl_type::uint_type, "z0", ir_var_auto);
+ body.emit(r061E);
+ ir_variable *const r061F = new(mem_ctx) ir_variable(glsl_type::uint_type, "zMiddleA", ir_var_auto);
+ body.emit(r061F);
+ ir_variable *const r0620 = new(mem_ctx) ir_variable(glsl_type::uint_type, "z1", ir_var_auto);
+ body.emit(r0620);
+ ir_variable *const r0621 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0621, bit_and(r0617, body.constant(65535u)), 0x01));
+
+ ir_variable *const r0622 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0622, rshift(r0617, body.constant(int(16))), 0x01));
+
+ ir_variable *const r0623 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0623, bit_and(r0619, body.constant(65535u)), 0x01));
+
+ ir_variable *const r0624 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0624, rshift(r0619, body.constant(int(16))), 0x01));
+
+ ir_variable *const r0625 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0625, mul(r0622, r0623), 0x01));
+
+ ir_expression *const r0626 = mul(r0621, r0624);
+ body.emit(assign(r061F, add(r0626, r0625), 0x01));
+
+ ir_expression *const r0627 = mul(r0622, r0624);
+ ir_expression *const r0628 = less(r061F, r0625);
+ ir_expression *const r0629 = expr(ir_unop_b2i, r0628);
+ ir_expression *const r062A = expr(ir_unop_i2u, r0629);
+ ir_expression *const r062B = lshift(r062A, body.constant(int(16)));
+ ir_expression *const r062C = rshift(r061F, body.constant(int(16)));
+ ir_expression *const r062D = add(r062B, r062C);
+ body.emit(assign(r061E, add(r0627, r062D), 0x01));
+
+ body.emit(assign(r061F, lshift(r061F, body.constant(int(16))), 0x01));
+
+ ir_expression *const r062E = mul(r0621, r0623);
+ body.emit(assign(r0620, add(r062E, r061F), 0x01));
+
+ ir_expression *const r062F = less(r0620, r061F);
+ ir_expression *const r0630 = expr(ir_unop_b2i, r062F);
+ ir_expression *const r0631 = expr(ir_unop_i2u, r0630);
+ body.emit(assign(r061E, add(r061E, r0631), 0x01));
+
+ ir_variable *const r0632 = new(mem_ctx) ir_variable(glsl_type::uint_type, "z0", ir_var_auto);
+ body.emit(r0632);
+ ir_variable *const r0633 = new(mem_ctx) ir_variable(glsl_type::uint_type, "zMiddleA", ir_var_auto);
+ body.emit(r0633);
+ ir_variable *const r0634 = new(mem_ctx) ir_variable(glsl_type::uint_type, "z1", ir_var_auto);
+ body.emit(r0634);
+ ir_variable *const r0635 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0635, bit_and(r0617, body.constant(65535u)), 0x01));
+
+ ir_variable *const r0636 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0636, rshift(r0617, body.constant(int(16))), 0x01));
+
+ ir_variable *const r0637 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0637, bit_and(r0618, body.constant(65535u)), 0x01));
+
+ ir_variable *const r0638 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0638, rshift(r0618, body.constant(int(16))), 0x01));
+
+ ir_variable *const r0639 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0639, mul(r0636, r0637), 0x01));
+
+ ir_expression *const r063A = mul(r0635, r0638);
+ body.emit(assign(r0633, add(r063A, r0639), 0x01));
+
+ ir_expression *const r063B = mul(r0636, r0638);
+ ir_expression *const r063C = less(r0633, r0639);
+ ir_expression *const r063D = expr(ir_unop_b2i, r063C);
+ ir_expression *const r063E = expr(ir_unop_i2u, r063D);
+ ir_expression *const r063F = lshift(r063E, body.constant(int(16)));
+ ir_expression *const r0640 = rshift(r0633, body.constant(int(16)));
+ ir_expression *const r0641 = add(r063F, r0640);
+ body.emit(assign(r0632, add(r063B, r0641), 0x01));
+
+ body.emit(assign(r0633, lshift(r0633, body.constant(int(16))), 0x01));
+
+ ir_expression *const r0642 = mul(r0635, r0637);
+ body.emit(assign(r0634, add(r0642, r0633), 0x01));
+
+ ir_expression *const r0643 = less(r0634, r0633);
+ ir_expression *const r0644 = expr(ir_unop_b2i, r0643);
+ ir_expression *const r0645 = expr(ir_unop_i2u, r0644);
+ body.emit(assign(r0632, add(r0632, r0645), 0x01));
+
+ ir_variable *const r0646 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0646, add(r0634, r061E), 0x01));
+
+ ir_variable *const r0647 = new(mem_ctx) ir_variable(glsl_type::uint_type, "z0", ir_var_auto);
+ body.emit(r0647);
+ ir_variable *const r0648 = new(mem_ctx) ir_variable(glsl_type::uint_type, "zMiddleA", ir_var_auto);
+ body.emit(r0648);
+ ir_variable *const r0649 = new(mem_ctx) ir_variable(glsl_type::uint_type, "z1", ir_var_auto);
+ body.emit(r0649);
+ ir_variable *const r064A = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r064A, bit_and(r0616, body.constant(65535u)), 0x01));
+
+ ir_variable *const r064B = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r064B, rshift(r0616, body.constant(int(16))), 0x01));
+
+ ir_variable *const r064C = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r064C, bit_and(r0618, body.constant(65535u)), 0x01));
+
+ ir_variable *const r064D = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r064D, rshift(r0618, body.constant(int(16))), 0x01));
+
+ ir_variable *const r064E = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r064E, mul(r064B, r064C), 0x01));
+
+ ir_expression *const r064F = mul(r064A, r064D);
+ body.emit(assign(r0648, add(r064F, r064E), 0x01));
+
+ ir_expression *const r0650 = mul(r064B, r064D);
+ ir_expression *const r0651 = less(r0648, r064E);
+ ir_expression *const r0652 = expr(ir_unop_b2i, r0651);
+ ir_expression *const r0653 = expr(ir_unop_i2u, r0652);
+ ir_expression *const r0654 = lshift(r0653, body.constant(int(16)));
+ ir_expression *const r0655 = rshift(r0648, body.constant(int(16)));
+ ir_expression *const r0656 = add(r0654, r0655);
+ body.emit(assign(r0647, add(r0650, r0656), 0x01));
+
+ body.emit(assign(r0648, lshift(r0648, body.constant(int(16))), 0x01));
+
+ ir_expression *const r0657 = mul(r064A, r064C);
+ body.emit(assign(r0649, add(r0657, r0648), 0x01));
+
+ ir_expression *const r0658 = less(r0649, r0648);
+ ir_expression *const r0659 = expr(ir_unop_b2i, r0658);
+ ir_expression *const r065A = expr(ir_unop_i2u, r0659);
+ body.emit(assign(r0647, add(r0647, r065A), 0x01));
+
+ ir_variable *const r065B = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ ir_expression *const r065C = less(r0646, r0634);
+ ir_expression *const r065D = expr(ir_unop_b2i, r065C);
+ ir_expression *const r065E = expr(ir_unop_i2u, r065D);
+ ir_expression *const r065F = add(r0632, r065E);
+ body.emit(assign(r065B, add(r0649, r065F), 0x01));
+
+ ir_variable *const r0660 = new(mem_ctx) ir_variable(glsl_type::uint_type, "z0", ir_var_auto);
+ body.emit(r0660);
+ ir_variable *const r0661 = new(mem_ctx) ir_variable(glsl_type::uint_type, "zMiddleA", ir_var_auto);
+ body.emit(r0661);
+ ir_variable *const r0662 = new(mem_ctx) ir_variable(glsl_type::uint_type, "z1", ir_var_auto);
+ body.emit(r0662);
+ ir_variable *const r0663 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0663, bit_and(r0616, body.constant(65535u)), 0x01));
+
+ ir_variable *const r0664 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0664, rshift(r0616, body.constant(int(16))), 0x01));
+
+ ir_variable *const r0665 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0665, bit_and(r0619, body.constant(65535u)), 0x01));
+
+ ir_variable *const r0666 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0666, rshift(r0619, body.constant(int(16))), 0x01));
+
+ ir_variable *const r0667 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0667, mul(r0664, r0665), 0x01));
+
+ ir_expression *const r0668 = mul(r0663, r0666);
+ body.emit(assign(r0661, add(r0668, r0667), 0x01));
+
+ ir_expression *const r0669 = mul(r0664, r0666);
+ ir_expression *const r066A = less(r0661, r0667);
+ ir_expression *const r066B = expr(ir_unop_b2i, r066A);
+ ir_expression *const r066C = expr(ir_unop_i2u, r066B);
+ ir_expression *const r066D = lshift(r066C, body.constant(int(16)));
+ ir_expression *const r066E = rshift(r0661, body.constant(int(16)));
+ ir_expression *const r066F = add(r066D, r066E);
+ body.emit(assign(r0660, add(r0669, r066F), 0x01));
+
+ body.emit(assign(r0661, lshift(r0661, body.constant(int(16))), 0x01));
+
+ ir_expression *const r0670 = mul(r0663, r0665);
+ body.emit(assign(r0662, add(r0670, r0661), 0x01));
+
+ ir_expression *const r0671 = less(r0662, r0661);
+ ir_expression *const r0672 = expr(ir_unop_b2i, r0671);
+ ir_expression *const r0673 = expr(ir_unop_i2u, r0672);
+ body.emit(assign(r0660, add(r0660, r0673), 0x01));
+
+ ir_variable *const r0674 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0674, add(r0662, r0646), 0x01));
+
+ ir_variable *const r0675 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ ir_expression *const r0676 = less(r0674, r0662);
+ ir_expression *const r0677 = expr(ir_unop_b2i, r0676);
+ ir_expression *const r0678 = expr(ir_unop_i2u, r0677);
+ ir_expression *const r0679 = add(r0660, r0678);
+ body.emit(assign(r0675, add(r065B, r0679), 0x01));
+
+ body.emit(assign(r061D, r0620, 0x01));
+
+ body.emit(assign(r061C, r0674, 0x01));
+
+ body.emit(assign(r061B, r0675, 0x01));
+
+ ir_expression *const r067A = less(r065B, r0649);
+ ir_expression *const r067B = expr(ir_unop_b2i, r067A);
+ ir_expression *const r067C = expr(ir_unop_i2u, r067B);
+ ir_expression *const r067D = add(r0647, r067C);
+ ir_expression *const r067E = less(r0675, r065B);
+ ir_expression *const r067F = expr(ir_unop_b2i, r067E);
+ ir_expression *const r0680 = expr(ir_unop_i2u, r067F);
+ body.emit(assign(r061A, add(r067D, r0680), 0x01));
+
+ sig->replace_parameters(&sig_parameters);
+ return sig;
+}
+ir_function_signature *
+normalizeFloat64Subnormal(void *mem_ctx, builtin_available_predicate avail)
+{
+ ir_function_signature *const sig =
+ new(mem_ctx) ir_function_signature(glsl_type::void_type, avail);
+ ir_factory body(&sig->body, mem_ctx);
+ sig->is_defined = true;
+
+ exec_list sig_parameters;
+
+ ir_variable *const r0681 = new(mem_ctx) ir_variable(glsl_type::uint_type, "aFrac0", ir_var_function_in);
+ sig_parameters.push_tail(r0681);
+ ir_variable *const r0682 = new(mem_ctx) ir_variable(glsl_type::uint_type, "aFrac1", ir_var_function_in);
+ sig_parameters.push_tail(r0682);
+ ir_variable *const r0683 = new(mem_ctx) ir_variable(glsl_type::int_type, "zExpPtr", ir_var_function_inout);
+ sig_parameters.push_tail(r0683);
+ ir_variable *const r0684 = new(mem_ctx) ir_variable(glsl_type::uint_type, "zFrac0Ptr", ir_var_function_inout);
+ sig_parameters.push_tail(r0684);
+ ir_variable *const r0685 = new(mem_ctx) ir_variable(glsl_type::uint_type, "zFrac1Ptr", ir_var_function_inout);
+ sig_parameters.push_tail(r0685);
+ ir_variable *const r0686 = new(mem_ctx) ir_variable(glsl_type::int_type, "shiftCount", ir_var_auto);
+ body.emit(r0686);
+ ir_variable *const r0687 = body.make_temp(glsl_type::uint_type, "a");
+ ir_expression *const r0688 = equal(r0681, body.constant(0u));
+ body.emit(assign(r0687, expr(ir_triop_csel, r0688, r0682, r0681), 0x01));
+
+ ir_expression *const r0689 = equal(r0687, body.constant(0u));
+ ir_expression *const r068A = expr(ir_unop_find_msb, r0687);
+ ir_expression *const r068B = sub(body.constant(int(31)), r068A);
+ ir_expression *const r068C = expr(ir_triop_csel, r0689, body.constant(int(32)), r068B);
+ body.emit(assign(r0686, add(r068C, body.constant(int(-11))), 0x01));
+
+ ir_expression *const r068D = equal(r0681, body.constant(0u));
+ ir_expression *const r068E = sub(body.constant(int(-31)), r0686);
+ ir_expression *const r068F = sub(body.constant(int(1)), r0686);
+ body.emit(assign(r0683, expr(ir_triop_csel, r068D, r068E, r068F), 0x01));
+
+ ir_expression *const r0690 = equal(r0681, body.constant(0u));
+ ir_expression *const r0691 = less(r0686, body.constant(int(0)));
+ ir_expression *const r0692 = neg(r0686);
+ ir_expression *const r0693 = rshift(r0682, r0692);
+ ir_expression *const r0694 = lshift(r0682, r0686);
+ ir_expression *const r0695 = expr(ir_triop_csel, r0691, r0693, r0694);
+ ir_expression *const r0696 = equal(r0686, body.constant(int(0)));
+ ir_expression *const r0697 = lshift(r0681, r0686);
+ ir_expression *const r0698 = neg(r0686);
+ ir_expression *const r0699 = bit_and(r0698, body.constant(int(31)));
+ ir_expression *const r069A = rshift(r0682, r0699);
+ ir_expression *const r069B = bit_or(r0697, r069A);
+ ir_expression *const r069C = expr(ir_triop_csel, r0696, r0681, r069B);
+ body.emit(assign(r0684, expr(ir_triop_csel, r0690, r0695, r069C), 0x01));
+
+ ir_expression *const r069D = equal(r0681, body.constant(0u));
+ ir_expression *const r069E = less(r0686, body.constant(int(0)));
+ ir_expression *const r069F = bit_and(r0686, body.constant(int(31)));
+ ir_expression *const r06A0 = lshift(r0682, r069F);
+ ir_expression *const r06A1 = expr(ir_triop_csel, r069E, r06A0, body.constant(0u));
+ ir_expression *const r06A2 = lshift(r0682, r0686);
+ body.emit(assign(r0685, expr(ir_triop_csel, r069D, r06A1, r06A2), 0x01));
+
+ sig->replace_parameters(&sig_parameters);
+ return sig;
+}
+ir_function_signature *
+fmul64(void *mem_ctx, builtin_available_predicate avail)
+{
+ ir_function_signature *const sig =
+ new(mem_ctx) ir_function_signature(glsl_type::uvec2_type, avail);
+ ir_factory body(&sig->body, mem_ctx);
+ sig->is_defined = true;
+
+ exec_list sig_parameters;
+
+ ir_variable *const r06A3 = new(mem_ctx) ir_variable(glsl_type::uvec2_type, "a", ir_var_function_in);
+ sig_parameters.push_tail(r06A3);
+ ir_variable *const r06A4 = new(mem_ctx) ir_variable(glsl_type::uvec2_type, "b", ir_var_function_in);
+ sig_parameters.push_tail(r06A4);
+ ir_variable *const r06A5 = body.make_temp(glsl_type::bool_type, "execute_flag");
+ body.emit(assign(r06A5, body.constant(true), 0x01));
+
+ ir_variable *const r06A6 = body.make_temp(glsl_type::uvec2_type, "return_value");
+ ir_variable *const r06A7 = new(mem_ctx) ir_variable(glsl_type::uint_type, "zSign", ir_var_auto);
+ body.emit(r06A7);
+ ir_variable *const r06A8 = new(mem_ctx) ir_variable(glsl_type::int_type, "bExp", ir_var_auto);
+ body.emit(r06A8);
+ ir_variable *const r06A9 = new(mem_ctx) ir_variable(glsl_type::int_type, "aExp", ir_var_auto);
+ body.emit(r06A9);
+ ir_variable *const r06AA = new(mem_ctx) ir_variable(glsl_type::uint_type, "bFracHi", ir_var_auto);
+ body.emit(r06AA);
+ ir_variable *const r06AB = new(mem_ctx) ir_variable(glsl_type::uint_type, "bFracLo", ir_var_auto);
+ body.emit(r06AB);
+ ir_variable *const r06AC = new(mem_ctx) ir_variable(glsl_type::uint_type, "aFracHi", ir_var_auto);
+ body.emit(r06AC);
+ ir_variable *const r06AD = new(mem_ctx) ir_variable(glsl_type::uint_type, "aFracLo", ir_var_auto);
+ body.emit(r06AD);
+ ir_variable *const r06AE = new(mem_ctx) ir_variable(glsl_type::int_type, "zExp", ir_var_auto);
+ body.emit(r06AE);
+ ir_variable *const r06AF = new(mem_ctx) ir_variable(glsl_type::uint_type, "zFrac2", ir_var_auto);
+ body.emit(r06AF);
+ ir_variable *const r06B0 = new(mem_ctx) ir_variable(glsl_type::uint_type, "zFrac1", ir_var_auto);
+ body.emit(r06B0);
+ ir_variable *const r06B1 = new(mem_ctx) ir_variable(glsl_type::uint_type, "zFrac0", ir_var_auto);
+ body.emit(r06B1);
+ body.emit(assign(r06B1, body.constant(0u), 0x01));
+
+ body.emit(assign(r06B0, body.constant(0u), 0x01));
+
+ body.emit(assign(r06AF, body.constant(0u), 0x01));
+
+ body.emit(assign(r06AD, swizzle_x(r06A3), 0x01));
+
+ ir_variable *const r06B2 = body.make_temp(glsl_type::uint_type, "extractFloat64FracHi_retval");
+ body.emit(assign(r06B2, bit_and(swizzle_y(r06A3), body.constant(1048575u)), 0x01));
+
+ body.emit(assign(r06AC, r06B2, 0x01));
+
+ body.emit(assign(r06AB, swizzle_x(r06A4), 0x01));
+
+ ir_variable *const r06B3 = body.make_temp(glsl_type::uint_type, "extractFloat64FracHi_retval");
+ body.emit(assign(r06B3, bit_and(swizzle_y(r06A4), body.constant(1048575u)), 0x01));
+
+ body.emit(assign(r06AA, r06B3, 0x01));
+
+ ir_variable *const r06B4 = body.make_temp(glsl_type::int_type, "extractFloat64Exp_retval");
+ ir_expression *const r06B5 = rshift(swizzle_y(r06A3), body.constant(int(20)));
+ ir_expression *const r06B6 = bit_and(r06B5, body.constant(2047u));
+ body.emit(assign(r06B4, expr(ir_unop_u2i, r06B6), 0x01));
+
+ body.emit(assign(r06A9, r06B4, 0x01));
+
+ ir_variable *const r06B7 = body.make_temp(glsl_type::int_type, "extractFloat64Exp_retval");
+ ir_expression *const r06B8 = rshift(swizzle_y(r06A4), body.constant(int(20)));
+ ir_expression *const r06B9 = bit_and(r06B8, body.constant(2047u));
+ body.emit(assign(r06B7, expr(ir_unop_u2i, r06B9), 0x01));
+
+ body.emit(assign(r06A8, r06B7, 0x01));
+
+ ir_expression *const r06BA = rshift(swizzle_y(r06A3), body.constant(int(31)));
+ ir_expression *const r06BB = rshift(swizzle_y(r06A4), body.constant(int(31)));
+ body.emit(assign(r06A7, bit_xor(r06BA, r06BB), 0x01));
+
+ /* IF CONDITION */
+ ir_expression *const r06BD = equal(r06B4, body.constant(int(2047)));
+ ir_if *f06BC = new(mem_ctx) ir_if(operand(r06BD).val);
+ exec_list *const f06BC_parent_instructions = body.instructions;
+
+ /* THEN INSTRUCTIONS */
+ body.instructions = &f06BC->then_instructions;
+
+ /* IF CONDITION */
+ ir_expression *const r06BF = bit_or(r06B2, swizzle_x(r06A3));
+ ir_expression *const r06C0 = nequal(r06BF, body.constant(0u));
+ ir_expression *const r06C1 = equal(r06B7, body.constant(int(2047)));
+ ir_expression *const r06C2 = bit_or(r06B3, swizzle_x(r06A4));
+ ir_expression *const r06C3 = nequal(r06C2, body.constant(0u));
+ ir_expression *const r06C4 = logic_and(r06C1, r06C3);
+ ir_expression *const r06C5 = logic_or(r06C0, r06C4);
+ ir_if *f06BE = new(mem_ctx) ir_if(operand(r06C5).val);
+ exec_list *const f06BE_parent_instructions = body.instructions;
+
+ /* THEN INSTRUCTIONS */
+ body.instructions = &f06BE->then_instructions;
+
+ ir_variable *const r06C6 = body.make_temp(glsl_type::uvec2_type, "a");
+ body.emit(assign(r06C6, swizzle_x(r06A3), 0x01));
+
+ ir_variable *const r06C7 = body.make_temp(glsl_type::uvec2_type, "b");
+ body.emit(assign(r06C7, swizzle_x(r06A4), 0x01));
+
+ body.emit(assign(r06C6, bit_or(swizzle_y(r06A3), body.constant(524288u)), 0x02));
+
+ body.emit(assign(r06C7, bit_or(swizzle_y(r06A4), body.constant(524288u)), 0x02));
+
+ ir_expression *const r06C8 = lshift(swizzle_y(r06A3), body.constant(int(1)));
+ ir_expression *const r06C9 = gequal(r06C8, body.constant(4292870144u));
+ ir_expression *const r06CA = nequal(swizzle_x(r06A3), body.constant(0u));
+ ir_expression *const r06CB = bit_and(swizzle_y(r06A3), body.constant(1048575u));
+ ir_expression *const r06CC = nequal(r06CB, body.constant(0u));
+ ir_expression *const r06CD = logic_or(r06CA, r06CC);
+ ir_expression *const r06CE = logic_and(r06C9, r06CD);
+ ir_swizzle *const r06CF = swizzle(r06CE, MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X), 2);
+ ir_expression *const r06D0 = lshift(swizzle_y(r06A4), body.constant(int(1)));
+ ir_expression *const r06D1 = gequal(r06D0, body.constant(4292870144u));
+ ir_expression *const r06D2 = nequal(swizzle_x(r06A4), body.constant(0u));
+ ir_expression *const r06D3 = bit_and(swizzle_y(r06A4), body.constant(1048575u));
+ ir_expression *const r06D4 = nequal(r06D3, body.constant(0u));
+ ir_expression *const r06D5 = logic_or(r06D2, r06D4);
+ ir_expression *const r06D6 = logic_and(r06D1, r06D5);
+ ir_swizzle *const r06D7 = swizzle(r06D6, MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X), 2);
+ ir_expression *const r06D8 = expr(ir_triop_csel, r06D7, r06C7, r06C6);
+ body.emit(assign(r06A6, expr(ir_triop_csel, r06CF, r06D8, r06C7), 0x03));
+
+ body.emit(assign(r06A5, body.constant(false), 0x01));
+
+
+ /* ELSE INSTRUCTIONS */
+ body.instructions = &f06BE->else_instructions;
+
+ /* IF CONDITION */
+ ir_expression *const r06DA = expr(ir_unop_i2u, r06B7);
+ ir_expression *const r06DB = bit_or(r06DA, r06B3);
+ ir_expression *const r06DC = bit_or(r06DB, swizzle_x(r06A4));
+ ir_expression *const r06DD = equal(r06DC, body.constant(0u));
+ ir_if *f06D9 = new(mem_ctx) ir_if(operand(r06DD).val);
+ exec_list *const f06D9_parent_instructions = body.instructions;
+
+ /* THEN INSTRUCTIONS */
+ body.instructions = &f06D9->then_instructions;
+
+ ir_constant_data r06DE_data;
+ memset(&r06DE_data, 0, sizeof(ir_constant_data));
+ r06DE_data.u[0] = 4294967295;
+ r06DE_data.u[1] = 4294967295;
+ ir_constant *const r06DE = new(mem_ctx) ir_constant(glsl_type::uvec2_type, &r06DE_data);
+ body.emit(assign(r06A6, r06DE, 0x03));
+
+ body.emit(assign(r06A5, body.constant(false), 0x01));
+
+
+ /* ELSE INSTRUCTIONS */
+ body.instructions = &f06D9->else_instructions;
+
+ ir_variable *const r06DF = new(mem_ctx) ir_variable(glsl_type::uvec2_type, "z", ir_var_auto);
+ body.emit(r06DF);
+ ir_expression *const r06E0 = lshift(r06A7, body.constant(int(31)));
+ body.emit(assign(r06DF, add(r06E0, body.constant(2146435072u)), 0x02));
+
+ body.emit(assign(r06DF, body.constant(0u), 0x01));
+
+ body.emit(assign(r06A6, r06DF, 0x03));
+
+ body.emit(assign(r06A5, body.constant(false), 0x01));
+
+
+ body.instructions = f06D9_parent_instructions;
+ body.emit(f06D9);
+
+ /* END IF */
+
+
+ body.instructions = f06BE_parent_instructions;
+ body.emit(f06BE);
+
+ /* END IF */
+
+
+ /* ELSE INSTRUCTIONS */
+ body.instructions = &f06BC->else_instructions;
+
+ /* IF CONDITION */
+ ir_expression *const r06E2 = equal(r06B7, body.constant(int(2047)));
+ ir_if *f06E1 = new(mem_ctx) ir_if(operand(r06E2).val);
+ exec_list *const f06E1_parent_instructions = body.instructions;
+
+ /* THEN INSTRUCTIONS */
+ body.instructions = &f06E1->then_instructions;
+
+ /* IF CONDITION */
+ ir_expression *const r06E4 = bit_or(r06B3, swizzle_x(r06A4));
+ ir_expression *const r06E5 = nequal(r06E4, body.constant(0u));
+ ir_if *f06E3 = new(mem_ctx) ir_if(operand(r06E5).val);
+ exec_list *const f06E3_parent_instructions = body.instructions;
+
+ /* THEN INSTRUCTIONS */
+ body.instructions = &f06E3->then_instructions;
+
+ ir_variable *const r06E6 = body.make_temp(glsl_type::uvec2_type, "a");
+ body.emit(assign(r06E6, swizzle_x(r06A3), 0x01));
+
+ ir_variable *const r06E7 = body.make_temp(glsl_type::uvec2_type, "b");
+ body.emit(assign(r06E7, swizzle_x(r06A4), 0x01));
+
+ body.emit(assign(r06E6, bit_or(swizzle_y(r06A3), body.constant(524288u)), 0x02));
+
+ body.emit(assign(r06E7, bit_or(swizzle_y(r06A4), body.constant(524288u)), 0x02));
+
+ ir_expression *const r06E8 = lshift(swizzle_y(r06A3), body.constant(int(1)));
+ ir_expression *const r06E9 = gequal(r06E8, body.constant(4292870144u));
+ ir_expression *const r06EA = nequal(swizzle_x(r06A3), body.constant(0u));
+ ir_expression *const r06EB = bit_and(swizzle_y(r06A3), body.constant(1048575u));
+ ir_expression *const r06EC = nequal(r06EB, body.constant(0u));
+ ir_expression *const r06ED = logic_or(r06EA, r06EC);
+ ir_expression *const r06EE = logic_and(r06E9, r06ED);
+ ir_swizzle *const r06EF = swizzle(r06EE, MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X), 2);
+ ir_expression *const r06F0 = lshift(swizzle_y(r06A4), body.constant(int(1)));
+ ir_expression *const r06F1 = gequal(r06F0, body.constant(4292870144u));
+ ir_expression *const r06F2 = nequal(swizzle_x(r06A4), body.constant(0u));
+ ir_expression *const r06F3 = bit_and(swizzle_y(r06A4), body.constant(1048575u));
+ ir_expression *const r06F4 = nequal(r06F3, body.constant(0u));
+ ir_expression *const r06F5 = logic_or(r06F2, r06F4);
+ ir_expression *const r06F6 = logic_and(r06F1, r06F5);
+ ir_swizzle *const r06F7 = swizzle(r06F6, MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X), 2);
+ ir_expression *const r06F8 = expr(ir_triop_csel, r06F7, r06E7, r06E6);
+ body.emit(assign(r06A6, expr(ir_triop_csel, r06EF, r06F8, r06E7), 0x03));
+
+ body.emit(assign(r06A5, body.constant(false), 0x01));
+
+
+ /* ELSE INSTRUCTIONS */
+ body.instructions = &f06E3->else_instructions;
+
+ /* IF CONDITION */
+ ir_expression *const r06FA = expr(ir_unop_i2u, r06B4);
+ ir_expression *const r06FB = bit_or(r06FA, r06B2);
+ ir_expression *const r06FC = bit_or(r06FB, swizzle_x(r06A3));
+ ir_expression *const r06FD = equal(r06FC, body.constant(0u));
+ ir_if *f06F9 = new(mem_ctx) ir_if(operand(r06FD).val);
+ exec_list *const f06F9_parent_instructions = body.instructions;
+
+ /* THEN INSTRUCTIONS */
+ body.instructions = &f06F9->then_instructions;
+
+ ir_constant_data r06FE_data;
+ memset(&r06FE_data, 0, sizeof(ir_constant_data));
+ r06FE_data.u[0] = 4294967295;
+ r06FE_data.u[1] = 4294967295;
+ ir_constant *const r06FE = new(mem_ctx) ir_constant(glsl_type::uvec2_type, &r06FE_data);
+ body.emit(assign(r06A6, r06FE, 0x03));
+
+ body.emit(assign(r06A5, body.constant(false), 0x01));
+
+
+ /* ELSE INSTRUCTIONS */
+ body.instructions = &f06F9->else_instructions;
+
+ ir_variable *const r06FF = new(mem_ctx) ir_variable(glsl_type::uvec2_type, "z", ir_var_auto);
+ body.emit(r06FF);
+ ir_expression *const r0700 = lshift(r06A7, body.constant(int(31)));
+ body.emit(assign(r06FF, add(r0700, body.constant(2146435072u)), 0x02));
+
+ body.emit(assign(r06FF, body.constant(0u), 0x01));
+
+ body.emit(assign(r06A6, r06FF, 0x03));
+
+ body.emit(assign(r06A5, body.constant(false), 0x01));
+
+
+ body.instructions = f06F9_parent_instructions;
+ body.emit(f06F9);
+
+ /* END IF */
+
+
+ body.instructions = f06E3_parent_instructions;
+ body.emit(f06E3);
+
+ /* END IF */
+
+
+ /* ELSE INSTRUCTIONS */
+ body.instructions = &f06E1->else_instructions;
+
+ /* IF CONDITION */
+ ir_expression *const r0702 = equal(r06B4, body.constant(int(0)));
+ ir_if *f0701 = new(mem_ctx) ir_if(operand(r0702).val);
+ exec_list *const f0701_parent_instructions = body.instructions;
+
+ /* THEN INSTRUCTIONS */
+ body.instructions = &f0701->then_instructions;
+
+ /* IF CONDITION */
+ ir_expression *const r0704 = bit_or(r06B2, swizzle_x(r06A3));
+ ir_expression *const r0705 = equal(r0704, body.constant(0u));
+ ir_if *f0703 = new(mem_ctx) ir_if(operand(r0705).val);
+ exec_list *const f0703_parent_instructions = body.instructions;
+
+ /* THEN INSTRUCTIONS */
+ body.instructions = &f0703->then_instructions;
+
+ ir_variable *const r0706 = new(mem_ctx) ir_variable(glsl_type::uvec2_type, "z", ir_var_auto);
+ body.emit(r0706);
+ body.emit(assign(r0706, lshift(r06A7, body.constant(int(31))), 0x02));
+
+ body.emit(assign(r0706, body.constant(0u), 0x01));
+
+ body.emit(assign(r06A6, r0706, 0x03));
+
+ body.emit(assign(r06A5, body.constant(false), 0x01));
+
+
+ /* ELSE INSTRUCTIONS */
+ body.instructions = &f0703->else_instructions;
+
+ ir_variable *const r0707 = new(mem_ctx) ir_variable(glsl_type::int_type, "shiftCount", ir_var_auto);
+ body.emit(r0707);
+ ir_variable *const r0708 = body.make_temp(glsl_type::uint_type, "a");
+ ir_expression *const r0709 = equal(r06B2, body.constant(0u));
+ body.emit(assign(r0708, expr(ir_triop_csel, r0709, swizzle_x(r06A3), r06B2), 0x01));
+
+ ir_expression *const r070A = equal(r0708, body.constant(0u));
+ ir_expression *const r070B = expr(ir_unop_find_msb, r0708);
+ ir_expression *const r070C = sub(body.constant(int(31)), r070B);
+ ir_expression *const r070D = expr(ir_triop_csel, r070A, body.constant(int(32)), r070C);
+ body.emit(assign(r0707, add(r070D, body.constant(int(-11))), 0x01));
+
+ ir_expression *const r070E = equal(r06B2, body.constant(0u));
+ ir_expression *const r070F = sub(body.constant(int(-31)), r0707);
+ ir_expression *const r0710 = sub(body.constant(int(1)), r0707);
+ body.emit(assign(r06A9, expr(ir_triop_csel, r070E, r070F, r0710), 0x01));
+
+ ir_expression *const r0711 = equal(r06B2, body.constant(0u));
+ ir_expression *const r0712 = less(r0707, body.constant(int(0)));
+ ir_expression *const r0713 = neg(r0707);
+ ir_expression *const r0714 = rshift(swizzle_x(r06A3), r0713);
+ ir_expression *const r0715 = lshift(swizzle_x(r06A3), r0707);
+ ir_expression *const r0716 = expr(ir_triop_csel, r0712, r0714, r0715);
+ ir_expression *const r0717 = equal(r0707, body.constant(int(0)));
+ ir_expression *const r0718 = lshift(r06B2, r0707);
+ ir_expression *const r0719 = neg(r0707);
+ ir_expression *const r071A = bit_and(r0719, body.constant(int(31)));
+ ir_expression *const r071B = rshift(swizzle_x(r06A3), r071A);
+ ir_expression *const r071C = bit_or(r0718, r071B);
+ ir_expression *const r071D = expr(ir_triop_csel, r0717, r06B2, r071C);
+ body.emit(assign(r06AC, expr(ir_triop_csel, r0711, r0716, r071D), 0x01));
+
+ ir_expression *const r071E = equal(r06B2, body.constant(0u));
+ ir_expression *const r071F = less(r0707, body.constant(int(0)));
+ ir_expression *const r0720 = bit_and(r0707, body.constant(int(31)));
+ ir_expression *const r0721 = lshift(swizzle_x(r06A3), r0720);
+ ir_expression *const r0722 = expr(ir_triop_csel, r071F, r0721, body.constant(0u));
+ ir_expression *const r0723 = lshift(swizzle_x(r06A3), r0707);
+ body.emit(assign(r06AD, expr(ir_triop_csel, r071E, r0722, r0723), 0x01));
+
+
+ body.instructions = f0703_parent_instructions;
+ body.emit(f0703);
+
+ /* END IF */
+
+
+ body.instructions = f0701_parent_instructions;
+ body.emit(f0701);
+
+ /* END IF */
+
+ /* IF CONDITION */
+ ir_if *f0724 = new(mem_ctx) ir_if(operand(r06A5).val);
+ exec_list *const f0724_parent_instructions = body.instructions;
+
+ /* THEN INSTRUCTIONS */
+ body.instructions = &f0724->then_instructions;
+
+ /* IF CONDITION */
+ ir_expression *const r0726 = equal(r06B7, body.constant(int(0)));
+ ir_if *f0725 = new(mem_ctx) ir_if(operand(r0726).val);
+ exec_list *const f0725_parent_instructions = body.instructions;
+
+ /* THEN INSTRUCTIONS */
+ body.instructions = &f0725->then_instructions;
+
+ /* IF CONDITION */
+ ir_expression *const r0728 = bit_or(r06B3, swizzle_x(r06A4));
+ ir_expression *const r0729 = equal(r0728, body.constant(0u));
+ ir_if *f0727 = new(mem_ctx) ir_if(operand(r0729).val);
+ exec_list *const f0727_parent_instructions = body.instructions;
+
+ /* THEN INSTRUCTIONS */
+ body.instructions = &f0727->then_instructions;
+
+ ir_variable *const r072A = new(mem_ctx) ir_variable(glsl_type::uvec2_type, "z", ir_var_auto);
+ body.emit(r072A);
+ body.emit(assign(r072A, lshift(r06A7, body.constant(int(31))), 0x02));
+
+ body.emit(assign(r072A, body.constant(0u), 0x01));
+
+ body.emit(assign(r06A6, r072A, 0x03));
+
+ body.emit(assign(r06A5, body.constant(false), 0x01));
+
+
+ /* ELSE INSTRUCTIONS */
+ body.instructions = &f0727->else_instructions;
+
+ ir_variable *const r072B = new(mem_ctx) ir_variable(glsl_type::int_type, "shiftCount", ir_var_auto);
+ body.emit(r072B);
+ ir_variable *const r072C = body.make_temp(glsl_type::uint_type, "a");
+ ir_expression *const r072D = equal(r06B3, body.constant(0u));
+ body.emit(assign(r072C, expr(ir_triop_csel, r072D, swizzle_x(r06A4), r06B3), 0x01));
+
+ ir_expression *const r072E = equal(r072C, body.constant(0u));
+ ir_expression *const r072F = expr(ir_unop_find_msb, r072C);
+ ir_expression *const r0730 = sub(body.constant(int(31)), r072F);
+ ir_expression *const r0731 = expr(ir_triop_csel, r072E, body.constant(int(32)), r0730);
+ body.emit(assign(r072B, add(r0731, body.constant(int(-11))), 0x01));
+
+ ir_expression *const r0732 = equal(r06B3, body.constant(0u));
+ ir_expression *const r0733 = sub(body.constant(int(-31)), r072B);
+ ir_expression *const r0734 = sub(body.constant(int(1)), r072B);
+ body.emit(assign(r06A8, expr(ir_triop_csel, r0732, r0733, r0734), 0x01));
+
+ ir_expression *const r0735 = equal(r06B3, body.constant(0u));
+ ir_expression *const r0736 = less(r072B, body.constant(int(0)));
+ ir_expression *const r0737 = neg(r072B);
+ ir_expression *const r0738 = rshift(swizzle_x(r06A4), r0737);
+ ir_expression *const r0739 = lshift(swizzle_x(r06A4), r072B);
+ ir_expression *const r073A = expr(ir_triop_csel, r0736, r0738, r0739);
+ ir_expression *const r073B = equal(r072B, body.constant(int(0)));
+ ir_expression *const r073C = lshift(r06B3, r072B);
+ ir_expression *const r073D = neg(r072B);
+ ir_expression *const r073E = bit_and(r073D, body.constant(int(31)));
+ ir_expression *const r073F = rshift(swizzle_x(r06A4), r073E);
+ ir_expression *const r0740 = bit_or(r073C, r073F);
+ ir_expression *const r0741 = expr(ir_triop_csel, r073B, r06B3, r0740);
+ body.emit(assign(r06AA, expr(ir_triop_csel, r0735, r073A, r0741), 0x01));
+
+ ir_expression *const r0742 = equal(r06B3, body.constant(0u));
+ ir_expression *const r0743 = less(r072B, body.constant(int(0)));
+ ir_expression *const r0744 = bit_and(r072B, body.constant(int(31)));
+ ir_expression *const r0745 = lshift(swizzle_x(r06A4), r0744);
+ ir_expression *const r0746 = expr(ir_triop_csel, r0743, r0745, body.constant(0u));
+ ir_expression *const r0747 = lshift(swizzle_x(r06A4), r072B);
+ body.emit(assign(r06AB, expr(ir_triop_csel, r0742, r0746, r0747), 0x01));
+
+
+ body.instructions = f0727_parent_instructions;
+ body.emit(f0727);
+
+ /* END IF */
+
+
+ body.instructions = f0725_parent_instructions;
+ body.emit(f0725);
+
+ /* END IF */
+
+ /* IF CONDITION */
+ ir_if *f0748 = new(mem_ctx) ir_if(operand(r06A5).val);
+ exec_list *const f0748_parent_instructions = body.instructions;
+
+ /* THEN INSTRUCTIONS */
+ body.instructions = &f0748->then_instructions;
+
+ ir_expression *const r0749 = add(r06A9, r06A8);
+ body.emit(assign(r06AE, add(r0749, body.constant(int(-1024))), 0x01));
+
+ body.emit(assign(r06AC, bit_or(r06AC, body.constant(1048576u)), 0x01));
+
+ ir_variable *const r074A = body.make_temp(glsl_type::uint_type, "z0Ptr");
+ ir_variable *const r074B = body.make_temp(glsl_type::uint_type, "z1Ptr");
+ body.emit(assign(r074B, lshift(r06AB, body.constant(int(12))), 0x01));
+
+ ir_expression *const r074C = lshift(r06AA, body.constant(int(12)));
+ ir_expression *const r074D = rshift(r06AB, body.constant(int(20)));
+ body.emit(assign(r074A, bit_or(r074C, r074D), 0x01));
+
+ body.emit(assign(r06AA, r074A, 0x01));
+
+ body.emit(assign(r06AB, r074B, 0x01));
+
+ ir_variable *const r074E = new(mem_ctx) ir_variable(glsl_type::uint_type, "z0", ir_var_auto);
+ body.emit(r074E);
+ ir_variable *const r074F = new(mem_ctx) ir_variable(glsl_type::uint_type, "zMiddleA", ir_var_auto);
+ body.emit(r074F);
+ ir_variable *const r0750 = new(mem_ctx) ir_variable(glsl_type::uint_type, "z1", ir_var_auto);
+ body.emit(r0750);
+ ir_variable *const r0751 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0751, bit_and(r06AD, body.constant(65535u)), 0x01));
+
+ ir_variable *const r0752 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0752, rshift(r06AD, body.constant(int(16))), 0x01));
+
+ ir_variable *const r0753 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0753, bit_and(r074B, body.constant(65535u)), 0x01));
+
+ ir_variable *const r0754 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0754, rshift(r074B, body.constant(int(16))), 0x01));
+
+ ir_variable *const r0755 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0755, mul(r0752, r0753), 0x01));
+
+ ir_expression *const r0756 = mul(r0751, r0754);
+ body.emit(assign(r074F, add(r0756, r0755), 0x01));
+
+ ir_expression *const r0757 = mul(r0752, r0754);
+ ir_expression *const r0758 = less(r074F, r0755);
+ ir_expression *const r0759 = expr(ir_unop_b2i, r0758);
+ ir_expression *const r075A = expr(ir_unop_i2u, r0759);
+ ir_expression *const r075B = lshift(r075A, body.constant(int(16)));
+ ir_expression *const r075C = rshift(r074F, body.constant(int(16)));
+ ir_expression *const r075D = add(r075B, r075C);
+ body.emit(assign(r074E, add(r0757, r075D), 0x01));
+
+ body.emit(assign(r074F, lshift(r074F, body.constant(int(16))), 0x01));
+
+ ir_expression *const r075E = mul(r0751, r0753);
+ body.emit(assign(r0750, add(r075E, r074F), 0x01));
+
+ ir_expression *const r075F = less(r0750, r074F);
+ ir_expression *const r0760 = expr(ir_unop_b2i, r075F);
+ ir_expression *const r0761 = expr(ir_unop_i2u, r0760);
+ body.emit(assign(r074E, add(r074E, r0761), 0x01));
+
+ ir_variable *const r0762 = new(mem_ctx) ir_variable(glsl_type::uint_type, "z0", ir_var_auto);
+ body.emit(r0762);
+ ir_variable *const r0763 = new(mem_ctx) ir_variable(glsl_type::uint_type, "zMiddleA", ir_var_auto);
+ body.emit(r0763);
+ ir_variable *const r0764 = new(mem_ctx) ir_variable(glsl_type::uint_type, "z1", ir_var_auto);
+ body.emit(r0764);
+ ir_variable *const r0765 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0765, bit_and(r06AD, body.constant(65535u)), 0x01));
+
+ ir_variable *const r0766 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0766, rshift(r06AD, body.constant(int(16))), 0x01));
+
+ ir_variable *const r0767 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0767, bit_and(r074A, body.constant(65535u)), 0x01));
+
+ ir_variable *const r0768 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0768, rshift(r074A, body.constant(int(16))), 0x01));
+
+ ir_variable *const r0769 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0769, mul(r0766, r0767), 0x01));
+
+ ir_expression *const r076A = mul(r0765, r0768);
+ body.emit(assign(r0763, add(r076A, r0769), 0x01));
+
+ ir_expression *const r076B = mul(r0766, r0768);
+ ir_expression *const r076C = less(r0763, r0769);
+ ir_expression *const r076D = expr(ir_unop_b2i, r076C);
+ ir_expression *const r076E = expr(ir_unop_i2u, r076D);
+ ir_expression *const r076F = lshift(r076E, body.constant(int(16)));
+ ir_expression *const r0770 = rshift(r0763, body.constant(int(16)));
+ ir_expression *const r0771 = add(r076F, r0770);
+ body.emit(assign(r0762, add(r076B, r0771), 0x01));
+
+ body.emit(assign(r0763, lshift(r0763, body.constant(int(16))), 0x01));
+
+ ir_expression *const r0772 = mul(r0765, r0767);
+ body.emit(assign(r0764, add(r0772, r0763), 0x01));
+
+ ir_expression *const r0773 = less(r0764, r0763);
+ ir_expression *const r0774 = expr(ir_unop_b2i, r0773);
+ ir_expression *const r0775 = expr(ir_unop_i2u, r0774);
+ body.emit(assign(r0762, add(r0762, r0775), 0x01));
+
+ ir_variable *const r0776 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0776, add(r0764, r074E), 0x01));
+
+ ir_variable *const r0777 = new(mem_ctx) ir_variable(glsl_type::uint_type, "z0", ir_var_auto);
+ body.emit(r0777);
+ ir_variable *const r0778 = new(mem_ctx) ir_variable(glsl_type::uint_type, "zMiddleA", ir_var_auto);
+ body.emit(r0778);
+ ir_variable *const r0779 = new(mem_ctx) ir_variable(glsl_type::uint_type, "z1", ir_var_auto);
+ body.emit(r0779);
+ ir_variable *const r077A = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r077A, bit_and(r06AC, body.constant(65535u)), 0x01));
+
+ ir_variable *const r077B = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r077B, rshift(r06AC, body.constant(int(16))), 0x01));
+
+ ir_variable *const r077C = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r077C, bit_and(r074A, body.constant(65535u)), 0x01));
+
+ ir_variable *const r077D = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r077D, rshift(r074A, body.constant(int(16))), 0x01));
+
+ ir_variable *const r077E = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r077E, mul(r077B, r077C), 0x01));
+
+ ir_expression *const r077F = mul(r077A, r077D);
+ body.emit(assign(r0778, add(r077F, r077E), 0x01));
+
+ ir_expression *const r0780 = mul(r077B, r077D);
+ ir_expression *const r0781 = less(r0778, r077E);
+ ir_expression *const r0782 = expr(ir_unop_b2i, r0781);
+ ir_expression *const r0783 = expr(ir_unop_i2u, r0782);
+ ir_expression *const r0784 = lshift(r0783, body.constant(int(16)));
+ ir_expression *const r0785 = rshift(r0778, body.constant(int(16)));
+ ir_expression *const r0786 = add(r0784, r0785);
+ body.emit(assign(r0777, add(r0780, r0786), 0x01));
+
+ body.emit(assign(r0778, lshift(r0778, body.constant(int(16))), 0x01));
+
+ ir_expression *const r0787 = mul(r077A, r077C);
+ body.emit(assign(r0779, add(r0787, r0778), 0x01));
+
+ ir_expression *const r0788 = less(r0779, r0778);
+ ir_expression *const r0789 = expr(ir_unop_b2i, r0788);
+ ir_expression *const r078A = expr(ir_unop_i2u, r0789);
+ body.emit(assign(r0777, add(r0777, r078A), 0x01));
+
+ ir_variable *const r078B = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ ir_expression *const r078C = less(r0776, r0764);
+ ir_expression *const r078D = expr(ir_unop_b2i, r078C);
+ ir_expression *const r078E = expr(ir_unop_i2u, r078D);
+ ir_expression *const r078F = add(r0762, r078E);
+ body.emit(assign(r078B, add(r0779, r078F), 0x01));
+
+ ir_variable *const r0790 = new(mem_ctx) ir_variable(glsl_type::uint_type, "z0", ir_var_auto);
+ body.emit(r0790);
+ ir_variable *const r0791 = new(mem_ctx) ir_variable(glsl_type::uint_type, "zMiddleA", ir_var_auto);
+ body.emit(r0791);
+ ir_variable *const r0792 = new(mem_ctx) ir_variable(glsl_type::uint_type, "z1", ir_var_auto);
+ body.emit(r0792);
+ ir_variable *const r0793 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0793, bit_and(r06AC, body.constant(65535u)), 0x01));
+
+ ir_variable *const r0794 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0794, rshift(r06AC, body.constant(int(16))), 0x01));
+
+ ir_variable *const r0795 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0795, bit_and(r074B, body.constant(65535u)), 0x01));
+
+ ir_variable *const r0796 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0796, rshift(r074B, body.constant(int(16))), 0x01));
+
+ ir_variable *const r0797 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0797, mul(r0794, r0795), 0x01));
+
+ ir_expression *const r0798 = mul(r0793, r0796);
+ body.emit(assign(r0791, add(r0798, r0797), 0x01));
+
+ ir_expression *const r0799 = mul(r0794, r0796);
+ ir_expression *const r079A = less(r0791, r0797);
+ ir_expression *const r079B = expr(ir_unop_b2i, r079A);
+ ir_expression *const r079C = expr(ir_unop_i2u, r079B);
+ ir_expression *const r079D = lshift(r079C, body.constant(int(16)));
+ ir_expression *const r079E = rshift(r0791, body.constant(int(16)));
+ ir_expression *const r079F = add(r079D, r079E);
+ body.emit(assign(r0790, add(r0799, r079F), 0x01));
+
+ body.emit(assign(r0791, lshift(r0791, body.constant(int(16))), 0x01));
+
+ ir_expression *const r07A0 = mul(r0793, r0795);
+ body.emit(assign(r0792, add(r07A0, r0791), 0x01));
+
+ ir_expression *const r07A1 = less(r0792, r0791);
+ ir_expression *const r07A2 = expr(ir_unop_b2i, r07A1);
+ ir_expression *const r07A3 = expr(ir_unop_i2u, r07A2);
+ body.emit(assign(r0790, add(r0790, r07A3), 0x01));
+
+ ir_variable *const r07A4 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r07A4, add(r0792, r0776), 0x01));
+
+ ir_variable *const r07A5 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ ir_expression *const r07A6 = less(r07A4, r0792);
+ ir_expression *const r07A7 = expr(ir_unop_b2i, r07A6);
+ ir_expression *const r07A8 = expr(ir_unop_i2u, r07A7);
+ ir_expression *const r07A9 = add(r0790, r07A8);
+ body.emit(assign(r07A5, add(r078B, r07A9), 0x01));
+
+ ir_variable *const r07AA = body.make_temp(glsl_type::uint_type, "z0Ptr");
+ ir_variable *const r07AB = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r07AB, add(r07A5, r06AD), 0x01));
+
+ ir_expression *const r07AC = less(r078B, r0779);
+ ir_expression *const r07AD = expr(ir_unop_b2i, r07AC);
+ ir_expression *const r07AE = expr(ir_unop_i2u, r07AD);
+ ir_expression *const r07AF = add(r0777, r07AE);
+ ir_expression *const r07B0 = less(r07A5, r078B);
+ ir_expression *const r07B1 = expr(ir_unop_b2i, r07B0);
+ ir_expression *const r07B2 = expr(ir_unop_i2u, r07B1);
+ ir_expression *const r07B3 = add(r07AF, r07B2);
+ ir_expression *const r07B4 = add(r07B3, r06AC);
+ ir_expression *const r07B5 = less(r07AB, r07A5);
+ ir_expression *const r07B6 = expr(ir_unop_b2i, r07B5);
+ ir_expression *const r07B7 = expr(ir_unop_i2u, r07B6);
+ body.emit(assign(r07AA, add(r07B4, r07B7), 0x01));
+
+ body.emit(assign(r06B1, r07AA, 0x01));
+
+ body.emit(assign(r06B0, r07AB, 0x01));
+
+ ir_expression *const r07B8 = nequal(r0750, body.constant(0u));
+ ir_expression *const r07B9 = expr(ir_unop_b2i, r07B8);
+ ir_expression *const r07BA = expr(ir_unop_i2u, r07B9);
+ body.emit(assign(r06AF, bit_or(r07A4, r07BA), 0x01));
+
+ /* IF CONDITION */
+ ir_expression *const r07BC = gequal(r07AA, body.constant(2097152u));
+ ir_if *f07BB = new(mem_ctx) ir_if(operand(r07BC).val);
+ exec_list *const f07BB_parent_instructions = body.instructions;
+
+ /* THEN INSTRUCTIONS */
+ body.instructions = &f07BB->then_instructions;
+
+ body.emit(assign(r06B1, rshift(r07AA, body.constant(int(1))), 0x01));
+
+ ir_expression *const r07BD = lshift(r07AA, body.constant(int(31)));
+ ir_expression *const r07BE = rshift(r07AB, body.constant(int(1)));
+ body.emit(assign(r06B0, bit_or(r07BD, r07BE), 0x01));
+
+ ir_expression *const r07BF = lshift(r07AB, body.constant(int(31)));
+ ir_expression *const r07C0 = nequal(r06AF, body.constant(0u));
+ ir_expression *const r07C1 = expr(ir_unop_b2i, r07C0);
+ ir_expression *const r07C2 = expr(ir_unop_i2u, r07C1);
+ body.emit(assign(r06AF, bit_or(r07BF, r07C2), 0x01));
+
+ body.emit(assign(r06AE, add(r06AE, body.constant(int(1))), 0x01));
+
+
+ body.instructions = f07BB_parent_instructions;
+ body.emit(f07BB);
+
+ /* END IF */
+
+ ir_variable *const r07C3 = body.make_temp(glsl_type::int_type, "zExp");
+ body.emit(assign(r07C3, r06AE, 0x01));
+
+ ir_variable *const r07C4 = body.make_temp(glsl_type::uint_type, "zFrac0");
+ body.emit(assign(r07C4, r06B1, 0x01));
+
+ ir_variable *const r07C5 = body.make_temp(glsl_type::uint_type, "zFrac1");
+ body.emit(assign(r07C5, r06B0, 0x01));
+
+ ir_variable *const r07C6 = body.make_temp(glsl_type::uint_type, "zFrac2");
+ body.emit(assign(r07C6, r06AF, 0x01));
+
+ ir_variable *const r07C7 = body.make_temp(glsl_type::bool_type, "execute_flag");
+ body.emit(assign(r07C7, body.constant(true), 0x01));
+
+ ir_variable *const r07C8 = body.make_temp(glsl_type::uvec2_type, "return_value");
+ ir_variable *const r07C9 = new(mem_ctx) ir_variable(glsl_type::bool_type, "increment", ir_var_auto);
+ body.emit(r07C9);
+ ir_expression *const r07CA = expr(ir_unop_u2i, r06AF);
+ body.emit(assign(r07C9, less(r07CA, body.constant(int(0))), 0x01));
+
+ /* IF CONDITION */
+ ir_expression *const r07CC = gequal(r06AE, body.constant(int(2045)));
+ ir_if *f07CB = new(mem_ctx) ir_if(operand(r07CC).val);
+ exec_list *const f07CB_parent_instructions = body.instructions;
+
+ /* THEN INSTRUCTIONS */
+ body.instructions = &f07CB->then_instructions;
+
+ /* IF CONDITION */
+ ir_expression *const r07CE = less(body.constant(int(2045)), r06AE);
+ ir_expression *const r07CF = equal(r06AE, body.constant(int(2045)));
+ ir_expression *const r07D0 = equal(body.constant(2097151u), r06B1);
+ ir_expression *const r07D1 = equal(body.constant(4294967295u), r06B0);
+ ir_expression *const r07D2 = logic_and(r07D0, r07D1);
+ ir_expression *const r07D3 = logic_and(r07CF, r07D2);
+ ir_expression *const r07D4 = logic_and(r07D3, r07C9);
+ ir_expression *const r07D5 = logic_or(r07CE, r07D4);
+ ir_if *f07CD = new(mem_ctx) ir_if(operand(r07D5).val);
+ exec_list *const f07CD_parent_instructions = body.instructions;
+
+ /* THEN INSTRUCTIONS */
+ body.instructions = &f07CD->then_instructions;
+
+ ir_variable *const r07D6 = new(mem_ctx) ir_variable(glsl_type::uvec2_type, "z", ir_var_auto);
+ body.emit(r07D6);
+ ir_expression *const r07D7 = lshift(r06A7, body.constant(int(31)));
+ body.emit(assign(r07D6, add(r07D7, body.constant(2146435072u)), 0x02));
+
+ body.emit(assign(r07D6, body.constant(0u), 0x01));
+
+ body.emit(assign(r07C8, r07D6, 0x03));
+
+ body.emit(assign(r07C7, body.constant(false), 0x01));
+
+
+ /* ELSE INSTRUCTIONS */
+ body.instructions = &f07CD->else_instructions;
+
+ /* IF CONDITION */
+ ir_expression *const r07D9 = less(r06AE, body.constant(int(0)));
+ ir_if *f07D8 = new(mem_ctx) ir_if(operand(r07D9).val);
+ exec_list *const f07D8_parent_instructions = body.instructions;
+
+ /* THEN INSTRUCTIONS */
+ body.instructions = &f07D8->then_instructions;
+
+ ir_variable *const r07DA = body.make_temp(glsl_type::int_type, "count");
+ body.emit(assign(r07DA, neg(r06AE), 0x01));
+
+ ir_variable *const r07DB = new(mem_ctx) ir_variable(glsl_type::uint_type, "z2", ir_var_auto);
+ body.emit(r07DB);
+ ir_variable *const r07DC = body.make_temp(glsl_type::int_type, "assignment_tmp");
+ ir_expression *const r07DD = neg(r07DA);
+ body.emit(assign(r07DC, bit_and(r07DD, body.constant(int(31))), 0x01));
+
+ ir_variable *const r07DE = body.make_temp(glsl_type::uint_type, "mix_retval");
+ ir_expression *const r07DF = less(r07DA, body.constant(int(32)));
+ ir_expression *const r07E0 = bit_or(r06AF, r06B0);
+ body.emit(assign(r07DE, expr(ir_triop_csel, r07DF, r06AF, r07E0), 0x01));
+
+ ir_expression *const r07E1 = less(r07DA, body.constant(int(32)));
+ ir_expression *const r07E2 = lshift(r06B0, r07DC);
+ ir_expression *const r07E3 = less(r07DA, body.constant(int(64)));
+ ir_expression *const r07E4 = lshift(r06B1, r07DC);
+ ir_expression *const r07E5 = equal(r07DA, body.constant(int(64)));
+ ir_expression *const r07E6 = nequal(r06B1, body.constant(0u));
+ ir_expression *const r07E7 = expr(ir_unop_b2i, r07E6);
+ ir_expression *const r07E8 = expr(ir_unop_i2u, r07E7);
+ ir_expression *const r07E9 = expr(ir_triop_csel, r07E5, r06B1, r07E8);
+ ir_expression *const r07EA = expr(ir_triop_csel, r07E3, r07E4, r07E9);
+ ir_expression *const r07EB = expr(ir_triop_csel, r07E1, r07E2, r07EA);
+ ir_expression *const r07EC = nequal(r07DE, body.constant(0u));
+ ir_expression *const r07ED = expr(ir_unop_b2i, r07EC);
+ ir_expression *const r07EE = expr(ir_unop_i2u, r07ED);
+ body.emit(assign(r07DB, bit_or(r07EB, r07EE), 0x01));
+
+ ir_variable *const r07EF = body.make_temp(glsl_type::uint_type, "mix_retval");
+ ir_expression *const r07F0 = equal(r07DA, body.constant(int(0)));
+ ir_expression *const r07F1 = equal(r07DA, body.constant(int(32)));
+ ir_expression *const r07F2 = expr(ir_triop_csel, r07F1, r06B0, r07DB);
+ body.emit(assign(r07EF, expr(ir_triop_csel, r07F0, r07DE, r07F2), 0x01));
+
+ body.emit(assign(r07DB, r07EF, 0x01));
+
+ ir_expression *const r07F3 = equal(r07DA, body.constant(int(0)));
+ ir_expression *const r07F4 = equal(r07DA, body.constant(int(32)));
+ ir_expression *const r07F5 = less(r07DA, body.constant(int(32)));
+ ir_expression *const r07F6 = rshift(r06B1, r07DA);
+ ir_expression *const r07F7 = expr(ir_triop_csel, r07F5, r07F6, body.constant(0u));
+ ir_expression *const r07F8 = expr(ir_triop_csel, r07F4, body.constant(0u), r07F7);
+ body.emit(assign(r07C4, expr(ir_triop_csel, r07F3, r06B1, r07F8), 0x01));
+
+ ir_expression *const r07F9 = equal(r07DA, body.constant(int(0)));
+ ir_expression *const r07FA = equal(r07DA, body.constant(int(32)));
+ ir_expression *const r07FB = less(r07DA, body.constant(int(32)));
+ ir_expression *const r07FC = lshift(r06B1, r07DC);
+ ir_expression *const r07FD = rshift(r06B0, r07DA);
+ ir_expression *const r07FE = bit_or(r07FC, r07FD);
+ ir_expression *const r07FF = less(r07DA, body.constant(int(64)));
+ ir_expression *const r0800 = bit_and(r07DA, body.constant(int(31)));
+ ir_expression *const r0801 = rshift(r06B1, r0800);
+ ir_expression *const r0802 = expr(ir_triop_csel, r07FF, r0801, body.constant(0u));
+ ir_expression *const r0803 = expr(ir_triop_csel, r07FB, r07FE, r0802);
+ ir_expression *const r0804 = expr(ir_triop_csel, r07FA, r06B1, r0803);
+ body.emit(assign(r07C5, expr(ir_triop_csel, r07F9, r06B0, r0804), 0x01));
+
+ body.emit(assign(r07C6, r07EF, 0x01));
+
+ body.emit(assign(r07C3, body.constant(int(0)), 0x01));
+
+ body.emit(assign(r07C9, less(r07EF, body.constant(0u)), 0x01));
+
+
+ body.instructions = f07D8_parent_instructions;
+ body.emit(f07D8);
+
+ /* END IF */
+
+
+ body.instructions = f07CD_parent_instructions;
+ body.emit(f07CD);
+
+ /* END IF */
+
+
+ body.instructions = f07CB_parent_instructions;
+ body.emit(f07CB);
+
+ /* END IF */
+
+ /* IF CONDITION */
+ ir_if *f0805 = new(mem_ctx) ir_if(operand(r07C7).val);
+ exec_list *const f0805_parent_instructions = body.instructions;
+
+ /* THEN INSTRUCTIONS */
+ body.instructions = &f0805->then_instructions;
+
+ /* IF CONDITION */
+ ir_if *f0806 = new(mem_ctx) ir_if(operand(r07C9).val);
+ exec_list *const f0806_parent_instructions = body.instructions;
+
+ /* THEN INSTRUCTIONS */
+ body.instructions = &f0806->then_instructions;
+
+ ir_variable *const r0807 = body.make_temp(glsl_type::uint_type, "assignment_tmp");
+ body.emit(assign(r0807, add(r07C5, body.constant(1u)), 0x01));
+
+ ir_expression *const r0808 = less(r0807, r07C5);
+ ir_expression *const r0809 = expr(ir_unop_b2i, r0808);
+ ir_expression *const r080A = expr(ir_unop_i2u, r0809);
+ body.emit(assign(r07C4, add(r07C4, r080A), 0x01));
+
+ ir_expression *const r080B = equal(r07C6, body.constant(0u));
+ ir_expression *const r080C = expr(ir_unop_b2i, r080B);
+ ir_expression *const r080D = expr(ir_unop_i2u, r080C);
+ ir_expression *const r080E = add(r07C6, r080D);
+ ir_expression *const r080F = bit_and(r080E, body.constant(1u));
+ ir_expression *const r0810 = expr(ir_unop_bit_not, r080F);
+ body.emit(assign(r07C5, bit_and(r0807, r0810), 0x01));
+
+
+ /* ELSE INSTRUCTIONS */
+ body.instructions = &f0806->else_instructions;
+
+ ir_expression *const r0811 = bit_or(r07C4, r07C5);
+ ir_expression *const r0812 = equal(r0811, body.constant(0u));
+ body.emit(assign(r07C3, expr(ir_triop_csel, r0812, body.constant(int(0)), r07C3), 0x01));
+
+
+ body.instructions = f0806_parent_instructions;
+ body.emit(f0806);
+
+ /* END IF */
+
+ ir_variable *const r0813 = new(mem_ctx) ir_variable(glsl_type::uvec2_type, "z", ir_var_auto);
+ body.emit(r0813);
+ ir_expression *const r0814 = lshift(r06A7, body.constant(int(31)));
+ ir_expression *const r0815 = expr(ir_unop_i2u, r07C3);
+ ir_expression *const r0816 = lshift(r0815, body.constant(int(20)));
+ ir_expression *const r0817 = add(r0814, r0816);
+ body.emit(assign(r0813, add(r0817, r07C4), 0x02));
+
+ body.emit(assign(r0813, r07C5, 0x01));
+
+ body.emit(assign(r07C8, r0813, 0x03));
+
+ body.emit(assign(r07C7, body.constant(false), 0x01));
+
+
+ body.instructions = f0805_parent_instructions;
+ body.emit(f0805);
+
+ /* END IF */
+
+ body.emit(assign(r06A6, r07C8, 0x03));
+
+ body.emit(assign(r06A5, body.constant(false), 0x01));
+
+
+ body.instructions = f0748_parent_instructions;
+ body.emit(f0748);
+
+ /* END IF */
+
+
+ body.instructions = f0724_parent_instructions;
+ body.emit(f0724);
+
+ /* END IF */
+
+
+ body.instructions = f06E1_parent_instructions;
+ body.emit(f06E1);
+
+ /* END IF */
+
+
+ body.instructions = f06BC_parent_instructions;
+ body.emit(f06BC);
+
+ /* END IF */
+
+ body.emit(ret(r06A6));
+
+ sig->replace_parameters(&sig_parameters);
+ return sig;
+}
diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp
index 941f7ab..f72c77f 100644
--- a/src/compiler/glsl/builtin_functions.cpp
+++ b/src/compiler/glsl/builtin_functions.cpp
@@ -3366,6 +3366,10 @@ builtin_builder::create_builtins()
generate_ir::fadd64(mem_ctx, integer_functions_supported),
NULL);
+ add_function("__builtin_fmul64",
+ generate_ir::fmul64(mem_ctx, integer_functions_supported),
+ NULL);
+
#undef F
#undef FI
#undef FIUD_VEC
diff --git a/src/compiler/glsl/builtin_functions.h b/src/compiler/glsl/builtin_functions.h
index 0d74736..6f0e8e5 100644
--- a/src/compiler/glsl/builtin_functions.h
+++ b/src/compiler/glsl/builtin_functions.h
@@ -85,6 +85,9 @@ flt64(void *mem_ctx, builtin_available_predicate avail);
ir_function_signature *
fadd64(void *mem_ctx, builtin_available_predicate avail);
+ir_function_signature *
+fmul64(void *mem_ctx, builtin_available_predicate avail);
+
}
#endif /* BULITIN_FUNCTIONS_H */
diff --git a/src/compiler/glsl/float64.glsl b/src/compiler/glsl/float64.glsl
index 1629e35..bd089f8 100644
--- a/src/compiler/glsl/float64.glsl
+++ b/src/compiler/glsl/float64.glsl
@@ -581,3 +581,151 @@ fadd64(uvec2 a, uvec2 b)
return mix(retval_0, retval_1, bvec2(zexp_normal, zexp_normal));
}
}
+
+/* Multiplies `a' by `b' to obtain a 64-bit product. The product is broken
+ * into two 32-bit pieces which are stored at the locations pointed to by
+ * `z0Ptr' and `z1Ptr'.
+ */
+void
+mul32To64(uint a, uint b, inout uint z0Ptr, inout uint z1Ptr)
+{
+ uint aLow = a & 0x0000FFFFu;
+ uint aHigh = a>>16;
+ uint bLow = b & 0x0000FFFFu;
+ uint bHigh = b>>16;
+ uint z1 = aLow * bLow;
+ uint zMiddleA = aLow * bHigh;
+ uint zMiddleB = aHigh * bLow;
+ uint z0 = aHigh * bHigh;
+ zMiddleA += zMiddleB;
+ z0 += ((uint(zMiddleA < zMiddleB)) << 16) + (zMiddleA >> 16);
+ zMiddleA <<= 16;
+ z1 += zMiddleA;
+ z0 += uint(z1 < zMiddleA);
+ z1Ptr = z1;
+ z0Ptr = z0;
+}
+
+/* Multiplies the 64-bit value formed by concatenating `a0' and `a1' to the
+ * 64-bit value formed by concatenating `b0' and `b1' to obtain a 128-bit
+ * product. The product is broken into four 32-bit pieces which are stored at
+ * the locations pointed to by `z0Ptr', `z1Ptr', `z2Ptr', and `z3Ptr'.
+ */
+void
+mul64To128(uint a0, uint a1, uint b0, uint b1,
+ inout uint z0Ptr,
+ inout uint z1Ptr,
+ inout uint z2Ptr,
+ inout uint z3Ptr )
+{
+ uint z0 = 0u;
+ uint z1 = 0u;
+ uint z2 = 0u;
+ uint z3 = 0u;
+ uint more1 = 0u;
+ uint more2 = 0u;
+
+ mul32To64(a1, b1, z2, z3);
+ mul32To64(a1, b0, z1, more2);
+ add64(z1, more2, 0u, z2, z1, z2);
+ mul32To64(a0, b0, z0, more1);
+ add64(z0, more1, 0u, z1, z0, z1);
+ mul32To64(a0, b1, more1, more2);
+ add64(more1, more2, 0u, z2, more1, z2);
+ add64(z0, z1, 0u, more1, z0, z1);
+ z3Ptr = z3;
+ z2Ptr = z2;
+ z1Ptr = z1;
+ z0Ptr = z0;
+}
+
+/* Normalizes the subnormal double-precision floating-point value represented
+ * by the denormalized significand formed by the concatenation of `aFrac0' and
+ * `aFrac1'. The normalized exponent is stored at the location pointed to by
+ * `zExpPtr'. The most significant 21 bits of the normalized significand are
+ * stored at the location pointed to by `zFrac0Ptr', and the least significant
+ * 32 bits of the normalized significand are stored at the location pointed to
+ * by `zFrac1Ptr'.
+ */
+void
+normalizeFloat64Subnormal(uint aFrac0, uint aFrac1,
+ inout int zExpPtr,
+ inout uint zFrac0Ptr,
+ inout uint zFrac1Ptr)
+{
+ int shiftCount;
+ uint temp_zfrac0, temp_zfrac1;
+ shiftCount = countLeadingZeros32(mix(aFrac0, aFrac1, aFrac0 == 0u)) - 11;
+ zExpPtr = mix(1 - shiftCount, -shiftCount - 31, aFrac0 == 0u);
+
+ temp_zfrac0 = mix(aFrac1<<shiftCount, aFrac1>>(-shiftCount), shiftCount < 0);
+ temp_zfrac1 = mix(0u, aFrac1<<(shiftCount & 31), shiftCount < 0);
+
+ shortShift64Left(aFrac0, aFrac1, shiftCount, zFrac0Ptr, zFrac1Ptr);
+
+ zFrac0Ptr = mix(zFrac0Ptr, temp_zfrac0, aFrac0 == 0);
+ zFrac1Ptr = mix(zFrac1Ptr, temp_zfrac1, aFrac0 == 0);
+}
+
+/* Returns the result of multiplying the double-precision floating-point values
+ * `a' and `b'. The operation is performed according to the IEEE Standard for
+ * Floating-Point Arithmetic.
+ */
+uvec2
+fmul64(uvec2 a, uvec2 b)
+{
+ uint zFrac0 = 0u;
+ uint zFrac1 = 0u;
+ uint zFrac2 = 0u;
+ uint zFrac3 = 0u;
+ int zExp;
+
+ uint aFracLo = extractFloat64FracLo(a);
+ uint aFracHi = extractFloat64FracHi(a);
+ uint bFracLo = extractFloat64FracLo(b);
+ uint bFracHi = extractFloat64FracHi(b);
+ int aExp = extractFloat64Exp(a);
+ uint aSign = extractFloat64Sign(a);
+ int bExp = extractFloat64Exp(b);
+ uint bSign = extractFloat64Sign(b);
+ uint zSign = aSign ^ bSign;
+ if (aExp == 0x7FF) {
+ if (((aFracHi | aFracLo) != 0u) ||
+ ((bExp == 0x7FF) && ((bFracHi | bFracLo) != 0u))) {
+ return propagateFloat64NaN(a, b);
+ }
+ if ((uint(bExp) | bFracHi | bFracLo) == 0u)
+ return uvec2(0xFFFFFFFFu, 0xFFFFFFFFu);
+ return packFloat64(zSign, 0x7FF, 0u, 0u);
+ }
+ if (bExp == 0x7FF) {
+ if ((bFracHi | bFracLo) != 0u)
+ return propagateFloat64NaN(a, b);
+ if ((uint(aExp) | aFracHi | aFracLo) == 0u)
+ return uvec2(0xFFFFFFFFu, 0xFFFFFFFFu);
+ return packFloat64(zSign, 0x7FF, 0u, 0u);
+ }
+ if (aExp == 0) {
+ if ((aFracHi | aFracLo) == 0u)
+ return packFloat64(zSign, 0, 0u, 0u);
+ normalizeFloat64Subnormal(aFracHi, aFracLo, aExp, aFracHi, aFracLo);
+ }
+ if (bExp == 0) {
+ if ((bFracHi | bFracLo) == 0u)
+ return packFloat64(zSign, 0, 0u, 0u);
+ normalizeFloat64Subnormal(bFracHi, bFracLo, bExp, bFracHi, bFracLo);
+ }
+ zExp = aExp + bExp - 0x400;
+ aFracHi |= 0x00100000u;
+ shortShift64Left(bFracHi, bFracLo, 12, bFracHi, bFracLo);
+ mul64To128(
+ aFracHi, aFracLo, bFracHi, bFracLo, zFrac0, zFrac1, zFrac2, zFrac3);
+ add64(zFrac0, zFrac1, aFracHi, aFracLo, zFrac0, zFrac1);
+ zFrac2 |= uint(zFrac3 != 0u);
+ if (0x00200000u <= zFrac0) {
+ shift64ExtraRightJamming(
+ zFrac0, zFrac1, zFrac2, 1, zFrac0, zFrac1, zFrac2);
+ ++zExp;
+ }
+ return roundAndPackFloat64(zSign, zExp, zFrac0, zFrac1, zFrac2);
+}
diff --git a/src/compiler/glsl/glcpp/glcpp-parse.y b/src/compiler/glsl/glcpp/glcpp-parse.y
index fce4b5f..21e90ba 100644
--- a/src/compiler/glsl/glcpp/glcpp-parse.y
+++ b/src/compiler/glsl/glcpp/glcpp-parse.y
@@ -2374,6 +2374,7 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
add_builtin_define(parser, "__have_builtin_builtin_feq64", 1);
add_builtin_define(parser, "__have_builtin_builtin_flt64", 1);
add_builtin_define(parser, "__have_builtin_builtin_fadd64", 1);
+ add_builtin_define(parser, "__have_builtin_builtin_fmul64", 1);
}
}
--
2.9.5
More information about the mesa-dev
mailing list