Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ futhark dev --gpu --verbose futracerlib.fut
- [ +0.000109] Reading and type-checking source program
- [ +0.249060] Internalising program
- [ +0.425029] Type-checking internalised program
- [ +0.120780] Running pass simplify
- [ +0.085439] Running pass Inline functions
- [ +0.469623] Running pass simplify
- [ +0.084080] Running pass CSE
- [ +0.041714] Running pass simplify
- [ +0.073842] Running pass Fuse SOACs
- [ +0.121451] Running pass CSE
- [ +0.027033] Running pass simplify
- [ +0.041800] Running pass Fuse SOACs
- [ +0.098423] Running pass CSE
- [ +0.026688] Running pass simplify
- [ +0.040797] Running pass Remove dead functions
- [ +0.021023] Running pass extract kernels
- Internal compiler error.
- Please report this at https://github.com/diku-dk/futhark/issues.
- Type error after pass 'extract kernels':
- In function render_triangles_raw
- When checking function body
- In expression of statement {[w_7133][h_7134]i32 res_7619}
- In expression of statement {[w_7133][h_7134]i32 res_8634}
- In expression of statement {[w_7133][h_7134]i32 res_8639}
- In expression of statement {[n_total_8638][lifted_0_rect_pixel_indices_arg_8964]i32 res_8971,
- [n_total_8638][lifted_0_rect_pixel_indices_arg_8964]i32 res_8972}
- In expression of statement {[n_total_8638][lifted_0_rect_pixel_indices_arg_8964]i32 res_14331}
- In expression of statement {[lifted_0_rect_pixel_indices_arg_8964]i32 res_14357}
- In subexp res_9384
- Use of unknown variable res_9384.
- entry {f32, f32, f32} translate_point_raw (f32 x_move_7065, f32 y_move_7066,
- f32 z_move_7067, f32 x_7068,
- f32 y_7069, f32 z_7070) = {
- let {f32 res_7071} = fadd32(x_move_7065, x_7068)
- let {f32 res_7072} = fadd32(y_move_7066, y_7069)
- let {f32 res_7073} = fadd32(z_move_7067, z_7070)
- in {res_7071, res_7072, res_7073}
- }
- entry {f32, f32, f32} rotate_point_raw (f32 angle_x_7074, f32 angle_y_7075,
- f32 angle_z_7076, f32 x_origo_7077,
- f32 y_origo_7078, f32 z_origo_7079,
- f32 x_7080, f32 y_7081, f32 z_7082) = {
- let {f32 res_7083} = fsub32(x_7080, x_origo_7077)
- let {f32 res_7084} = fsub32(y_7081, y_origo_7078)
- let {f32 res_7085} = fsub32(z_7082, z_origo_7079)
- let {f32 res_7086} =
- sin32(angle_x_7074)
- let {f32 res_7087} =
- cos32(angle_x_7074)
- let {f32 res_7088} =
- sin32(angle_y_7075)
- let {f32 res_7089} =
- cos32(angle_y_7075)
- let {f32 res_7090} =
- sin32(angle_z_7076)
- let {f32 res_7091} =
- cos32(angle_z_7076)
- let {f32 x_7092} = fmul32(res_7084, res_7087)
- let {f32 y_7093} = fmul32(res_7085, res_7086)
- let {f32 res_7094} = fsub32(x_7092, y_7093)
- let {f32 x_7095} = fmul32(res_7084, res_7086)
- let {f32 y_7096} = fmul32(res_7085, res_7087)
- let {f32 res_7097} = fadd32(x_7095, y_7096)
- let {f32 x_7098} = fmul32(res_7088, res_7097)
- let {f32 y_7099} = fmul32(res_7083, res_7089)
- let {f32 res_7100} = fadd32(x_7098, y_7099)
- let {f32 x_7101} = fmul32(res_7089, res_7097)
- let {f32 y_7102} = fmul32(res_7083, res_7088)
- let {f32 res_7103} = fsub32(x_7101, y_7102)
- let {f32 x_7104} = fmul32(res_7091, res_7100)
- let {f32 y_7105} = fmul32(res_7090, res_7094)
- let {f32 res_7106} = fsub32(x_7104, y_7105)
- let {f32 x_7107} = fmul32(res_7090, res_7100)
- let {f32 y_7108} = fmul32(res_7091, res_7094)
- let {f32 res_7109} = fadd32(x_7107, y_7108)
- let {f32 res_7110} = fadd32(x_origo_7077, res_7106)
- let {f32 res_7111} = fadd32(y_origo_7078, res_7109)
- let {f32 res_7112} = fadd32(z_origo_7079, res_7103)
- in {res_7110, res_7111, res_7112}
- }
- entry {[?0][?1]i32} render_triangles_raw (i32 n_7113, i32 n_7114, i32 n_7115,
- i32 n_7116, i32 n_7117, i32 n_7118,
- i32 n_7119, i32 n_7120, i32 n_7121,
- i32 n_7122, i32 n_7123, i32 n_7124,
- i32 n_7125, i32 n_7126,
- i32 impl₂_7127, i32 impl₂_7128,
- i32 impl₂_7129,
- i32 render_approach_7130,
- i32 n_draw_rects_x_7131,
- i32 n_draw_rects_y_7132, i32 w_7133,
- i32 h_7134, f32 view_dist_7135,
- f32 draw_dist_7136,
- [n_7113]f32 x0s_7137,
- [n_7114]f32 y0s_7138,
- [n_7115]f32 z0s_7139,
- [n_7116]f32 x1s_7140,
- [n_7117]f32 y1s_7141,
- [n_7118]f32 z1s_7142,
- [n_7119]f32 x2s_7143,
- [n_7120]f32 y2s_7144,
- [n_7121]f32 z2s_7145,
- [n_7122]i32 surface_types_7146,
- [n_7123]f32 surface_hsv_hs_7147,
- [n_7124]f32 surface_hsv_ss_7148,
- [n_7125]f32 surface_hsv_vs_7149,
- [n_7126]i32 surface_indices_7150,
- i32 surface_n_7151,
- i32 surface_w_7152,
- i32 surface_h_7153,
- [impl₂_7127]f32 surface_textures_flat_hsv_hs_7154,
- [impl₂_7128]f32 surface_textures_flat_hsv_ss_7155,
- [impl₂_7129]f32 surface_textures_flat_hsv_vs_7156,
- f32 c_x_7157, f32 c_y_7158,
- f32 c_z_7159, f32 c_ax_7160,
- f32 c_ay_7161, f32 c_az_7162) = {
- let {bool dim_match_7163} = eq_i32(n_7113, n_7114)
- let {cert empty_or_match_cert_7164} =
- assert(dim_match_7163, "function arguments of wrong shape",
- "futracerlib.fut:21:1-71:70")
- let {bool dim_match_7165} = eq_i32(n_7113, n_7115)
- let {cert empty_or_match_cert_7166} =
- assert(dim_match_7165, "function arguments of wrong shape",
- "futracerlib.fut:21:1-71:70")
- let {bool dim_match_7167} = eq_i32(n_7113, n_7116)
- let {cert empty_or_match_cert_7168} =
- assert(dim_match_7167, "function arguments of wrong shape",
- "futracerlib.fut:21:1-71:70")
- let {bool dim_match_7169} = eq_i32(n_7113, n_7117)
- let {cert empty_or_match_cert_7170} =
- assert(dim_match_7169, "function arguments of wrong shape",
- "futracerlib.fut:21:1-71:70")
- let {bool dim_match_7171} = eq_i32(n_7113, n_7118)
- let {cert empty_or_match_cert_7172} =
- assert(dim_match_7171, "function arguments of wrong shape",
- "futracerlib.fut:21:1-71:70")
- let {bool dim_match_7173} = eq_i32(n_7113, n_7119)
- let {cert empty_or_match_cert_7174} =
- assert(dim_match_7173, "function arguments of wrong shape",
- "futracerlib.fut:21:1-71:70")
- let {bool dim_match_7175} = eq_i32(n_7113, n_7120)
- let {cert empty_or_match_cert_7176} =
- assert(dim_match_7175, "function arguments of wrong shape",
- "futracerlib.fut:21:1-71:70")
- let {bool dim_match_7177} = eq_i32(n_7113, n_7121)
- let {cert empty_or_match_cert_7178} =
- assert(dim_match_7177, "function arguments of wrong shape",
- "futracerlib.fut:21:1-71:70")
- let {bool dim_match_7179} = eq_i32(n_7113, n_7122)
- let {cert empty_or_match_cert_7180} =
- assert(dim_match_7179, "function arguments of wrong shape",
- "futracerlib.fut:21:1-71:70")
- -- surface_types_7181 aliases surface_types_7146
- let {[n_7113]i32 surface_types_7181} =
- <empty_or_match_cert_7180>
- reshape((~n_7113), surface_types_7146)
- let {bool dim_match_7182} = eq_i32(n_7113, n_7123)
- let {cert empty_or_match_cert_7183} =
- assert(dim_match_7182, "function arguments of wrong shape",
- "futracerlib.fut:21:1-71:70")
- -- surface_hsv_hs_7184 aliases surface_hsv_hs_7147
- let {[n_7113]f32 surface_hsv_hs_7184} =
- <empty_or_match_cert_7183>
- reshape((~n_7113), surface_hsv_hs_7147)
- let {bool dim_match_7185} = eq_i32(n_7113, n_7124)
- let {cert empty_or_match_cert_7186} =
- assert(dim_match_7185, "function arguments of wrong shape",
- "futracerlib.fut:21:1-71:70")
- -- surface_hsv_ss_7187 aliases surface_hsv_ss_7148
- let {[n_7113]f32 surface_hsv_ss_7187} =
- <empty_or_match_cert_7186>
- reshape((~n_7113), surface_hsv_ss_7148)
- let {bool dim_match_7188} = eq_i32(n_7113, n_7125)
- let {cert empty_or_match_cert_7189} =
- assert(dim_match_7188, "function arguments of wrong shape",
- "futracerlib.fut:21:1-71:70")
- -- surface_hsv_vs_7190 aliases surface_hsv_vs_7149
- let {[n_7113]f32 surface_hsv_vs_7190} =
- <empty_or_match_cert_7189>
- reshape((~n_7113), surface_hsv_vs_7149)
- let {bool dim_match_7191} = eq_i32(n_7113, n_7126)
- let {cert empty_or_match_cert_7192} =
- assert(dim_match_7191, "function arguments of wrong shape",
- "futracerlib.fut:21:1-71:70")
- -- surface_indices_7193 aliases surface_indices_7150
- let {[n_7113]i32 surface_indices_7193} =
- <empty_or_match_cert_7192>
- reshape((~n_7113), surface_indices_7150)
- let {bool dim_match_7194} = eq_i32(impl₂_7127, impl₂_7128)
- let {cert empty_or_match_cert_7195} =
- assert(dim_match_7194, "function arguments of wrong shape",
- "futracerlib.fut:21:1-71:70")
- let {bool dim_match_7196} = eq_i32(impl₂_7127, impl₂_7129)
- let {cert empty_or_match_cert_7197} =
- assert(dim_match_7196, "function arguments of wrong shape",
- "futracerlib.fut:21:1-71:70")
- let {i32 unflatten_arg_7198} = mul32(surface_n_7151, surface_h_7153)
- let {i32 x_7199} = mul_nw32(surface_w_7152, unflatten_arg_7198)
- let {bool assert_arg_7200} = eq_i32(x_7199, impl₂_7127)
- let {cert dim_ok_7201} =
- assert(assert_arg_7200,
- "new shape has different number of elements than old shape",
- "/prelude/array.fut:95:3-33")
- let {f32 translate_point_arg_7202} = fsub32(0.0f32, c_x_7157)
- let {f32 translate_point_arg_7203} = fsub32(0.0f32, c_y_7158)
- let {f32 translate_point_arg_7204} = fsub32(0.0f32, c_z_7159)
- let {f32 rotate_point_arg_7205} = fsub32(0.0f32, c_ax_7160)
- let {f32 rotate_point_arg_7206} = fsub32(0.0f32, c_ay_7161)
- let {f32 rotate_point_arg_7207} = fsub32(0.0f32, c_az_7162)
- let {f32 res_7208} =
- sin32(rotate_point_arg_7205)
- let {f32 res_7209} =
- cos32(rotate_point_arg_7205)
- let {f32 res_7210} =
- sin32(rotate_point_arg_7206)
- let {f32 res_7211} =
- cos32(rotate_point_arg_7206)
- let {f32 res_7212} =
- sin32(rotate_point_arg_7207)
- let {f32 res_7213} =
- cos32(rotate_point_arg_7207)
- let {f32 res_7214} = sitofp i32 w_7133 to f32
- let {f32 y_7215} = fdiv32(res_7214, 2.0f32)
- let {f32 res_7216} = sitofp i32 h_7134 to f32
- let {f32 y_7217} = fdiv32(res_7216, 2.0f32)
- -- reshape_7346 aliases y0s_7138
- let {[n_7113]f32 reshape_7346} =
- <empty_or_match_cert_7164>
- reshape((~n_7113), y0s_7138)
- -- reshape_7347 aliases z0s_7139
- let {[n_7113]f32 reshape_7347} =
- <empty_or_match_cert_7166>
- reshape((~n_7113), z0s_7139)
- -- reshape_7348 aliases x1s_7140
- let {[n_7113]f32 reshape_7348} =
- <empty_or_match_cert_7168>
- reshape((~n_7113), x1s_7140)
- -- reshape_7349 aliases y1s_7141
- let {[n_7113]f32 reshape_7349} =
- <empty_or_match_cert_7170>
- reshape((~n_7113), y1s_7141)
- -- reshape_7350 aliases z1s_7142
- let {[n_7113]f32 reshape_7350} =
- <empty_or_match_cert_7172>
- reshape((~n_7113), z1s_7142)
- -- reshape_7351 aliases x2s_7143
- let {[n_7113]f32 reshape_7351} =
- <empty_or_match_cert_7174>
- reshape((~n_7113), x2s_7143)
- -- reshape_7352 aliases y2s_7144
- let {[n_7113]f32 reshape_7352} =
- <empty_or_match_cert_7176>
- reshape((~n_7113), y2s_7144)
- -- reshape_7353 aliases z2s_7145
- let {[n_7113]f32 reshape_7353} =
- <empty_or_match_cert_7178>
- reshape((~n_7113), z2s_7145)
- let {i64 n_9676} = sext i32 n_7113 to i64
- let {i64 nest_size_9677} = mul_nw64(n_9676, 1i64)
- let {i32 segscan_group_size_9679} =
- get_size(segscan_group_size_9678, group_size)
- let {i32 num_groups_9681} =
- calc_num_groups(nest_size_9677, segscan_num_groups_9680,
- segscan_group_size_9679)
- let {i32 num_threads_9682} =
- mul_nw32(num_groups_9681, segscan_group_size_9679)
- let {[n_7113]i32 offsets_7354, [n_7113]i32 increments_7355,
- [n_7113]i32 res_7356, [n_7113]i32 res_7357, [n_7113]i32 res_7358,
- [n_7113]i32 res_7359, [n_7113]i32 res_7360, [n_7113]i32 res_7361,
- [n_7113]f32 res_7362, [n_7113]f32 res_7363, [n_7113]f32 res_7364} =
- segscan_thread
- (#groups=num_groups_9681; groupsize=segscan_group_size_9679)
- ({{0i32},
- [],
- fn {i32} (i32 x_7365, i32 y_7366) =>
- let {i32 z_7367} = add_nw32(x_7365, y_7366)
- in {z_7367}})
- (gtid_9683 < n_7113) (~phys_tid_9684) : {i32, i32, i32, i32, i32, i32, i32,
- i32, f32, f32, f32} {
- let {f32 x_7368} = x0s_7137[gtid_9683]
- let {f32 x_7369} = reshape_7346[gtid_9683]
- let {f32 x_7370} = reshape_7347[gtid_9683]
- let {f32 x_7371} = reshape_7348[gtid_9683]
- let {f32 x_7372} = reshape_7349[gtid_9683]
- let {f32 x_7373} = reshape_7350[gtid_9683]
- let {f32 x_7374} = reshape_7351[gtid_9683]
- let {f32 x_7375} = reshape_7352[gtid_9683]
- let {f32 x_7376} = reshape_7353[gtid_9683]
- let {f32 res_7377} = fadd32(translate_point_arg_7202, x_7368)
- let {f32 res_7378} = fadd32(translate_point_arg_7203, x_7369)
- let {f32 res_7379} = fadd32(translate_point_arg_7204, x_7370)
- let {f32 x_7380} = fmul32(res_7209, res_7378)
- let {f32 y_7381} = fmul32(res_7208, res_7379)
- let {f32 res_7382} = fsub32(x_7380, y_7381)
- let {f32 x_7383} = fmul32(res_7208, res_7378)
- let {f32 y_7384} = fmul32(res_7209, res_7379)
- let {f32 res_7385} = fadd32(x_7383, y_7384)
- let {f32 x_7386} = fmul32(res_7210, res_7385)
- let {f32 y_7387} = fmul32(res_7211, res_7377)
- let {f32 res_7388} = fadd32(x_7386, y_7387)
- let {f32 x_7389} = fmul32(res_7211, res_7385)
- let {f32 y_7390} = fmul32(res_7210, res_7377)
- let {f32 res_7391} = fsub32(x_7389, y_7390)
- let {f32 x_7392} = fmul32(res_7213, res_7388)
- let {f32 y_7393} = fmul32(res_7212, res_7382)
- let {f32 res_7394} = fsub32(x_7392, y_7393)
- let {f32 x_7395} = fmul32(res_7212, res_7388)
- let {f32 y_7396} = fmul32(res_7213, res_7382)
- let {f32 res_7397} = fadd32(x_7395, y_7396)
- let {f32 res_7398} = fadd32(translate_point_arg_7202, x_7371)
- let {f32 res_7399} = fadd32(translate_point_arg_7203, x_7372)
- let {f32 res_7400} = fadd32(translate_point_arg_7204, x_7373)
- let {f32 x_7401} = fmul32(res_7209, res_7399)
- let {f32 y_7402} = fmul32(res_7208, res_7400)
- let {f32 res_7403} = fsub32(x_7401, y_7402)
- let {f32 x_7404} = fmul32(res_7208, res_7399)
- let {f32 y_7405} = fmul32(res_7209, res_7400)
- let {f32 res_7406} = fadd32(x_7404, y_7405)
- let {f32 x_7407} = fmul32(res_7210, res_7406)
- let {f32 y_7408} = fmul32(res_7211, res_7398)
- let {f32 res_7409} = fadd32(x_7407, y_7408)
- let {f32 x_7410} = fmul32(res_7211, res_7406)
- let {f32 y_7411} = fmul32(res_7210, res_7398)
- let {f32 res_7412} = fsub32(x_7410, y_7411)
- let {f32 x_7413} = fmul32(res_7213, res_7409)
- let {f32 y_7414} = fmul32(res_7212, res_7403)
- let {f32 res_7415} = fsub32(x_7413, y_7414)
- let {f32 x_7416} = fmul32(res_7212, res_7409)
- let {f32 y_7417} = fmul32(res_7213, res_7403)
- let {f32 res_7418} = fadd32(x_7416, y_7417)
- let {f32 res_7419} = fadd32(translate_point_arg_7202, x_7374)
- let {f32 res_7420} = fadd32(translate_point_arg_7203, x_7375)
- let {f32 res_7421} = fadd32(translate_point_arg_7204, x_7376)
- let {f32 x_7422} = fmul32(res_7209, res_7420)
- let {f32 y_7423} = fmul32(res_7208, res_7421)
- let {f32 res_7424} = fsub32(x_7422, y_7423)
- let {f32 x_7425} = fmul32(res_7208, res_7420)
- let {f32 y_7426} = fmul32(res_7209, res_7421)
- let {f32 res_7427} = fadd32(x_7425, y_7426)
- let {f32 x_7428} = fmul32(res_7210, res_7427)
- let {f32 y_7429} = fmul32(res_7211, res_7419)
- let {f32 res_7430} = fadd32(x_7428, y_7429)
- let {f32 x_7431} = fmul32(res_7211, res_7427)
- let {f32 y_7432} = fmul32(res_7210, res_7419)
- let {f32 res_7433} = fsub32(x_7431, y_7432)
- let {f32 x_7434} = fmul32(res_7213, res_7430)
- let {f32 y_7435} = fmul32(res_7212, res_7424)
- let {f32 res_7436} = fsub32(x_7434, y_7435)
- let {f32 x_7437} = fmul32(res_7212, res_7430)
- let {f32 y_7438} = fmul32(res_7213, res_7424)
- let {f32 res_7439} = fadd32(x_7437, y_7438)
- let {bool cond_7440} = le32(0.0f32, res_7391)
- let {f32 z_ratio_7441} =
- -- Branch returns: {f32}
- if cond_7440
- then {
- let {f32 x_7442} = fadd32(view_dist_7135, res_7391)
- let {f32 res_7443} = fdiv32(x_7442, view_dist_7135)
- in {res_7443}
- } else {
- let {f32 x_7444} = fsub32(view_dist_7135, res_7391)
- let {f32 y_7445} = fdiv32(x_7444, view_dist_7135)
- let {f32 res_7446} = fdiv32(1.0f32, y_7445)
- in {res_7446}
- }
- let {f32 x_7447} = fdiv32(res_7394, z_ratio_7441)
- let {f32 x_projected_7448} = fadd32(y_7215, x_7447)
- let {f32 x_7449} = fdiv32(res_7397, z_ratio_7441)
- let {f32 y_projected_7450} = fadd32(y_7217, x_7449)
- let {i32 res_7451} = fptosi f32 x_projected_7448 to i32
- let {i32 res_7452} = fptosi f32 y_projected_7450 to i32
- let {bool cond_7453} = le32(0.0f32, res_7412)
- let {f32 z_ratio_7454} =
- -- Branch returns: {f32}
- if cond_7453
- then {
- let {f32 x_7455} = fadd32(view_dist_7135, res_7412)
- let {f32 res_7456} = fdiv32(x_7455, view_dist_7135)
- in {res_7456}
- } else {
- let {f32 x_7457} = fsub32(view_dist_7135, res_7412)
- let {f32 y_7458} = fdiv32(x_7457, view_dist_7135)
- let {f32 res_7459} = fdiv32(1.0f32, y_7458)
- in {res_7459}
- }
- let {f32 x_7460} = fdiv32(res_7415, z_ratio_7454)
- let {f32 x_projected_7461} = fadd32(y_7215, x_7460)
- let {f32 x_7462} = fdiv32(res_7418, z_ratio_7454)
- let {f32 y_projected_7463} = fadd32(y_7217, x_7462)
- let {i32 res_7464} = fptosi f32 x_projected_7461 to i32
- let {i32 res_7465} = fptosi f32 y_projected_7463 to i32
- let {bool cond_7466} = le32(0.0f32, res_7433)
- let {f32 z_ratio_7467} =
- -- Branch returns: {f32}
- if cond_7466
- then {
- let {f32 x_7468} = fadd32(view_dist_7135, res_7433)
- let {f32 res_7469} = fdiv32(x_7468, view_dist_7135)
- in {res_7469}
- } else {
- let {f32 x_7470} = fsub32(view_dist_7135, res_7433)
- let {f32 y_7471} = fdiv32(x_7470, view_dist_7135)
- let {f32 res_7472} = fdiv32(1.0f32, y_7471)
- in {res_7472}
- }
- let {f32 x_7473} = fdiv32(res_7436, z_ratio_7467)
- let {f32 x_projected_7474} = fadd32(y_7215, x_7473)
- let {f32 x_7475} = fdiv32(res_7439, z_ratio_7467)
- let {f32 y_projected_7476} = fadd32(y_7217, x_7475)
- let {i32 res_7477} = fptosi f32 x_projected_7474 to i32
- let {i32 res_7478} = fptosi f32 y_projected_7476 to i32
- let {bool res_7480} = lt32(res_7391, draw_dist_7136)
- let {bool x_7481} = logand(cond_7440, res_7480)
- let {bool res_7483} = lt32(res_7412, draw_dist_7136)
- let {bool x_7484} = logand(cond_7453, res_7483)
- let {bool x_7485} = not x_7481
- let {bool y_7486} = logand(x_7484, x_7485)
- let {bool cond_7487} = logor(x_7481, y_7486)
- let {bool res_7489} = lt32(res_7433, draw_dist_7136)
- let {bool x_7490} = logand(cond_7466, res_7489)
- let {bool x_7491} = not cond_7487
- let {bool y_7492} = logand(x_7490, x_7491)
- let {bool cond_7493} = logor(cond_7487, y_7492)
- let {bool cond_7494} = slt32(res_7451, 0i32)
- let {bool res_7495} = slt32(res_7464, 0i32)
- let {bool x_7496} = logand(cond_7494, res_7495)
- let {bool res_7497} = slt32(res_7477, 0i32)
- let {bool x_7498} = logand(x_7496, res_7497)
- let {bool cond_7499} = sle32(w_7133, res_7451)
- let {bool res_7500} = sle32(w_7133, res_7464)
- let {bool x_7501} = logand(cond_7499, res_7500)
- let {bool res_7502} = sle32(w_7133, res_7477)
- let {bool x_7503} = logand(x_7501, res_7502)
- let {bool x_7504} = not x_7498
- let {bool y_7505} = logand(x_7503, x_7504)
- let {bool cond_7506} = logor(x_7498, y_7505)
- let {bool cond_7507} = slt32(res_7452, 0i32)
- let {bool res_7508} = slt32(res_7465, 0i32)
- let {bool x_7509} = logand(cond_7507, res_7508)
- let {bool res_7510} = slt32(res_7478, 0i32)
- let {bool x_7511} = logand(x_7509, res_7510)
- let {bool x_7512} = not cond_7506
- let {bool y_7513} = logand(x_7511, x_7512)
- let {bool cond_7514} = logor(cond_7506, y_7513)
- let {bool cond_7515} = sle32(h_7134, res_7452)
- let {bool res_7516} = sle32(h_7134, res_7465)
- let {bool x_7517} = logand(cond_7515, res_7516)
- let {bool res_7518} = sle32(h_7134, res_7478)
- let {bool x_7519} = logand(x_7517, res_7518)
- let {bool x_7520} = not cond_7514
- let {bool y_7521} = logand(x_7519, x_7520)
- let {bool res_7522} = logor(cond_7514, y_7521)
- let {bool res_7523} = not res_7522
- let {bool x_7524} = logand(cond_7493, res_7523)
- let {bool cond_neg_7525} = not x_7524
- let {i32 res_7526} = btoi bool cond_neg_7525 to i32
- let {bool is_i_7527} = eq_i32(res_7526, 0i32)
- let {bool cond_neg_7528} = not is_i_7527
- let {i32 part_res_7529} = btoi bool cond_neg_7528 to i32
- let {i32 part_res_7530} = btoi bool is_i_7527 to i32
- return {returns part_res_7530, returns part_res_7529, returns res_7451,
- returns res_7452, returns res_7464, returns res_7465,
- returns res_7477, returns res_7478, returns res_7391,
- returns res_7412, returns res_7433}
- }
- let {i32 last_index_7542} = sub_nw32(n_7113, 1i32)
- let {bool is_empty_7543} = eq_i32(n_7113, 0i32)
- let {i32 partition_size_7544} =
- -- Branch returns: {i32}
- if is_empty_7543
- then {0i32} else {
- let {i32 last_offset_7545} = offsets_7354[last_index_7542]
- in {last_offset_7545}
- }
- let {[n_7113]i32 partition_dest_7546} = scratch(i32, n_7113)
- let {[n_7113]i32 partition_dest_7547} = scratch(i32, n_7113)
- let {[n_7113]f32 partition_dest_7548} = scratch(f32, n_7113)
- let {[n_7113]i32 partition_dest_7549} = scratch(i32, n_7113)
- let {[n_7113]i32 partition_dest_7550} = scratch(i32, n_7113)
- let {[n_7113]f32 partition_dest_7551} = scratch(f32, n_7113)
- let {[n_7113]i32 partition_dest_7552} = scratch(i32, n_7113)
- let {[n_7113]i32 partition_dest_7553} = scratch(i32, n_7113)
- let {[n_7113]f32 partition_dest_7554} = scratch(f32, n_7113)
- let {[n_7113]i32 partition_dest_7555} = scratch(i32, n_7113)
- let {[n_7113]f32 partition_dest_7556} = scratch(f32, n_7113)
- let {[n_7113]f32 partition_dest_7557} = scratch(f32, n_7113)
- let {[n_7113]f32 partition_dest_7558} = scratch(f32, n_7113)
- let {[n_7113]i32 partition_dest_7559} = scratch(i32, n_7113)
- let {i64 n_9687} = sext i32 n_7113 to i64
- let {i64 nest_size_9688} = mul_nw64(n_9687, 1i64)
- let {i32 segmap_group_size_9690} =
- get_size(segmap_group_size_9689, group_size)
- let {i64 segmap_group_size_9691} = sext i32 segmap_group_size_9690 to i64
- let {i64 segmap_usable_groups_64_9692} =
- sdiv_up64(nest_size_9688, segmap_group_size_9691)
- let {i32 segmap_usable_groups_9693} =
- sext i64 segmap_usable_groups_64_9692 to i32
- let {[n_7113]i32 partition_res_7560, [n_7113]i32 partition_res_7561,
- [n_7113]f32 partition_res_7562, [n_7113]i32 partition_res_7563,
- [n_7113]i32 partition_res_7564, [n_7113]f32 partition_res_7565,
- [n_7113]i32 partition_res_7566, [n_7113]i32 partition_res_7567,
- [n_7113]f32 partition_res_7568, [n_7113]i32 partition_res_7569,
- [n_7113]f32 partition_res_7570, [n_7113]f32 partition_res_7571,
- [n_7113]f32 partition_res_7572, [n_7113]i32 partition_res_7573} =
- -- Consumes partition_dest_7546, partition_dest_7547, partition_dest_7548, partition_dest_7549, partition_dest_7550, partition_dest_7551, partition_dest_7552, partition_dest_7553, partition_dest_7554, partition_dest_7555, partition_dest_7556, partition_dest_7557, partition_dest_7558, partition_dest_7559
- segmap_thread
- (#groups=segmap_usable_groups_9693; groupsize=segmap_group_size_9690)
- (write_i_9685 < n_7113) (~phys_tid_9686) : {i32, i32, f32, i32, i32, f32,
- i32, i32, f32, i32, f32, f32,
- f32, i32} {
- let {i32 c_7574} = increments_7355[write_i_9685]
- let {i32 offset_7575} = offsets_7354[write_i_9685]
- let {i32 v_7576} = res_7356[write_i_9685]
- let {i32 v_7577} = res_7357[write_i_9685]
- let {f32 v_7578} = res_7362[write_i_9685]
- let {i32 v_7579} = res_7358[write_i_9685]
- let {i32 v_7580} = res_7359[write_i_9685]
- let {f32 v_7581} = res_7363[write_i_9685]
- let {i32 v_7582} = res_7360[write_i_9685]
- let {i32 v_7583} = res_7361[write_i_9685]
- let {f32 v_7584} = res_7364[write_i_9685]
- let {i32 v_7585} = surface_types_7181[write_i_9685]
- let {f32 v_7586} = surface_hsv_hs_7184[write_i_9685]
- let {f32 v_7587} = surface_hsv_ss_7187[write_i_9685]
- let {f32 v_7588} = surface_hsv_vs_7190[write_i_9685]
- let {i32 v_7589} = surface_indices_7193[write_i_9685]
- let {bool is_this_one_7590} = eq_i32(c_7574, 0i32)
- let {i32 this_offset_7591} = add_nw32(-1i32, offset_7575)
- let {i32 total_res_7592} =
- -- Branch returns: {i32}
- if is_this_one_7590
- then {this_offset_7591} else {-1i32}
- return {partition_dest_7546 with ([total_res_7592 < n_7113] <- v_7576),
- partition_dest_7547 with ([total_res_7592 < n_7113] <- v_7577),
- partition_dest_7548 with ([total_res_7592 < n_7113] <- v_7578),
- partition_dest_7549 with ([total_res_7592 < n_7113] <- v_7579),
- partition_dest_7550 with ([total_res_7592 < n_7113] <- v_7580),
- partition_dest_7551 with ([total_res_7592 < n_7113] <- v_7581),
- partition_dest_7552 with ([total_res_7592 < n_7113] <- v_7582),
- partition_dest_7553 with ([total_res_7592 < n_7113] <- v_7583),
- partition_dest_7554 with ([total_res_7592 < n_7113] <- v_7584),
- partition_dest_7555 with ([total_res_7592 < n_7113] <- v_7585),
- partition_dest_7556 with ([total_res_7592 < n_7113] <- v_7586),
- partition_dest_7557 with ([total_res_7592 < n_7113] <- v_7587),
- partition_dest_7558 with ([total_res_7592 < n_7113] <- v_7588),
- partition_dest_7559 with ([total_res_7592 < n_7113] <- v_7589)}
- }
- let {bool empty_slice_7593} = eq_i32(partition_size_7544, 0i32)
- let {i32 m_7594} = sub32(partition_size_7544, 1i32)
- let {bool zero_leq_i_p_m_t_s_7595} = sle32(0i32, m_7594)
- let {bool i_p_m_t_s_leq_w_7596} = slt32(m_7594, n_7113)
- let {bool i_lte_j_7597} = sle32(0i32, partition_size_7544)
- let {bool y_7598} = logand(zero_leq_i_p_m_t_s_7595, i_p_m_t_s_leq_w_7596)
- let {bool y_7599} = logand(i_lte_j_7597, y_7598)
- let {bool ok_or_empty_7600} = logor(empty_slice_7593, y_7599)
- let {cert index_certs_7601} =
- assert(ok_or_empty_7600, "Index [:", partition_size_7544,
- "] out of bounds for array of shape [", n_7113,
- "].", "/prelude/soacs.fut:141:6-16")
- -- res_7602 aliases partition_res_7560
- let {[partition_size_7544]i32 res_7602} =
- <index_certs_7601>
- partition_res_7560[0i32:+partition_size_7544*1i32]
- -- res_7603 aliases partition_res_7561
- let {[partition_size_7544]i32 res_7603} =
- <index_certs_7601>
- partition_res_7561[0i32:+partition_size_7544*1i32]
- -- res_7604 aliases partition_res_7562
- let {[partition_size_7544]f32 res_7604} =
- <index_certs_7601>
- partition_res_7562[0i32:+partition_size_7544*1i32]
- -- res_7605 aliases partition_res_7563
- let {[partition_size_7544]i32 res_7605} =
- <index_certs_7601>
- partition_res_7563[0i32:+partition_size_7544*1i32]
- -- res_7606 aliases partition_res_7564
- let {[partition_size_7544]i32 res_7606} =
- <index_certs_7601>
- partition_res_7564[0i32:+partition_size_7544*1i32]
- -- res_7607 aliases partition_res_7565
- let {[partition_size_7544]f32 res_7607} =
- <index_certs_7601>
- partition_res_7565[0i32:+partition_size_7544*1i32]
- -- res_7608 aliases partition_res_7566
- let {[partition_size_7544]i32 res_7608} =
- <index_certs_7601>
- partition_res_7566[0i32:+partition_size_7544*1i32]
- -- res_7609 aliases partition_res_7567
- let {[partition_size_7544]i32 res_7609} =
- <index_certs_7601>
- partition_res_7567[0i32:+partition_size_7544*1i32]
- -- res_7610 aliases partition_res_7568
- let {[partition_size_7544]f32 res_7610} =
- <index_certs_7601>
- partition_res_7568[0i32:+partition_size_7544*1i32]
- -- res_7611 aliases partition_res_7569
- let {[partition_size_7544]i32 res_7611} =
- <index_certs_7601>
- partition_res_7569[0i32:+partition_size_7544*1i32]
- -- res_7612 aliases partition_res_7570
- let {[partition_size_7544]f32 res_7612} =
- <index_certs_7601>
- partition_res_7570[0i32:+partition_size_7544*1i32]
- -- res_7613 aliases partition_res_7571
- let {[partition_size_7544]f32 res_7613} =
- <index_certs_7601>
- partition_res_7571[0i32:+partition_size_7544*1i32]
- -- res_7614 aliases partition_res_7572
- let {[partition_size_7544]f32 res_7614} =
- <index_certs_7601>
- partition_res_7572[0i32:+partition_size_7544*1i32]
- -- res_7615 aliases partition_res_7573
- let {[partition_size_7544]i32 res_7615} =
- <index_certs_7601>
- partition_res_7573[0i32:+partition_size_7544*1i32]
- let {bool cond_7616} = eq_i32(render_approach_7130, 1i32)
- let {[partition_size_7544]i32 res_7617} = iota32(partition_size_7544, 0i32,
- 1i32)
- let {i32 replicate_arg_7618} = mul32(w_7133, h_7134)
- let {[w_7133][h_7134]i32 res_7619} =
- -- Branch returns: {[w_7133][h_7134]i32}
- if cond_7616
- then {
- let {i64 partition_size_9694} = sext i32 partition_size_7544 to i64
- let {i64 nest_size_9695} = mul_nw64(partition_size_9694, 1i64)
- let {i32 segscan_group_size_9697} =
- get_size(segscan_group_size_9696, group_size)
- let {i32 num_groups_9699} =
- calc_num_groups(nest_size_9695, segscan_num_groups_9698,
- segscan_group_size_9697)
- let {i32 num_threads_9700} =
- mul_nw32(num_groups_9699, segscan_group_size_9697)
- let {[partition_size_7544]i32 res_7647, [partition_size_7544]i32 res_7648,
- [partition_size_7544]i32 res_7649, [partition_size_7544]i32 res_7650,
- [partition_size_7544]i32 res_7651, [partition_size_7544]i32 res_7652,
- [partition_size_7544]i32 res_7653,
- [partition_size_7544]i32 res_7654} =
- segscan_thread
- (#groups=num_groups_9699; groupsize=segscan_group_size_9697)
- ({{0i32},
- [],
- fn {i32} (i32 x_7655, i32 x_7656) =>
- let {i32 res_7657} = add32(x_7655, x_7656)
- in {res_7657}})
- (gtid_9701 < partition_size_7544) (~phys_tid_9702) : {i32, i32, i32,
- i32, i32, i32,
- i32, i32} {
- let {i32 x_7658} = res_7602[gtid_9701]
- let {i32 x_7659} = res_7603[gtid_9701]
- let {i32 x_7660} = res_7605[gtid_9701]
- let {i32 x_7661} = res_7606[gtid_9701]
- let {i32 x_7662} = res_7608[gtid_9701]
- let {i32 x_7663} = res_7609[gtid_9701]
- let {bool cond_7664} = slt32(x_7661, x_7659)
- let {i32 res_7665} =
- -- Branch returns: {i32}
- if cond_7664
- then {x_7660} else {x_7658}
- let {i32 res_7666} =
- -- Branch returns: {i32}
- if cond_7664
- then {x_7661} else {x_7659}
- let {i32 res_7667} =
- -- Branch returns: {i32}
- if cond_7664
- then {x_7658} else {x_7660}
- let {i32 res_7668} =
- -- Branch returns: {i32}
- if cond_7664
- then {x_7659} else {x_7661}
- let {bool cond_7669} = slt32(x_7663, res_7668)
- let {i32 res_7670} =
- -- Branch returns: {i32}
- if cond_7669
- then {x_7662} else {res_7667}
- let {i32 res_7671} =
- -- Branch returns: {i32}
- if cond_7669
- then {x_7663} else {res_7668}
- let {i32 res_7672} =
- -- Branch returns: {i32}
- if cond_7669
- then {res_7667} else {x_7662}
- let {i32 res_7673} =
- -- Branch returns: {i32}
- if cond_7669
- then {res_7668} else {x_7663}
- let {bool cond_7674} = slt32(res_7671, res_7666)
- let {i32 res_7675} =
- -- Branch returns: {i32}
- if cond_7674
- then {res_7670} else {res_7665}
- let {i32 res_7676} =
- -- Branch returns: {i32}
- if cond_7674
- then {res_7671} else {res_7666}
- let {i32 res_7677} =
- -- Branch returns: {i32}
- if cond_7674
- then {res_7665} else {res_7670}
- let {i32 res_7678} =
- -- Branch returns: {i32}
- if cond_7674
- then {res_7666} else {res_7671}
- let {i32 x_7679} = sub32(res_7673, res_7676)
- let {i32 res_7680} = add32(1i32, x_7679)
- return {returns res_7680, returns res_7680, returns res_7675,
- returns res_7676, returns res_7677, returns res_7678,
- returns res_7672, returns res_7673}
- }
- -- res_7689 aliases res_7647
- let {[partition_size_7544]i32 res_7689} = rotate((-1i32), res_7647)
- let {i64 partition_size_9703} = sext i32 partition_size_7544 to i64
- let {i64 nest_size_9704} = mul_nw64(partition_size_9703, 1i64)
- let {i32 segred_group_size_9706} =
- get_size(segred_group_size_9705, group_size)
- let {i32 num_groups_9708} =
- calc_num_groups(nest_size_9704, segred_num_groups_9707,
- segred_group_size_9706)
- let {i32 num_threads_9709} =
- mul_nw32(num_groups_9708, segred_group_size_9706)
- let {[1i32]i32 res_9710} =
- segred_thread
- (#groups=num_groups_9708; groupsize=segred_group_size_9706)
- ({{0i32},
- [],
- commutative fn {i32} (i32 x_7691, i32 x_7692) =>
- let {i32 res_7693} = add32(x_7691, x_7692)
- in {res_7693}})
- (dummy_9711 < 1i32,
- gtid_9712 < partition_size_7544) (~phys_tid_9713) : {i32} {
- let {i32 x_7694} = res_7648[gtid_9712]
- return {returns x_7694}
- }
- let {i32 res_7690} = res_9710[0i32]
- let {bool bounds_invalid_upwards_7695} = slt32(res_7690, 0i32)
- let {bool valid_7696} = not bounds_invalid_upwards_7695
- let {cert range_valid_c_7697} =
- assert(valid_7696, "Range ", 0i32, "..", 1i32, "..<", res_7690,
- " is invalid.", "/prelude/math.fut:453:23-30")
- let {[res_7690]i32 res_7698} = replicate([res_7690], 0i32)
- let {i64 partition_size_9714} = sext i32 partition_size_7544 to i64
- let {i64 nest_size_9715} = mul_nw64(partition_size_9714, 1i64)
- let {i32 seghist_group_size_9717} =
- get_size(seghist_group_size_9716, group_size)
- let {i32 num_groups_9719} =
- calc_num_groups(nest_size_9715, seghist_num_groups_9718,
- seghist_group_size_9717)
- let {i32 num_threads_9720} =
- mul_nw32(num_groups_9719, seghist_group_size_9717)
- let {[res_7690]i32 res_7699} =
- -- Consumes res_7698
- seghist_thread
- (#groups=num_groups_9719; groupsize=seghist_group_size_9717)
- _thread
- (#groups=num_groups_9719; groupsize=seghist_group_size_9717)
- ({res_7690, 1i32,
- {res_7698},
- {0i32},
- [],
- fn {i32} (i32 x_9723, i32 x_9724) =>
- let {i32 res_9725} =
- <range_valid_c_7697>
- smax32(x_9723, x_9724)
- in {res_9725}})
- (gtid_9721 < partition_size_7544) (~phys_tid_9722) : {i32, i32} {
- let {i32 x_9726} = res_7617[gtid_9721]
- let {i32 x_9727} = res_7689[gtid_9721]
- let {bool cond_9728} = eq_i32(x_9726, 0i32)
- let {i32 res_9729} =
- -- Branch returns: {i32}
- if cond_9728
- then {0i32} else {x_9727}
- return {returns res_9729, returns x_9726}
- }
- let {i64 res_9730} = sext i32 res_7690 to i64
- let {i64 nest_size_9731} = mul_nw64(res_9730, 1i64)
- let {i32 segscan_group_size_9733} =
- get_size(segscan_group_size_9732, group_size)
- let {i32 num_groups_9735} =
- calc_num_groups(nest_size_9731, segscan_num_groups_9734,
- segscan_group_size_9733)
- let {i32 num_threads_9736} =
- mul_nw32(num_groups_9735, segscan_group_size_9733)
- let {[res_7690]bool res_7707, [res_7690]i32 res_7708} =
- segscan_thread
- (#groups=num_groups_9735; groupsize=segscan_group_size_9733)
- ({{false, 0i32},
- [],
- fn {bool, i32} (bool x_7709, i32 x_7710, bool x_7711, i32 x_7712) =>
- let {bool res_7713} = logor(x_7709, x_7711)
- let {i32 res_7714} =
- -- Branch returns: {i32}
- if x_7711
- then {x_7712} else {
- let {i32 res_7715} = add32(x_7710, x_7712)
- in {res_7715}
- }
- in {res_7713, res_7714}})
- (gtid_9737 < res_7690) (~phys_tid_9738) : {bool, i32} {
- let {i32 x_7716} = res_7699[gtid_9737]
- let {bool res_7717} = slt32(0i32, x_7716)
- return {returns res_7717, returns x_7716}
- }
- -- res_7718 aliases res_7708
- let {[res_7690]i32 res_7718} = rotate((-1i32), res_7708)
- let {[res_7690]i32 res_7719} = replicate([res_7690], 1i32)
- let {i32 chunk_7833} = res_7690
- let {bool inpacc_7834} = false
- let {i32 inpacc_7835} = 0i32
- let {i32 inpacc_7836} = 0i32
- -- inp_7837 aliases res_7719
- let {[chunk_7833]i32 inp_7837} = reshape((~chunk_7833), res_7719)
- -- inp_7838 aliases res_7708
- let {[chunk_7833]i32 inp_7838} = reshape((~chunk_7833), res_7708)
- -- inp_7839 aliases res_7718
- let {[chunk_7833]i32 inp_7839} = reshape((~chunk_7833), res_7718)
- let {i64 chunk_9739} = sext i32 chunk_7833 to i64
- let {i64 nest_size_9740} = mul_nw64(chunk_9739, 1i64)
- let {i32 segscan_group_size_9742} =
- get_size(segscan_group_size_9741, group_size)
- let {i32 num_groups_9744} =
- calc_num_groups(nest_size_9740, segscan_num_groups_9743,
- segscan_group_size_9742)
- let {i32 num_threads_9745} =
- mul_nw32(num_groups_9744, segscan_group_size_9742)
- let {[chunk_7833]bool resarr0_7840, [chunk_7833]i32 resarr0_7841} =
- segscan_thread
- (#groups=num_groups_9744; groupsize=segscan_group_size_9742)
- ({{false, 0i32},
- [],
- fn {bool, i32} (bool x_7842, i32 x_7843, bool x_7844, i32 x_7845) =>
- let {bool res_7846} = logor(x_7842, x_7844)
- let {i32 res_7847} =
- -- Branch returns: {i32}
- if x_7844
- then {x_7845} else {
- let {i32 res_7848} = add32(x_7843, x_7845)
- in {res_7848}
- }
- in {res_7846, res_7847}})
- (gtid_9746 < chunk_7833) (~phys_tid_9747) : {bool, i32} {
- let {i32 x_7849} = inp_7838[gtid_9746]
- let {i32 x_7850} = inp_7839[gtid_9746]
- let {i32 x_7851} = inp_7837[gtid_9746]
- let {bool res_7852} = eq_i32(x_7849, x_7850)
- let {bool res_7853} = not res_7852
- return {returns res_7853, returns x_7851}
- }
- let {i32 szm1_7854} = sub_nw32(chunk_7833, 1i32)
- let {bool empty_arr_7855} = slt32(szm1_7854, 0i32)
- let {bool lstel_7856, i32 lstel_7857} =
- -- Branch returns: {bool, i32}
- if empty_arr_7855
- then {false, 0i32} else {
- let {bool lstel_tmp_7858} = resarr0_7840[szm1_7854]
- let {i32 lstel_tmp_7859} = resarr0_7841[szm1_7854]
- in {lstel_tmp_7858, lstel_tmp_7859}
- }
- let {bool res_7860} = logor(inpacc_7834, lstel_7856)
- let {i32 res_7861} =
- -- Branch returns: {i32}
- if lstel_7856
- then {lstel_7857} else {
- let {i32 res_7862} = add32(inpacc_7835, lstel_7857)
- in {res_7862}
- }
- let {i64 chunk_9748} = sext i32 chunk_7833 to i64
- let {i64 nest_size_9749} = mul_nw64(chunk_9748, 1i64)
- let {i32 segscan_group_size_9751} =
- get_size(segscan_group_size_9750, group_size)
- let {i32 num_groups_9753} =
- calc_num_groups(nest_size_9749, segscan_num_groups_9752,
- segscan_group_size_9751)
- let {i32 num_threads_9754} =
- mul_nw32(num_groups_9753, segscan_group_size_9751)
- let {[chunk_7833]i32 resarr0_7932, [chunk_7833]i32 map_res_7933,
- [chunk_7833]i32 res_7934, [chunk_7833]i32 res_7935,
- [chunk_7833]i32 res_7936, [chunk_7833]i32 res_7937} =
- segscan_thread
- (#groups=num_groups_9753; groupsize=segscan_group_size_9751)
- ({{0i32},
- [],
- fn {i32} (i32 x_7938, i32 x_7939) =>
- let {i32 res_7940} = add32(x_7938, x_7939)
- in {res_7940}})
- (gtid_9755 < chunk_7833) (~phys_tid_9756) : {i32, i32, i32, i32, i32,
- i32} {
- let {bool x_7941} = resarr0_7840[gtid_9755]
- let {i32 x_7942} = resarr0_7841[gtid_9755]
- let {i32 x_7943} = inp_7838[gtid_9755]
- let {i32 res_7944} =
- -- Branch returns: {i32}
- if x_7941
- then {x_7942} else {
- let {i32 res_7945} = add32(inpacc_7835, x_7942)
- in {res_7945}
- }
- let {i32 res_7946} = sub32(res_7944, 1i32)
- let {bool x_7947} = sle32(0i32, x_7943)
- let {bool y_7948} = slt32(x_7943, partition_size_7544)
- let {bool bounds_check_7949} = logand(x_7947, y_7948)
- let {cert index_certs_7950} =
- assert(bounds_check_7949, "Index [", x_7943,
- "] out of bounds for array of shape [",
- partition_size_7544, "].",
- "futracerlib/lib/github.com/diku-dk/segmented/segmented.fut:74:24-29")
- let {i32 lifted_0_get_arg_7951} =
- <index_certs_7950>
- res_7649[x_7943]
- let {i32 lifted_0_get_arg_7952} =
- <index_certs_7950>
- res_7650[x_7943]
- let {i32 lifted_0_get_arg_7953} =
- <index_certs_7950>
- res_7651[x_7943]
- let {i32 lifted_0_get_arg_7954} =
- <index_certs_7950>
- res_7652[x_7943]
- let {i32 lifted_0_get_arg_7955} =
- <index_certs_7950>
- res_7653[x_7943]
- let {i32 lifted_0_get_arg_7956} =
- <index_certs_7950>
- res_7654[x_7943]
- let {i32 y_7957} = add32(res_7946, lifted_0_get_arg_7952)
- let {i32 y_7958} = sub32(lifted_0_get_arg_7954, lifted_0_get_arg_7952)
- let {bool cond_7959} = sle32(res_7946, y_7958)
- let {i32 res_7960, i32 res_7961} =
- -- Branch returns: {i32, i32}
- if cond_7959
- then {
- let {i32 dx_7962} =
- sub32(lifted_0_get_arg_7953, lifted_0_get_arg_7951)
- let {bool cond_7963} = eq_i32(y_7958, 0i32)
- let {f32 res_7964} =
- -- Branch returns: {f32}
- if cond_7963
- then {0.0f32} else {
- let {f32 res_7965} = sitofp i32 y_7958 to f32
- let {f32 res_7966} = sitofp i32 dx_7962 to f32
- let {f32 res_7967} = fdiv32(res_7966, res_7965)
- in {res_7967}
- }
- let {i32 dx_7968} =
- sub32(lifted_0_get_arg_7955, lifted_0_get_arg_7951)
- let {i32 dy_7969} =
- sub32(lifted_0_get_arg_7956, lifted_0_get_arg_7952)
- let {bool cond_7970} = eq_i32(dy_7969, 0i32)
- let {f32 res_7971} =
- -- Branch returns: {f32}
- if cond_7970
- then {0.0f32} else {
- let {f32 res_7972} = sitofp i32 dy_7969 to f32
- let {f32 res_7973} = sitofp i32 dx_7968 to f32
- let {f32 res_7974} = fdiv32(res_7973, res_7972)
- in {res_7974}
- }
- let {f32 res_7975} = sitofp i32 res_7946 to f32
- let {f32 f32_arg_7976} = fmul32(res_7964, res_7975)
- let {i32 res_7977} = fptosi f32 f32_arg_7976 to i32
- let {i32 x1_7978} = add32(lifted_0_get_arg_7951, res_7977)
- let {f32 f32_arg_7979} = fmul32(res_7971, res_7975)
- let {i32 res_7980} = fptosi f32 f32_arg_7979 to i32
- let {i32 x2_7981} = add32(lifted_0_get_arg_7951, res_7980)
- in {x1_7978, x2_7981}
- } else {
- let {i32 dx_7982} =
- sub32(lifted_0_get_arg_7951, lifted_0_get_arg_7955)
- let {i32 dy_7983} =
- sub32(lifted_0_get_arg_7952, lifted_0_get_arg_7956)
- let {bool cond_7984} = eq_i32(dy_7983, 0i32)
- let {f32 res_7985} =
- -- Branch returns: {f32}
- if cond_7984
- then {0.0f32} else {
- let {f32 res_7986} = sitofp i32 dy_7983 to f32
- let {f32 res_7987} = sitofp i32 dx_7982 to f32
- let {f32 res_7988} = fdiv32(res_7987, res_7986)
- in {res_7988}
- }
- let {i32 dx_7989} =
- sub32(lifted_0_get_arg_7953, lifted_0_get_arg_7955)
- let {i32 dy_7990} =
- sub32(lifted_0_get_arg_7954, lifted_0_get_arg_7956)
- let {bool cond_7991} = eq_i32(dy_7990, 0i32)
- let {f32 res_7992} =
- -- Branch returns: {f32}
- if cond_7991
- then {0.0f32} else {
- let {f32 res_7993} = sitofp i32 dy_7990 to f32
- let {f32 res_7994} = sitofp i32 dx_7989 to f32
- let {f32 res_7995} = fdiv32(res_7994, res_7993)
- in {res_7995}
- }
- let {i32 x_7996} =
- sub32(lifted_0_get_arg_7956, lifted_0_get_arg_7952)
- let {i32 dy_7997} = sub32(x_7996, res_7946)
- let {f32 res_7998} = sitofp i32 dy_7997 to f32
- let {f32 f32_arg_7999} = fmul32(res_7985, res_7998)
- let {i32 res_8000} = fptosi f32 f32_arg_7999 to i32
- let {i32 x1_8001} = sub32(lifted_0_get_arg_7955, res_8000)
- let {f32 f32_arg_8002} = fmul32(res_7992, res_7998)
- let {i32 res_8003} = fptosi f32 f32_arg_8002 to i32
- let {i32 x2_8004} = sub32(lifted_0_get_arg_7955, res_8003)
- in {x1_8001, x2_8004}
- }
- let {i32 res_elem_8005} =
- <index_certs_7950>
- x_7943
- let {i32 res_8006} = sub32(y_7957, y_7957)
- let {i32 res_8007} = abs32 res_8006
- let {i32 res_8008} = sub32(res_7961, res_7960)
- let {i32 res_8009} = abs32 res_8008
- let {i32 res_8010} = smax32(res_8007, res_8009)
- let {i32 res_8011} = add32(1i32, res_8010)
- return {returns res_8011, returns res_8011, returns res_7960,
- returns y_7957, returns res_7961, returns res_elem_8005}
- }
- let {i32 lstel_8020} =
- -- Branch returns: {i32}
- if empty_arr_7855
- then {0i32} else {
- let {i32 lstel_tmp_8021} = resarr0_7932[szm1_7854]
- in {lstel_tmp_8021}
- }
- let {i32 comparatee_9757} = mul_nw32(chunk_7833, 1i32)
- let {bool suff_outer_par_9758} =
- get_size(suff_outer_par_0, threshold ()) <= comparatee_9757
- let {i64 chunk_9790} = sext i32 chunk_7833 to i64
- let {i64 nest_size_9791} = mul_nw64(chunk_9790, 1i64)
- let {i32 segmap_group_size_9792} =
- get_size(segmap_group_size_9783, group_size)
- let {i64 segmap_group_size_9793} = sext i32 segmap_group_size_9792 to i64
- let {i64 segmap_usable_groups_64_9794} =
- sdiv_up64(nest_size_9791, segmap_group_size_9793)
- let {i32 segmap_usable_groups_9795} =
- sext i64 segmap_usable_groups_64_9794 to i32
- let {[chunk_7833]i32 res_9796} =
- segmap_thread
- (#groups=segmap_usable_groups_9795; groupsize=segmap_group_size_9792)
- (gtid_9779 < chunk_7833) (~phys_tid_9780) : {i32} {
- let {i32 x_9797} = resarr0_7932[gtid_9779]
- let {i32 res_9798} = add32(inpacc_7836, x_9797)
- return {returns res_9798}
- }
- -- res_8022 aliases res_9796
- let {[chunk_7833]i32 res_8022} = res_9796
- let {i32 res_8025} = add32(inpacc_7836, lstel_8020)
- let {bool inpacc_7824} = res_7860
- let {i32 inpacc_7825} = res_7861
- let {i32 inpacc_7826} = res_8025
- -- res_7827 aliases res_8022
- let {[res_7690]i32 res_7827} = reshape((~res_7690), res_8022)
- -- res_7828 aliases map_res_7933
- let {[res_7690]i32 res_7828} = reshape((~res_7690), map_res_7933)
- -- res_7829 aliases res_7934
- let {[res_7690]i32 res_7829} = reshape((~res_7690), res_7934)
- -- res_7830 aliases res_7935
- let {[res_7690]i32 res_7830} = reshape((~res_7690), res_7935)
- -- res_7831 aliases res_7936
- let {[res_7690]i32 res_7831} = reshape((~res_7690), res_7936)
- -- res_7832 aliases res_7937
- let {[res_7690]i32 res_7832} = reshape((~res_7690), res_7937)
- -- res_8035 aliases res_7827
- let {[res_7690]i32 res_8035} = rotate((-1i32), res_7827)
- let {[res_7690]i32 res_8036} = iota32(res_7690, 0i32, 1i32)
- let {i64 res_9799} = sext i32 res_7690 to i64
- let {i64 nest_size_9800} = mul_nw64(res_9799, 1i64)
- let {i32 segred_group_size_9802} =
- get_size(segred_group_size_9801, group_size)
- let {i32 num_groups_9804} =
- calc_num_groups(nest_size_9800, segred_num_groups_9803,
- segred_group_size_9802)
- let {i32 num_threads_9805} =
- mul_nw32(num_groups_9804, segred_group_size_9802)
- let {[1i32]i32 res_9806} =
- segred_thread
- (#groups=num_groups_9804; groupsize=segred_group_size_9802)
- ({{0i32},
- [],
- commutative fn {i32} (i32 x_8038, i32 x_8039) =>
- let {i32 res_8040} = add32(x_8038, x_8039)
- in {res_8040}})
- (dummy_9807 < 1i32, gtid_9808 < res_7690) (~phys_tid_9809) : {i32} {
- let {i32 x_8041} = res_7828[gtid_9808]
- return {returns x_8041}
- }
- let {i32 res_8037} = res_9806[0i32]
- let {bool bounds_invalid_upwards_8042} = slt32(res_8037, 0i32)
- let {bool valid_8043} = not bounds_invalid_upwards_8042
- let {cert range_valid_c_8044} =
- assert(valid_8043, "Range ", 0i32, "..", 1i32, "..<", res_8037,
- " is invalid.", "/prelude/math.fut:453:23-30")
- let {[res_8037]i32 res_8045} = replicate([res_8037], 0i32)
- let {i64 res_9810} = sext i32 res_7690 to i64
- let {i64 nest_size_9811} = mul_nw64(res_9810, 1i64)
- let {i32 seghist_group_size_9813} =
- get_size(seghist_group_size_9812, group_size)
- let {i32 num_groups_9815} =
- calc_num_groups(nest_size_9811, seghist_num_groups_9814,
- seghist_group_size_9813)
- let {i32 num_threads_9816} =
- mul_nw32(num_groups_9815, seghist_group_size_9813)
- let {[res_8037]i32 res_8046} =
- -- Consumes res_8045
- seghist_thread
- (#groups=num_groups_9815; groupsize=seghist_group_size_9813)
- _thread
- (#groups=num_groups_9815; groupsize=seghist_group_size_9813)
- ({res_8037, 1i32,
- {res_8045},
- {0i32},
- [],
- fn {i32} (i32 x_9819, i32 x_9820) =>
- let {i32 res_9821} =
- <range_valid_c_8044>
- smax32(x_9819, x_9820)
- in {res_9821}})
- (gtid_9817 < res_7690) (~phys_tid_9818) : {i32, i32} {
- let {i32 x_9822} = res_8036[gtid_9817]
- let {i32 x_9823} = res_8035[gtid_9817]
- let {bool cond_9824} = eq_i32(x_9822, 0i32)
- let {i32 res_9825} =
- -- Branch returns: {i32}
- if cond_9824
- then {0i32} else {x_9823}
- return {returns res_9825, returns x_9822}
- }
- let {i64 res_9826} = sext i32 res_8037 to i64
- let {i64 nest_size_9827} = mul_nw64(res_9826, 1i64)
- let {i32 segscan_group_size_9829} =
- get_size(segscan_group_size_9828, group_size)
- let {i32 num_groups_9831} =
- calc_num_groups(nest_size_9827, segscan_num_groups_9830,
- segscan_group_size_9829)
- let {i32 num_threads_9832} =
- mul_nw32(num_groups_9831, segscan_group_size_9829)
- let {[res_8037]bool res_8054, [res_8037]i32 res_8055} =
- segscan_thread
- (#groups=num_groups_9831; groupsize=segscan_group_size_9829)
- ({{false, 0i32},
- [],
- fn {bool, i32} (bool x_8056, i32 x_8057, bool x_8058, i32 x_8059) =>
- let {bool res_8060} = logor(x_8056, x_8058)
- let {i32 res_8061} =
- -- Branch returns: {i32}
- if x_8058
- then {x_8059} else {
- let {i32 res_8062} = add32(x_8057, x_8059)
- in {res_8062}
- }
- in {res_8060, res_8061}})
- (gtid_9833 < res_8037) (~phys_tid_9834) : {bool, i32} {
- let {i32 x_8063} = res_8046[gtid_9833]
- let {bool res_8064} = slt32(0i32, x_8063)
- return {returns res_8064, returns x_8063}
- }
- -- res_8065 aliases res_8055
- let {[res_8037]i32 res_8065} = rotate((-1i32), res_8055)
- let {[res_8037]i32 res_8066} = replicate([res_8037], 1i32)
- let {i32 chunk_8156} = res_8037
- let {bool inpacc_8157} = false
- let {i32 inpacc_8158} = 0i32
- let {i32 inpacc_8159} = 0i32
- -- inp_8160 aliases res_8066
- let {[chunk_8156]i32 inp_8160} = reshape((~chunk_8156), res_8066)
- -- inp_8161 aliases res_8055
- let {[chunk_8156]i32 inp_8161} = reshape((~chunk_8156), res_8055)
- -- inp_8162 aliases res_8065
- let {[chunk_8156]i32 inp_8162} = reshape((~chunk_8156), res_8065)
- let {i64 chunk_9835} = sext i32 chunk_8156 to i64
- let {i64 nest_size_9836} = mul_nw64(chunk_9835, 1i64)
- let {i32 segscan_group_size_9838} =
- get_size(segscan_group_size_9837, group_size)
- let {i32 num_groups_9840} =
- calc_num_groups(nest_size_9836, segscan_num_groups_9839,
- segscan_group_size_9838)
- let {i32 num_threads_9841} =
- mul_nw32(num_groups_9840, segscan_group_size_9838)
- let {[chunk_8156]bool resarr0_8163, [chunk_8156]i32 resarr0_8164} =
- segscan_thread
- (#groups=num_groups_9840; groupsize=segscan_group_size_9838)
- ({{false, 0i32},
- [],
- fn {bool, i32} (bool x_8165, i32 x_8166, bool x_8167, i32 x_8168) =>
- let {bool res_8169} = logor(x_8165, x_8167)
- let {i32 res_8170} =
- -- Branch returns: {i32}
- if x_8167
- then {x_8168} else {
- let {i32 res_8171} = add32(x_8166, x_8168)
- in {res_8171}
- }
- in {res_8169, res_8170}})
- (gtid_9842 < chunk_8156) (~phys_tid_9843) : {bool, i32} {
- let {i32 x_8172} = inp_8161[gtid_9842]
- let {i32 x_8173} = inp_8162[gtid_9842]
- let {i32 x_8174} = inp_8160[gtid_9842]
- let {bool res_8175} = eq_i32(x_8172, x_8173)
- let {bool res_8176} = not res_8175
- return {returns res_8176, returns x_8174}
- }
- let {i32 szm1_8177} = sub_nw32(chunk_8156, 1i32)
- let {bool empty_arr_8178} = slt32(szm1_8177, 0i32)
- let {bool lstel_8179, i32 lstel_8180} =
- -- Branch returns: {bool, i32}
- if empty_arr_8178
- then {false, 0i32} else {
- let {bool lstel_tmp_8181} = resarr0_8163[szm1_8177]
- let {i32 lstel_tmp_8182} = resarr0_8164[szm1_8177]
- in {lstel_tmp_8181, lstel_tmp_8182}
- }
- let {bool res_8183} = logor(inpacc_8157, lstel_8179)
- let {i32 res_8184} =
- -- Branch returns: {i32}
- if lstel_8179
- then {lstel_8180} else {
- let {i32 res_8185} = add32(inpacc_8158, lstel_8180)
- in {res_8185}
- }
- let {i64 chunk_9844} = sext i32 chunk_8156 to i64
- let {i64 nest_size_9845} = mul_nw64(chunk_9844, 1i64)
- let {i32 segscan_group_size_9847} =
- get_size(segscan_group_size_9846, group_size)
- let {i32 num_groups_9849} =
- calc_num_groups(nest_size_9845, segscan_num_groups_9848,
- segscan_group_size_9847)
- let {i32 num_threads_9850} =
- mul_nw32(num_groups_9849, segscan_group_size_9847)
- let {[chunk_8156]i32 resarr0_8233, [chunk_8156]i32 map_res_8234,
- [chunk_8156]i32 res_8235, [chunk_8156]i32 res_8236,
- [chunk_8156]i32 res_8237} =
- segscan_thread
- (#groups=num_groups_9849; groupsize=segscan_group_size_9847)
- ({{0i32},
- [],
- fn {i32} (i32 x_8238, i32 y_8239) =>
- let {i32 z_8240} = add_nw32(x_8238, y_8239)
- in {z_8240}})
- (gtid_9851 < chunk_8156) (~phys_tid_9852) : {i32, i32, i32, i32, i32} {
- let {bool x_8241} = resarr0_8163[gtid_9851]
- let {i32 x_8242} = resarr0_8164[gtid_9851]
- let {i32 x_8243} = inp_8161[gtid_9851]
- let {i32 res_8244} =
- -- Branch returns: {i32}
- if x_8241
- then {x_8242} else {
- let {i32 res_8245} = add32(inpacc_8158, x_8242)
- in {res_8245}
- }
- let {i32 res_8246} = sub32(res_8244, 1i32)
- let {bool x_8247} = sle32(0i32, x_8243)
- let {bool y_8248} = slt32(x_8243, res_7690)
- let {bool bounds_check_8249} = logand(x_8247, y_8248)
- let {cert index_certs_8250} =
- assert(bounds_check_8249, "Index [", x_8243,
- "] out of bounds for array of shape [",
- res_7690, "].",
- "futracerlib/lib/github.com/diku-dk/segmented/segmented.fut:74:24-29")
- let {i32 lifted_0_get_arg_8251} =
- <index_certs_8250>
- res_7829[x_8243]
- let {i32 lifted_0_get_arg_8252} =
- <index_certs_8250>
- res_7830[x_8243]
- let {i32 lifted_0_get_arg_8253} =
- <index_certs_8250>
- res_7831[x_8243]
- let {i32 lifted_0_get_arg_8254} =
- <index_certs_8250>
- res_7832[x_8243]
- let {i32 abs_arg_8255} =
- sub32(lifted_0_get_arg_8251, lifted_0_get_arg_8253)
- let {i32 res_8256} = abs32 abs_arg_8255
- let {i32 abs_arg_8257} =
- sub32(lifted_0_get_arg_8252, lifted_0_get_arg_8252)
- let {i32 res_8258} = abs32 abs_arg_8257
- let {bool cond_8259} = slt32(res_8258, res_8256)
- let {i32 res_8260, i32 res_8261} =
- -- Branch returns: {i32, i32}
- if cond_8259
- then {
- let {bool cond_8262} =
- slt32(lifted_0_get_arg_8251, lifted_0_get_arg_8253)
- let {i32 res_8263} =
- -- Branch returns: {i32}
- if cond_8262
- then {1i32} else {
- let {bool cond_8264} =
- slt32(lifted_0_get_arg_8253, lifted_0_get_arg_8251)
- let {i32 res_8265} =
- -- Branch returns: {i32}
- if cond_8264
- then {-1i32} else {0i32}
- in {res_8265}
- }
- let {bool cond_8266} =
- eq_i32(lifted_0_get_arg_8253, lifted_0_get_arg_8251)
- let {f32 res_8267} =
- -- Branch returns: {f32}
- if cond_8266
- then {-1.0f32} else {
- let {f32 res_8268} = sitofp i32 abs_arg_8257 to f32
- let {i32 abs_arg_8269} =
- sub32(lifted_0_get_arg_8253, lifted_0_get_arg_8251)
- let {i32 res_8270} = abs32 abs_arg_8269
- let {f32 res_8271} = sitofp i32 res_8270 to f32
- let {f32 res_8272} = fdiv32(res_8268, res_8271)
- in {res_8272}
- }
- let {i32 y_8273} = mul32(res_8246, res_8263)
- let {i32 res_8274} = add32(lifted_0_get_arg_8251, y_8273)
- let {f32 res_8275} = sitofp i32 res_8246 to f32
- let {f32 t32_arg_8276} = fmul32(res_8267, res_8275)
- let {i32 res_8277} = fptosi f32 t32_arg_8276 to i32
- let {i32 res_8278} = add32(lifted_0_get_arg_8252, res_8277)
- in {res_8274, res_8278}
- } else {
- let {bool cond_8279} =
- slt32(lifted_0_get_arg_8251, lifted_0_get_arg_8253)
- let {f32 res_8280} =
- -- Branch returns: {f32}
- if cond_8279
- then {1.0f32} else {-1.0f32}
- let {f32 res_8281} = sitofp i32 res_8246 to f32
- let {f32 t32_arg_8282} = fmul32(res_8280, res_8281)
- let {i32 res_8283} = fptosi f32 t32_arg_8282 to i32
- let {i32 res_8284} = add32(lifted_0_get_arg_8251, res_8283)
- in {res_8284, lifted_0_get_arg_8252}
- }
- let {bool cond_8285} = sle32(0i32, res_8260)
- let {bool res_8286} = slt32(res_8260, w_7133)
- let {bool x_8287} = logand(cond_8285, res_8286)
- let {bool res_8288} = sle32(0i32, res_8261)
- let {bool x_8289} = logand(x_8287, res_8288)
- let {bool res_8290} = slt32(res_8261, h_7134)
- let {bool x_8291} = logand(x_8289, res_8290)
- let {bool cond_neg_8292} = not x_8291
- let {i32 res_8293} = btoi bool cond_neg_8292 to i32
- let {bool is_i_8294} = eq_i32(res_8293, 0i32)
- let {bool cond_neg_8295} = not is_i_8294
- let {i32 part_res_8296} = btoi bool cond_neg_8295 to i32
- let {i32 part_res_8297} = btoi bool is_i_8294 to i32
- return {returns part_res_8297, returns part_res_8296,
- returns res_8260, returns res_8261,
- returns lifted_0_get_arg_8254}
- }
- let {i32 lstel_8305} =
- -- Branch returns: {i32}
- if empty_arr_8178
- then {0i32} else {
- let {i32 lstel_tmp_8306} = resarr0_8233[szm1_8177]
- in {lstel_tmp_8306}
- }
- let {i32 comparatee_9853} = mul_nw32(chunk_8156, 1i32)
- let {bool suff_outer_par_9854} =
- get_size(suff_outer_par_1, threshold ()) <= comparatee_9853
- let {i64 chunk_9886} = sext i32 chunk_8156 to i64
- let {i64 nest_size_9887} = mul_nw64(chunk_9886, 1i64)
- let {i32 segmap_group_size_9888} =
- get_size(segmap_group_size_9879, group_size)
- let {i64 segmap_group_size_9889} = sext i32 segmap_group_size_9888 to i64
- let {i64 segmap_usable_groups_64_9890} =
- sdiv_up64(nest_size_9887, segmap_group_size_9889)
- let {i32 segmap_usable_groups_9891} =
- sext i64 segmap_usable_groups_64_9890 to i32
- let {[chunk_8156]i32 res_9892} =
- segmap_thread
- (#groups=segmap_usable_groups_9891; groupsize=segmap_group_size_9888)
- (gtid_9875 < chunk_8156) (~phys_tid_9876) : {i32} {
- let {i32 y_9893} = resarr0_8233[gtid_9875]
- let {i32 z_9894} = add_nw32(inpacc_8159, y_9893)
- return {returns z_9894}
- }
- -- res_8307 aliases res_9892
- let {[chunk_8156]i32 res_8307} = res_9892
- let {i32 z_8310} = add_nw32(inpacc_8159, lstel_8305)
- let {bool inpacc_8148} = res_8183
- let {i32 inpacc_8149} = res_8184
- let {i32 inpacc_8150} = z_8310
- -- offsets_8151 aliases res_8307
- let {[res_8037]i32 offsets_8151} = reshape((~res_8037), res_8307)
- -- increments_8152 aliases map_res_8234
- let {[res_8037]i32 increments_8152} = reshape((~res_8037), map_res_8234)
- -- res_8153 aliases res_8235
- let {[res_8037]i32 res_8153} = reshape((~res_8037), res_8235)
- -- res_8154 aliases res_8236
- let {[res_8037]i32 res_8154} = reshape((~res_8037), res_8236)
- -- res_8155 aliases res_8237
- let {[res_8037]i32 res_8155} = reshape((~res_8037), res_8237)
- let {i32 last_index_8319} = sub_nw32(res_8037, 1i32)
- let {bool is_empty_8320} = eq_i32(res_8037, 0i32)
- let {i32 partition_size_8321} =
- -- Branch returns: {i32}
- if is_empty_8320
- then {0i32} else {
- let {i32 last_offset_8322} = offsets_8151[last_index_8319]
- in {last_offset_8322}
- }
- let {[res_8037]i32 partition_dest_8323} = scratch(i32, res_8037)
- let {[res_8037]i32 partition_dest_8324} = scratch(i32, res_8037)
- let {[res_8037]i32 partition_dest_8325} = scratch(i32, res_8037)
- let {i64 res_9897} = sext i32 res_8037 to i64
- let {i64 nest_size_9898} = mul_nw64(res_9897, 1i64)
- let {i32 segmap_group_size_9900} =
- get_size(segmap_group_size_9899, group_size)
- let {i64 segmap_group_size_9901} = sext i32 segmap_group_size_9900 to i64
- let {i64 segmap_usable_groups_64_9902} =
- sdiv_up64(nest_size_9898, segmap_group_size_9901)
- let {i32 segmap_usable_groups_9903} =
- sext i64 segmap_usable_groups_64_9902 to i32
- let {[res_8037]i32 partition_res_8326, [res_8037]i32 partition_res_8327,
- [res_8037]i32 partition_res_8328} =
- -- Consumes partition_dest_8323, partition_dest_8324, partition_dest_8325
- segmap_thread
- (#groups=segmap_usable_groups_9903; groupsize=segmap_group_size_9900)
- (write_i_9895 < res_8037) (~phys_tid_9896) : {i32, i32, i32} {
- let {i32 c_8329} = increments_8152[write_i_9895]
- let {i32 offset_8330} = offsets_8151[write_i_9895]
- let {i32 v_8331} = res_8153[write_i_9895]
- let {i32 v_8332} = res_8154[write_i_9895]
- let {i32 v_8333} = res_8155[write_i_9895]
- let {bool is_this_one_8334} = eq_i32(c_8329, 0i32)
- let {i32 this_offset_8335} = add_nw32(-1i32, offset_8330)
- let {i32 total_res_8336} =
- -- Branch returns: {i32}
- if is_this_one_8334
- then {this_offset_8335} else {-1i32}
- return {partition_dest_8323 with ([total_res_8336 < res_8037] <- v_8331),
- partition_dest_8324 with ([total_res_8336 < res_8037] <- v_8332),
- partition_dest_8325 with ([total_res_8336 < res_8037] <- v_8333)}
- }
- let {bool empty_slice_8337} = eq_i32(partition_size_8321, 0i32)
- let {i32 m_8338} = sub32(partition_size_8321, 1i32)
- let {bool zero_leq_i_p_m_t_s_8339} = sle32(0i32, m_8338)
- let {bool i_p_m_t_s_leq_w_8340} = slt32(m_8338, res_8037)
- let {bool i_lte_j_8341} = sle32(0i32, partition_size_8321)
- let {bool y_8342} = logand(zero_leq_i_p_m_t_s_8339, i_p_m_t_s_leq_w_8340)
- let {bool y_8343} = logand(i_lte_j_8341, y_8342)
- let {bool ok_or_empty_8344} = logor(empty_slice_8337, y_8343)
- let {cert index_certs_8345} =
- assert(ok_or_empty_8344, "Index [:", partition_size_8321,
- "] out of bounds for array of shape [",
- res_8037, "].", "/prelude/soacs.fut:141:6-16")
- -- res_8346 aliases partition_res_8326
- let {[partition_size_8321]i32 res_8346} =
- <index_certs_8345>
- partition_res_8326[0i32:+partition_size_8321*1i32]
- -- res_8347 aliases partition_res_8327
- let {[partition_size_8321]i32 res_8347} =
- <index_certs_8345>
- partition_res_8327[0i32:+partition_size_8321*1i32]
- -- res_8348 aliases partition_res_8328
- let {[partition_size_8321]i32 res_8348} =
- <index_certs_8345>
- partition_res_8328[0i32:+partition_size_8321*1i32]
- let {bool bounds_invalid_upwards_8349} = slt32(replicate_arg_7618, 0i32)
- let {bool valid_8350} = not bounds_invalid_upwards_8349
- let {cert range_valid_c_8351} =
- assert(valid_8350, "Range ", 0i32, "..", 1i32, "..<",
- replicate_arg_7618, " is invalid.",
- "/prelude/math.fut:453:23-30")
- let {[replicate_arg_7618]i64 res_8352} = replicate([replicate_arg_7618],
- -1i64)
- let {i64 partition_size_9904} = sext i32 partition_size_8321 to i64
- let {i64 nest_size_9905} = mul_nw64(partition_size_9904, 1i64)
- let {i32 seghist_group_size_9907} =
- get_size(seghist_group_size_9906, group_size)
- let {i32 num_groups_9909} =
- calc_num_groups(nest_size_9905, seghist_num_groups_9908,
- seghist_group_size_9907)
- let {i32 num_threads_9910} =
- mul_nw32(num_groups_9909, seghist_group_size_9907)
- let {[replicate_arg_7618]i64 res_8353} =
- -- Consumes res_8352
- seghist_thread
- (#groups=num_groups_9909; groupsize=seghist_group_size_9907)
- _thread
- (#groups=num_groups_9909; groupsize=seghist_group_size_9907)
- ({replicate_arg_7618, 1i32,
- {res_8352},
- {-1i64},
- [],
- fn {i64} (i64 x_9913, i64 x_9914) =>
- let {i64 i64_arg_9915} = ashr64(x_9913, 32i64)
- let {i32 res_9916} = sext i64 i64_arg_9915 to i32
- let {i32 res_9917} = sext i64 x_9913 to i32
- let {i64 i64_arg_9918} = ashr64(x_9914, 32i64)
- let {i32 res_9919} = sext i64 i64_arg_9918 to i32
- let {i32 res_9920} = sext i64 x_9914 to i32
- let {bool cond_9921} = eq_i32(res_9917, -1i32)
- let {i64 res_9922} =
- -- Branch returns: {i64}
- if cond_9921
- then {x_9914} else {
- let {bool cond_9923} = eq_i32(res_9920, -1i32)
- let {i64 res_9924} =
- -- Branch returns: {i64}
- if cond_9923
- then {x_9913} else {
- let {bool zero_9925} = eq_i32(h_7134, 0i32)
- let {bool nonzero_9926} = not zero_9925
- let {cert nonzero_cert_9927} =
- assert(nonzero_9926, "division by zero",
- "futracerlib/render.fut:321:32-39")
- let {i32 res_9928} =
- <nonzero_cert_9927>
- sdiv32(res_9916, h_7134)
- let {i32 res_9929} =
- <nonzero_cert_9927>
- smod32(res_9916, h_7134)
- let {i32 res_9930} =
- <nonzero_cert_9927>
- sdiv32(res_9919, h_7134)
- let {i32 res_9931} =
- <nonzero_cert_9927>
- smod32(res_9919, h_7134)
- let {i32 res_9932} =
- <index_certs_7601>
- partition_res_7560[res_9917]
- let {i32 res_9933} =
- <index_certs_7601>
- partition_res_7561[res_9917]
- let {f32 res_9934} =
- <index_certs_7601>
- partition_res_7562[res_9917]
- let {i32 res_9935} =
- <index_certs_7601>
- partition_res_7563[res_9917]
- let {i32 res_9936} =
- <index_certs_7601>
- partition_res_7564[res_9917]
- let {f32 res_9937} =
- <index_certs_7601>
- partition_res_7565[res_9917]
- let {i32 res_9938} =
- <index_certs_7601>
- partition_res_7566[res_9917]
- let {i32 res_9939} =
- <index_certs_7601>
- partition_res_7567[res_9917]
- let {f32 res_9940} =
- <index_certs_7601>
- partition_res_7568[res_9917]
- let {i32 res_9941} =
- <index_certs_7601>
- partition_res_7560[res_9920]
- let {i32 res_9942} =
- <index_certs_7601>
- partition_res_7561[res_9920]
- let {f32 res_9943} =
- <index_certs_7601>
- partition_res_7562[res_9920]
- let {i32 res_9944} =
- <index_certs_7601>
- partition_res_7563[res_9920]
- let {i32 res_9945} =
- <index_certs_7601>
- partition_res_7564[res_9920]
- let {f32 res_9946} =
- <index_certs_7601>
- partition_res_7565[res_9920]
- let {i32 res_9947} =
- <index_certs_7601>
- partition_res_7566[res_9920]
- let {i32 res_9948} =
- <index_certs_7601>
- partition_res_7567[res_9920]
- let {f32 res_9949} =
- <index_certs_7601>
- partition_res_7568[res_9920]
- let {i32 x_9950} = sub32(res_9936, res_9939)
- let {i32 y_9951} = sub32(res_9932, res_9938)
- let {i32 x_9952} = mul32(x_9950, y_9951)
- let {i32 x_9953} = sub32(res_9938, res_9935)
- let {i32 y_9954} = sub32(res_9933, res_9939)
- let {i32 y_9955} = mul32(x_9953, y_9954)
- let {i32 factor_9956} = add32(x_9952, y_9955)
- let {bool cond_9957} = eq_i32(factor_9956, 0i32)
- let {bool cond_9958} = not cond_9957
- let {f32 res_9959, f32 res_9960, f32 res_9961} =
- -- Branch returns: {f32, f32, f32}
- if cond_9958
- then {
- let {i32 y_9962} = sub32(res_9928, res_9938)
- let {i32 x_9963} = mul32(x_9950, y_9962)
- let {i32 y_9964} = sub32(res_9929, res_9939)
- let {i32 y_9965} = mul32(x_9953, y_9964)
- let {i32 a_9966} = add32(x_9963, y_9965)
- let {i32 x_9967} = sub32(res_9939, res_9933)
- let {i32 x_9968} = mul32(y_9962, x_9967)
- let {i32 y_9969} = mul32(y_9951, y_9964)
- let {i32 b_9970} = add32(x_9968, y_9969)
- let {f32 res_9971} = sitofp i32 factor_9956 to f32
- let {f32 res_9972} = sitofp i32 a_9966 to f32
- let {f32 an_9973} = fdiv32(res_9972, res_9971)
- let {f32 res_9974} = sitofp i32 b_9970 to f32
- let {f32 bn_9975} = fdiv32(res_9974, res_9971)
- let {f32 x_9976} = fsub32(1.0f32, an_9973)
- let {f32 cn_9977} = fsub32(x_9976, bn_9975)
- in {an_9973, bn_9975, cn_9977}
- } else {-1.0f32, -1.0f32, -1.0f32}
- let {i32 x_9978} = sub32(res_9945, res_9948)
- let {i32 y_9979} = sub32(res_9941, res_9947)
- let {i32 x_9980} = mul32(x_9978, y_9979)
- let {i32 x_9981} = sub32(res_9947, res_9944)
- let {i32 y_9982} = sub32(res_9942, res_9948)
- let {i32 y_9983} = mul32(x_9981, y_9982)
- let {i32 factor_9984} = add32(x_9980, y_9983)
- let {bool cond_9985} = eq_i32(factor_9984, 0i32)
- let {bool cond_9986} = not cond_9985
- let {f32 res_9987, f32 res_9988, f32 res_9989} =
- -- Branch returns: {f32, f32, f32}
- if cond_9986
- then {
- let {i32 y_9990} = sub32(res_9930, res_9947)
- let {i32 x_9991} = mul32(x_9978, y_9990)
- let {i32 y_9992} = sub32(res_9931, res_9948)
- let {i32 y_9993} = mul32(x_9981, y_9992)
- let {i32 a_9994} = add32(x_9991, y_9993)
- let {i32 x_9995} = sub32(res_9948, res_9942)
- let {i32 x_9996} = mul32(y_9990, x_9995)
- let {i32 y_9997} = mul32(y_9979, y_9992)
- let {i32 b_9998} = add32(x_9996, y_9997)
- let {f32 res_9999} = sitofp i32 factor_9984 to f32
- let {f32 res_10000} = sitofp i32 a_9994 to f32
- let {f32 an_10001} = fdiv32(res_10000, res_9999)
- let {f32 res_10002} = sitofp i32 b_9998 to f32
- let {f32 bn_10003} = fdiv32(res_10002, res_9999)
- let {f32 x_10004} = fsub32(1.0f32, an_10001)
- let {f32 cn_10005} = fsub32(x_10004, bn_10003)
- in {an_10001, bn_10003, cn_10005}
- } else {-1.0f32, -1.0f32, -1.0f32}
- let {f32 x_10006} = fmul32(res_9934, res_9959)
- let {f32 y_10007} = fmul32(res_9937, res_9960)
- let {f32 x_10008} = fadd32(x_10006, y_10007)
- let {f32 y_10009} = fmul32(res_9940, res_9961)
- let {f32 res_10010} = fadd32(x_10008, y_10009)
- let {f32 x_10011} = fmul32(res_9943, res_9987)
- let {f32 y_10012} = fmul32(res_9946, res_9988)
- let {f32 x_10013} = fadd32(x_10011, y_10012)
- let {f32 y_10014} = fmul32(res_9949, res_9989)
- let {f32 res_10015} = fadd32(x_10013, y_10014)
- let {bool cond_10016} = lt32(res_10010, res_10015)
- let {i64 res_10017} =
- -- Branch returns: {i64}
- if cond_10016
- then {x_9913} else {x_9914}
- in {res_10017}
- }
- in {res_9924}
- }
- in {res_9922}})
- (gtid_9911 < partition_size_8321) (~phys_tid_9912) : {i32, i64} {
- let {i32 x_10018} = res_8346[gtid_9911]
- let {i32 x_10019} = res_8347[gtid_9911]
- let {i32 x_10020} = res_8348[gtid_9911]
- let {i32 x_10021} = mul32(h_7134, x_10018)
- let {i32 res_10022} = add32(x_10019, x_10021)
- let {i64 res_10023} = sext i32 res_10022 to i64
- let {i64 x_10024} = shl64(res_10023, 32i64)
- let {i64 res_10025} = sext i32 x_10020 to i64
- let {i64 res_10026} = or64(x_10024, res_10025)
- return {returns res_10022, returns res_10026}
- }
- let {bool zero_8468} = eq_i32(h_7134, 0i32)
- let {bool nonzero_8469} = not zero_8468
- let {cert nonzero_cert_8470} =
- assert(nonzero_8469, "division by zero",
- "futracerlib/render.fut:332:16-22")
- let {i32 comparatee_10027} = mul_nw32(replicate_arg_7618, 1i32)
- let {bool suff_outer_par_10028} =
- get_size(suff_outer_par_2, threshold ()) <= comparatee_10027
- let {i64 replicate_arg_10534} = sext i32 replicate_arg_7618 to i64
- let {i64 nest_size_10535} = mul_nw64(replicate_arg_10534, 1i64)
- let {i32 segmap_group_size_10536} =
- get_size(segmap_group_size_10369, group_size)
- let {i64 segmap_group_size_10537} =
- sext i32 segmap_group_size_10536 to i64
- let {i64 segmap_usable_groups_64_10538} =
- sdiv_up64(nest_size_10535, segmap_group_size_10537)
- let {i32 segmap_usable_groups_10539} =
- sext i64 segmap_usable_groups_64_10538 to i32
- let {[replicate_arg_7618]i32 res_10540} =
- segmap_thread
- (#groups=segmap_usable_groups_10539; groupsize=segmap_group_size_10536)
- (gtid_10365 < replicate_arg_7618) (~phys_tid_10366) : {i32} {
- let {i64 x_10541} = res_8353[gtid_10365]
- let {i64 i64_arg_10542} = ashr64(x_10541, 32i64)
- let {i32 res_10543} = sext i64 i64_arg_10542 to i32
- let {i32 res_10544} = sext i64 x_10541 to i32
- let {i32 res_10545} =
- <nonzero_cert_8470>
- sdiv32(res_10543, h_7134)
- let {i32 res_10546} =
- <nonzero_cert_8470>
- smod32(res_10543, h_7134)
- let {bool cond_10547} = eq_i32(res_10544, -1i32)
- let {i32 res_10548} =
- -- Branch returns: {i32}
- if cond_10547
- then {0i32} else {
- let {i32 res_10549} =
- <index_certs_7601>
- partition_res_7560[res_10544]
- let {i32 res_10550} =
- <index_certs_7601>
- partition_res_7561[res_10544]
- let {f32 res_10551} =
- <index_certs_7601>
- partition_res_7562[res_10544]
- let {i32 res_10552} =
- <index_certs_7601>
- partition_res_7563[res_10544]
- let {i32 res_10553} =
- <index_certs_7601>
- partition_res_7564[res_10544]
- let {f32 res_10554} =
- <index_certs_7601>
- partition_res_7565[res_10544]
- let {i32 res_10555} =
- <index_certs_7601>
- partition_res_7566[res_10544]
- let {i32 res_10556} =
- <index_certs_7601>
- partition_res_7567[res_10544]
- let {f32 res_10557} =
- <index_certs_7601>
- partition_res_7568[res_10544]
- let {i32 res_10558} =
- <index_certs_7601>
- partition_res_7569[res_10544]
- let {f32 res_10559} =
- <index_certs_7601>
- partition_res_7570[res_10544]
- let {f32 res_10560} =
- <index_certs_7601>
- partition_res_7571[res_10544]
- let {f32 res_10561} =
- <index_certs_7601>
- partition_res_7572[res_10544]
- let {i32 res_10562} =
- <index_certs_7601>
- partition_res_7573[res_10544]
- let {i32 x_10563} = sub32(res_10553, res_10556)
- let {i32 y_10564} = sub32(res_10549, res_10555)
- let {i32 x_10565} = mul32(x_10563, y_10564)
- let {i32 x_10566} = sub32(res_10555, res_10552)
- let {i32 y_10567} = sub32(res_10550, res_10556)
- let {i32 y_10568} = mul32(x_10566, y_10567)
- let {i32 factor_10569} = add32(x_10565, y_10568)
- let {bool cond_10570} = eq_i32(factor_10569, 0i32)
- let {bool cond_10571} = not cond_10570
- let {f32 res_10572, f32 res_10573, f32 res_10574} =
- -- Branch returns: {f32, f32, f32}
- if cond_10571
- then {
- let {i32 y_10575} = sub32(res_10545, res_10555)
- let {i32 x_10576} = mul32(x_10563, y_10575)
- let {i32 y_10577} = sub32(res_10546, res_10556)
- let {i32 y_10578} = mul32(x_10566, y_10577)
- let {i32 a_10579} = add32(x_10576, y_10578)
- let {i32 x_10580} = sub32(res_10556, res_10550)
- let {i32 x_10581} = mul32(y_10575, x_10580)
- let {i32 y_10582} = mul32(y_10564, y_10577)
- let {i32 b_10583} = add32(x_10581, y_10582)
- let {f32 res_10584} = sitofp i32 factor_10569 to f32
- let {f32 res_10585} = sitofp i32 a_10579 to f32
- let {f32 an_10586} = fdiv32(res_10585, res_10584)
- let {f32 res_10587} = sitofp i32 b_10583 to f32
- let {f32 bn_10588} = fdiv32(res_10587, res_10584)
- let {f32 x_10589} = fsub32(1.0f32, an_10586)
- let {f32 cn_10590} = fsub32(x_10589, bn_10588)
- in {an_10586, bn_10588, cn_10590}
- } else {-1.0f32, -1.0f32, -1.0f32}
- let {f32 x_10591} = fmul32(res_10551, res_10572)
- let {f32 y_10592} = fmul32(res_10554, res_10573)
- let {f32 x_10593} = fadd32(x_10591, y_10592)
- let {f32 y_10594} = fmul32(res_10557, res_10574)
- let {f32 res_10595} = fadd32(x_10593, y_10594)
- let {bool cond_10596} = eq_i32(res_10558, 1i32)
- let {f32 res_10597, f32 res_10598, f32 res_10599} =
- -- Branch returns: {f32, f32, f32}
- if cond_10596
- then {res_10559, res_10560, res_10561} else {
- let {bool cond_10600} = eq_i32(res_10558, 2i32)
- let {f32 res_10601, f32 res_10602, f32 res_10603} =
- -- Branch returns: {f32, f32, f32}
- if cond_10600
- then {
- let {i32 i_10604} = sdiv32(res_10562, 2i32)
- let {i32 x_10605} = and32(1i32, res_10562)
- let {bool cond_10606} = eq_i32(x_10605, 0i32)
- let {f32 res_10607} =
- -- Branch returns: {f32}
- if cond_10606
- then {0.0f32} else {1.0f32}
- let {f32 res_10608} =
- -- Branch returns: {f32}
- if cond_10606
- then {1.0f32} else {0.0f32}
- let {f32 x_10609} = fmul32(res_10572, res_10607)
- let {f32 y_10610} = fmul32(res_10573, res_10608)
- let {f32 x_10611} = fadd32(x_10609, y_10610)
- let {f32 y_10612} = fmul32(res_10574, res_10607)
- let {f32 yn_10613} = fadd32(x_10611, y_10612)
- let {f32 y_10614} = fmul32(res_10573, res_10607)
- let {f32 x_10615} = fadd32(x_10609, y_10614)
- let {f32 y_10616} = fmul32(res_10574, res_10608)
- let {f32 xn_10617} = fadd32(x_10615, y_10616)
- let {f32 res_10618} = sitofp i32 surface_h_7153 to f32
- let {f32 t32_arg_10619} = fmul32(yn_10613, res_10618)
- let {i32 res_10620} = fptosi f32 t32_arg_10619 to i32
- let {f32 res_10621} = sitofp i32 surface_w_7152 to f32
- let {f32 t32_arg_10622} = fmul32(xn_10617, res_10621)
- let {i32 res_10623} = fptosi f32 t32_arg_10622 to i32
- let {i32 clamp_arg_10624} = sub32(surface_h_7153, 1i32)
- let {i32 res_10625} = smax32(0i32, res_10620)
- let {i32 res_10626} = smin32(clamp_arg_10624, res_10625)
- let {i32 clamp_arg_10627} = sub32(surface_w_7152, 1i32)
- let {i32 res_10628} = smax32(0i32, res_10623)
- let {i32 res_10629} = smin32(clamp_arg_10627, res_10628)
- let {i32 binop_y_10630} =
- mul_nw32(surface_w_7152, surface_h_7153)
- let {i32 binop_x_10631} = mul_nw32(i_10604, binop_y_10630)
- let {i32 binop_y_10632} =
- mul_nw32(surface_w_7152, res_10626)
- let {i32 binop_x_10633} =
- add_nw32(binop_x_10631, binop_y_10632)
- let {i32 new_index_10634} =
- add_nw32(res_10629, binop_x_10633)
- let {f32 res_10635} =
- <dim_ok_7201>
- surface_textures_flat_hsv_hs_7154[new_index_10634]
- let {f32 res_10636} =
- <empty_or_match_cert_7195, dim_ok_7201>
- surface_textures_flat_hsv_ss_7155[new_index_10634]
- let {f32 res_10637} =
- <empty_or_match_cert_7197, dim_ok_7201>
- surface_textures_flat_hsv_vs_7156[new_index_10634]
- in {res_10635, res_10636, res_10637}
- } else {0.0f32, 0.0f32, 0.0f32}
- in {res_10601, res_10602, res_10603}
- }
- let {f32 y_10638} = fpow32(res_10595, 2.0f32)
- let {f32 min_arg_10639} = fdiv32(2000000.0f32, y_10638)
- let {f32 res_10640} = fmin32(1.0f32, min_arg_10639)
- let {f32 res_10641} = fmul32(res_10599, res_10640)
- let {f32 c_10642} = fmul32(res_10598, res_10641)
- let {f32 h'_10643} = fdiv32(res_10597, 60.0f32)
- let {f32 t32_arg_10644} = fdiv32(h'_10643, 2.0f32)
- let {i32 res_10645} = fptosi f32 t32_arg_10644 to i32
- let {f32 res_10646} = sitofp i32 res_10645 to f32
- let {f32 y_10647} = fmul32(2.0f32, res_10646)
- let {f32 res_10648} = fsub32(h'_10643, y_10647)
- let {f32 abs_arg_10649} = fsub32(res_10648, 1.0f32)
- let {f32 res_10650} = fabs32 abs_arg_10649
- let {f32 y_10651} = fsub32(1.0f32, res_10650)
- let {f32 x_10652} = fmul32(c_10642, y_10651)
- let {bool cond_10653} = le32(0.0f32, h'_10643)
- let {bool res_10654} = lt32(h'_10643, 1.0f32)
- let {bool x_10655} = logand(cond_10653, res_10654)
- let {f32 res_10656, f32 res_10657, f32 res_10658} =
- -- Branch returns: {f32, f32, f32}
- if x_10655
- then {c_10642, x_10652, 0.0f32} else {
- let {bool cond_10659} = le32(1.0f32, h'_10643)
- let {bool res_10660} = lt32(h'_10643, 2.0f32)
- let {bool x_10661} = logand(cond_10659, res_10660)
- let {f32 res_10662, f32 res_10663, f32 res_10664} =
- -- Branch returns: {f32, f32, f32}
- if x_10661
- then {x_10652, c_10642, 0.0f32} else {
- let {bool cond_10665} = le32(2.0f32, h'_10643)
- let {bool res_10666} = lt32(h'_10643, 3.0f32)
- let {bool x_10667} = logand(cond_10665, res_10666)
- let {f32 res_10668, f32 res_10669, f32 res_10670} =
- -- Branch returns: {f32, f32, f32}
- if x_10667
- then {0.0f32, c_10642, x_10652} else {
- let {bool cond_10671} = le32(3.0f32, h'_10643)
- let {bool res_10672} = lt32(h'_10643, 4.0f32)
- let {bool x_10673} = logand(cond_10671, res_10672)
- let {f32 res_10674} =
- -- Branch returns: {f32}
- if x_10673
- then {x_10652} else {0.0f32}
- let {f32 res_10675, f32 res_10676} =
- -- Branch returns: {f32, f32}
- if x_10673
- then {0.0f32, c_10642} else {
- let {bool cond_10677} = le32(4.0f32, h'_10643)
- let {bool res_10678} = lt32(h'_10643, 5.0f32)
- let {bool x_10679} = logand(cond_10677, res_10678)
- let {f32 res_10680, f32 res_10681} =
- -- Branch returns: {f32, f32}
- if x_10679
- then {x_10652, c_10642} else {
- let {bool cond_10682} = le32(5.0f32, h'_10643)
- let {bool res_10683} = lt32(h'_10643, 6.0f32)
- let {bool x_10684} =
- logand(cond_10682, res_10683)
- let {f32 res_10685} =
- -- Branch returns: {f32}
- if x_10684
- then {c_10642} else {0.0f32}
- let {f32 res_10686} =
- -- Branch returns: {f32}
- if x_10684
- then {x_10652} else {0.0f32}
- in {res_10685, res_10686}
- }
- in {res_10680, res_10681}
- }
- in {res_10675, res_10674, res_10676}
- }
- in {res_10668, res_10669, res_10670}
- }
- in {res_10662, res_10663, res_10664}
- }
- let {f32 m_10687} = fsub32(res_10641, c_10642)
- let {f32 res_10688} = fadd32(res_10656, m_10687)
- let {f32 res_10689} = fadd32(res_10657, m_10687)
- let {f32 res_10690} = fadd32(res_10658, m_10687)
- let {f32 f32_arg_10691} = fmul32(255.0f32, res_10688)
- let {i32 unsign_arg_10692} = fptoui f32 f32_arg_10691 to i32
- let {f32 f32_arg_10693} = fmul32(255.0f32, res_10689)
- let {i32 unsign_arg_10694} = fptoui f32 f32_arg_10693 to i32
- let {f32 f32_arg_10695} = fmul32(255.0f32, res_10690)
- let {i32 unsign_arg_10696} = fptoui f32 f32_arg_10695 to i32
- let {i32 x_10697} = shl32(unsign_arg_10692, 16i32)
- let {i32 y_10698} = shl32(unsign_arg_10694, 8i32)
- let {i32 x_10699} = or32(x_10697, y_10698)
- let {i32 res_10700} = or32(unsign_arg_10696, x_10699)
- in {res_10700}
- }
- return {returns res_10548}
- }
- -- res_8471 aliases res_10540
- let {[replicate_arg_7618]i32 res_8471} = res_10540
- -- res_8632 aliases res_8471
- let {[w_7133][h_7134]i32 res_8632} =
- <range_valid_c_8351>
- reshape((w_7133, h_7134), res_8471)
- in {res_8632}
- } else {
- let {bool cond_8633} = eq_i32(render_approach_7130, 2i32)
- let {[w_7133][h_7134]i32 res_8634} =
- -- Branch returns: {[w_7133][h_7134]i32}
- if cond_8633
- then {
- let {bool cond_8635} = eq_i32(n_draw_rects_x_7131, 1i32)
- let {bool res_8636} = eq_i32(n_draw_rects_y_7132, 1i32)
- let {bool x_8637} = logand(cond_8635, res_8636)
- let {i32 n_total_8638} =
- mul32(n_draw_rects_x_7131, n_draw_rects_y_7132)
- let {[w_7133][h_7134]i32 res_8639} =
- -- Branch returns: {[w_7133][h_7134]i32}
- if x_8637
- then {
- let {bool bounds_invalid_upwards_8640} =
- slt32(replicate_arg_7618, 0i32)
- let {bool valid_8641} = not bounds_invalid_upwards_8640
- let {cert range_valid_c_8642} =
- assert(valid_8641, "Range ", 0i32, "..", 1i32, "..<",
- replicate_arg_7618, " is invalid.",
- "/prelude/math.fut:453:23-30")
- let {[replicate_arg_7618]i32 res_8643} =
- <range_valid_c_8642>
- iota32(replicate_arg_7618, 0i32, 1i32)
- let {i32 comparatee_10701} = mul_nw32(replicate_arg_7618, 1i32)
- let {bool suff_outer_par_10702} =
- get_size(suff_outer_par_3, threshold ()) <= comparatee_10701
- let {[replicate_arg_7618]i32 res_8644} =
- -- Branch returns: {[replicate_arg_7618]i32}
- if <equiv> suff_outer_par_10702
- then {
- let {i64 replicate_arg_10994} =
- sext i32 replicate_arg_7618 to i64
- let {i64 nest_size_10995} =
- mul_nw64(replicate_arg_10994, 1i64)
- let {i32 segmap_group_size_10996} =
- get_size(segmap_group_size_10707, group_size)
- let {i64 segmap_group_size_10997} =
- sext i32 segmap_group_size_10996 to i64
- let {i64 segmap_usable_groups_64_10998} =
- sdiv_up64(nest_size_10995, segmap_group_size_10997)
- let {i32 segmap_usable_groups_10999} =
- sext i64 segmap_usable_groups_64_10998 to i32
- let {[replicate_arg_7618]i32 res_11000} =
- segmap_thread
- (#groups=segmap_usable_groups_10999; groupsize=segmap_group_size_10996)
- (gtid_10703 < replicate_arg_7618) (~phys_tid_10704) : {i32} {
- let {i32 x_11001} = res_8643[gtid_10703]
- let {i32 res_11002} = sdiv32(x_11001, h_7134)
- let {i32 res_11003} = smod32(x_11001, h_7134)
- let {bool res_11004, f32 res_11005, i32 res_11006} =
- redomap(partition_size_7544,
- {commutative fn {bool, f32, i32} (bool x_11007,
- f32 x_11008,
- i32 x_11009,
- bool x_11010,
- f32 x_11011,
- i32 x_11012) =>
- let {bool res_11013} = le32(0.0f32, x_11008)
- let {bool x_11014} =
- logand(x_11007, res_11013)
- let {bool cond_11015} = lt32(x_11011, 0.0f32)
- let {bool res_11016} = not x_11010
- let {bool x_11017} = not cond_11015
- let {bool y_11018} =
- logand(res_11016, x_11017)
- let {bool cond_11019} =
- logor(cond_11015, y_11018)
- let {bool res_11020} = lt32(x_11008, x_11011)
- let {bool x_11021} = not cond_11019
- let {bool y_11022} =
- logand(res_11020, x_11021)
- let {bool res_11023} =
- logor(cond_11019, y_11022)
- let {bool x_11024} =
- logand(x_11014, res_11023)
- let {bool res_11025, f32 res_11026,
- i32 res_11027} =
- -- Branch returns: {bool, f32, i32}
- if x_11024
- then {true, x_11008, x_11009} else {
- let {bool res_11028} =
- le32(0.0f32, x_11011)
- let {bool x_11029} =
- logand(x_11010, res_11028)
- let {bool cond_11030} =
- lt32(x_11008, 0.0f32)
- let {bool res_11031} = not x_11007
- let {bool x_11032} = not cond_11030
- let {bool y_11033} =
- logand(res_11031, x_11032)
- let {bool cond_11034} =
- logor(cond_11030, y_11033)
- let {bool res_11035} =
- lt32(x_11011, x_11008)
- let {bool x_11036} = not cond_11034
- let {bool y_11037} =
- logand(res_11035, x_11036)
- let {bool res_11038} =
- logor(cond_11034, y_11037)
- let {bool x_11039} =
- logand(x_11029, res_11038)
- let {bool res_11040, f32 res_11041,
- i32 res_11042} =
- -- Branch returns: {bool, f32, i32}
- if x_11039
- then {true, x_11011, x_11012} else {
- let {bool x_11043} =
- logand(x_11010, x_11014)
- let {bool x_11044} =
- logand(res_11028, x_11043)
- let {bool res_11045} =
- eq_f32(x_11008, x_11011)
- let {bool x_11046} =
- logand(x_11044, res_11045)
- let {f32 res_11047} =
- -- Branch returns: {f32}
- if x_11046
- then {x_11008} else {-1.0f32}
- let {i32 res_11048} =
- -- Branch returns: {i32}
- if x_11046
- then {x_11009} else {-1i32}
- in {x_11046, res_11047, res_11048}
- }
- in {res_11040, res_11041, res_11042}
- }
- in {res_11025, res_11026, res_11027},
- {false, -1.0f32, -1i32}},
- fn {bool, f32, i32} (i32 x_11049, i32 x_11050,
- f32 x_11051, i32 x_11052,
- i32 x_11053, f32 x_11054,
- i32 x_11055, i32 x_11056,
- f32 x_11057,
- i32 x_11058) =>
- let {i32 x_11059} = sub32(x_11053, x_11056)
- let {i32 y_11060} = sub32(x_11049, x_11055)
- let {i32 x_11061} = mul32(x_11059, y_11060)
- let {i32 x_11062} = sub32(x_11055, x_11052)
- let {i32 y_11063} = sub32(x_11050, x_11056)
- let {i32 y_11064} = mul32(x_11062, y_11063)
- let {i32 factor_11065} =
- add32(x_11061, y_11064)
- let {bool cond_11066} =
- eq_i32(factor_11065, 0i32)
- let {bool cond_11067} = not cond_11066
- let {i32 res_11068} =
- -- Branch returns: {i32}
- if cond_11067
- then {factor_11065} else {1i32}
- let {i32 res_11069, i32 res_11070,
- i32 res_11071, f32 res_11072,
- f32 res_11073, f32 res_11074} =
- -- Branch returns: {i32, i32, i32, f32, f32, f32}
- if cond_11067
- then {
- let {i32 y_11075} =
- sub32(res_11002, x_11055)
- let {i32 x_11076} =
- mul32(x_11059, y_11075)
- let {i32 y_11077} =
- sub32(res_11003, x_11056)
- let {i32 y_11078} =
- mul32(x_11062, y_11077)
- let {i32 a_11079} =
- add32(x_11076, y_11078)
- let {i32 x_11080} =
- sub32(x_11056, x_11050)
- let {i32 x_11081} =
- mul32(y_11075, x_11080)
- let {i32 y_11082} =
- mul32(y_11060, y_11077)
- let {i32 b_11083} =
- add32(x_11081, y_11082)
- let {i32 x_11084} =
- sub32(factor_11065, a_11079)
- let {i32 c_11085} =
- sub32(x_11084, b_11083)
- let {f32 res_11086} =
- sitofp i32 factor_11065 to f32
- let {f32 res_11087} =
- sitofp i32 a_11079 to f32
- let {f32 an_11088} =
- fdiv32(res_11087, res_11086)
- let {f32 res_11089} =
- sitofp i32 b_11083 to f32
- let {f32 bn_11090} =
- fdiv32(res_11089, res_11086)
- let {f32 x_11091} =
- fsub32(1.0f32, an_11088)
- let {f32 cn_11092} =
- fsub32(x_11091, bn_11090)
- in {a_11079, b_11083, c_11085, an_11088,
- bn_11090, cn_11092}
- } else {-1i32, -1i32, -1i32, -1.0f32,
- -1.0f32, -1.0f32}
- let {bool cond_11093} = slt32(0i32, res_11068)
- let {bool res_11094} = sle32(0i32, res_11069)
- let {bool x_11095} =
- logand(cond_11093, res_11094)
- let {bool res_11096} =
- sle32(res_11069, res_11068)
- let {bool x_11097} =
- logand(x_11095, res_11096)
- let {bool cond_11098} = sle32(res_11068, 0i32)
- let {bool res_11099} =
- sle32(res_11068, res_11069)
- let {bool x_11100} =
- logand(cond_11098, res_11099)
- let {bool res_11101} = sle32(res_11069, 0i32)
- let {bool x_11102} =
- logand(x_11100, res_11101)
- let {bool x_11103} = not x_11097
- let {bool y_11104} = logand(x_11102, x_11103)
- let {bool res_11105} = logor(x_11097, y_11104)
- let {bool res_11106} = sle32(0i32, res_11070)
- let {bool x_11107} =
- logand(cond_11093, res_11106)
- let {bool res_11108} =
- sle32(res_11070, res_11068)
- let {bool x_11109} =
- logand(x_11107, res_11108)
- let {bool res_11110} =
- sle32(res_11068, res_11070)
- let {bool x_11111} =
- logand(cond_11098, res_11110)
- let {bool res_11112} = sle32(res_11070, 0i32)
- let {bool x_11113} =
- logand(x_11111, res_11112)
- let {bool x_11114} = not x_11109
- let {bool y_11115} = logand(x_11113, x_11114)
- let {bool res_11116} = logor(x_11109, y_11115)
- let {bool x_11117} =
- logand(res_11105, res_11116)
- let {bool res_11118} = sle32(0i32, res_11071)
- let {bool x_11119} =
- logand(cond_11093, res_11118)
- let {bool res_11120} =
- sle32(res_11071, res_11068)
- let {bool x_11121} =
- logand(x_11119, res_11120)
- let {bool res_11122} =
- sle32(res_11068, res_11071)
- let {bool x_11123} =
- logand(cond_11098, res_11122)
- let {bool res_11124} = sle32(res_11071, 0i32)
- let {bool x_11125} =
- logand(x_11123, res_11124)
- let {bool x_11126} = not x_11121
- let {bool y_11127} = logand(x_11125, x_11126)
- let {bool res_11128} = logor(x_11121, y_11127)
- let {bool x_11129} =
- logand(x_11117, res_11128)
- let {f32 x_11130} = fmul32(x_11051, res_11072)
- let {f32 y_11131} = fmul32(x_11054, res_11073)
- let {f32 x_11132} = fadd32(x_11130, y_11131)
- let {f32 y_11133} = fmul32(x_11057, res_11074)
- let {f32 res_11134} = fadd32(x_11132, y_11133)
- in {x_11129, res_11134, x_11058},
- res_7602, res_7603, res_7604, res_7605,
- res_7606, res_7607, res_7608, res_7609,
- res_7610, res_7617)
- let {bool cond_11135} = eq_i32(res_11006, -1i32)
- let {f32 res_11136, f32 res_11137, f32 res_11138} =
- -- Branch returns: {f32, f32, f32}
- if cond_11135
- then {0.0f32, 0.0f32, 0.0f32} else {
- let {i32 barycentric_coordinates_arg_11139} =
- <index_certs_7601>
- partition_res_7560[res_11006]
- let {i32 barycentric_coordinates_arg_11140} =
- <index_certs_7601>
- partition_res_7561[res_11006]
- let {i32 barycentric_coordinates_arg_11141} =
- <index_certs_7601>
- partition_res_7563[res_11006]
- let {i32 barycentric_coordinates_arg_11142} =
- <index_certs_7601>
- partition_res_7564[res_11006]
- let {i32 barycentric_coordinates_arg_11143} =
- <index_certs_7601>
- partition_res_7566[res_11006]
- let {i32 barycentric_coordinates_arg_11144} =
- <index_certs_7601>
- partition_res_7567[res_11006]
- let {i32 x_11145} =
- sub32(barycentric_coordinates_arg_11142, barycentric_coordinates_arg_11144)
- let {i32 y_11146} =
- sub32(barycentric_coordinates_arg_11139, barycentric_coordinates_arg_11143)
- let {i32 x_11147} = mul32(x_11145, y_11146)
- let {i32 x_11148} =
- sub32(barycentric_coordinates_arg_11143, barycentric_coordinates_arg_11141)
- let {i32 y_11149} =
- sub32(barycentric_coordinates_arg_11140, barycentric_coordinates_arg_11144)
- let {i32 y_11150} = mul32(x_11148, y_11149)
- let {i32 factor_11151} = add32(x_11147, y_11150)
- let {bool cond_11152} = eq_i32(factor_11151, 0i32)
- let {bool cond_11153} = not cond_11152
- let {f32 res_11154, f32 res_11155, f32 res_11156} =
- -- Branch returns: {f32, f32, f32}
- if cond_11153
- then {
- let {i32 y_11157} =
- sub32(res_11002, barycentric_coordinates_arg_11143)
- let {i32 x_11158} = mul32(x_11145, y_11157)
- let {i32 y_11159} =
- sub32(res_11003, barycentric_coordinates_arg_11144)
- let {i32 y_11160} = mul32(x_11148, y_11159)
- let {i32 a_11161} = add32(x_11158, y_11160)
- let {i32 x_11162} =
- sub32(barycentric_coordinates_arg_11144, barycentric_coordinates_arg_11140)
- let {i32 x_11163} = mul32(y_11157, x_11162)
- let {i32 y_11164} = mul32(y_11146, y_11159)
- let {i32 b_11165} = add32(x_11163, y_11164)
- let {f32 res_11166} =
- sitofp i32 factor_11151 to f32
- let {f32 res_11167} = sitofp i32 a_11161 to f32
- let {f32 an_11168} = fdiv32(res_11167, res_11166)
- let {f32 res_11169} = sitofp i32 b_11165 to f32
- let {f32 bn_11170} = fdiv32(res_11169, res_11166)
- let {f32 x_11171} = fsub32(1.0f32, an_11168)
- let {f32 cn_11172} = fsub32(x_11171, bn_11170)
- in {an_11168, bn_11170, cn_11172}
- } else {-1.0f32, -1.0f32, -1.0f32}
- let {i32 color_point_arg_11173} =
- <index_certs_7601>
- partition_res_7569[res_11006]
- let {f32 color_point_arg_11174} =
- <index_certs_7601>
- partition_res_7570[res_11006]
- let {f32 color_point_arg_11175} =
- <index_certs_7601>
- partition_res_7571[res_11006]
- let {f32 color_point_arg_11176} =
- <index_certs_7601>
- partition_res_7572[res_11006]
- let {i32 color_point_arg_11177} =
- <index_certs_7601>
- partition_res_7573[res_11006]
- let {bool cond_11178} =
- eq_i32(color_point_arg_11173, 1i32)
- let {f32 res_11179, f32 res_11180, f32 res_11181} =
- -- Branch returns: {f32, f32, f32}
- if cond_11178
- then {color_point_arg_11174, color_point_arg_11175,
- color_point_arg_11176} else {
- let {bool cond_11182} =
- eq_i32(color_point_arg_11173, 2i32)
- let {f32 res_11183, f32 res_11184,
- f32 res_11185} =
- -- Branch returns: {f32, f32, f32}
- if cond_11182
- then {
- let {i32 i_11186} =
- sdiv32(color_point_arg_11177, 2i32)
- let {i32 x_11187} =
- and32(1i32, color_point_arg_11177)
- let {bool cond_11188} = eq_i32(x_11187, 0i32)
- let {f32 res_11189} =
- -- Branch returns: {f32}
- if cond_11188
- then {0.0f32} else {1.0f32}
- let {f32 res_11190} =
- -- Branch returns: {f32}
- if cond_11188
- then {1.0f32} else {0.0f32}
- let {f32 x_11191} =
- fmul32(res_11154, res_11189)
- let {f32 y_11192} =
- fmul32(res_11155, res_11190)
- let {f32 x_11193} = fadd32(x_11191, y_11192)
- let {f32 y_11194} =
- fmul32(res_11156, res_11189)
- let {f32 yn_11195} = fadd32(x_11193, y_11194)
- let {f32 y_11196} =
- fmul32(res_11155, res_11189)
- let {f32 x_11197} = fadd32(x_11191, y_11196)
- let {f32 y_11198} =
- fmul32(res_11156, res_11190)
- let {f32 xn_11199} = fadd32(x_11197, y_11198)
- let {f32 res_11200} =
- sitofp i32 surface_h_7153 to f32
- let {f32 t32_arg_11201} =
- fmul32(yn_11195, res_11200)
- let {i32 res_11202} =
- fptosi f32 t32_arg_11201 to i32
- let {f32 res_11203} =
- sitofp i32 surface_w_7152 to f32
- let {f32 t32_arg_11204} =
- fmul32(xn_11199, res_11203)
- let {i32 res_11205} =
- fptosi f32 t32_arg_11204 to i32
- let {i32 clamp_arg_11206} =
- sub32(surface_h_7153, 1i32)
- let {i32 res_11207} = smax32(0i32, res_11202)
- let {i32 res_11208} =
- smin32(clamp_arg_11206, res_11207)
- let {i32 clamp_arg_11209} =
- sub32(surface_w_7152, 1i32)
- let {i32 res_11210} = smax32(0i32, res_11205)
- let {i32 res_11211} =
- smin32(clamp_arg_11209, res_11210)
- let {i32 binop_y_11212} =
- mul_nw32(surface_w_7152, surface_h_7153)
- let {i32 binop_x_11213} =
- mul_nw32(i_11186, binop_y_11212)
- let {i32 binop_y_11214} =
- mul_nw32(surface_w_7152, res_11208)
- let {i32 binop_x_11215} =
- add_nw32(binop_x_11213, binop_y_11214)
- let {i32 new_index_11216} =
- add_nw32(res_11211, binop_x_11215)
- let {f32 res_11217} =
- <dim_ok_7201>
- surface_textures_flat_hsv_hs_7154[new_index_11216]
- let {f32 res_11218} =
- <empty_or_match_cert_7195, dim_ok_7201>
- surface_textures_flat_hsv_ss_7155[new_index_11216]
- let {f32 res_11219} =
- <empty_or_match_cert_7197, dim_ok_7201>
- surface_textures_flat_hsv_vs_7156[new_index_11216]
- in {res_11217, res_11218, res_11219}
- } else {0.0f32, 0.0f32, 0.0f32}
- in {res_11183, res_11184, res_11185}
- }
- let {f32 y_11220} = fpow32(res_11005, 2.0f32)
- let {f32 min_arg_11221} =
- fdiv32(2000000.0f32, y_11220)
- let {f32 res_11222} = fmin32(1.0f32, min_arg_11221)
- let {f32 res_11223} = fmul32(res_11181, res_11222)
- in {res_11179, res_11180, res_11223}
- }
- let {f32 c_11224} = fmul32(res_11137, res_11138)
- let {f32 h'_11225} = fdiv32(res_11136, 60.0f32)
- let {f32 t32_arg_11226} = fdiv32(h'_11225, 2.0f32)
- let {i32 res_11227} = fptosi f32 t32_arg_11226 to i32
- let {f32 res_11228} = sitofp i32 res_11227 to f32
- let {f32 y_11229} = fmul32(2.0f32, res_11228)
- let {f32 res_11230} = fsub32(h'_11225, y_11229)
- let {f32 abs_arg_11231} = fsub32(res_11230, 1.0f32)
- let {f32 res_11232} = fabs32 abs_arg_11231
- let {f32 y_11233} = fsub32(1.0f32, res_11232)
- let {f32 x_11234} = fmul32(c_11224, y_11233)
- let {bool cond_11235} = le32(0.0f32, h'_11225)
- let {bool res_11236} = lt32(h'_11225, 1.0f32)
- let {bool x_11237} = logand(cond_11235, res_11236)
- let {f32 res_11238, f32 res_11239, f32 res_11240} =
- -- Branch returns: {f32, f32, f32}
- if x_11237
- then {c_11224, x_11234, 0.0f32} else {
- let {bool cond_11241} = le32(1.0f32, h'_11225)
- let {bool res_11242} = lt32(h'_11225, 2.0f32)
- let {bool x_11243} = logand(cond_11241, res_11242)
- let {f32 res_11244, f32 res_11245, f32 res_11246} =
- -- Branch returns: {f32, f32, f32}
- if x_11243
- then {x_11234, c_11224, 0.0f32} else {
- let {bool cond_11247} = le32(2.0f32, h'_11225)
- let {bool res_11248} = lt32(h'_11225, 3.0f32)
- let {bool x_11249} = logand(cond_11247, res_11248)
- let {f32 res_11250, f32 res_11251,
- f32 res_11252} =
- -- Branch returns: {f32, f32, f32}
- if x_11249
- then {0.0f32, c_11224, x_11234} else {
- let {bool cond_11253} = le32(3.0f32, h'_11225)
- let {bool res_11254} = lt32(h'_11225, 4.0f32)
- let {bool x_11255} =
- logand(cond_11253, res_11254)
- let {f32 res_11256} =
- -- Branch returns: {f32}
- if x_11255
- then {x_11234} else {0.0f32}
- let {f32 res_11257, f32 res_11258} =
- -- Branch returns: {f32, f32}
- if x_11255
- then {0.0f32, c_11224} else {
- let {bool cond_11259} =
- le32(4.0f32, h'_11225)
- let {bool res_11260} =
- lt32(h'_11225, 5.0f32)
- let {bool x_11261} =
- logand(cond_11259, res_11260)
- let {f32 res_11262, f32 res_11263} =
- -- Branch returns: {f32, f32}
- if x_11261
- then {x_11234, c_11224} else {
- let {bool cond_11264} =
- le32(5.0f32, h'_11225)
- let {bool res_11265} =
- lt32(h'_11225, 6.0f32)
- let {bool x_11266} =
- logand(cond_11264, res_11265)
- let {f32 res_11267} =
- -- Branch returns: {f32}
- if x_11266
- then {c_11224} else {0.0f32}
- let {f32 res_11268} =
- -- Branch returns: {f32}
- if x_11266
- then {x_11234} else {0.0f32}
- in {res_11267, res_11268}
- }
- in {res_11262, res_11263}
- }
- in {res_11257, res_11256, res_11258}
- }
- in {res_11250, res_11251, res_11252}
- }
- in {res_11244, res_11245, res_11246}
- }
- let {f32 m_11269} = fsub32(res_11138, c_11224)
- let {f32 res_11270} = fadd32(res_11238, m_11269)
- let {f32 res_11271} = fadd32(res_11239, m_11269)
- let {f32 res_11272} = fadd32(res_11240, m_11269)
- let {f32 f32_arg_11273} = fmul32(255.0f32, res_11270)
- let {i32 unsign_arg_11274} =
- fptoui f32 f32_arg_11273 to i32
- let {f32 f32_arg_11275} = fmul32(255.0f32, res_11271)
- let {i32 unsign_arg_11276} =
- fptoui f32 f32_arg_11275 to i32
- let {f32 f32_arg_11277} = fmul32(255.0f32, res_11272)
- let {i32 unsign_arg_11278} =
- fptoui f32 f32_arg_11277 to i32
- let {i32 x_11279} = shl32(unsign_arg_11274, 16i32)
- let {i32 y_11280} = shl32(unsign_arg_11276, 8i32)
- let {i32 x_11281} = or32(x_11279, y_11280)
- let {i32 res_11282} = or32(unsign_arg_11278, x_11281)
- return {returns res_11282}
- }
- in {res_11000}
- } else {
- let {i64 replicate_arg_11603} =
- sext i32 replicate_arg_7618 to i64
- let {i64 nest_size_11604} =
- mul_nw64(replicate_arg_11603, 1i64)
- let {i32 segmap_group_size_11605} =
- get_size(segmap_group_size_11595, group_size)
- let {i64 segmap_group_size_11606} =
- sext i32 segmap_group_size_11605 to i64
- let {i64 segmap_usable_groups_64_11607} =
- sdiv_up64(nest_size_11604, segmap_group_size_11606)
- let {i32 segmap_usable_groups_11608} =
- sext i64 segmap_usable_groups_64_11607 to i32
- let {[replicate_arg_7618]i32 res_r_11609,
- [replicate_arg_7618]i32 res_r_11610} =
- segmap_thread
- (#groups=segmap_usable_groups_11608; groupsize=segmap_group_size_11605)
- (gtid_11591 < replicate_arg_7618) (~phys_tid_11592) : {i32,
- i32} {
- let {i32 x_11611} = res_8643[gtid_11591]
- let {i32 res_11612} = sdiv32(x_11611, h_7134)
- let {i32 res_11613} = smod32(x_11611, h_7134)
- return {returns res_11612, returns res_11613}
- }
- let {i64 partition_size_11614} =
- sext i32 partition_size_7544 to i64
- let {i64 replicate_arg_11615} =
- sext i32 replicate_arg_7618 to i64
- let {i64 y_11616} = mul_nw64(replicate_arg_11615, 1i64)
- let {i64 nest_size_11617} =
- mul_nw64(partition_size_11614, y_11616)
- let {i32 segred_group_size_11618} =
- get_size(segred_group_size_11454, group_size)
- let {i32 num_groups_11619} =
- calc_num_groups(nest_size_11617, segred_num_groups_11456,
- segred_group_size_11618)
- let {i32 num_threads_11620} =
- mul_nw32(num_groups_11619, segred_group_size_11618)
- let {[replicate_arg_7618]bool res_11621,
- [replicate_arg_7618]f32 res_r_11622,
- [replicate_arg_7618]i32 res_r_11623} =
- segred_thread
- (#groups=num_groups_11619; groupsize=segred_group_size_11618)
- ({{false, -1.0f32, -1i32},
- [],
- commutative fn {bool, f32, i32} (bool x_11624,
- f32 x_11625, i32 x_11626,
- bool x_11627,
- f32 x_11628,
- i32 x_11629) =>
- let {bool res_11630} = le32(0.0f32, x_11625)
- let {bool x_11631} = logand(x_11624, res_11630)
- let {bool cond_11632} = lt32(x_11628, 0.0f32)
- let {bool res_11633} = not x_11627
- let {bool x_11634} = not cond_11632
- let {bool y_11635} = logand(res_11633, x_11634)
- let {bool cond_11636} = logor(cond_11632, y_11635)
- let {bool res_11637} = lt32(x_11625, x_11628)
- let {bool x_11638} = not cond_11636
- let {bool y_11639} = logand(res_11637, x_11638)
- let {bool res_11640} = logor(cond_11636, y_11639)
- let {bool x_11641} = logand(x_11631, res_11640)
- let {bool res_11642, f32 res_11643, i32 res_11644} =
- -- Branch returns: {bool, f32, i32}
- if x_11641
- then {true, x_11625, x_11626} else {
- let {bool res_11645} = le32(0.0f32, x_11628)
- let {bool x_11646} = logand(x_11627, res_11645)
- let {bool cond_11647} = lt32(x_11625, 0.0f32)
- let {bool res_11648} = not x_11624
- let {bool x_11649} = not cond_11647
- let {bool y_11650} = logand(res_11648, x_11649)
- let {bool cond_11651} = logor(cond_11647, y_11650)
- let {bool res_11652} = lt32(x_11628, x_11625)
- let {bool x_11653} = not cond_11651
- let {bool y_11654} = logand(res_11652, x_11653)
- let {bool res_11655} = logor(cond_11651, y_11654)
- let {bool x_11656} = logand(x_11646, res_11655)
- let {bool res_11657, f32 res_11658, i32 res_11659} =
- -- Branch returns: {bool, f32, i32}
- if x_11656
- then {true, x_11628, x_11629} else {
- let {bool x_11660} = logand(x_11627, x_11631)
- let {bool x_11661} = logand(res_11645, x_11660)
- let {bool res_11662} = eq_f32(x_11625, x_11628)
- let {bool x_11663} = logand(x_11661, res_11662)
- let {f32 res_11664} =
- -- Branch returns: {f32}
- if x_11663
- then {x_11625} else {-1.0f32}
- let {i32 res_11665} =
- -- Branch returns: {i32}
- if x_11663
- then {x_11626} else {-1i32}
- in {x_11663, res_11664, res_11665}
- }
- in {res_11657, res_11658, res_11659}
- }
- in {res_11642, res_11643, res_11644}})
- (gtid_11449 < replicate_arg_7618,
- gtid_11459 < partition_size_7544) (~phys_tid_11460) : {bool,
- f32,
- i32} {
- let {i32 res_11666} = res_r_11609[gtid_11449]
- let {i32 res_11667} = res_r_11610[gtid_11449]
- let {i32 x_11668} = res_7602[gtid_11459]
- let {i32 x_11669} = res_7603[gtid_11459]
- let {f32 x_11670} = res_7604[gtid_11459]
- let {i32 x_11671} = res_7605[gtid_11459]
- let {i32 x_11672} = res_7606[gtid_11459]
- let {f32 x_11673} = res_7607[gtid_11459]
- let {i32 x_11674} = res_7608[gtid_11459]
- let {i32 x_11675} = res_7609[gtid_11459]
- let {f32 x_11676} = res_7610[gtid_11459]
- let {i32 x_11677} = res_7617[gtid_11459]
- let {i32 x_11678} = sub32(x_11672, x_11675)
- let {i32 y_11679} = sub32(x_11668, x_11674)
- let {i32 x_11680} = mul32(x_11678, y_11679)
- let {i32 x_11681} = sub32(x_11674, x_11671)
- let {i32 y_11682} = sub32(x_11669, x_11675)
- let {i32 y_11683} = mul32(x_11681, y_11682)
- let {i32 factor_11684} = add32(x_11680, y_11683)
- let {bool cond_11685} = eq_i32(factor_11684, 0i32)
- let {bool cond_11686} = not cond_11685
- let {i32 res_11687} =
- -- Branch returns: {i32}
- if cond_11686
- then {factor_11684} else {1i32}
- let {i32 res_11688, i32 res_11689, i32 res_11690,
- f32 res_11691, f32 res_11692, f32 res_11693} =
- -- Branch returns: {i32, i32, i32, f32, f32, f32}
- if cond_11686
- then {
- let {i32 y_11694} = sub32(res_11666, x_11674)
- let {i32 x_11695} = mul32(x_11678, y_11694)
- let {i32 y_11696} = sub32(res_11667, x_11675)
- let {i32 y_11697} = mul32(x_11681, y_11696)
- let {i32 a_11698} = add32(x_11695, y_11697)
- let {i32 x_11699} = sub32(x_11675, x_11669)
- let {i32 x_11700} = mul32(y_11694, x_11699)
- let {i32 y_11701} = mul32(y_11679, y_11696)
- let {i32 b_11702} = add32(x_11700, y_11701)
- let {i32 x_11703} = sub32(factor_11684, a_11698)
- let {i32 c_11704} = sub32(x_11703, b_11702)
- let {f32 res_11705} = sitofp i32 factor_11684 to f32
- let {f32 res_11706} = sitofp i32 a_11698 to f32
- let {f32 an_11707} = fdiv32(res_11706, res_11705)
- let {f32 res_11708} = sitofp i32 b_11702 to f32
- let {f32 bn_11709} = fdiv32(res_11708, res_11705)
- let {f32 x_11710} = fsub32(1.0f32, an_11707)
- let {f32 cn_11711} = fsub32(x_11710, bn_11709)
- in {a_11698, b_11702, c_11704, an_11707, bn_11709,
- cn_11711}
- } else {-1i32, -1i32, -1i32, -1.0f32, -1.0f32, -1.0f32}
- let {bool cond_11712} = slt32(0i32, res_11687)
- let {bool res_11713} = sle32(0i32, res_11688)
- let {bool x_11714} = logand(cond_11712, res_11713)
- let {bool res_11715} = sle32(res_11688, res_11687)
- let {bool x_11716} = logand(x_11714, res_11715)
- let {bool cond_11717} = sle32(res_11687, 0i32)
- let {bool res_11718} = sle32(res_11687, res_11688)
- let {bool x_11719} = logand(cond_11717, res_11718)
- let {bool res_11720} = sle32(res_11688, 0i32)
- let {bool x_11721} = logand(x_11719, res_11720)
- let {bool x_11722} = not x_11716
- let {bool y_11723} = logand(x_11721, x_11722)
- let {bool res_11724} = logor(x_11716, y_11723)
- let {bool res_11725} = sle32(0i32, res_11689)
- let {bool x_11726} = logand(cond_11712, res_11725)
- let {bool res_11727} = sle32(res_11689, res_11687)
- let {bool x_11728} = logand(x_11726, res_11727)
- let {bool res_11729} = sle32(res_11687, res_11689)
- let {bool x_11730} = logand(cond_11717, res_11729)
- let {bool res_11731} = sle32(res_11689, 0i32)
- let {bool x_11732} = logand(x_11730, res_11731)
- let {bool x_11733} = not x_11728
- let {bool y_11734} = logand(x_11732, x_11733)
- let {bool res_11735} = logor(x_11728, y_11734)
- let {bool x_11736} = logand(res_11724, res_11735)
- let {bool res_11737} = sle32(0i32, res_11690)
- let {bool x_11738} = logand(cond_11712, res_11737)
- let {bool res_11739} = sle32(res_11690, res_11687)
- let {bool x_11740} = logand(x_11738, res_11739)
- let {bool res_11741} = sle32(res_11687, res_11690)
- let {bool x_11742} = logand(cond_11717, res_11741)
- let {bool res_11743} = sle32(res_11690, 0i32)
- let {bool x_11744} = logand(x_11742, res_11743)
- let {bool x_11745} = not x_11740
- let {bool y_11746} = logand(x_11744, x_11745)
- let {bool res_11747} = logor(x_11740, y_11746)
- let {bool x_11748} = logand(x_11736, res_11747)
- let {f32 x_11749} = fmul32(x_11670, res_11691)
- let {f32 y_11750} = fmul32(x_11673, res_11692)
- let {f32 x_11751} = fadd32(x_11749, y_11750)
- let {f32 y_11752} = fmul32(x_11676, res_11693)
- let {f32 res_11753} = fadd32(x_11751, y_11752)
- return {returns x_11748, returns res_11753,
- returns x_11677}
- }
- let {i64 replicate_arg_11754} =
- sext i32 replicate_arg_7618 to i64
- let {i64 nest_size_11755} =
- mul_nw64(replicate_arg_11754, 1i64)
- let {i32 segmap_group_size_11756} =
- get_size(segmap_group_size_11291, group_size)
- let {i64 segmap_group_size_11757} =
- sext i32 segmap_group_size_11756 to i64
- let {i64 segmap_usable_groups_64_11758} =
- sdiv_up64(nest_size_11755, segmap_group_size_11757)
- let {i32 segmap_usable_groups_11759} =
- sext i64 segmap_usable_groups_64_11758 to i32
- let {[replicate_arg_7618]i32 res_11760} =
- segmap_thread
- (#groups=segmap_usable_groups_11759; groupsize=segmap_group_size_11756)
- (gtid_11287 < replicate_arg_7618) (~phys_tid_11288) : {i32} {
- let {i32 res_11761} = res_r_11609[gtid_11287]
- let {i32 res_11762} = res_r_11610[gtid_11287]
- let {f32 res_11763} = res_r_11622[gtid_11287]
- let {i32 res_11764} = res_r_11623[gtid_11287]
- let {bool cond_11765} = eq_i32(res_11764, -1i32)
- let {f32 res_11766, f32 res_11767, f32 res_11768} =
- -- Branch returns: {f32, f32, f32}
- if cond_11765
- then {0.0f32, 0.0f32, 0.0f32} else {
- let {i32 barycentric_coordinates_arg_11769} =
- <index_certs_7601>
- partition_res_7560[res_11764]
- let {i32 barycentric_coordinates_arg_11770} =
- <index_certs_7601>
- partition_res_7561[res_11764]
- let {i32 barycentric_coordinates_arg_11771} =
- <index_certs_7601>
- partition_res_7563[res_11764]
- let {i32 barycentric_coordinates_arg_11772} =
- <index_certs_7601>
- partition_res_7564[res_11764]
- let {i32 barycentric_coordinates_arg_11773} =
- <index_certs_7601>
- partition_res_7566[res_11764]
- let {i32 barycentric_coordinates_arg_11774} =
- <index_certs_7601>
- partition_res_7567[res_11764]
- let {i32 x_11775} =
- sub32(barycentric_coordinates_arg_11772, barycentric_coordinates_arg_11774)
- let {i32 y_11776} =
- sub32(barycentric_coordinates_arg_11769, barycentric_coordinates_arg_11773)
- let {i32 x_11777} = mul32(x_11775, y_11776)
- let {i32 x_11778} =
- sub32(barycentric_coordinates_arg_11773, barycentric_coordinates_arg_11771)
- let {i32 y_11779} =
- sub32(barycentric_coordinates_arg_11770, barycentric_coordinates_arg_11774)
- let {i32 y_11780} = mul32(x_11778, y_11779)
- let {i32 factor_11781} = add32(x_11777, y_11780)
- let {bool cond_11782} = eq_i32(factor_11781, 0i32)
- let {bool cond_11783} = not cond_11782
- let {f32 res_11784, f32 res_11785, f32 res_11786} =
- -- Branch returns: {f32, f32, f32}
- if cond_11783
- then {
- let {i32 y_11787} =
- sub32(res_11761, barycentric_coordinates_arg_11773)
- let {i32 x_11788} = mul32(x_11775, y_11787)
- let {i32 y_11789} =
- sub32(res_11762, barycentric_coordinates_arg_11774)
- let {i32 y_11790} = mul32(x_11778, y_11789)
- let {i32 a_11791} = add32(x_11788, y_11790)
- let {i32 x_11792} =
- sub32(barycentric_coordinates_arg_11774, barycentric_coordinates_arg_11770)
- let {i32 x_11793} = mul32(y_11787, x_11792)
- let {i32 y_11794} = mul32(y_11776, y_11789)
- let {i32 b_11795} = add32(x_11793, y_11794)
- let {f32 res_11796} =
- sitofp i32 factor_11781 to f32
- let {f32 res_11797} = sitofp i32 a_11791 to f32
- let {f32 an_11798} = fdiv32(res_11797, res_11796)
- let {f32 res_11799} = sitofp i32 b_11795 to f32
- let {f32 bn_11800} = fdiv32(res_11799, res_11796)
- let {f32 x_11801} = fsub32(1.0f32, an_11798)
- let {f32 cn_11802} = fsub32(x_11801, bn_11800)
- in {an_11798, bn_11800, cn_11802}
- } else {-1.0f32, -1.0f32, -1.0f32}
- let {i32 color_point_arg_11803} =
- <index_certs_7601>
- partition_res_7569[res_11764]
- let {f32 color_point_arg_11804} =
- <index_certs_7601>
- partition_res_7570[res_11764]
- let {f32 color_point_arg_11805} =
- <index_certs_7601>
- partition_res_7571[res_11764]
- let {f32 color_point_arg_11806} =
- <index_certs_7601>
- partition_res_7572[res_11764]
- let {i32 color_point_arg_11807} =
- <index_certs_7601>
- partition_res_7573[res_11764]
- let {bool cond_11808} =
- eq_i32(color_point_arg_11803, 1i32)
- let {f32 res_11809, f32 res_11810, f32 res_11811} =
- -- Branch returns: {f32, f32, f32}
- if cond_11808
- then {color_point_arg_11804, color_point_arg_11805,
- color_point_arg_11806} else {
- let {bool cond_11812} =
- eq_i32(color_point_arg_11803, 2i32)
- let {f32 res_11813, f32 res_11814,
- f32 res_11815} =
- -- Branch returns: {f32, f32, f32}
- if cond_11812
- then {
- let {i32 i_11816} =
- sdiv32(color_point_arg_11807, 2i32)
- let {i32 x_11817} =
- and32(1i32, color_point_arg_11807)
- let {bool cond_11818} = eq_i32(x_11817, 0i32)
- let {f32 res_11819} =
- -- Branch returns: {f32}
- if cond_11818
- then {0.0f32} else {1.0f32}
- let {f32 res_11820} =
- -- Branch returns: {f32}
- if cond_11818
- then {1.0f32} else {0.0f32}
- let {f32 x_11821} =
- fmul32(res_11784, res_11819)
- let {f32 y_11822} =
- fmul32(res_11785, res_11820)
- let {f32 x_11823} = fadd32(x_11821, y_11822)
- let {f32 y_11824} =
- fmul32(res_11786, res_11819)
- let {f32 yn_11825} = fadd32(x_11823, y_11824)
- let {f32 y_11826} =
- fmul32(res_11785, res_11819)
- let {f32 x_11827} = fadd32(x_11821, y_11826)
- let {f32 y_11828} =
- fmul32(res_11786, res_11820)
- let {f32 xn_11829} = fadd32(x_11827, y_11828)
- let {f32 res_11830} =
- sitofp i32 surface_h_7153 to f32
- let {f32 t32_arg_11831} =
- fmul32(yn_11825, res_11830)
- let {i32 res_11832} =
- fptosi f32 t32_arg_11831 to i32
- let {f32 res_11833} =
- sitofp i32 surface_w_7152 to f32
- let {f32 t32_arg_11834} =
- fmul32(xn_11829, res_11833)
- let {i32 res_11835} =
- fptosi f32 t32_arg_11834 to i32
- let {i32 clamp_arg_11836} =
- sub32(surface_h_7153, 1i32)
- let {i32 res_11837} = smax32(0i32, res_11832)
- let {i32 res_11838} =
- smin32(clamp_arg_11836, res_11837)
- let {i32 clamp_arg_11839} =
- sub32(surface_w_7152, 1i32)
- let {i32 res_11840} = smax32(0i32, res_11835)
- let {i32 res_11841} =
- smin32(clamp_arg_11839, res_11840)
- let {i32 binop_y_11842} =
- mul_nw32(surface_w_7152, surface_h_7153)
- let {i32 binop_x_11843} =
- mul_nw32(i_11816, binop_y_11842)
- let {i32 binop_y_11844} =
- mul_nw32(surface_w_7152, res_11838)
- let {i32 binop_x_11845} =
- add_nw32(binop_x_11843, binop_y_11844)
- let {i32 new_index_11846} =
- add_nw32(res_11841, binop_x_11845)
- let {f32 res_11847} =
- <dim_ok_7201>
- surface_textures_flat_hsv_hs_7154[new_index_11846]
- let {f32 res_11848} =
- <empty_or_match_cert_7195, dim_ok_7201>
- surface_textures_flat_hsv_ss_7155[new_index_11846]
- let {f32 res_11849} =
- <empty_or_match_cert_7197, dim_ok_7201>
- surface_textures_flat_hsv_vs_7156[new_index_11846]
- in {res_11847, res_11848, res_11849}
- } else {0.0f32, 0.0f32, 0.0f32}
- in {res_11813, res_11814, res_11815}
- }
- let {f32 y_11850} = fpow32(res_11763, 2.0f32)
- let {f32 min_arg_11851} =
- fdiv32(2000000.0f32, y_11850)
- let {f32 res_11852} = fmin32(1.0f32, min_arg_11851)
- let {f32 res_11853} = fmul32(res_11811, res_11852)
- in {res_11809, res_11810, res_11853}
- }
- let {f32 c_11854} = fmul32(res_11767, res_11768)
- let {f32 h'_11855} = fdiv32(res_11766, 60.0f32)
- let {f32 t32_arg_11856} = fdiv32(h'_11855, 2.0f32)
- let {i32 res_11857} = fptosi f32 t32_arg_11856 to i32
- let {f32 res_11858} = sitofp i32 res_11857 to f32
- let {f32 y_11859} = fmul32(2.0f32, res_11858)
- let {f32 res_11860} = fsub32(h'_11855, y_11859)
- let {f32 abs_arg_11861} = fsub32(res_11860, 1.0f32)
- let {f32 res_11862} = fabs32 abs_arg_11861
- let {f32 y_11863} = fsub32(1.0f32, res_11862)
- let {f32 x_11864} = fmul32(c_11854, y_11863)
- let {bool cond_11865} = le32(0.0f32, h'_11855)
- let {bool res_11866} = lt32(h'_11855, 1.0f32)
- let {bool x_11867} = logand(cond_11865, res_11866)
- let {f32 res_11868, f32 res_11869, f32 res_11870} =
- -- Branch returns: {f32, f32, f32}
- if x_11867
- then {c_11854, x_11864, 0.0f32} else {
- let {bool cond_11871} = le32(1.0f32, h'_11855)
- let {bool res_11872} = lt32(h'_11855, 2.0f32)
- let {bool x_11873} = logand(cond_11871, res_11872)
- let {f32 res_11874, f32 res_11875, f32 res_11876} =
- -- Branch returns: {f32, f32, f32}
- if x_11873
- then {x_11864, c_11854, 0.0f32} else {
- let {bool cond_11877} = le32(2.0f32, h'_11855)
- let {bool res_11878} = lt32(h'_11855, 3.0f32)
- let {bool x_11879} = logand(cond_11877, res_11878)
- let {f32 res_11880, f32 res_11881,
- f32 res_11882} =
- -- Branch returns: {f32, f32, f32}
- if x_11879
- then {0.0f32, c_11854, x_11864} else {
- let {bool cond_11883} = le32(3.0f32, h'_11855)
- let {bool res_11884} = lt32(h'_11855, 4.0f32)
- let {bool x_11885} =
- logand(cond_11883, res_11884)
- let {f32 res_11886} =
- -- Branch returns: {f32}
- if x_11885
- then {x_11864} else {0.0f32}
- let {f32 res_11887, f32 res_11888} =
- -- Branch returns: {f32, f32}
- if x_11885
- then {0.0f32, c_11854} else {
- let {bool cond_11889} =
- le32(4.0f32, h'_11855)
- let {bool res_11890} =
- lt32(h'_11855, 5.0f32)
- let {bool x_11891} =
- logand(cond_11889, res_11890)
- let {f32 res_11892, f32 res_11893} =
- -- Branch returns: {f32, f32}
- if x_11891
- then {x_11864, c_11854} else {
- let {bool cond_11894} =
- le32(5.0f32, h'_11855)
- let {bool res_11895} =
- lt32(h'_11855, 6.0f32)
- let {bool x_11896} =
- logand(cond_11894, res_11895)
- let {f32 res_11897} =
- -- Branch returns: {f32}
- if x_11896
- then {c_11854} else {0.0f32}
- let {f32 res_11898} =
- -- Branch returns: {f32}
- if x_11896
- then {x_11864} else {0.0f32}
- in {res_11897, res_11898}
- }
- in {res_11892, res_11893}
- }
- in {res_11887, res_11886, res_11888}
- }
- in {res_11880, res_11881, res_11882}
- }
- in {res_11874, res_11875, res_11876}
- }
- let {f32 m_11899} = fsub32(res_11768, c_11854)
- let {f32 res_11900} = fadd32(res_11868, m_11899)
- let {f32 res_11901} = fadd32(res_11869, m_11899)
- let {f32 res_11902} = fadd32(res_11870, m_11899)
- let {f32 f32_arg_11903} = fmul32(255.0f32, res_11900)
- let {i32 unsign_arg_11904} =
- fptoui f32 f32_arg_11903 to i32
- let {f32 f32_arg_11905} = fmul32(255.0f32, res_11901)
- let {i32 unsign_arg_11906} =
- fptoui f32 f32_arg_11905 to i32
- let {f32 f32_arg_11907} = fmul32(255.0f32, res_11902)
- let {i32 unsign_arg_11908} =
- fptoui f32 f32_arg_11907 to i32
- let {i32 x_11909} = shl32(unsign_arg_11904, 16i32)
- let {i32 y_11910} = shl32(unsign_arg_11906, 8i32)
- let {i32 x_11911} = or32(x_11909, y_11910)
- let {i32 res_11912} = or32(unsign_arg_11908, x_11911)
- return {returns res_11912}
- }
- -- res_11913 aliases res_11760
- let {[replicate_arg_7618]i32 res_11913} = res_11760
- in {res_11913}
- }
- -- res_8927 aliases res_8644
- let {[w_7133][h_7134]i32 res_8927} =
- <range_valid_c_8642>
- reshape((w_7133, h_7134), res_8644)
- in {res_8927}
- } else {
- let {bool zero_8928} = eq_i32(n_draw_rects_x_7131, 0i32)
- let {bool nonzero_8929} = not zero_8928
- let {cert nonzero_cert_8930} =
- assert(nonzero_8929, "division by zero",
- "futracerlib/render.fut:206:19-31")
- let {i32 x_8931} =
- <nonzero_cert_8930>
- sdiv32(w_7133, n_draw_rects_x_7131)
- let {i32 x_8932} =
- <nonzero_cert_8930>
- smod32(w_7133, n_draw_rects_x_7131)
- let {bool bool_arg_8933} = slt32(0i32, x_8932)
- let {i32 res_8934} = btoi bool bool_arg_8933 to i32
- let {i32 x_size_8935} = add32(x_8931, res_8934)
- let {bool zero_8936} = eq_i32(n_draw_rects_y_7132, 0i32)
- let {bool nonzero_8937} = not zero_8936
- let {cert nonzero_cert_8938} =
- assert(nonzero_8937, "division by zero",
- "futracerlib/render.fut:207:19-31")
- let {i32 x_8939} =
- <nonzero_cert_8938>
- sdiv32(h_7134, n_draw_rects_y_7132)
- let {i32 x_8940} =
- <nonzero_cert_8938>
- smod32(h_7134, n_draw_rects_y_7132)
- let {bool bool_arg_8941} = slt32(0i32, x_8940)
- let {i32 res_8942} = btoi bool bool_arg_8941 to i32
- let {i32 y_size_8943} = add32(x_8939, res_8942)
- let {bool bounds_invalid_upwards_8944} =
- slt32(n_draw_rects_x_7131, 0i32)
- let {bool valid_8945} = not bounds_invalid_upwards_8944
- let {cert range_valid_c_8946} =
- assert(valid_8945, "Range ", 0i32, "..", 1i32, "..<",
- n_draw_rects_x_7131, " is invalid.",
- "/prelude/math.fut:453:23-30")
- let {[n_draw_rects_x_7131]i32 res_8947} =
- <range_valid_c_8946>
- iota32(n_draw_rects_x_7131, 0i32, 1i32)
- let {bool bounds_invalid_upwards_8948} =
- slt32(n_draw_rects_y_7132, 0i32)
- let {bool valid_8949} = not bounds_invalid_upwards_8948
- let {cert range_valid_c_8950} =
- assert(valid_8949, "Range ", 0i32, "..", 1i32, "..<",
- n_draw_rects_y_7132, " is invalid.",
- "/prelude/math.fut:453:23-30")
- let {[n_draw_rects_y_7132]i32 res_8951} =
- <range_valid_c_8950>
- iota32(n_draw_rects_y_7132, 0i32, 1i32)
- let {i32 comparatee_11914} = mul_nw32(n_draw_rects_y_7132, 1i32)
- let {bool suff_outer_par_11915} =
- get_size(suff_outer_par_4, threshold ()) <= comparatee_11914
- let {i64 n_draw_rects_y_11951} =
- sext i32 n_draw_rects_y_7132 to i64
- let {i64 nest_size_11952} = mul_nw64(n_draw_rects_y_11951, 1i64)
- let {i32 segmap_group_size_11953} =
- get_size(segmap_group_size_11943, group_size)
- let {i64 segmap_group_size_11954} =
- sext i32 segmap_group_size_11953 to i64
- let {i64 segmap_usable_groups_64_11955} =
- sdiv_up64(nest_size_11952, segmap_group_size_11954)
- let {i32 segmap_usable_groups_11956} =
- sext i64 segmap_usable_groups_64_11955 to i32
- let {[n_draw_rects_y_7132]i32 res_11957,
- [n_draw_rects_y_7132]i32 res_11958} =
- <range_valid_c_8950>
- segmap_thread
- (#groups=segmap_usable_groups_11956; groupsize=segmap_group_size_11953)
- (gtid_11939 < n_draw_rects_y_7132) (~phys_tid_11940) : {i32,
- i32} {
- let {i32 x_11959} = res_8951[gtid_11939]
- let {i32 y0_11960} = mul32(y_size_8943, x_11959)
- let {i32 y1_11961} = add32(y_size_8943, y0_11960)
- return {returns y0_11960, returns y1_11961}
- }
- -- res_8952 aliases res_11957
- let {[n_draw_rects_y_7132]i32 res_8952} = res_11957
- -- res_8953 aliases res_11958
- let {[n_draw_rects_y_7132]i32 res_8953} = res_11958
- let {i32 comparatee_11962} = mul_nw32(n_draw_rects_x_7131, 1i32)
- let {bool suff_outer_par_11963} =
- get_size(suff_outer_par_5, threshold ()) <= comparatee_11962
- let {i64 n_draw_rects_x_12092} =
- sext i32 n_draw_rects_x_7131 to i64
- let {i64 nest_size_12093} = mul_nw64(n_draw_rects_x_12092, 1i64)
- let {i32 segmap_group_size_12094} =
- get_size(segmap_group_size_12084, group_size)
- let {i64 segmap_group_size_12095} =
- sext i32 segmap_group_size_12094 to i64
- let {i64 segmap_usable_groups_64_12096} =
- sdiv_up64(nest_size_12093, segmap_group_size_12095)
- let {i32 segmap_usable_groups_12097} =
- sext i64 segmap_usable_groups_64_12096 to i32
- let {[n_draw_rects_x_7131]i32 x0_r_12098,
- [n_draw_rects_x_7131]i32 x1_r_12099} =
- segmap_thread
- (#groups=segmap_usable_groups_12097; groupsize=segmap_group_size_12094)
- (gtid_12080 < n_draw_rects_x_7131) (~phys_tid_12081) : {i32,
- i32} {
- let {i32 x_12100} = res_8947[gtid_12080]
- let {i32 x0_12101} = mul32(x_size_8935, x_12100)
- let {i32 x1_12102} = add32(x_size_8935, x0_12101)
- return {returns x0_12101, returns x1_12102}
- }
- let {i64 n_draw_rects_x_12103} =
- sext i32 n_draw_rects_x_7131 to i64
- let {i64 n_draw_rects_y_12104} =
- sext i32 n_draw_rects_y_7132 to i64
- let {i64 y_12105} = mul_nw64(n_draw_rects_y_12104, 1i64)
- let {i64 nest_size_12106} =
- mul_nw64(n_draw_rects_x_12103, y_12105)
- let {i32 segmap_group_size_12107} =
- get_size(segmap_group_size_12044, group_size)
- let {i64 segmap_group_size_12108} =
- sext i32 segmap_group_size_12107 to i64
- let {i64 segmap_usable_groups_64_12109} =
- sdiv_up64(nest_size_12106, segmap_group_size_12108)
- let {i32 segmap_usable_groups_12110} =
- sext i64 segmap_usable_groups_64_12109 to i32
- let {i32 y_12111} = mul_nw32(n_draw_rects_y_7132, 1i32)
- let {i32 comparatee_12112} =
- mul_nw32(n_draw_rects_x_7131, y_12111)
- let {bool suff_outer_par_12113} =
- get_size(suff_outer_par_7,
- threshold (!suff_outer_par_5)) <= comparatee_12112
- let {i64 n_draw_rects_x_12114} =
- sext i32 n_draw_rects_x_7131 to i64
- let {i64 n_draw_rects_y_12115} =
- sext i32 n_draw_rects_y_7132 to i64
- let {i64 y_12116} = mul_nw64(n_draw_rects_y_12115, 1i64)
- let {i64 nest_size_12117} =
- mul_nw64(n_draw_rects_x_12114, y_12116)
- let {i32 segmap_group_size_12118} =
- get_size(segmap_group_size_12062, group_size)
- let {i64 segmap_group_size_12119} =
- sext i32 segmap_group_size_12118 to i64
- let {i64 segmap_usable_groups_64_12120} =
- sdiv_up64(nest_size_12117, segmap_group_size_12119)
- let {i32 segmap_usable_groups_12121} =
- sext i64 segmap_usable_groups_64_12120 to i32
- let {[n_draw_rects_x_7131][n_draw_rects_y_7132]i32 res_12122} =
- segmap_thread
- (#groups=segmap_usable_groups_12121; groupsize=segmap_group_size_12118)
- (gtid_12055 < n_draw_rects_x_7131,
- gtid_12056 < n_draw_rects_y_7132) (~phys_tid_12057) : {i32} {
- let {i32 x0_12123} = x0_r_12098[gtid_12055]
- let {i32 tmp_12124} = replicate([], x0_12123)
- return {returns tmp_12124}
- }
- -- res_12125 aliases res_12122
- let {[n_draw_rects_x_7131][n_draw_rects_y_7132]i32 res_12125} =
- res_12122
- let {i64 n_draw_rects_x_12126} =
- sext i32 n_draw_rects_x_7131 to i64
- let {i64 n_draw_rects_y_12127} =
- sext i32 n_draw_rects_y_7132 to i64
- let {i64 y_12128} = mul_nw64(n_draw_rects_y_12127, 1i64)
- let {i64 nest_size_12129} =
- mul_nw64(n_draw_rects_x_12126, y_12128)
- let {i32 segmap_group_size_12130} =
- get_size(segmap_group_size_11999, group_size)
- let {i64 segmap_group_size_12131} =
- sext i32 segmap_group_size_12130 to i64
- let {i64 segmap_usable_groups_64_12132} =
- sdiv_up64(nest_size_12129, segmap_group_size_12131)
- let {i32 segmap_usable_groups_12133} =
- sext i64 segmap_usable_groups_64_12132 to i32
- let {i32 y_12134} = mul_nw32(n_draw_rects_y_7132, 1i32)
- let {i32 comparatee_12135} =
- mul_nw32(n_draw_rects_x_7131, y_12134)
- let {bool suff_outer_par_12136} =
- get_size(suff_outer_par_6,
- threshold (!suff_outer_par_5)) <= comparatee_12135
- let {i64 n_draw_rects_x_12137} =
- sext i32 n_draw_rects_x_7131 to i64
- let {i64 n_draw_rects_y_12138} =
- sext i32 n_draw_rects_y_7132 to i64
- let {i64 y_12139} = mul_nw64(n_draw_rects_y_12138, 1i64)
- let {i64 nest_size_12140} =
- mul_nw64(n_draw_rects_x_12137, y_12139)
- let {i32 segmap_group_size_12141} =
- get_size(segmap_group_size_12017, group_size)
- let {i64 segmap_group_size_12142} =
- sext i32 segmap_group_size_12141 to i64
- let {i64 segmap_usable_groups_64_12143} =
- sdiv_up64(nest_size_12140, segmap_group_size_12142)
- let {i32 segmap_usable_groups_12144} =
- sext i64 segmap_usable_groups_64_12143 to i32
- let {[n_draw_rects_x_7131][n_draw_rects_y_7132]i32 res_12145} =
- segmap_thread
- (#groups=segmap_usable_groups_12144; groupsize=segmap_group_size_12141)
- (gtid_12010 < n_draw_rects_x_7131,
- gtid_12011 < n_draw_rects_y_7132) (~phys_tid_12012) : {i32} {
- let {i32 x1_12146} = x1_r_12099[gtid_12010]
- let {i32 tmp_12147} = replicate([], x1_12146)
- return {returns tmp_12147}
- }
- -- res_12148 aliases res_12145
- let {[n_draw_rects_x_7131][n_draw_rects_y_7132]i32 res_12148} =
- res_12145
- -- res_8957 aliases res_12125
- let {[n_draw_rects_x_7131][n_draw_rects_y_7132]i32 res_8957} =
- res_12125
- -- res_8958 aliases res_12148
- let {[n_draw_rects_x_7131][n_draw_rects_y_7132]i32 res_8958} =
- res_12148
- let {i32 lifted_0_rect_pixel_indices_arg_8964} =
- mul32(x_size_8935, y_size_8943)
- -- reshape_8965 aliases res_8957
- let {[n_total_8638]i32 reshape_8965} =
- <range_valid_c_8946>
- reshape((n_total_8638), res_8957)
- let {[n_draw_rects_x_7131][n_draw_rects_y_7132]i32 repeat_8966} =
- replicate([n_draw_rects_x_7131], res_8952)
- -- reshape_8967 aliases repeat_8966
- let {[n_total_8638]i32 reshape_8967} =
- <range_valid_c_8946>
- reshape((n_total_8638), repeat_8966)
- -- reshape_8968 aliases res_8958
- let {[n_total_8638]i32 reshape_8968} =
- <range_valid_c_8946>
- reshape((n_total_8638), res_8958)
- let {[n_draw_rects_x_7131][n_draw_rects_y_7132]i32 repeat_8969} =
- replicate([n_draw_rects_x_7131], res_8953)
- -- reshape_8970 aliases repeat_8969
- let {[n_total_8638]i32 reshape_8970} =
- <range_valid_c_8946>
- reshape((n_total_8638), repeat_8969)
- let {i32 comparatee_12149} = mul_nw32(n_total_8638, 1i32)
- let {bool suff_outer_par_12150} =
- get_size(suff_outer_par_8, threshold ()) <= comparatee_12149
- let {[n_total_8638][lifted_0_rect_pixel_indices_arg_8964]i32 res_8971,
- [n_total_8638][lifted_0_rect_pixel_indices_arg_8964]i32 res_8972} =
- -- Branch returns: {[n_total_8638][lifted_0_rect_pixel_indices_arg_8964]i32,
- -- [n_total_8638][lifted_0_rect_pixel_indices_arg_8964]i32}
- if <equiv> suff_outer_par_12150
- then {
- let {i64 n_total_12892} = sext i32 n_total_8638 to i64
- let {i64 nest_size_12893} = mul_nw64(n_total_12892, 1i64)
- let {i32 segmap_group_size_12894} =
- get_size(segmap_group_size_12475, group_size)
- let {i32 num_groups_12895} =
- calc_num_groups(nest_size_12893, segmap_num_groups_12477,
- segmap_group_size_12894)
- let {i32 num_threads_12896} =
- mul_nw32(num_groups_12895, segmap_group_size_12894)
- let {[n_total_8638][lifted_0_rect_pixel_indices_arg_8964]i32 res_12897,
- [n_total_8638][lifted_0_rect_pixel_indices_arg_8964]i32 res_12898} =
- segmap_thread
- (#groups=num_groups_12895; groupsize=segmap_group_size_12894; virtualise)
- (gtid_12471 < n_total_8638) (~phys_tid_12472) : {[lifted_0_rect_pixel_indices_arg_8964]i32,
- [lifted_0_rect_pixel_indices_arg_8964]i32} {
- let {i32 x_12899} = reshape_8965[gtid_12471]
- let {i32 x_12900} = reshape_8967[gtid_12471]
- let {i32 x_12901} = reshape_8968[gtid_12471]
- let {i32 x_12902} = reshape_8970[gtid_12471]
- let {i32 res_12903} = sub32(x_12901, x_12899)
- let {i32 res_12904} = sub32(x_12902, x_12900)
- let {[res_12903]i32 res_12905} = iota32(res_12903, 0i32,
- 1i32)
- let {[res_12904]i32 res_12906} = iota32(res_12904, 0i32,
- 1i32)
- let {[res_12904]i32 res_12907} =
- map(res_12904,
- fn {i32} (i32 x_12908) =>
- let {i32 res_12909} = add32(x_12900, x_12908)
- in {res_12909},
- res_12906)
- let {[res_12903][res_12904]i32 res_12910} =
- map(res_12903,
- fn {[res_12904]i32} (i32 x_12911) =>
- let {i32 res_12912} = add32(x_12899, x_12911)
- let {i32 x_12913} = mul32(h_7134, res_12912)
- let {[res_12904]i32 res_12914} =
- map(res_12904,
- fn {i32} (i32 x_12915) =>
- let {i32 res_12916} =
- add32(x_12913, x_12915)
- in {res_12916},
- res_12907)
- in {res_12914},
- res_12905)
- -- result_proper_shape_12917 aliases res_12910
- let {[lifted_0_rect_pixel_indices_arg_8964]i32 result_proper_shape_12917} =
- reshape((lifted_0_rect_pixel_indices_arg_8964),
- res_12910)
- let {[partition_size_7544]i32 offsets_12918,
- [partition_size_7544]i32 increments_12919} =
- scanomap(partition_size_7544,
- {fn {i32} (i32 x_12920, i32 y_12921) =>
- let {i32 z_12922} =
- add_nw32(x_12920, y_12921)
- in {z_12922},
- {0i32}},
- fn {i32, i32} (i32 x_12923, i32 x_12924,
- i32 x_12925, i32 x_12926,
- i32 x_12927, i32 x_12928) =>
- let {i32 res_12929} =
- smin32(x_12923, x_12925)
- let {i32 res_12930} =
- smin32(x_12927, res_12929)
- let {i32 res_12931} =
- smin32(x_12924, x_12926)
- let {i32 res_12932} =
- smin32(x_12928, res_12931)
- let {i32 res_12933} =
- smax32(x_12923, x_12925)
- let {i32 res_12934} =
- smax32(x_12927, res_12933)
- let {i32 res_12935} =
- smax32(x_12924, x_12926)
- let {i32 res_12936} =
- smax32(x_12928, res_12935)
- let {bool cond_12937} =
- sle32(res_12934, x_12899)
- let {bool res_12938} =
- sle32(x_12901, res_12930)
- let {bool x_12939} = not cond_12937
- let {bool y_12940} =
- logand(res_12938, x_12939)
- let {bool cond_12941} =
- logor(cond_12937, y_12940)
- let {bool res_12942} =
- sle32(res_12936, x_12900)
- let {bool x_12943} = not cond_12941
- let {bool y_12944} =
- logand(res_12942, x_12943)
- let {bool cond_12945} =
- logor(cond_12941, y_12944)
- let {bool res_12946} =
- sle32(x_12902, res_12932)
- let {bool x_12947} = not cond_12945
- let {bool y_12948} =
- logand(res_12946, x_12947)
- let {bool complement_arg_12949} =
- logor(cond_12945, y_12948)
- let {bool res_12950} =
- not complement_arg_12949
- let {bool x_12951} = not res_12938
- let {bool y_12952} =
- logand(cond_12937, x_12951)
- let {bool cond_12953} =
- logor(res_12938, y_12952)
- let {bool x_12954} = not cond_12953
- let {bool y_12955} =
- logand(res_12946, x_12954)
- let {bool cond_12956} =
- logor(cond_12953, y_12955)
- let {bool x_12957} = not cond_12956
- let {bool y_12958} =
- logand(res_12942, x_12957)
- let {bool complement_arg_12959} =
- logor(cond_12956, y_12958)
- let {bool res_12960} =
- not complement_arg_12959
- let {bool y_12961} =
- logand(complement_arg_12949, res_12960)
- let {bool res_12962} =
- logor(res_12950, y_12961)
- let {bool cond_neg_12963} = not res_12962
- let {i32 res_12964} =
- btoi bool cond_neg_12963 to i32
- let {bool is_i_12965} =
- eq_i32(res_12964, 0i32)
- let {bool cond_neg_12966} = not is_i_12965
- let {i32 part_res_12967} =
- btoi bool cond_neg_12966 to i32
- let {i32 part_res_12968} =
- btoi bool is_i_12965 to i32
- in {part_res_12968, part_res_12967},
- res_7602, res_7603, res_7605, res_7606,
- res_7608, res_7609)
- let {i32 partition_size_12969} =
- -- Branch returns: {i32}
- if empty_slice_7593
- then {0i32} else {
- let {i32 last_offset_12970} = offsets_12918[m_7594]
- in {last_offset_12970}
- }
- let {[partition_size_7544]i32 partition_dest_12971} =
- scratch(i32, partition_size_7544)
- let {[partition_size_7544]i32 partition_dest_12972} =
- scratch(i32, partition_size_7544)
- let {[partition_size_7544]f32 partition_dest_12973} =
- scratch(f32, partition_size_7544)
- let {[partition_size_7544]i32 partition_dest_12974} =
- scratch(i32, partition_size_7544)
- let {[partition_size_7544]i32 partition_dest_12975} =
- scratch(i32, partition_size_7544)
- let {[partition_size_7544]f32 partition_dest_12976} =
- scratch(f32, partition_size_7544)
- let {[partition_size_7544]i32 partition_dest_12977} =
- scratch(i32, partition_size_7544)
- let {[partition_size_7544]i32 partition_dest_12978} =
- scratch(i32, partition_size_7544)
- let {[partition_size_7544]f32 partition_dest_12979} =
- scratch(f32, partition_size_7544)
- let {[partition_size_7544]i32 partition_dest_12980} =
- scratch(i32, partition_size_7544)
- let {[partition_size_7544]f32 partition_dest_12981} =
- scratch(f32, partition_size_7544)
- let {[partition_size_7544]f32 partition_dest_12982} =
- scratch(f32, partition_size_7544)
- let {[partition_size_7544]f32 partition_dest_12983} =
- scratch(f32, partition_size_7544)
- let {[partition_size_7544]i32 partition_dest_12984} =
- scratch(i32, partition_size_7544)
- let {[partition_size_7544]i32 partition_res_12985,
- [partition_size_7544]i32 partition_res_12986,
- [partition_size_7544]f32 partition_res_12987,
- [partition_size_7544]i32 partition_res_12988,
- [partition_size_7544]i32 partition_res_12989,
- [partition_size_7544]f32 partition_res_12990,
- [partition_size_7544]i32 partition_res_12991,
- [partition_size_7544]i32 partition_res_12992,
- [partition_size_7544]f32 partition_res_12993,
- [partition_size_7544]i32 partition_res_12994,
- [partition_size_7544]f32 partition_res_12995,
- [partition_size_7544]f32 partition_res_12996,
- [partition_size_7544]f32 partition_res_12997,
- [partition_size_7544]i32 partition_res_12998} =
- -- Consumes partition_dest_12971, partition_dest_12972, partition_dest_12973, partition_dest_12974, partition_dest_12975, partition_dest_12976, partition_dest_12977, partition_dest_12978, partition_dest_12979, partition_dest_12980, partition_dest_12981, partition_dest_12982, partition_dest_12983, partition_dest_12984
- scatter(partition_size_7544,
- fn {i32, i32, i32, i32, i32, i32, i32, i32, i32,
- i32, i32, i32, i32, i32, i32, i32, f32, i32,
- i32, f32, i32, i32, f32, i32, f32, f32, f32,
- i32} (i32 c_12999, i32 offset_13000,
- i32 v_13001, i32 v_13002, f32 v_13003,
- i32 v_13004, i32 v_13005, f32 v_13006,
- i32 v_13007, i32 v_13008, f32 v_13009,
- i32 v_13010, f32 v_13011, f32 v_13012,
- f32 v_13013, i32 v_13014) =>
- let {bool is_this_one_13015} =
- eq_i32(c_12999, 0i32)
- let {i32 this_offset_13016} =
- add_nw32(-1i32, offset_13000)
- let {i32 total_res_13017} =
- -- Branch returns: {i32}
- if is_this_one_13015
- then {this_offset_13016} else {-1i32}
- in {total_res_13017, total_res_13017,
- total_res_13017, total_res_13017,
- total_res_13017, total_res_13017,
- total_res_13017, total_res_13017,
- total_res_13017, total_res_13017,
- total_res_13017, total_res_13017,
- total_res_13017, total_res_13017, v_13001,
- v_13002, v_13003, v_13004, v_13005,
- v_13006, v_13007, v_13008, v_13009,
- v_13010, v_13011, v_13012, v_13013,
- v_13014},
- {increments_12919, offsets_12918, res_7602,
- res_7603, res_7604, res_7605, res_7606,
- res_7607, res_7608, res_7609, res_7610,
- res_7611, res_7612, res_7613, res_7614,
- res_7615}, (1, partition_dest_12971), (1,
- partition_dest_12972),
- (1, partition_dest_12973), (1,
- partition_dest_12974),
- (1, partition_dest_12975), (1,
- partition_dest_12976),
- (1, partition_dest_12977), (1,
- partition_dest_12978),
- (1, partition_dest_12979), (1,
- partition_dest_12980),
- (1, partition_dest_12981), (1,
- partition_dest_12982),
- (1, partition_dest_12983), (1,
- partition_dest_12984))
- -- res_13018 aliases partition_res_12985
- let {[partition_size_12969]i32 res_13018} =
- partition_res_12985[0i32:+partition_size_12969*1i32]
- -- res_13019 aliases partition_res_12986
- let {[partition_size_12969]i32 res_13019} =
- partition_res_12986[0i32:+partition_size_12969*1i32]
- -- res_13020 aliases partition_res_12987
- let {[partition_size_12969]f32 res_13020} =
- partition_res_12987[0i32:+partition_size_12969*1i32]
- -- res_13021 aliases partition_res_12988
- let {[partition_size_12969]i32 res_13021} =
- partition_res_12988[0i32:+partition_size_12969*1i32]
- -- res_13022 aliases partition_res_12989
- let {[partition_size_12969]i32 res_13022} =
- partition_res_12989[0i32:+partition_size_12969*1i32]
- -- res_13023 aliases partition_res_12990
- let {[partition_size_12969]f32 res_13023} =
- partition_res_12990[0i32:+partition_size_12969*1i32]
- -- res_13024 aliases partition_res_12991
- let {[partition_size_12969]i32 res_13024} =
- partition_res_12991[0i32:+partition_size_12969*1i32]
- -- res_13025 aliases partition_res_12992
- let {[partition_size_12969]i32 res_13025} =
- partition_res_12992[0i32:+partition_size_12969*1i32]
- -- res_13026 aliases partition_res_12993
- let {[partition_size_12969]f32 res_13026} =
- partition_res_12993[0i32:+partition_size_12969*1i32]
- let {[partition_size_12969]i32 lifted_2_map2_arg_13027} =
- iota32(partition_size_12969, 0i32, 1i32)
- let {[lifted_0_rect_pixel_indices_arg_8964]i32 res_13028} =
- map(lifted_0_rect_pixel_indices_arg_8964,
- fn {i32} (i32 x_13029) =>
- let {i32 res_13030} = sdiv32(x_13029, h_7134)
- let {i32 res_13031} = smod32(x_13029, h_7134)
- let {bool res_13032, f32 res_13033,
- i32 res_13034} =
- redomap(partition_size_12969,
- {commutative fn {bool, f32, i32}
- (bool x_13035, f32 x_13036,
- i32 x_13037, bool x_13038,
- f32 x_13039, i32 x_13040) =>
- let {bool res_13041} =
- le32(0.0f32, x_13036)
- let {bool x_13042} =
- logand(x_13035, res_13041)
- let {bool cond_13043} =
- lt32(x_13039, 0.0f32)
- let {bool res_13044} = not x_13038
- let {bool x_13045} = not cond_13043
- let {bool y_13046} =
- logand(res_13044, x_13045)
- let {bool cond_13047} =
- logor(cond_13043, y_13046)
- let {bool res_13048} =
- lt32(x_13036, x_13039)
- let {bool x_13049} = not cond_13047
- let {bool y_13050} =
- logand(res_13048, x_13049)
- let {bool res_13051} =
- logor(cond_13047, y_13050)
- let {bool x_13052} =
- logand(x_13042, res_13051)
- let {bool res_13053, f32 res_13054,
- i32 res_13055} =
- -- Branch returns: {bool, f32, i32}
- if x_13052
- then {true, x_13036,
- x_13037} else {
- let {bool res_13056} =
- le32(0.0f32, x_13039)
- let {bool x_13057} =
- logand(x_13038, res_13056)
- let {bool cond_13058} =
- lt32(x_13036, 0.0f32)
- let {bool res_13059} =
- not x_13035
- let {bool x_13060} =
- not cond_13058
- let {bool y_13061} =
- logand(res_13059, x_13060)
- let {bool cond_13062} =
- logor(cond_13058, y_13061)
- let {bool res_13063} =
- lt32(x_13039, x_13036)
- let {bool x_13064} =
- not cond_13062
- let {bool y_13065} =
- logand(res_13063, x_13064)
- let {bool res_13066} =
- logor(cond_13062, y_13065)
- let {bool x_13067} =
- logand(x_13057, res_13066)
- let {bool res_13068,
- f32 res_13069,
- i32 res_13070} =
- -- Branch returns: {bool, f32, i32}
- if x_13067
- then {true, x_13039,
- x_13040} else {
- let {bool x_13071} =
- logand(x_13038, x_13042)
- let {bool x_13072} =
- logand(res_13056, x_13071)
- let {bool res_13073} =
- eq_f32(x_13036, x_13039)
- let {bool x_13074} =
- logand(x_13072, res_13073)
- let {f32 res_13075} =
- -- Branch returns: {f32}
- if x_13074
- then {x_13036} else {-1.0f32}
- let {i32 res_13076} =
- -- Branch returns: {i32}
- if x_13074
- then {x_13037} else {-1i32}
- in {x_13074, res_13075,
- res_13076}
- }
- in {res_13068, res_13069,
- res_13070}
- }
- in {res_13053, res_13054, res_13055},
- {false, -1.0f32, -1i32}},
- fn {bool, f32, i32} (i32 x_13077,
- i32 x_13078,
- f32 x_13079,
- i32 x_13080,
- i32 x_13081,
- f32 x_13082,
- i32 x_13083,
- i32 x_13084,
- f32 x_13085,
- i32 x_13086) =>
- let {i32 x_13087} =
- sub32(x_13081, x_13084)
- let {i32 y_13088} =
- sub32(x_13077, x_13083)
- let {i32 x_13089} =
- mul32(x_13087, y_13088)
- let {i32 x_13090} =
- sub32(x_13083, x_13080)
- let {i32 y_13091} =
- sub32(x_13078, x_13084)
- let {i32 y_13092} =
- mul32(x_13090, y_13091)
- let {i32 factor_13093} =
- add32(x_13089, y_13092)
- let {bool cond_13094} =
- eq_i32(factor_13093, 0i32)
- let {bool cond_13095} = not cond_13094
- let {i32 res_13096} =
- -- Branch returns: {i32}
- if cond_13095
- then {factor_13093} else {1i32}
- let {i32 res_13097, i32 res_13098,
- i32 res_13099, f32 res_13100,
- f32 res_13101, f32 res_13102} =
- -- Branch returns: {i32, i32, i32, f32, f32, f32}
- if cond_13095
- then {
- let {i32 y_13103} =
- sub32(res_13030, x_13083)
- let {i32 x_13104} =
- mul32(x_13087, y_13103)
- let {i32 y_13105} =
- sub32(res_13031, x_13084)
- let {i32 y_13106} =
- mul32(x_13090, y_13105)
- let {i32 a_13107} =
- add32(x_13104, y_13106)
- let {i32 x_13108} =
- sub32(x_13084, x_13078)
- let {i32 x_13109} =
- mul32(y_13103, x_13108)
- let {i32 y_13110} =
- mul32(y_13088, y_13105)
- let {i32 b_13111} =
- add32(x_13109, y_13110)
- let {i32 x_13112} =
- sub32(factor_13093, a_13107)
- let {i32 c_13113} =
- sub32(x_13112, b_13111)
- let {f32 res_13114} =
- sitofp i32 factor_13093 to f32
- let {f32 res_13115} =
- sitofp i32 a_13107 to f32
- let {f32 an_13116} =
- fdiv32(res_13115, res_13114)
- let {f32 res_13117} =
- sitofp i32 b_13111 to f32
- let {f32 bn_13118} =
- fdiv32(res_13117, res_13114)
- let {f32 x_13119} =
- fsub32(1.0f32, an_13116)
- let {f32 cn_13120} =
- fsub32(x_13119, bn_13118)
- in {a_13107, b_13111, c_13113,
- an_13116, bn_13118, cn_13120}
- } else {-1i32, -1i32, -1i32,
- -1.0f32, -1.0f32, -1.0f32}
- let {bool cond_13121} =
- slt32(0i32, res_13096)
- let {bool res_13122} =
- sle32(0i32, res_13097)
- let {bool x_13123} =
- logand(cond_13121, res_13122)
- let {bool res_13124} =
- sle32(res_13097, res_13096)
- let {bool x_13125} =
- logand(x_13123, res_13124)
- let {bool cond_13126} =
- sle32(res_13096, 0i32)
- let {bool res_13127} =
- sle32(res_13096, res_13097)
- let {bool x_13128} =
- logand(cond_13126, res_13127)
- let {bool res_13129} =
- sle32(res_13097, 0i32)
- let {bool x_13130} =
- logand(x_13128, res_13129)
- let {bool x_13131} = not x_13125
- let {bool y_13132} =
- logand(x_13130, x_13131)
- let {bool res_13133} =
- logor(x_13125, y_13132)
- let {bool res_13134} =
- sle32(0i32, res_13098)
- let {bool x_13135} =
- logand(cond_13121, res_13134)
- let {bool res_13136} =
- sle32(res_13098, res_13096)
- let {bool x_13137} =
- logand(x_13135, res_13136)
- let {bool res_13138} =
- sle32(res_13096, res_13098)
- let {bool x_13139} =
- logand(cond_13126, res_13138)
- let {bool res_13140} =
- sle32(res_13098, 0i32)
- let {bool x_13141} =
- logand(x_13139, res_13140)
- let {bool x_13142} = not x_13137
- let {bool y_13143} =
- logand(x_13141, x_13142)
- let {bool res_13144} =
- logor(x_13137, y_13143)
- let {bool x_13145} =
- logand(res_13133, res_13144)
- let {bool res_13146} =
- sle32(0i32, res_13099)
- let {bool x_13147} =
- logand(cond_13121, res_13146)
- let {bool res_13148} =
- sle32(res_13099, res_13096)
- let {bool x_13149} =
- logand(x_13147, res_13148)
- let {bool res_13150} =
- sle32(res_13096, res_13099)
- let {bool x_13151} =
- logand(cond_13126, res_13150)
- let {bool res_13152} =
- sle32(res_13099, 0i32)
- let {bool x_13153} =
- logand(x_13151, res_13152)
- let {bool x_13154} = not x_13149
- let {bool y_13155} =
- logand(x_13153, x_13154)
- let {bool res_13156} =
- logor(x_13149, y_13155)
- let {bool x_13157} =
- logand(x_13145, res_13156)
- let {f32 x_13158} =
- fmul32(x_13079, res_13100)
- let {f32 y_13159} =
- fmul32(x_13082, res_13101)
- let {f32 x_13160} =
- fadd32(x_13158, y_13159)
- let {f32 y_13161} =
- fmul32(x_13085, res_13102)
- let {f32 res_13162} =
- fadd32(x_13160, y_13161)
- in {x_13157, res_13162, x_13086},
- res_13018, res_13019, res_13020,
- res_13021, res_13022, res_13023,
- res_13024, res_13025, res_13026,
- lifted_2_map2_arg_13027)
- let {bool cond_13163} = eq_i32(res_13034, -1i32)
- let {f32 res_13164, f32 res_13165,
- f32 res_13166} =
- -- Branch returns: {f32, f32, f32}
- if cond_13163
- then {0.0f32, 0.0f32, 0.0f32} else {
- let {i32 barycentric_coordinates_arg_13167} =
- partition_res_12985[res_13034]
- let {i32 barycentric_coordinates_arg_13168} =
- partition_res_12986[res_13034]
- let {i32 barycentric_coordinates_arg_13169} =
- partition_res_12988[res_13034]
- let {i32 barycentric_coordinates_arg_13170} =
- partition_res_12989[res_13034]
- let {i32 barycentric_coordinates_arg_13171} =
- partition_res_12991[res_13034]
- let {i32 barycentric_coordinates_arg_13172} =
- partition_res_12992[res_13034]
- let {i32 x_13173} =
- sub32(barycentric_coordinates_arg_13170, barycentric_coordinates_arg_13172)
- let {i32 y_13174} =
- sub32(barycentric_coordinates_arg_13167, barycentric_coordinates_arg_13171)
- let {i32 x_13175} = mul32(x_13173, y_13174)
- let {i32 x_13176} =
- sub32(barycentric_coordinates_arg_13171, barycentric_coordinates_arg_13169)
- let {i32 y_13177} =
- sub32(barycentric_coordinates_arg_13168, barycentric_coordinates_arg_13172)
- let {i32 y_13178} = mul32(x_13176, y_13177)
- let {i32 factor_13179} =
- add32(x_13175, y_13178)
- let {bool cond_13180} =
- eq_i32(factor_13179, 0i32)
- let {bool cond_13181} = not cond_13180
- let {f32 res_13182, f32 res_13183,
- f32 res_13184} =
- -- Branch returns: {f32, f32, f32}
- if cond_13181
- then {
- let {i32 y_13185} =
- sub32(res_13030, barycentric_coordinates_arg_13171)
- let {i32 x_13186} =
- mul32(x_13173, y_13185)
- let {i32 y_13187} =
- sub32(res_13031, barycentric_coordinates_arg_13172)
- let {i32 y_13188} =
- mul32(x_13176, y_13187)
- let {i32 a_13189} =
- add32(x_13186, y_13188)
- let {i32 x_13190} =
- sub32(barycentric_coordinates_arg_13172, barycentric_coordinates_arg_13168)
- let {i32 x_13191} =
- mul32(y_13185, x_13190)
- let {i32 y_13192} =
- mul32(y_13174, y_13187)
- let {i32 b_13193} =
- add32(x_13191, y_13192)
- let {f32 res_13194} =
- sitofp i32 factor_13179 to f32
- let {f32 res_13195} =
- sitofp i32 a_13189 to f32
- let {f32 an_13196} =
- fdiv32(res_13195, res_13194)
- let {f32 res_13197} =
- sitofp i32 b_13193 to f32
- let {f32 bn_13198} =
- fdiv32(res_13197, res_13194)
- let {f32 x_13199} =
- fsub32(1.0f32, an_13196)
- let {f32 cn_13200} =
- fsub32(x_13199, bn_13198)
- in {an_13196, bn_13198, cn_13200}
- } else {-1.0f32, -1.0f32, -1.0f32}
- let {i32 color_point_arg_13201} =
- partition_res_12994[res_13034]
- let {f32 color_point_arg_13202} =
- partition_res_12995[res_13034]
- let {f32 color_point_arg_13203} =
- partition_res_12996[res_13034]
- let {f32 color_point_arg_13204} =
- partition_res_12997[res_13034]
- let {i32 color_point_arg_13205} =
- partition_res_12998[res_13034]
- let {bool cond_13206} =
- eq_i32(color_point_arg_13201, 1i32)
- let {f32 res_13207, f32 res_13208,
- f32 res_13209} =
- -- Branch returns: {f32, f32, f32}
- if cond_13206
- then {color_point_arg_13202,
- color_point_arg_13203,
- color_point_arg_13204} else {
- let {bool cond_13210} =
- eq_i32(color_point_arg_13201, 2i32)
- let {f32 res_13211, f32 res_13212,
- f32 res_13213} =
- -- Branch returns: {f32, f32, f32}
- if cond_13210
- then {
- let {i32 i_13214} =
- sdiv32(color_point_arg_13205, 2i32)
- let {i32 x_13215} =
- and32(1i32, color_point_arg_13205)
- let {bool cond_13216} =
- eq_i32(x_13215, 0i32)
- let {f32 res_13217} =
- -- Branch returns: {f32}
- if cond_13216
- then {0.0f32} else {1.0f32}
- let {f32 res_13218} =
- -- Branch returns: {f32}
- if cond_13216
- then {1.0f32} else {0.0f32}
- let {f32 x_13219} =
- fmul32(res_13182, res_13217)
- let {f32 y_13220} =
- fmul32(res_13183, res_13218)
- let {f32 x_13221} =
- fadd32(x_13219, y_13220)
- let {f32 y_13222} =
- fmul32(res_13184, res_13217)
- let {f32 yn_13223} =
- fadd32(x_13221, y_13222)
- let {f32 y_13224} =
- fmul32(res_13183, res_13217)
- let {f32 x_13225} =
- fadd32(x_13219, y_13224)
- let {f32 y_13226} =
- fmul32(res_13184, res_13218)
- let {f32 xn_13227} =
- fadd32(x_13225, y_13226)
- let {f32 res_13228} =
- sitofp i32 surface_h_7153 to f32
- let {f32 t32_arg_13229} =
- fmul32(yn_13223, res_13228)
- let {i32 res_13230} =
- fptosi f32 t32_arg_13229 to i32
- let {f32 res_13231} =
- sitofp i32 surface_w_7152 to f32
- let {f32 t32_arg_13232} =
- fmul32(xn_13227, res_13231)
- let {i32 res_13233} =
- fptosi f32 t32_arg_13232 to i32
- let {i32 clamp_arg_13234} =
- sub32(surface_h_7153, 1i32)
- let {i32 res_13235} =
- smax32(0i32, res_13230)
- let {i32 res_13236} =
- smin32(clamp_arg_13234, res_13235)
- let {i32 clamp_arg_13237} =
- sub32(surface_w_7152, 1i32)
- let {i32 res_13238} =
- smax32(0i32, res_13233)
- let {i32 res_13239} =
- smin32(clamp_arg_13237, res_13238)
- let {i32 binop_y_13240} =
- mul_nw32(surface_w_7152, surface_h_7153)
- let {i32 binop_x_13241} =
- mul_nw32(i_13214, binop_y_13240)
- let {i32 binop_y_13242} =
- mul_nw32(surface_w_7152, res_13236)
- let {i32 binop_x_13243} =
- add_nw32(binop_x_13241, binop_y_13242)
- let {i32 new_index_13244} =
- add_nw32(res_13239, binop_x_13243)
- let {f32 res_13245} =
- <dim_ok_7201>
- surface_textures_flat_hsv_hs_7154[new_index_13244]
- let {f32 res_13246} =
- <empty_or_match_cert_7195,
- dim_ok_7201>
- surface_textures_flat_hsv_ss_7155[new_index_13244]
- let {f32 res_13247} =
- <empty_or_match_cert_7197,
- dim_ok_7201>
- surface_textures_flat_hsv_vs_7156[new_index_13244]
- in {res_13245, res_13246, res_13247}
- } else {0.0f32, 0.0f32, 0.0f32}
- in {res_13211, res_13212, res_13213}
- }
- let {f32 y_13248} = fpow32(res_13033, 2.0f32)
- let {f32 min_arg_13249} =
- fdiv32(2000000.0f32, y_13248)
- let {f32 res_13250} =
- fmin32(1.0f32, min_arg_13249)
- let {f32 res_13251} =
- fmul32(res_13209, res_13250)
- in {res_13207, res_13208, res_13251}
- }
- let {f32 c_13252} = fmul32(res_13165, res_13166)
- let {f32 h'_13253} = fdiv32(res_13164, 60.0f32)
- let {f32 t32_arg_13254} = fdiv32(h'_13253, 2.0f32)
- let {i32 res_13255} =
- fptosi f32 t32_arg_13254 to i32
- let {f32 res_13256} = sitofp i32 res_13255 to f32
- let {f32 y_13257} = fmul32(2.0f32, res_13256)
- let {f32 res_13258} = fsub32(h'_13253, y_13257)
- let {f32 abs_arg_13259} =
- fsub32(res_13258, 1.0f32)
- let {f32 res_13260} = fabs32 abs_arg_13259
- let {f32 y_13261} = fsub32(1.0f32, res_13260)
- let {f32 x_13262} = fmul32(c_13252, y_13261)
- let {bool cond_13263} = le32(0.0f32, h'_13253)
- let {bool res_13264} = lt32(h'_13253, 1.0f32)
- let {bool x_13265} = logand(cond_13263, res_13264)
- let {f32 res_13266, f32 res_13267,
- f32 res_13268} =
- -- Branch returns: {f32, f32, f32}
- if x_13265
- then {c_13252, x_13262, 0.0f32} else {
- let {bool cond_13269} = le32(1.0f32, h'_13253)
- let {bool res_13270} = lt32(h'_13253, 2.0f32)
- let {bool x_13271} =
- logand(cond_13269, res_13270)
- let {f32 res_13272, f32 res_13273,
- f32 res_13274} =
- -- Branch returns: {f32, f32, f32}
- if x_13271
- then {x_13262, c_13252, 0.0f32} else {
- let {bool cond_13275} =
- le32(2.0f32, h'_13253)
- let {bool res_13276} =
- lt32(h'_13253, 3.0f32)
- let {bool x_13277} =
- logand(cond_13275, res_13276)
- let {f32 res_13278, f32 res_13279,
- f32 res_13280} =
- -- Branch returns: {f32, f32, f32}
- if x_13277
- then {0.0f32, c_13252, x_13262} else {
- let {bool cond_13281} =
- le32(3.0f32, h'_13253)
- let {bool res_13282} =
- lt32(h'_13253, 4.0f32)
- let {bool x_13283} =
- logand(cond_13281, res_13282)
- let {f32 res_13284} =
- -- Branch returns: {f32}
- if x_13283
- then {x_13262} else {0.0f32}
- let {f32 res_13285, f32 res_13286} =
- -- Branch returns: {f32, f32}
- if x_13283
- then {0.0f32, c_13252} else {
- let {bool cond_13287} =
- le32(4.0f32, h'_13253)
- let {bool res_13288} =
- lt32(h'_13253, 5.0f32)
- let {bool x_13289} =
- logand(cond_13287, res_13288)
- let {f32 res_13290,
- f32 res_13291} =
- -- Branch returns: {f32, f32}
- if x_13289
- then {x_13262, c_13252} else {
- let {bool cond_13292} =
- le32(5.0f32, h'_13253)
- let {bool res_13293} =
- lt32(h'_13253, 6.0f32)
- let {bool x_13294} =
- logand(cond_13292, res_13293)
- let {f32 res_13295} =
- -- Branch returns: {f32}
- if x_13294
- then {c_13252} else {0.0f32}
- let {f32 res_13296} =
- -- Branch returns: {f32}
- if x_13294
- then {x_13262} else {0.0f32}
- in {res_13295, res_13296}
- }
- in {res_13290, res_13291}
- }
- in {res_13285, res_13284, res_13286}
- }
- in {res_13278, res_13279, res_13280}
- }
- in {res_13272, res_13273, res_13274}
- }
- let {f32 m_13297} = fsub32(res_13166, c_13252)
- let {f32 res_13298} = fadd32(res_13266, m_13297)
- let {f32 res_13299} = fadd32(res_13267, m_13297)
- let {f32 res_13300} = fadd32(res_13268, m_13297)
- let {f32 f32_arg_13301} =
- fmul32(255.0f32, res_13298)
- let {i32 unsign_arg_13302} =
- fptoui f32 f32_arg_13301 to i32
- let {f32 f32_arg_13303} =
- fmul32(255.0f32, res_13299)
- let {i32 unsign_arg_13304} =
- fptoui f32 f32_arg_13303 to i32
- let {f32 f32_arg_13305} =
- fmul32(255.0f32, res_13300)
- let {i32 unsign_arg_13306} =
- fptoui f32 f32_arg_13305 to i32
- let {i32 x_13307} = shl32(unsign_arg_13302, 16i32)
- let {i32 y_13308} = shl32(unsign_arg_13304, 8i32)
- let {i32 x_13309} = or32(x_13307, y_13308)
- let {i32 res_13310} =
- or32(unsign_arg_13306, x_13309)
- in {res_13310},
- result_proper_shape_12917)
- return {returns res_13028,
- returns result_proper_shape_12917}
- }
- in {res_12897, res_12898}
- } else {
- let {i64 n_total_14145} = sext i32 n_total_8638 to i64
- let {i64 nest_size_14146} = mul_nw64(n_total_14145, 1i64)
- let {i32 segmap_group_size_14147} =
- get_size(segmap_group_size_14121, group_size)
- let {i32 num_groups_14148} =
- calc_num_groups(nest_size_14146, segmap_num_groups_14123,
- segmap_group_size_14147)
- let {i32 num_threads_14149} =
- mul_nw32(num_groups_14148, segmap_group_size_14147)
- let {[n_total_8638][lifted_0_rect_pixel_indices_arg_8964]i32 res_14150} =
- segmap_thread
- (#groups=num_groups_14148; groupsize=segmap_group_size_14147; virtualise)
- (gtid_14117 < n_total_8638) (~phys_tid_14118) : {[lifted_0_rect_pixel_indices_arg_8964]i32} {
- let {i32 x_14151} = reshape_8965[gtid_14117]
- let {i32 x_14152} = reshape_8967[gtid_14117]
- let {i32 x_14153} = reshape_8968[gtid_14117]
- let {i32 x_14154} = reshape_8970[gtid_14117]
- let {i32 res_14155} = sub32(x_14153, x_14151)
- let {i32 res_14156} = sub32(x_14154, x_14152)
- let {[res_14155]i32 res_14157} = iota32(res_14155, 0i32,
- 1i32)
- let {[res_14156]i32 res_14158} = iota32(res_14156, 0i32,
- 1i32)
- let {[res_14156]i32 res_14159} =
- map(res_14156,
- fn {i32} (i32 x_14160) =>
- let {i32 res_14161} = add32(x_14152, x_14160)
- in {res_14161},
- res_14158)
- let {[res_14155][res_14156]i32 res_14162} =
- map(res_14155,
- fn {[res_14156]i32} (i32 x_14163) =>
- let {i32 res_14164} = add32(x_14151, x_14163)
- let {i32 x_14165} = mul32(h_7134, res_14164)
- let {[res_14156]i32 res_14166} =
- map(res_14156,
- fn {i32} (i32 x_14167) =>
- let {i32 res_14168} =
- add32(x_14165, x_14167)
- in {res_14168},
- res_14159)
- in {res_14166},
- res_14157)
- -- result_proper_shape_14169 aliases res_14162
- let {[lifted_0_rect_pixel_indices_arg_8964]i32 result_proper_shape_14169} =
- reshape((lifted_0_rect_pixel_indices_arg_8964),
- res_14162)
- return {returns result_proper_shape_14169}
- }
- let {i64 partition_size_14170} =
- sext i32 partition_size_7544 to i64
- let {i64 n_total_14171} = sext i32 n_total_8638 to i64
- let {i64 y_14172} = mul_nw64(n_total_14171, 1i64)
- let {i64 nest_size_14173} =
- mul_nw64(partition_size_14170, y_14172)
- let {i32 segscan_group_size_14174} =
- get_size(segscan_group_size_14051, group_size)
- let {i32 num_groups_14175} =
- calc_num_groups(nest_size_14173, segscan_num_groups_14053,
- segscan_group_size_14174)
- let {i32 num_threads_14176} =
- mul_nw32(num_groups_14175, segscan_group_size_14174)
- let {[n_total_8638][partition_size_7544]i32 offsets_r_14177,
- [n_total_8638][partition_size_7544]i32 increments_r_14178} =
- segscan_thread
- (#groups=num_groups_14175; groupsize=segscan_group_size_14174)
- ({{0i32},
- [],
- fn {i32} (i32 x_14179, i32 y_14180) =>
- let {i32 z_14181} = add_nw32(x_14179, y_14180)
- in {z_14181}})
- (gtid_14046 < n_total_8638,
- gtid_14056 < partition_size_7544) (~phys_tid_14057) : {i32,
- i32} {
- let {i32 x_14182} = reshape_8965[gtid_14046]
- let {i32 x_14183} = reshape_8967[gtid_14046]
- let {i32 x_14184} = reshape_8968[gtid_14046]
- let {i32 x_14185} = reshape_8970[gtid_14046]
- let {i32 x_14186} = res_7602[gtid_14056]
- let {i32 x_14187} = res_7603[gtid_14056]
- let {i32 x_14188} = res_7605[gtid_14056]
- let {i32 x_14189} = res_7606[gtid_14056]
- let {i32 x_14190} = res_7608[gtid_14056]
- let {i32 x_14191} = res_7609[gtid_14056]
- let {i32 res_14192} = smin32(x_14186, x_14188)
- let {i32 res_14193} = smin32(x_14190, res_14192)
- let {i32 res_14194} = smin32(x_14187, x_14189)
- let {i32 res_14195} = smin32(x_14191, res_14194)
- let {i32 res_14196} = smax32(x_14186, x_14188)
- let {i32 res_14197} = smax32(x_14190, res_14196)
- let {i32 res_14198} = smax32(x_14187, x_14189)
- let {i32 res_14199} = smax32(x_14191, res_14198)
- let {bool cond_14200} = sle32(res_14197, x_14182)
- let {bool res_14201} = sle32(x_14184, res_14193)
- let {bool x_14202} = not cond_14200
- let {bool y_14203} = logand(res_14201, x_14202)
- let {bool cond_14204} = logor(cond_14200, y_14203)
- let {bool res_14205} = sle32(res_14199, x_14183)
- let {bool x_14206} = not cond_14204
- let {bool y_14207} = logand(res_14205, x_14206)
- let {bool cond_14208} = logor(cond_14204, y_14207)
- let {bool res_14209} = sle32(x_14185, res_14195)
- let {bool x_14210} = not cond_14208
- let {bool y_14211} = logand(res_14209, x_14210)
- let {bool complement_arg_14212} =
- logor(cond_14208, y_14211)
- let {bool res_14213} = not complement_arg_14212
- let {bool x_14214} = not res_14201
- let {bool y_14215} = logand(cond_14200, x_14214)
- let {bool cond_14216} = logor(res_14201, y_14215)
- let {bool x_14217} = not cond_14216
- let {bool y_14218} = logand(res_14209, x_14217)
- let {bool cond_14219} = logor(cond_14216, y_14218)
- let {bool x_14220} = not cond_14219
- let {bool y_14221} = logand(res_14205, x_14220)
- let {bool complement_arg_14222} =
- logor(cond_14219, y_14221)
- let {bool res_14223} = not complement_arg_14222
- let {bool y_14224} =
- logand(complement_arg_14212, res_14223)
- let {bool res_14225} = logor(res_14213, y_14224)
- let {bool cond_neg_14226} = not res_14225
- let {i32 res_14227} = btoi bool cond_neg_14226 to i32
- let {bool is_i_14228} = eq_i32(res_14227, 0i32)
- let {bool cond_neg_14229} = not is_i_14228
- let {i32 part_res_14230} = btoi bool cond_neg_14229 to i32
- let {i32 part_res_14231} = btoi bool is_i_14228 to i32
- return {returns part_res_14231, returns part_res_14230}
- }
- let {i64 n_total_14232} = sext i32 n_total_8638 to i64
- let {i64 nest_size_14233} = mul_nw64(n_total_14232, 1i64)
- let {i32 segmap_group_size_14234} =
- get_size(segmap_group_size_14024, group_size)
- let {i32 num_groups_14235} =
- calc_num_groups(nest_size_14233, segmap_num_groups_14026,
- segmap_group_size_14234)
- let {i32 num_threads_14236} =
- mul_nw32(num_groups_14235, segmap_group_size_14234)
- let {[n_total_8638][partition_size_7544]i32 partition_dest_r_14237,
- [n_total_8638][partition_size_7544]i32 partition_dest_r_14238,
- [n_total_8638][partition_size_7544]f32 partition_dest_r_14239,
- [n_total_8638][partition_size_7544]i32 partition_dest_r_14240,
- [n_total_8638][partition_size_7544]i32 partition_dest_r_14241,
- [n_total_8638][partition_size_7544]f32 partition_dest_r_14242,
- [n_total_8638][partition_size_7544]i32 partition_dest_r_14243,
- [n_total_8638][partition_size_7544]i32 partition_dest_r_14244,
- [n_total_8638][partition_size_7544]f32 partition_dest_r_14245,
- [n_total_8638][partition_size_7544]i32 partition_dest_r_14246,
- [n_total_8638][partition_size_7544]f32 partition_dest_r_14247,
- [n_total_8638][partition_size_7544]f32 partition_dest_r_14248,
- [n_total_8638][partition_size_7544]f32 partition_dest_r_14249,
- [n_total_8638][partition_size_7544]i32 partition_dest_r_14250,
- [n_total_8638]i32 partition_size_r_14251} =
- segmap_thread
- (#groups=num_groups_14235; groupsize=segmap_group_size_14234; virtualise)
- (gtid_14020 < n_total_8638) (~phys_tid_14021) : {[partition_size_7544]i32,
- [partition_size_7544]i32,
- [partition_size_7544]f32,
- [partition_size_7544]i32,
- [partition_size_7544]i32,
- [partition_size_7544]f32,
- [partition_size_7544]i32,
- [partition_size_7544]i32,
- [partition_size_7544]f32,
- [partition_size_7544]i32,
- [partition_size_7544]f32,
- [partition_size_7544]f32,
- [partition_size_7544]f32,
- [partition_size_7544]i32,
- i32} {
- -- offsets_14252 aliases offsets_r_14177
- let {[partition_size_7544]i32 offsets_14252} =
- offsets_r_14177[gtid_14020,
- 0i32:+partition_size_7544*1i32]
- let {i32 partition_size_14253} =
- -- Branch returns: {i32}
- if empty_slice_7593
- then {0i32} else {
- let {i32 last_offset_14254} = offsets_14252[m_7594]
- in {last_offset_14254}
- }
- let {[partition_size_7544]i32 partition_dest_14255} =
- scratch(i32, partition_size_7544)
- let {[partition_size_7544]i32 partition_dest_14256} =
- scratch(i32, partition_size_7544)
- let {[partition_size_7544]f32 partition_dest_14257} =
- scratch(f32, partition_size_7544)
- let {[partition_size_7544]i32 partition_dest_14258} =
- scratch(i32, partition_size_7544)
- let {[partition_size_7544]i32 partition_dest_14259} =
- scratch(i32, partition_size_7544)
- let {[partition_size_7544]f32 partition_dest_14260} =
- scratch(f32, partition_size_7544)
- let {[partition_size_7544]i32 partition_dest_14261} =
- scratch(i32, partition_size_7544)
- let {[partition_size_7544]i32 partition_dest_14262} =
- scratch(i32, partition_size_7544)
- let {[partition_size_7544]f32 partition_dest_14263} =
- scratch(f32, partition_size_7544)
- let {[partition_size_7544]i32 partition_dest_14264} =
- scratch(i32, partition_size_7544)
- let {[partition_size_7544]f32 partition_dest_14265} =
- scratch(f32, partition_size_7544)
- let {[partition_size_7544]f32 partition_dest_14266} =
- scratch(f32, partition_size_7544)
- let {[partition_size_7544]f32 partition_dest_14267} =
- scratch(f32, partition_size_7544)
- let {[partition_size_7544]i32 partition_dest_14268} =
- scratch(i32, partition_size_7544)
- return {returns partition_dest_14255,
- returns partition_dest_14256,
- returns partition_dest_14257,
- returns partition_dest_14258,
- returns partition_dest_14259,
- returns partition_dest_14260,
- returns partition_dest_14261,
- returns partition_dest_14262,
- returns partition_dest_14263,
- returns partition_dest_14264,
- returns partition_dest_14265,
- returns partition_dest_14266,
- returns partition_dest_14267,
- returns partition_dest_14268,
- returns partition_size_14253}
- }
- let {i64 n_total_14269} = sext i32 n_total_8638 to i64
- let {i64 partition_size_14270} =
- sext i32 partition_size_7544 to i64
- let {i64 y_14271} = mul_nw64(partition_size_14270, 1i64)
- let {i64 nest_size_14272} = mul_nw64(n_total_14269, y_14271)
- let {i32 segmap_group_size_14273} =
- get_size(segmap_group_size_13980, group_size)
- let {i64 segmap_group_size_14274} =
- sext i32 segmap_group_size_14273 to i64
- let {i64 segmap_usable_groups_64_14275} =
- sdiv_up64(nest_size_14272, segmap_group_size_14274)
- let {i32 segmap_usable_groups_14276} =
- sext i64 segmap_usable_groups_64_14275 to i32
- let {[n_total_8638][partition_size_7544]i32 partition_res_r_14277,
- [n_total_8638][partition_size_7544]i32 partition_res_r_14278,
- [n_total_8638][partition_size_7544]f32 partition_res_r_14279,
- [n_total_8638][partition_size_7544]i32 partition_res_r_14280,
- [n_total_8638][partition_size_7544]i32 partition_res_r_14281,
- [n_total_8638][partition_size_7544]f32 partition_res_r_14282,
- [n_total_8638][partition_size_7544]i32 partition_res_r_14283,
- [n_total_8638][partition_size_7544]i32 partition_res_r_14284,
- [n_total_8638][partition_size_7544]f32 partition_res_r_14285,
- [n_total_8638][partition_size_7544]i32 partition_res_r_14286,
- [n_total_8638][partition_size_7544]f32 partition_res_r_14287,
- [n_total_8638][partition_size_7544]f32 partition_res_r_14288,
- [n_total_8638][partition_size_7544]f32 partition_res_r_14289,
- [n_total_8638][partition_size_7544]i32 partition_res_r_14290} =
- -- Consumes partition_dest_r_14237, partition_dest_r_14238, partition_dest_r_14239, partition_dest_r_14240, partition_dest_r_14241, partition_dest_r_14242, partition_dest_r_14243, partition_dest_r_14244, partition_dest_r_14245, partition_dest_r_14246, partition_dest_r_14247, partition_dest_r_14248, partition_dest_r_14249, partition_dest_r_14250
- segmap_thread
- (#groups=segmap_usable_groups_14276; groupsize=segmap_group_size_14273)
- (gtid_13973 < n_total_8638,
- gtid_13974 < partition_size_7544) (~phys_tid_13975) : {i32,
- i32,
- f32,
- i32,
- i32,
- f32,
- i32,
- i32,
- f32,
- i32,
- f32,
- f32,
- f32,
- i32} {
- -- offsets_14291 aliases offsets_r_14177
- let {[partition_size_7544]i32 offsets_14291} =
- offsets_r_14177[gtid_13973,
- 0i32:+partition_size_7544*1i32]
- -- increments_14292 aliases increments_r_14178
- let {[partition_size_7544]i32 increments_14292} =
- increments_r_14178[gtid_13973,
- 0i32:+partition_size_7544*1i32]
- -- partition_dest_14293 aliases partition_dest_r_14237
- let {[partition_size_7544]i32 partition_dest_14293} =
- partition_dest_r_14237[gtid_13973,
- 0i32:+partition_size_7544*1i32]
- -- partition_dest_14294 aliases partition_dest_r_14238
- let {[partition_size_7544]i32 partition_dest_14294} =
- partition_dest_r_14238[gtid_13973,
- 0i32:+partition_size_7544*1i32]
- -- partition_dest_14295 aliases partition_dest_r_14239
- let {[partition_size_7544]f32 partition_dest_14295} =
- partition_dest_r_14239[gtid_13973,
- 0i32:+partition_size_7544*1i32]
- -- partition_dest_14296 aliases partition_dest_r_14240
- let {[partition_size_7544]i32 partition_dest_14296} =
- partition_dest_r_14240[gtid_13973,
- 0i32:+partition_size_7544*1i32]
- -- partition_dest_14297 aliases partition_dest_r_14241
- let {[partition_size_7544]i32 partition_dest_14297} =
- partition_dest_r_14241[gtid_13973,
- 0i32:+partition_size_7544*1i32]
- -- partition_dest_14298 aliases partition_dest_r_14242
- let {[partition_size_7544]f32 partition_dest_14298} =
- partition_dest_r_14242[gtid_13973,
- 0i32:+partition_size_7544*1i32]
- -- partition_dest_14299 aliases partition_dest_r_14243
- let {[partition_size_7544]i32 partition_dest_14299} =
- partition_dest_r_14243[gtid_13973,
- 0i32:+partition_size_7544*1i32]
- -- partition_dest_14300 aliases partition_dest_r_14244
- let {[partition_size_7544]i32 partition_dest_14300} =
- partition_dest_r_14244[gtid_13973,
- 0i32:+partition_size_7544*1i32]
- -- partition_dest_14301 aliases partition_dest_r_14245
- let {[partition_size_7544]f32 partition_dest_14301} =
- partition_dest_r_14245[gtid_13973,
- 0i32:+partition_size_7544*1i32]
- -- partition_dest_14302 aliases partition_dest_r_14246
- let {[partition_size_7544]i32 partition_dest_14302} =
- partition_dest_r_14246[gtid_13973,
- 0i32:+partition_size_7544*1i32]
- -- partition_dest_14303 aliases partition_dest_r_14247
- let {[partition_size_7544]f32 partition_dest_14303} =
- partition_dest_r_14247[gtid_13973,
- 0i32:+partition_size_7544*1i32]
- -- partition_dest_14304 aliases partition_dest_r_14248
- let {[partition_size_7544]f32 partition_dest_14304} =
- partition_dest_r_14248[gtid_13973,
- 0i32:+partition_size_7544*1i32]
- -- partition_dest_14305 aliases partition_dest_r_14249
- let {[partition_size_7544]f32 partition_dest_14305} =
- partition_dest_r_14249[gtid_13973,
- 0i32:+partition_size_7544*1i32]
- -- partition_dest_14306 aliases partition_dest_r_14250
- let {[partition_size_7544]i32 partition_dest_14306} =
- partition_dest_r_14250[gtid_13973,
- 0i32:+partition_size_7544*1i32]
- let {i32 c_14307} = increments_r_14178[gtid_13973,
- gtid_13974]
- let {i32 offset_14308} = offsets_r_14177[gtid_13973,
- gtid_13974]
- let {i32 v_14309} = res_7602[gtid_13974]
- let {i32 v_14310} = res_7603[gtid_13974]
- let {f32 v_14311} = res_7604[gtid_13974]
- let {i32 v_14312} = res_7605[gtid_13974]
- let {i32 v_14313} = res_7606[gtid_13974]
- let {f32 v_14314} = res_7607[gtid_13974]
- let {i32 v_14315} = res_7608[gtid_13974]
- let {i32 v_14316} = res_7609[gtid_13974]
- let {f32 v_14317} = res_7610[gtid_13974]
- let {i32 v_14318} = res_7611[gtid_13974]
- let {f32 v_14319} = res_7612[gtid_13974]
- let {f32 v_14320} = res_7613[gtid_13974]
- let {f32 v_14321} = res_7614[gtid_13974]
- let {i32 v_14322} = res_7615[gtid_13974]
- let {bool is_this_one_14323} = eq_i32(c_14307, 0i32)
- let {i32 this_offset_14324} =
- add_nw32(-1i32, offset_14308)
- let {i32 total_res_14325} =
- -- Branch returns: {i32}
- if is_this_one_14323
- then {this_offset_14324} else {-1i32}
- return {partition_dest_r_14237 with ([gtid_13973 < n_total_8638,
- total_res_14325 < partition_size_7544] <- v_14309),
- partition_dest_r_14238 with ([gtid_13973 < n_total_8638,
- total_res_14325 < partition_size_7544] <- v_14310),
- partition_dest_r_14239 with ([gtid_13973 < n_total_8638,
- total_res_14325 < partition_size_7544] <- v_14311),
- partition_dest_r_14240 with ([gtid_13973 < n_total_8638,
- total_res_14325 < partition_size_7544] <- v_14312),
- partition_dest_r_14241 with ([gtid_13973 < n_total_8638,
- total_res_14325 < partition_size_7544] <- v_14313),
- partition_dest_r_14242 with ([gtid_13973 < n_total_8638,
- total_res_14325 < partition_size_7544] <- v_14314),
- partition_dest_r_14243 with ([gtid_13973 < n_total_8638,
- total_res_14325 < partition_size_7544] <- v_14315),
- partition_dest_r_14244 with ([gtid_13973 < n_total_8638,
- total_res_14325 < partition_size_7544] <- v_14316),
- partition_dest_r_14245 with ([gtid_13973 < n_total_8638,
- total_res_14325 < partition_size_7544] <- v_14317),
- partition_dest_r_14246 with ([gtid_13973 < n_total_8638,
- total_res_14325 < partition_size_7544] <- v_14318),
- partition_dest_r_14247 with ([gtid_13973 < n_total_8638,
- total_res_14325 < partition_size_7544] <- v_14319),
- partition_dest_r_14248 with ([gtid_13973 < n_total_8638,
- total_res_14325 < partition_size_7544] <- v_14320),
- partition_dest_r_14249 with ([gtid_13973 < n_total_8638,
- total_res_14325 < partition_size_7544] <- v_14321),
- partition_dest_r_14250 with ([gtid_13973 < n_total_8638,
- total_res_14325 < partition_size_7544] <- v_14322)}
- }
- let {i64 n_total_14326} = sext i32 n_total_8638 to i64
- let {i64 nest_size_14327} = mul_nw64(n_total_14326, 1i64)
- let {i32 segmap_group_size_14328} =
- get_size(segmap_group_size_13645, group_size)
- let {i32 num_groups_14329} =
- calc_num_groups(nest_size_14327, segmap_num_groups_13647,
- segmap_group_size_14328)
- let {i32 num_threads_14330} =
- mul_nw32(num_groups_14329, segmap_group_size_14328)
- let {[n_total_8638][lifted_0_rect_pixel_indices_arg_8964]i32 res_14331} =
- segmap_thread
- (#groups=num_groups_14329; groupsize=segmap_group_size_14328; virtualise)
- (gtid_13641 < n_total_8638) (~phys_tid_13642) : {[lifted_0_rect_pixel_indices_arg_8964]i32} {
- let {i32 partition_size_14332} =
- partition_size_r_14251[gtid_13641]
- -- partition_res_14333 aliases partition_res_r_14277
- let {[partition_size_7544]i32 partition_res_14333} =
- partition_res_r_14277[gtid_13641,
- 0i32:+partition_size_7544*1i32]
- -- partition_res_14334 aliases partition_res_r_14278
- let {[partition_size_7544]i32 partition_res_14334} =
- partition_res_r_14278[gtid_13641,
- 0i32:+partition_size_7544*1i32]
- -- partition_res_14335 aliases partition_res_r_14279
- let {[partition_size_7544]f32 partition_res_14335} =
- partition_res_r_14279[gtid_13641,
- 0i32:+partition_size_7544*1i32]
- -- partition_res_14336 aliases partition_res_r_14280
- let {[partition_size_7544]i32 partition_res_14336} =
- partition_res_r_14280[gtid_13641,
- 0i32:+partition_size_7544*1i32]
- -- partition_res_14337 aliases partition_res_r_14281
- let {[partition_size_7544]i32 partition_res_14337} =
- partition_res_r_14281[gtid_13641,
- 0i32:+partition_size_7544*1i32]
- -- partition_res_14338 aliases partition_res_r_14282
- let {[partition_size_7544]f32 partition_res_14338} =
- partition_res_r_14282[gtid_13641,
- 0i32:+partition_size_7544*1i32]
- -- partition_res_14339 aliases partition_res_r_14283
- let {[partition_size_7544]i32 partition_res_14339} =
- partition_res_r_14283[gtid_13641,
- 0i32:+partition_size_7544*1i32]
- -- partition_res_14340 aliases partition_res_r_14284
- let {[partition_size_7544]i32 partition_res_14340} =
- partition_res_r_14284[gtid_13641,
- 0i32:+partition_size_7544*1i32]
- -- partition_res_14341 aliases partition_res_r_14285
- let {[partition_size_7544]f32 partition_res_14341} =
- partition_res_r_14285[gtid_13641,
- 0i32:+partition_size_7544*1i32]
- -- partition_res_14342 aliases partition_res_r_14286
- let {[partition_size_7544]i32 partition_res_14342} =
- partition_res_r_14286[gtid_13641,
- 0i32:+partition_size_7544*1i32]
- -- partition_res_14343 aliases partition_res_r_14287
- let {[partition_size_7544]f32 partition_res_14343} =
- partition_res_r_14287[gtid_13641,
- 0i32:+partition_size_7544*1i32]
- -- partition_res_14344 aliases partition_res_r_14288
- let {[partition_size_7544]f32 partition_res_14344} =
- partition_res_r_14288[gtid_13641,
- 0i32:+partition_size_7544*1i32]
- -- partition_res_14345 aliases partition_res_r_14289
- let {[partition_size_7544]f32 partition_res_14345} =
- partition_res_r_14289[gtid_13641,
- 0i32:+partition_size_7544*1i32]
- -- partition_res_14346 aliases partition_res_r_14290
- let {[partition_size_7544]i32 partition_res_14346} =
- partition_res_r_14290[gtid_13641,
- 0i32:+partition_size_7544*1i32]
- -- res_14347 aliases partition_res_14333
- let {[partition_size_14332]i32 res_14347} =
- partition_res_14333[0i32:+partition_size_14332*1i32]
- -- res_14348 aliases partition_res_14334
- let {[partition_size_14332]i32 res_14348} =
- partition_res_14334[0i32:+partition_size_14332*1i32]
- -- res_14349 aliases partition_res_14335
- let {[partition_size_14332]f32 res_14349} =
- partition_res_14335[0i32:+partition_size_14332*1i32]
- -- res_14350 aliases partition_res_14336
- let {[partition_size_14332]i32 res_14350} =
- partition_res_14336[0i32:+partition_size_14332*1i32]
- -- res_14351 aliases partition_res_14337
- let {[partition_size_14332]i32 res_14351} =
- partition_res_14337[0i32:+partition_size_14332*1i32]
- -- res_14352 aliases partition_res_14338
- let {[partition_size_14332]f32 res_14352} =
- partition_res_14338[0i32:+partition_size_14332*1i32]
- -- res_14353 aliases partition_res_14339
- let {[partition_size_14332]i32 res_14353} =
- partition_res_14339[0i32:+partition_size_14332*1i32]
- -- res_14354 aliases partition_res_14340
- let {[partition_size_14332]i32 res_14354} =
- partition_res_14340[0i32:+partition_size_14332*1i32]
- -- res_14355 aliases partition_res_14341
- let {[partition_size_14332]f32 res_14355} =
- partition_res_14341[0i32:+partition_size_14332*1i32]
- let {[partition_size_14332]i32 lifted_2_map2_arg_14356} =
- iota32(partition_size_14332, 0i32, 1i32)
- let {[lifted_0_rect_pixel_indices_arg_8964]i32 res_14357} =
- replicate([lifted_0_rect_pixel_indices_arg_8964],
- res_9384)
- let {i32 res_14358} = sdiv32(x_9103, h_7134)
- let {i32 res_14359} = smod32(x_9103, h_7134)
- let {bool res_14360, f32 res_14361, i32 res_14362} =
- redomap(partition_size_14332,
- {commutative fn {bool, f32, i32} (bool x_14363,
- f32 x_14364,
- i32 x_14365,
- bool x_14366,
- f32 x_14367,
- i32 x_14368) =>
- let {bool res_14369} = le32(0.0f32, x_14364)
- let {bool x_14370} =
- logand(x_14363, res_14369)
- let {bool cond_14371} = lt32(x_14367, 0.0f32)
- let {bool res_14372} = not x_14366
- let {bool x_14373} = not cond_14371
- let {bool y_14374} =
- logand(res_14372, x_14373)
- let {bool cond_14375} =
- logor(cond_14371, y_14374)
- let {bool res_14376} = lt32(x_14364, x_14367)
- let {bool x_14377} = not cond_14375
- let {bool y_14378} =
- logand(res_14376, x_14377)
- let {bool res_14379} =
- logor(cond_14375, y_14378)
- let {bool x_14380} =
- logand(x_14370, res_14379)
- let {bool res_14381, f32 res_14382,
- i32 res_14383} =
- -- Branch returns: {bool, f32, i32}
- if x_14380
- then {true, x_14364, x_14365} else {
- let {bool res_14384} =
- le32(0.0f32, x_14367)
- let {bool x_14385} =
- logand(x_14366, res_14384)
- let {bool cond_14386} =
- lt32(x_14364, 0.0f32)
- let {bool res_14387} = not x_14363
- let {bool x_14388} = not cond_14386
- let {bool y_14389} =
- logand(res_14387, x_14388)
- let {bool cond_14390} =
- logor(cond_14386, y_14389)
- let {bool res_14391} =
- lt32(x_14367, x_14364)
- let {bool x_14392} = not cond_14390
- let {bool y_14393} =
- logand(res_14391, x_14392)
- let {bool res_14394} =
- logor(cond_14390, y_14393)
- let {bool x_14395} =
- logand(x_14385, res_14394)
- let {bool res_14396, f32 res_14397,
- i32 res_14398} =
- -- Branch returns: {bool, f32, i32}
- if x_14395
- then {true, x_14367, x_14368} else {
- let {bool x_14399} =
- logand(x_14366, x_14370)
- let {bool x_14400} =
- logand(res_14384, x_14399)
- let {bool res_14401} =
- eq_f32(x_14364, x_14367)
- let {bool x_14402} =
- logand(x_14400, res_14401)
- let {f32 res_14403} =
- -- Branch returns: {f32}
- if x_14402
- then {x_14364} else {-1.0f32}
- let {i32 res_14404} =
- -- Branch returns: {i32}
- if x_14402
- then {x_14365} else {-1i32}
- in {x_14402, res_14403, res_14404}
- }
- in {res_14396, res_14397, res_14398}
- }
- in {res_14381, res_14382, res_14383},
- {false, -1.0f32, -1i32}},
- fn {bool, f32, i32} (i32 x_14405, i32 x_14406,
- f32 x_14407, i32 x_14408,
- i32 x_14409, f32 x_14410,
- i32 x_14411, i32 x_14412,
- f32 x_14413,
- i32 x_14414) =>
- let {i32 x_14415} = sub32(x_14409, x_14412)
- let {i32 y_14416} = sub32(x_14405, x_14411)
- let {i32 x_14417} = mul32(x_14415, y_14416)
- let {i32 x_14418} = sub32(x_14411, x_14408)
- let {i32 y_14419} = sub32(x_14406, x_14412)
- let {i32 y_14420} = mul32(x_14418, y_14419)
- let {i32 factor_14421} =
- add32(x_14417, y_14420)
- let {bool cond_14422} =
- eq_i32(factor_14421, 0i32)
- let {bool cond_14423} = not cond_14422
- let {i32 res_14424} =
- -- Branch returns: {i32}
- if cond_14423
- then {factor_14421} else {1i32}
- let {i32 res_14425, i32 res_14426,
- i32 res_14427, f32 res_14428,
- f32 res_14429, f32 res_14430} =
- -- Branch returns: {i32, i32, i32, f32, f32, f32}
- if cond_14423
- then {
- let {i32 y_14431} =
- sub32(res_14358, x_14411)
- let {i32 x_14432} =
- mul32(x_14415, y_14431)
- let {i32 y_14433} =
- sub32(res_14359, x_14412)
- let {i32 y_14434} =
- mul32(x_14418, y_14433)
- let {i32 a_14435} =
- add32(x_14432, y_14434)
- let {i32 x_14436} =
- sub32(x_14412, x_14406)
- let {i32 x_14437} =
- mul32(y_14431, x_14436)
- let {i32 y_14438} =
- mul32(y_14416, y_14433)
- let {i32 b_14439} =
- add32(x_14437, y_14438)
- let {i32 x_14440} =
- sub32(factor_14421, a_14435)
- let {i32 c_14441} =
- sub32(x_14440, b_14439)
- let {f32 res_14442} =
- sitofp i32 factor_14421 to f32
- let {f32 res_14443} =
- sitofp i32 a_14435 to f32
- let {f32 an_14444} =
- fdiv32(res_14443, res_14442)
- let {f32 res_14445} =
- sitofp i32 b_14439 to f32
- let {f32 bn_14446} =
- fdiv32(res_14445, res_14442)
- let {f32 x_14447} =
- fsub32(1.0f32, an_14444)
- let {f32 cn_14448} =
- fsub32(x_14447, bn_14446)
- in {a_14435, b_14439, c_14441, an_14444,
- bn_14446, cn_14448}
- } else {-1i32, -1i32, -1i32, -1.0f32,
- -1.0f32, -1.0f32}
- let {bool cond_14449} = slt32(0i32, res_14424)
- let {bool res_14450} = sle32(0i32, res_14425)
- let {bool x_14451} =
- logand(cond_14449, res_14450)
- let {bool res_14452} =
- sle32(res_14425, res_14424)
- let {bool x_14453} =
- logand(x_14451, res_14452)
- let {bool cond_14454} = sle32(res_14424, 0i32)
- let {bool res_14455} =
- sle32(res_14424, res_14425)
- let {bool x_14456} =
- logand(cond_14454, res_14455)
- let {bool res_14457} = sle32(res_14425, 0i32)
- let {bool x_14458} =
- logand(x_14456, res_14457)
- let {bool x_14459} = not x_14453
- let {bool y_14460} = logand(x_14458, x_14459)
- let {bool res_14461} = logor(x_14453, y_14460)
- let {bool res_14462} = sle32(0i32, res_14426)
- let {bool x_14463} =
- logand(cond_14449, res_14462)
- let {bool res_14464} =
- sle32(res_14426, res_14424)
- let {bool x_14465} =
- logand(x_14463, res_14464)
- let {bool res_14466} =
- sle32(res_14424, res_14426)
- let {bool x_14467} =
- logand(cond_14454, res_14466)
- let {bool res_14468} = sle32(res_14426, 0i32)
- let {bool x_14469} =
- logand(x_14467, res_14468)
- let {bool x_14470} = not x_14465
- let {bool y_14471} = logand(x_14469, x_14470)
- let {bool res_14472} = logor(x_14465, y_14471)
- let {bool x_14473} =
- logand(res_14461, res_14472)
- let {bool res_14474} = sle32(0i32, res_14427)
- let {bool x_14475} =
- logand(cond_14449, res_14474)
- let {bool res_14476} =
- sle32(res_14427, res_14424)
- let {bool x_14477} =
- logand(x_14475, res_14476)
- let {bool res_14478} =
- sle32(res_14424, res_14427)
- let {bool x_14479} =
- logand(cond_14454, res_14478)
- let {bool res_14480} = sle32(res_14427, 0i32)
- let {bool x_14481} =
- logand(x_14479, res_14480)
- let {bool x_14482} = not x_14477
- let {bool y_14483} = logand(x_14481, x_14482)
- let {bool res_14484} = logor(x_14477, y_14483)
- let {bool x_14485} =
- logand(x_14473, res_14484)
- let {f32 x_14486} = fmul32(x_14407, res_14428)
- let {f32 y_14487} = fmul32(x_14410, res_14429)
- let {f32 x_14488} = fadd32(x_14486, y_14487)
- let {f32 y_14489} = fmul32(x_14413, res_14430)
- let {f32 res_14490} = fadd32(x_14488, y_14489)
- in {x_14485, res_14490, x_14414},
- res_14347, res_14348, res_14349, res_14350,
- res_14351, res_14352, res_14353, res_14354,
- res_14355, lifted_2_map2_arg_14356)
- let {bool cond_14491} = eq_i32(res_14362, -1i32)
- let {f32 res_14492, f32 res_14493, f32 res_14494} =
- -- Branch returns: {f32, f32, f32}
- if cond_14491
- then {0.0f32, 0.0f32, 0.0f32} else {
- let {i32 barycentric_coordinates_arg_14495} =
- partition_res_14333[res_14362]
- let {i32 barycentric_coordinates_arg_14496} =
- partition_res_14334[res_14362]
- let {i32 barycentric_coordinates_arg_14497} =
- partition_res_14336[res_14362]
- let {i32 barycentric_coordinates_arg_14498} =
- partition_res_14337[res_14362]
- let {i32 barycentric_coordinates_arg_14499} =
- partition_res_14339[res_14362]
- let {i32 barycentric_coordinates_arg_14500} =
- partition_res_14340[res_14362]
- let {i32 x_14501} =
- sub32(barycentric_coordinates_arg_14498, barycentric_coordinates_arg_14500)
- let {i32 y_14502} =
- sub32(barycentric_coordinates_arg_14495, barycentric_coordinates_arg_14499)
- let {i32 x_14503} = mul32(x_14501, y_14502)
- let {i32 x_14504} =
- sub32(barycentric_coordinates_arg_14499, barycentric_coordinates_arg_14497)
- let {i32 y_14505} =
- sub32(barycentric_coordinates_arg_14496, barycentric_coordinates_arg_14500)
- let {i32 y_14506} = mul32(x_14504, y_14505)
- let {i32 factor_14507} = add32(x_14503, y_14506)
- let {bool cond_14508} = eq_i32(factor_14507, 0i32)
- let {bool cond_14509} = not cond_14508
- let {f32 res_14510, f32 res_14511, f32 res_14512} =
- -- Branch returns: {f32, f32, f32}
- if cond_14509
- then {
- let {i32 y_14513} =
- sub32(res_14358, barycentric_coordinates_arg_14499)
- let {i32 x_14514} = mul32(x_14501, y_14513)
- let {i32 y_14515} =
- sub32(res_14359, barycentric_coordinates_arg_14500)
- let {i32 y_14516} = mul32(x_14504, y_14515)
- let {i32 a_14517} = add32(x_14514, y_14516)
- let {i32 x_14518} =
- sub32(barycentric_coordinates_arg_14500, barycentric_coordinates_arg_14496)
- let {i32 x_14519} = mul32(y_14513, x_14518)
- let {i32 y_14520} = mul32(y_14502, y_14515)
- let {i32 b_14521} = add32(x_14519, y_14520)
- let {f32 res_14522} =
- sitofp i32 factor_14507 to f32
- let {f32 res_14523} = sitofp i32 a_14517 to f32
- let {f32 an_14524} = fdiv32(res_14523, res_14522)
- let {f32 res_14525} = sitofp i32 b_14521 to f32
- let {f32 bn_14526} = fdiv32(res_14525, res_14522)
- let {f32 x_14527} = fsub32(1.0f32, an_14524)
- let {f32 cn_14528} = fsub32(x_14527, bn_14526)
- in {an_14524, bn_14526, cn_14528}
- } else {-1.0f32, -1.0f32, -1.0f32}
- let {i32 color_point_arg_14529} =
- partition_res_14342[res_14362]
- let {f32 color_point_arg_14530} =
- partition_res_14343[res_14362]
- let {f32 color_point_arg_14531} =
- partition_res_14344[res_14362]
- let {f32 color_point_arg_14532} =
- partition_res_14345[res_14362]
- let {i32 color_point_arg_14533} =
- partition_res_14346[res_14362]
- let {bool cond_14534} =
- eq_i32(color_point_arg_14529, 1i32)
- let {f32 res_14535, f32 res_14536, f32 res_14537} =
- -- Branch returns: {f32, f32, f32}
- if cond_14534
- then {color_point_arg_14530, color_point_arg_14531,
- color_point_arg_14532} else {
- let {bool cond_14538} =
- eq_i32(color_point_arg_14529, 2i32)
- let {f32 res_14539, f32 res_14540,
- f32 res_14541} =
- -- Branch returns: {f32, f32, f32}
- if cond_14538
- then {
- let {i32 i_14542} =
- sdiv32(color_point_arg_14533, 2i32)
- let {i32 x_14543} =
- and32(1i32, color_point_arg_14533)
- let {bool cond_14544} = eq_i32(x_14543, 0i32)
- let {f32 res_14545} =
- -- Branch returns: {f32}
- if cond_14544
- then {0.0f32} else {1.0f32}
- let {f32 res_14546} =
- -- Branch returns: {f32}
- if cond_14544
- then {1.0f32} else {0.0f32}
- let {f32 x_14547} =
- fmul32(res_14510, res_14545)
- let {f32 y_14548} =
- fmul32(res_14511, res_14546)
- let {f32 x_14549} = fadd32(x_14547, y_14548)
- let {f32 y_14550} =
- fmul32(res_14512, res_14545)
- let {f32 yn_14551} = fadd32(x_14549, y_14550)
- let {f32 y_14552} =
- fmul32(res_14511, res_14545)
- let {f32 x_14553} = fadd32(x_14547, y_14552)
- let {f32 y_14554} =
- fmul32(res_14512, res_14546)
- let {f32 xn_14555} = fadd32(x_14553, y_14554)
- let {f32 res_14556} =
- sitofp i32 surface_h_7153 to f32
- let {f32 t32_arg_14557} =
- fmul32(yn_14551, res_14556)
- let {i32 res_14558} =
- fptosi f32 t32_arg_14557 to i32
- let {f32 res_14559} =
- sitofp i32 surface_w_7152 to f32
- let {f32 t32_arg_14560} =
- fmul32(xn_14555, res_14559)
- let {i32 res_14561} =
- fptosi f32 t32_arg_14560 to i32
- let {i32 clamp_arg_14562} =
- sub32(surface_h_7153, 1i32)
- let {i32 res_14563} = smax32(0i32, res_14558)
- let {i32 res_14564} =
- smin32(clamp_arg_14562, res_14563)
- let {i32 clamp_arg_14565} =
- sub32(surface_w_7152, 1i32)
- let {i32 res_14566} = smax32(0i32, res_14561)
- let {i32 res_14567} =
- smin32(clamp_arg_14565, res_14566)
- let {i32 binop_y_14568} =
- mul_nw32(surface_w_7152, surface_h_7153)
- let {i32 binop_x_14569} =
- mul_nw32(i_14542, binop_y_14568)
- let {i32 binop_y_14570} =
- mul_nw32(surface_w_7152, res_14564)
- let {i32 binop_x_14571} =
- add_nw32(binop_x_14569, binop_y_14570)
- let {i32 new_index_14572} =
- add_nw32(res_14567, binop_x_14571)
- let {f32 res_14573} =
- <dim_ok_7201>
- surface_textures_flat_hsv_hs_7154[new_index_14572]
- let {f32 res_14574} =
- <empty_or_match_cert_7195, dim_ok_7201>
- surface_textures_flat_hsv_ss_7155[new_index_14572]
- let {f32 res_14575} =
- <empty_or_match_cert_7197, dim_ok_7201>
- surface_textures_flat_hsv_vs_7156[new_index_14572]
- in {res_14573, res_14574, res_14575}
- } else {0.0f32, 0.0f32, 0.0f32}
- in {res_14539, res_14540, res_14541}
- }
- let {f32 y_14576} = fpow32(res_14361, 2.0f32)
- let {f32 min_arg_14577} =
- fdiv32(2000000.0f32, y_14576)
- let {f32 res_14578} = fmin32(1.0f32, min_arg_14577)
- let {f32 res_14579} = fmul32(res_14537, res_14578)
- in {res_14535, res_14536, res_14579}
- }
- let {f32 c_14580} = fmul32(res_14493, res_14494)
- let {f32 h'_14581} = fdiv32(res_14492, 60.0f32)
- let {f32 t32_arg_14582} = fdiv32(h'_14581, 2.0f32)
- let {i32 res_14583} = fptosi f32 t32_arg_14582 to i32
- let {f32 res_14584} = sitofp i32 res_14583 to f32
- let {f32 y_14585} = fmul32(2.0f32, res_14584)
- let {f32 res_14586} = fsub32(h'_14581, y_14585)
- let {f32 abs_arg_14587} = fsub32(res_14586, 1.0f32)
- let {f32 res_14588} = fabs32 abs_arg_14587
- let {f32 y_14589} = fsub32(1.0f32, res_14588)
- let {f32 x_14590} = fmul32(c_14580, y_14589)
- let {bool cond_14591} = le32(0.0f32, h'_14581)
- let {bool res_14592} = lt32(h'_14581, 1.0f32)
- let {bool x_14593} = logand(cond_14591, res_14592)
- let {f32 res_14594, f32 res_14595, f32 res_14596} =
- -- Branch returns: {f32, f32, f32}
- if x_14593
- then {c_14580, x_14590, 0.0f32} else {
- let {bool cond_14597} = le32(1.0f32, h'_14581)
- let {bool res_14598} = lt32(h'_14581, 2.0f32)
- let {bool x_14599} = logand(cond_14597, res_14598)
- let {f32 res_14600, f32 res_14601, f32 res_14602} =
- -- Branch returns: {f32, f32, f32}
- if x_14599
- then {x_14590, c_14580, 0.0f32} else {
- let {bool cond_14603} = le32(2.0f32, h'_14581)
- let {bool res_14604} = lt32(h'_14581, 3.0f32)
- let {bool x_14605} = logand(cond_14603, res_14604)
- let {f32 res_14606, f32 res_14607,
- f32 res_14608} =
- -- Branch returns: {f32, f32, f32}
- if x_14605
- then {0.0f32, c_14580, x_14590} else {
- let {bool cond_14609} = le32(3.0f32, h'_14581)
- let {bool res_14610} = lt32(h'_14581, 4.0f32)
- let {bool x_14611} =
- logand(cond_14609, res_14610)
- let {f32 res_14612} =
- -- Branch returns: {f32}
- if x_14611
- then {x_14590} else {0.0f32}
- let {f32 res_14613, f32 res_14614} =
- -- Branch returns: {f32, f32}
- if x_14611
- then {0.0f32, c_14580} else {
- let {bool cond_14615} =
- le32(4.0f32, h'_14581)
- let {bool res_14616} =
- lt32(h'_14581, 5.0f32)
- let {bool x_14617} =
- logand(cond_14615, res_14616)
- let {f32 res_14618, f32 res_14619} =
- -- Branch returns: {f32, f32}
- if x_14617
- then {x_14590, c_14580} else {
- let {bool cond_14620} =
- le32(5.0f32, h'_14581)
- let {bool res_14621} =
- lt32(h'_14581, 6.0f32)
- let {bool x_14622} =
- logand(cond_14620, res_14621)
- let {f32 res_14623} =
- -- Branch returns: {f32}
- if x_14622
- then {c_14580} else {0.0f32}
- let {f32 res_14624} =
- -- Branch returns: {f32}
- if x_14622
- then {x_14590} else {0.0f32}
- in {res_14623, res_14624}
- }
- in {res_14618, res_14619}
- }
- in {res_14613, res_14612, res_14614}
- }
- in {res_14606, res_14607, res_14608}
- }
- in {res_14600, res_14601, res_14602}
- }
- let {f32 m_14625} = fsub32(res_14494, c_14580)
- let {f32 res_14626} = fadd32(res_14594, m_14625)
- let {f32 res_14627} = fadd32(res_14595, m_14625)
- let {f32 res_14628} = fadd32(res_14596, m_14625)
- let {f32 f32_arg_14629} = fmul32(255.0f32, res_14626)
- let {i32 unsign_arg_14630} =
- fptoui f32 f32_arg_14629 to i32
- let {f32 f32_arg_14631} = fmul32(255.0f32, res_14627)
- let {i32 unsign_arg_14632} =
- fptoui f32 f32_arg_14631 to i32
- let {f32 f32_arg_14633} = fmul32(255.0f32, res_14628)
- let {i32 unsign_arg_14634} =
- fptoui f32 f32_arg_14633 to i32
- let {i32 x_14635} = shl32(unsign_arg_14630, 16i32)
- let {i32 y_14636} = shl32(unsign_arg_14632, 8i32)
- let {i32 x_14637} = or32(x_14635, y_14636)
- let {i32 res_14638} = or32(unsign_arg_14634, x_14637)
- return {returns res_14357}
- }
- -- res_14639 aliases res_14331
- let {[n_total_8638][lifted_0_rect_pixel_indices_arg_8964]i32 res_14639} =
- res_14331
- -- res_14640 aliases res_14150
- let {[n_total_8638][lifted_0_rect_pixel_indices_arg_8964]i32 res_14640} =
- res_14150
- in {res_14639, res_14640}
- }
- let {i32 flat_dim_9385} =
- mul_nw32(n_total_8638, lifted_0_rect_pixel_indices_arg_8964)
- let {bool bounds_invalid_upwards_9386} =
- slt32(replicate_arg_7618, 0i32)
- let {bool valid_9387} = not bounds_invalid_upwards_9386
- let {cert range_valid_c_9388} =
- assert(valid_9387, "Range ", 0i32, "..", 1i32, "..<",
- replicate_arg_7618, " is invalid.",
- "/prelude/math.fut:453:23-30")
- let {[replicate_arg_7618]i32 res_9389} =
- replicate([replicate_arg_7618], 0i32)
- -- reshape_9390 aliases res_8972
- let {[flat_dim_9385]i32 reshape_9390} = reshape((flat_dim_9385),
- res_8972)
- -- reshape_9391 aliases res_8971
- let {[flat_dim_9385]i32 reshape_9391} = reshape((flat_dim_9385),
- res_8971)
- let {i64 flat_dim_14643} =
- <range_valid_c_9388>
- sext i32 flat_dim_9385 to i64
- let {i64 nest_size_14644} =
- <range_valid_c_9388>
- mul_nw64(flat_dim_14643, 1i64)
- let {i32 segmap_group_size_14646} =
- <range_valid_c_9388>
- get_size(segmap_group_size_14645, group_size)
- let {i64 segmap_group_size_14647} =
- <range_valid_c_9388>
- sext i32 segmap_group_size_14646 to i64
- let {i64 segmap_usable_groups_64_14648} =
- <range_valid_c_9388>
- sdiv_up64(nest_size_14644, segmap_group_size_14647)
- let {i32 segmap_usable_groups_14649} =
- <range_valid_c_9388>
- sext i64 segmap_usable_groups_64_14648 to i32
- let {[replicate_arg_7618]i32 res_9392} =
- -- Consumes res_9389
- <range_valid_c_9388>
- segmap_thread
- (#groups=segmap_usable_groups_14649; groupsize=segmap_group_size_14646)
- (write_i_14641 < flat_dim_9385) (~phys_tid_14642) : {i32} {
- let {i32 x_9393} = reshape_9390[write_i_14641]
- let {i32 write_value_9394} = reshape_9391[write_i_14641]
- let {bool cond_9395} = slt32(x_9393, replicate_arg_7618)
- let {i32 res_9396} =
- -- Branch returns: {i32}
- if cond_9395
- then {x_9393} else {-1i32}
- return {res_9389 with ([res_9396 < replicate_arg_7618] <- write_value_9394)}
- }
- -- res_9397 aliases res_9392
- let {[w_7133][h_7134]i32 res_9397} = reshape((w_7133, h_7134),
- res_9392)
- in {res_9397}
- }
- in {res_8639}
- } else {
- let {bool cond_9398} = eq_i32(render_approach_7130, 3i32)
- let {[w_7133][h_7134]i32 res_9399} =
- -- Branch returns: {[w_7133][h_7134]i32}
- if cond_9398
- then {
- let {bool bounds_invalid_upwards_9400} =
- slt32(replicate_arg_7618, 0i32)
- let {bool valid_9401} = not bounds_invalid_upwards_9400
- let {cert range_valid_c_9402} =
- assert(valid_9401, "Range ", 0i32, "..", 1i32, "..<",
- replicate_arg_7618, " is invalid.",
- "/prelude/math.fut:453:23-30")
- let {[replicate_arg_7618]i32 res_9403} =
- replicate([replicate_arg_7618], 0i32)
- let {[replicate_arg_7618]f32 res_9404} =
- replicate([replicate_arg_7618], f32.inf)
- let {i32 within_bounds_arg_9405} = sub32(w_7133, 1i32)
- let {i32 within_bounds_arg_9406} = sub32(h_7134, 1i32)
- let {f32 res_9407} = sitofp i32 surface_h_7153 to f32
- let {f32 res_9408} = sitofp i32 surface_w_7152 to f32
- let {i32 clamp_arg_9409} = sub32(surface_h_7153, 1i32)
- let {i32 clamp_arg_9410} = sub32(surface_w_7152, 1i32)
- let {i32 binop_y_9411} = mul_nw32(surface_w_7152, surface_h_7153)
- let {[replicate_arg_7618]i32 res_9412,
- [replicate_arg_7618]f32 res_9413} =
- -- Consumes res_9403, res_9404
- loop {*[replicate_arg_7618]i32 pixels_9414,
- *[replicate_arg_7618]f32 z_values_9415} = {res_9403,
- res_9404}
- for i_9416:i32 < partition_size_7544 do {
- let {i32 loopres_9417} =
- <range_valid_c_9402, index_certs_7601>
- partition_res_7560[i_9416]
- let {i32 loopres_9418} =
- <index_certs_7601>
- partition_res_7561[i_9416]
- let {f32 loopres_9419} =
- <index_certs_7601>
- partition_res_7562[i_9416]
- let {i32 loopres_9420} =
- <index_certs_7601>
- partition_res_7563[i_9416]
- let {i32 loopres_9421} =
- <index_certs_7601>
- partition_res_7564[i_9416]
- let {f32 loopres_9422} =
- <index_certs_7601>
- partition_res_7565[i_9416]
- let {i32 loopres_9423} =
- <index_certs_7601>
- partition_res_7566[i_9416]
- let {i32 loopres_9424} =
- <index_certs_7601>
- partition_res_7567[i_9416]
- let {f32 loopres_9425} =
- <index_certs_7601>
- partition_res_7568[i_9416]
- let {i32 loopres_9426} =
- <index_certs_7601>
- partition_res_7569[i_9416]
- let {f32 loopres_9427} =
- <index_certs_7601>
- partition_res_7570[i_9416]
- let {f32 loopres_9428} =
- <index_certs_7601>
- partition_res_7571[i_9416]
- let {f32 loopres_9429} =
- <index_certs_7601>
- partition_res_7572[i_9416]
- let {i32 loopres_9430} =
- <index_certs_7601>
- partition_res_7573[i_9416]
- let {i32 res_9431} = smin32(loopres_9417, loopres_9420)
- let {i32 res_9432} = smin32(loopres_9423, res_9431)
- let {i32 res_9433} = smin32(within_bounds_arg_9405, res_9432)
- let {i32 res_9434} = smax32(0i32, res_9433)
- let {i32 res_9435} = smin32(loopres_9418, loopres_9421)
- let {i32 res_9436} = smin32(loopres_9424, res_9435)
- let {i32 res_9437} = smin32(within_bounds_arg_9406, res_9436)
- let {i32 res_9438} = smax32(0i32, res_9437)
- let {i32 res_9439} = smax32(loopres_9417, loopres_9420)
- let {i32 res_9440} = smax32(loopres_9423, res_9439)
- let {i32 res_9441} = smin32(within_bounds_arg_9405, res_9440)
- let {i32 res_9442} = smax32(0i32, res_9441)
- let {i32 res_9443} = smax32(loopres_9418, loopres_9421)
- let {i32 res_9444} = smax32(loopres_9424, res_9443)
- let {i32 res_9445} = smin32(within_bounds_arg_9406, res_9444)
- let {i32 res_9446} = smax32(0i32, res_9445)
- let {i32 x_9447} = sub32(res_9442, res_9434)
- let {i32 x_span_9448} = add32(1i32, x_9447)
- let {i32 x_9449} = sub32(res_9446, res_9438)
- let {i32 y_span_9450} = add32(1i32, x_9449)
- let {bool bounds_invalid_upwards_9451} =
- slt32(x_span_9448, 0i32)
- let {bool valid_9452} = not bounds_invalid_upwards_9451
- let {cert range_valid_c_9453} =
- assert(valid_9452, "Range ", 0i32, "..", 1i32, "..<",
- x_span_9448, " is invalid.",
- "/prelude/math.fut:453:23-30")
- let {[x_span_9448]i32 res_9454} =
- <range_valid_c_9453>
- iota32(x_span_9448, 0i32, 1i32)
- let {bool bounds_invalid_upwards_9455} =
- slt32(y_span_9450, 0i32)
- let {bool valid_9456} = not bounds_invalid_upwards_9455
- let {cert range_valid_c_9457} =
- assert(valid_9456, "Range ", 0i32, "..", 1i32, "..<",
- y_span_9450, " is invalid.",
- "/prelude/math.fut:453:23-30")
- let {[y_span_9450]i32 res_9458} =
- <range_valid_c_9457>
- iota32(y_span_9450, 0i32, 1i32)
- let {i32 comparatee_14650} = mul_nw32(y_span_9450, 1i32)
- let {bool suff_outer_par_14651} =
- get_size(suff_outer_par_9, threshold ()) <= comparatee_14650
- let {i64 y_span_14683} = sext i32 y_span_9450 to i64
- let {i64 nest_size_14684} = mul_nw64(y_span_14683, 1i64)
- let {i32 segmap_group_size_14685} =
- get_size(segmap_group_size_14676, group_size)
- let {i64 segmap_group_size_14686} =
- sext i32 segmap_group_size_14685 to i64
- let {i64 segmap_usable_groups_64_14687} =
- sdiv_up64(nest_size_14684, segmap_group_size_14686)
- let {i32 segmap_usable_groups_14688} =
- sext i64 segmap_usable_groups_64_14687 to i32
- let {[y_span_9450]i32 res_14689} =
- <range_valid_c_9457>
- segmap_thread
- (#groups=segmap_usable_groups_14688; groupsize=segmap_group_size_14685)
- (gtid_14672 < y_span_9450) (~phys_tid_14673) : {i32} {
- let {i32 x_14690} = res_9458[gtid_14672]
- let {i32 res_14691} = add32(res_9438, x_14690)
- return {returns res_14691}
- }
- -- res_9459 aliases res_14689
- let {[y_span_9450]i32 res_9459} = res_14689
- let {i32 comparatee_14692} = mul_nw32(x_span_9448, 1i32)
- let {bool suff_outer_par_14693} =
- get_size(suff_outer_par_10,
- threshold ()) <= comparatee_14692
- let {i64 x_span_14771} = sext i32 x_span_9448 to i64
- let {i64 nest_size_14772} = mul_nw64(x_span_14771, 1i64)
- let {i32 segmap_group_size_14773} =
- get_size(segmap_group_size_14764, group_size)
- let {i64 segmap_group_size_14774} =
- sext i32 segmap_group_size_14773 to i64
- let {i64 segmap_usable_groups_64_14775} =
- sdiv_up64(nest_size_14772, segmap_group_size_14774)
- let {i32 segmap_usable_groups_14776} =
- sext i64 segmap_usable_groups_64_14775 to i32
- let {[x_span_9448]i32 res_r_14777} =
- <range_valid_c_9453>
- segmap_thread
- (#groups=segmap_usable_groups_14776; groupsize=segmap_group_size_14773)
- (gtid_14760 < x_span_9448) (~phys_tid_14761) : {i32} {
- let {i32 x_14778} = res_9454[gtid_14760]
- let {i32 res_14779} = add32(res_9434, x_14778)
- return {returns res_14779}
- }
- let {i64 x_span_14780} = sext i32 x_span_9448 to i64
- let {i64 y_span_14781} = sext i32 y_span_9450 to i64
- let {i64 y_14782} = mul_nw64(y_span_14781, 1i64)
- let {i64 nest_size_14783} = mul_nw64(x_span_14780, y_14782)
- let {i32 segmap_group_size_14784} =
- get_size(segmap_group_size_14724, group_size)
- let {i64 segmap_group_size_14785} =
- sext i32 segmap_group_size_14784 to i64
- let {i64 segmap_usable_groups_64_14786} =
- sdiv_up64(nest_size_14783, segmap_group_size_14785)
- let {i32 segmap_usable_groups_14787} =
- sext i64 segmap_usable_groups_64_14786 to i32
- let {i32 y_14788} = mul_nw32(y_span_9450, 1i32)
- let {i32 comparatee_14789} = mul_nw32(x_span_9448, y_14788)
- let {bool suff_outer_par_14790} =
- get_size(suff_outer_par_11,
- threshold (!suff_outer_par_10)) <= comparatee_14789
- let {i64 x_span_14791} = sext i32 x_span_9448 to i64
- let {i64 y_span_14792} = sext i32 y_span_9450 to i64
- let {i64 y_14793} = mul_nw64(y_span_14792, 1i64)
- let {i64 nest_size_14794} = mul_nw64(x_span_14791, y_14793)
- let {i32 segmap_group_size_14795} =
- get_size(segmap_group_size_14742, group_size)
- let {i64 segmap_group_size_14796} =
- sext i32 segmap_group_size_14795 to i64
- let {i64 segmap_usable_groups_64_14797} =
- sdiv_up64(nest_size_14794, segmap_group_size_14796)
- let {i32 segmap_usable_groups_14798} =
- sext i64 segmap_usable_groups_64_14797 to i32
- let {[x_span_9448][y_span_9450]i32 res_14799} =
- <range_valid_c_9453>
- segmap_thread
- (#groups=segmap_usable_groups_14798; groupsize=segmap_group_size_14795)
- (gtid_14735 < x_span_9448,
- gtid_14736 < y_span_9450) (~phys_tid_14737) : {i32} {
- let {i32 res_14800} = res_r_14777[gtid_14735]
- let {i32 tmp_14801} = replicate([], res_14800)
- return {returns tmp_14801}
- }
- -- res_14802 aliases res_14799
- let {[x_span_9448][y_span_9450]i32 res_14802} = res_14799
- -- res_9462 aliases res_14802
- let {[x_span_9448][y_span_9450]i32 res_9462} = res_14802
- let {i32 flat_dim_9466} = mul_nw32(x_span_9448, y_span_9450)
- -- reshape_9467 aliases res_9462
- let {[flat_dim_9466]i32 reshape_9467} =
- reshape((flat_dim_9466), res_9462)
- let {[x_span_9448][y_span_9450]i32 repeat_9468} =
- replicate([x_span_9448], res_9459)
- -- reshape_9469 aliases repeat_9468
- let {[flat_dim_9466]i32 reshape_9469} =
- reshape((flat_dim_9466), repeat_9468)
- let {i32 comparatee_14803} = mul_nw32(flat_dim_9466, 1i32)
- let {bool suff_outer_par_14804} =
- get_size(suff_outer_par_12,
- threshold ()) <= comparatee_14803
- let {i64 flat_dim_14846} = sext i32 flat_dim_9466 to i64
- let {i64 nest_size_14847} = mul_nw64(flat_dim_14846, 1i64)
- let {i32 segmap_group_size_14848} =
- get_size(segmap_group_size_14836, group_size)
- let {i64 segmap_group_size_14849} =
- sext i32 segmap_group_size_14848 to i64
- let {i64 segmap_usable_groups_64_14850} =
- sdiv_up64(nest_size_14847, segmap_group_size_14849)
- let {i32 segmap_usable_groups_14851} =
- sext i64 segmap_usable_groups_64_14850 to i32
- let {[flat_dim_9466]f32 res_14852,
- [flat_dim_9466]i32 res_14853} =
- segmap_thread
- (#groups=segmap_usable_groups_14851; groupsize=segmap_group_size_14848)
- (gtid_14832 < flat_dim_9466) (~phys_tid_14833) : {f32,
- i32} {
- let {i32 x_14854} = reshape_9467[gtid_14832]
- let {i32 x_14855} = reshape_9469[gtid_14832]
- let {i32 x_14856} = mul32(h_7134, x_14854)
- let {i32 res_14857} = add32(x_14855, x_14856)
- let {f32 res_14858} = z_values_9415[res_14857]
- return {returns res_14858, returns res_14857}
- }
- -- res_9470 aliases res_14852
- let {[flat_dim_9466]f32 res_9470} = res_14852
- -- res_9471 aliases res_14853
- let {[flat_dim_9466]i32 res_9471} = res_14853
- let {i32 x_9477} = sub32(loopres_9421, loopres_9424)
- let {i32 y_9478} = sub32(loopres_9417, loopres_9423)
- let {i32 x_9479} = mul32(x_9477, y_9478)
- let {i32 x_9480} = sub32(loopres_9423, loopres_9420)
- let {i32 y_9481} = sub32(loopres_9418, loopres_9424)
- let {i32 y_9482} = mul32(x_9480, y_9481)
- let {i32 factor_9483} = add32(x_9479, y_9482)
- let {bool cond_9484} = eq_i32(factor_9483, 0i32)
- let {bool cond_9485} = not cond_9484
- let {i32 res_9486} =
- -- Branch returns: {i32}
- if cond_9485
- then {factor_9483} else {1i32}
- let {i32 x_9487} = sub32(loopres_9424, loopres_9418)
- let {f32 res_9488} = sitofp i32 factor_9483 to f32
- let {bool cond_9489} = eq_i32(loopres_9426, 1i32)
- let {bool cond_9490} = eq_i32(loopres_9426, 2i32)
- let {i32 i_9491} = sdiv32(loopres_9430, 2i32)
- let {i32 x_9492} = and32(1i32, loopres_9430)
- let {bool cond_9493} = eq_i32(x_9492, 0i32)
- let {f32 res_9494} =
- -- Branch returns: {f32}
- if cond_9493
- then {0.0f32} else {1.0f32}
- let {f32 res_9495} =
- -- Branch returns: {f32}
- if cond_9493
- then {1.0f32} else {0.0f32}
- let {i32 binop_x_9496} = mul_nw32(binop_y_9411, i_9491)
- let {bool cond_9497} = slt32(0i32, res_9486)
- let {bool cond_9498} = sle32(res_9486, 0i32)
- let {i64 flat_dim_14861} = sext i32 flat_dim_9466 to i64
- let {i64 nest_size_14862} = mul_nw64(flat_dim_14861, 1i64)
- let {i32 segmap_group_size_14864} =
- get_size(segmap_group_size_14863, group_size)
- let {i64 segmap_group_size_14865} =
- sext i32 segmap_group_size_14864 to i64
- let {i64 segmap_usable_groups_64_14866} =
- sdiv_up64(nest_size_14862, segmap_group_size_14865)
- let {i32 segmap_usable_groups_14867} =
- sext i64 segmap_usable_groups_64_14866 to i32
- let {[replicate_arg_7618]f32 res_9499,
- [replicate_arg_7618]i32 res_9500} =
- -- Consumes pixels_9414, z_values_9415
- segmap_thread
- (#groups=segmap_usable_groups_14867; groupsize=segmap_group_size_14864)
- (write_i_14859 < flat_dim_9466) (~phys_tid_14860) : {f32,
- i32} {
- let {i32 x_9501} = res_9471[write_i_14859]
- let {f32 x_9502} = res_9470[write_i_14859]
- let {i32 x_9503} = reshape_9467[write_i_14859]
- let {i32 x_9504} = reshape_9469[write_i_14859]
- let {i32 res_9505, i32 res_9506, i32 res_9507,
- f32 res_9508, f32 res_9509, f32 res_9510} =
- -- Branch returns: {i32, i32, i32, f32, f32, f32}
- if cond_9485
- then {
- let {i32 y_9511} = sub32(x_9503, loopres_9423)
- let {i32 x_9512} = mul32(x_9477, y_9511)
- let {i32 y_9513} = sub32(x_9504, loopres_9424)
- let {i32 y_9514} = mul32(x_9480, y_9513)
- let {i32 a_9515} = add32(x_9512, y_9514)
- let {i32 x_9516} = mul32(x_9487, y_9511)
- let {i32 y_9517} = mul32(y_9478, y_9513)
- let {i32 b_9518} = add32(x_9516, y_9517)
- let {i32 x_9519} = sub32(factor_9483, a_9515)
- let {i32 c_9520} = sub32(x_9519, b_9518)
- let {f32 res_9521} = sitofp i32 a_9515 to f32
- let {f32 an_9522} = fdiv32(res_9521, res_9488)
- let {f32 res_9523} = sitofp i32 b_9518 to f32
- let {f32 bn_9524} = fdiv32(res_9523, res_9488)
- let {f32 x_9525} = fsub32(1.0f32, an_9522)
- let {f32 cn_9526} = fsub32(x_9525, bn_9524)
- in {a_9515, b_9518, c_9520, an_9522, bn_9524, cn_9526}
- } else {-1i32, -1i32, -1i32, -1.0f32, -1.0f32, -1.0f32}
- let {f32 x_9527} = fmul32(loopres_9419, res_9508)
- let {f32 y_9528} = fmul32(loopres_9422, res_9509)
- let {f32 x_9529} = fadd32(x_9527, y_9528)
- let {f32 y_9530} = fmul32(loopres_9425, res_9510)
- let {f32 res_9531} = fadd32(x_9529, y_9530)
- let {f32 res_9532, f32 res_9533, f32 res_9534} =
- -- Branch returns: {f32, f32, f32}
- if cond_9489
- then {loopres_9427, loopres_9428, loopres_9429} else {
- let {f32 res_9535, f32 res_9536, f32 res_9537} =
- -- Branch returns: {f32, f32, f32}
- if cond_9490
- then {
- let {f32 x_9538} = fmul32(res_9494, res_9508)
- let {f32 y_9539} = fmul32(res_9495, res_9509)
- let {f32 x_9540} = fadd32(x_9538, y_9539)
- let {f32 y_9541} = fmul32(res_9494, res_9510)
- let {f32 yn_9542} = fadd32(x_9540, y_9541)
- let {f32 y_9543} = fmul32(res_9494, res_9509)
- let {f32 x_9544} = fadd32(x_9538, y_9543)
- let {f32 y_9545} = fmul32(res_9495, res_9510)
- let {f32 xn_9546} = fadd32(x_9544, y_9545)
- let {f32 t32_arg_9547} = fmul32(res_9407, yn_9542)
- let {i32 res_9548} =
- fptosi f32 t32_arg_9547 to i32
- let {f32 t32_arg_9549} = fmul32(res_9408, xn_9546)
- let {i32 res_9550} =
- fptosi f32 t32_arg_9549 to i32
- let {i32 res_9551} = smax32(0i32, res_9548)
- let {i32 res_9552} =
- smin32(clamp_arg_9409, res_9551)
- let {i32 res_9553} = smax32(0i32, res_9550)
- let {i32 res_9554} =
- smin32(clamp_arg_9410, res_9553)
- let {i32 binop_y_9555} =
- mul_nw32(surface_w_7152, res_9552)
- let {i32 binop_x_9556} =
- add_nw32(binop_x_9496, binop_y_9555)
- let {i32 new_index_9557} =
- add_nw32(res_9554, binop_x_9556)
- let {f32 res_9558} =
- <dim_ok_7201>
- surface_textures_flat_hsv_hs_7154[new_index_9557]
- let {f32 res_9559} =
- <empty_or_match_cert_7195, dim_ok_7201>
- surface_textures_flat_hsv_ss_7155[new_index_9557]
- let {f32 res_9560} =
- <empty_or_match_cert_7197, dim_ok_7201>
- surface_textures_flat_hsv_vs_7156[new_index_9557]
- in {res_9558, res_9559, res_9560}
- } else {0.0f32, 0.0f32, 0.0f32}
- in {res_9535, res_9536, res_9537}
- }
- let {f32 y_9561} = fpow32(res_9531, 2.0f32)
- let {f32 min_arg_9562} = fdiv32(2000000.0f32, y_9561)
- let {f32 res_9563} = fmin32(1.0f32, min_arg_9562)
- let {f32 res_9564} = fmul32(res_9534, res_9563)
- let {f32 c_9565} = fmul32(res_9533, res_9564)
- let {f32 h'_9566} = fdiv32(res_9532, 60.0f32)
- let {f32 t32_arg_9567} = fdiv32(h'_9566, 2.0f32)
- let {i32 res_9568} = fptosi f32 t32_arg_9567 to i32
- let {f32 res_9569} = sitofp i32 res_9568 to f32
- let {f32 y_9570} = fmul32(2.0f32, res_9569)
- let {f32 res_9571} = fsub32(h'_9566, y_9570)
- let {f32 abs_arg_9572} = fsub32(res_9571, 1.0f32)
- let {f32 res_9573} = fabs32 abs_arg_9572
- let {f32 y_9574} = fsub32(1.0f32, res_9573)
- let {f32 x_9575} = fmul32(c_9565, y_9574)
- let {bool cond_9576} = le32(0.0f32, h'_9566)
- let {bool res_9577} = lt32(h'_9566, 1.0f32)
- let {bool x_9578} = logand(cond_9576, res_9577)
- let {f32 res_9579, f32 res_9580, f32 res_9581} =
- -- Branch returns: {f32, f32, f32}
- if x_9578
- then {c_9565, x_9575, 0.0f32} else {
- let {bool cond_9582} = le32(1.0f32, h'_9566)
- let {bool res_9583} = lt32(h'_9566, 2.0f32)
- let {bool x_9584} = logand(cond_9582, res_9583)
- let {f32 res_9585, f32 res_9586, f32 res_9587} =
- -- Branch returns: {f32, f32, f32}
- if x_9584
- then {x_9575, c_9565, 0.0f32} else {
- let {bool cond_9588} = le32(2.0f32, h'_9566)
- let {bool res_9589} = lt32(h'_9566, 3.0f32)
- let {bool x_9590} = logand(cond_9588, res_9589)
- let {f32 res_9591, f32 res_9592, f32 res_9593} =
- -- Branch returns: {f32, f32, f32}
- if x_9590
- then {0.0f32, c_9565, x_9575} else {
- let {bool cond_9594} = le32(3.0f32, h'_9566)
- let {bool res_9595} = lt32(h'_9566, 4.0f32)
- let {bool x_9596} =
- logand(cond_9594, res_9595)
- let {f32 res_9597} =
- -- Branch returns: {f32}
- if x_9596
- then {x_9575} else {0.0f32}
- let {f32 res_9598, f32 res_9599} =
- -- Branch returns: {f32, f32}
- if x_9596
- then {0.0f32, c_9565} else {
- let {bool cond_9600} =
- le32(4.0f32, h'_9566)
- let {bool res_9601} =
- lt32(h'_9566, 5.0f32)
- let {bool x_9602} =
- logand(cond_9600, res_9601)
- let {f32 res_9603, f32 res_9604} =
- -- Branch returns: {f32, f32}
- if x_9602
- then {x_9575, c_9565} else {
- let {bool cond_9605} =
- le32(5.0f32, h'_9566)
- let {bool res_9606} =
- lt32(h'_9566, 6.0f32)
- let {bool x_9607} =
- logand(cond_9605, res_9606)
- let {f32 res_9608} =
- -- Branch returns: {f32}
- if x_9607
- then {c_9565} else {0.0f32}
- let {f32 res_9609} =
- -- Branch returns: {f32}
- if x_9607
- then {x_9575} else {0.0f32}
- in {res_9608, res_9609}
- }
- in {res_9603, res_9604}
- }
- in {res_9598, res_9597, res_9599}
- }
- in {res_9591, res_9592, res_9593}
- }
- in {res_9585, res_9586, res_9587}
- }
- let {f32 m_9610} = fsub32(res_9564, c_9565)
- let {f32 res_9611} = fadd32(res_9579, m_9610)
- let {f32 res_9612} = fadd32(res_9580, m_9610)
- let {f32 res_9613} = fadd32(res_9581, m_9610)
- let {f32 f32_arg_9614} = fmul32(255.0f32, res_9611)
- let {i32 unsign_arg_9615} = fptoui f32 f32_arg_9614 to i32
- let {f32 f32_arg_9616} = fmul32(255.0f32, res_9612)
- let {i32 unsign_arg_9617} = fptoui f32 f32_arg_9616 to i32
- let {f32 f32_arg_9618} = fmul32(255.0f32, res_9613)
- let {i32 unsign_arg_9619} = fptoui f32 f32_arg_9618 to i32
- let {i32 x_9620} = shl32(unsign_arg_9615, 16i32)
- let {i32 y_9621} = shl32(unsign_arg_9617, 8i32)
- let {i32 x_9622} = or32(x_9620, y_9621)
- let {i32 res_9623} = or32(unsign_arg_9619, x_9622)
- let {bool res_9624} = sle32(0i32, res_9505)
- let {bool x_9625} = logand(cond_9497, res_9624)
- let {bool res_9626} = sle32(res_9505, res_9486)
- let {bool x_9627} = logand(x_9625, res_9626)
- let {bool res_9628} = sle32(res_9486, res_9505)
- let {bool x_9629} = logand(cond_9498, res_9628)
- let {bool res_9630} = sle32(res_9505, 0i32)
- let {bool x_9631} = logand(x_9629, res_9630)
- let {bool x_9632} = not x_9627
- let {bool y_9633} = logand(x_9631, x_9632)
- let {bool res_9634} = logor(x_9627, y_9633)
- let {bool res_9635} = sle32(0i32, res_9506)
- let {bool x_9636} = logand(cond_9497, res_9635)
- let {bool res_9637} = sle32(res_9506, res_9486)
- let {bool x_9638} = logand(x_9636, res_9637)
- let {bool res_9639} = sle32(res_9486, res_9506)
- let {bool x_9640} = logand(cond_9498, res_9639)
- let {bool res_9641} = sle32(res_9506, 0i32)
- let {bool x_9642} = logand(x_9640, res_9641)
- let {bool x_9643} = not x_9638
- let {bool y_9644} = logand(x_9642, x_9643)
- let {bool res_9645} = logor(x_9638, y_9644)
- let {bool x_9646} = logand(res_9634, res_9645)
- let {bool res_9647} = sle32(0i32, res_9507)
- let {bool x_9648} = logand(cond_9497, res_9647)
- let {bool res_9649} = sle32(res_9507, res_9486)
- let {bool x_9650} = logand(x_9648, res_9649)
- let {bool res_9651} = sle32(res_9486, res_9507)
- let {bool x_9652} = logand(cond_9498, res_9651)
- let {bool res_9653} = sle32(res_9507, 0i32)
- let {bool x_9654} = logand(x_9652, res_9653)
- let {bool x_9655} = not x_9650
- let {bool y_9656} = logand(x_9654, x_9655)
- let {bool res_9657} = logor(x_9650, y_9656)
- let {bool x_9658} = logand(x_9646, res_9657)
- let {bool res_9659} = le32(0.0f32, res_9531)
- let {bool x_9660} = logand(x_9658, res_9659)
- let {bool cond_9661} = lt32(x_9502, 0.0f32)
- let {bool res_9662} = lt32(res_9531, x_9502)
- let {bool x_9663} = not cond_9661
- let {bool y_9664} = logand(res_9662, x_9663)
- let {bool res_9665} = logor(cond_9661, y_9664)
- let {bool x_9666} = logand(x_9660, res_9665)
- let {i32 res_9667} =
- -- Branch returns: {i32}
- if x_9666
- then {x_9501} else {-1i32}
- let {i32 res_9668} =
- -- Branch returns: {i32}
- if x_9666
- then {res_9623} else {0i32}
- let {f32 res_9669} =
- -- Branch returns: {f32}
- if x_9666
- then {res_9531} else {0.0f32}
- return {z_values_9415 with ([res_9667 < replicate_arg_7618] <- res_9669),
- pixels_9414 with ([res_9667 < replicate_arg_7618] <- res_9668)}
- }
- in {res_9500, res_9499}
- }
- -- res_9670 aliases res_9412
- let {[w_7133][h_7134]i32 res_9670} = reshape((w_7133, h_7134),
- res_9412)
- in {res_9670}
- } else {
- let {bool bounds_invalid_upwards_9671} = slt32(w_7133, 0i32)
- let {bool valid_9672} = not bounds_invalid_upwards_9671
- let {cert range_valid_c_9673} =
- assert(valid_9672, "Range ", 0i32, "..", 1i32, "..<", w_7133,
- " is invalid.",
- "/prelude/math.fut:453:23-30")
- let {[w_7133][h_7134]i32 res_9674} = replicate([w_7133, h_7134],
- 0i32)
- -- res_9675 aliases res_9674
- let {[w_7133][h_7134]i32 res_9675} =
- <range_valid_c_9673>
- res_9674
- in {res_9675}
- }
- in {res_9399}
- }
- in {res_8634}
- }
- in {w_7133, h_7134, res_7619}
- }
Add Comment
Please, Sign In to add comment