module __float64__add( input wire [63:0] x, input wire [63:0] y, output wire [63:0] out ); function automatic priority_sel_1b_2way (input reg [1:0] sel, input reg case0, input reg case1, input reg default_value); begin casez (sel) 2'b?1: begin priority_sel_1b_2way = case0; end 2'b10: begin priority_sel_1b_2way = case1; end 2'b00: begin priority_sel_1b_2way = default_value; end default: begin // Propagate X priority_sel_1b_2way = 1'dx; end endcase end endfunction function automatic [1:0] priority_sel_2b_2way (input reg [1:0] sel, input reg [1:0] case0, input reg [1:0] case1, input reg [1:0] default_value); begin casez (sel) 2'b?1: begin priority_sel_2b_2way = case0; end 2'b10: begin priority_sel_2b_2way = case1; end 2'b00: begin priority_sel_2b_2way = default_value; end default: begin // Propagate X priority_sel_2b_2way = 2'dx; end endcase end endfunction function automatic priority_sel_1b_4way (input reg [3:0] sel, input reg case0, input reg case1, input reg case2, input reg case3, input reg default_value); begin casez (sel) 4'b???1: begin priority_sel_1b_4way = case0; end 4'b??10: begin priority_sel_1b_4way = case1; end 4'b?100: begin priority_sel_1b_4way = case2; end 4'b1000: begin priority_sel_1b_4way = case3; end 4'b0000: begin priority_sel_1b_4way = default_value; end default: begin // Propagate X priority_sel_1b_4way = 1'dx; end endcase end endfunction function automatic [2:0] priority_sel_3b_2way (input reg [1:0] sel, input reg [2:0] case0, input reg [2:0] case1, input reg [2:0] default_value); begin casez (sel) 2'b?1: begin priority_sel_3b_2way = case0; end 2'b10: begin priority_sel_3b_2way = case1; end 2'b00: begin priority_sel_3b_2way = default_value; end default: begin // Propagate X priority_sel_3b_2way = 3'dx; end endcase end endfunction function automatic [3:0] priority_sel_4b_2way (input reg [1:0] sel, input reg [3:0] case0, input reg [3:0] case1, input reg [3:0] default_value); begin casez (sel) 2'b?1: begin priority_sel_4b_2way = case0; end 2'b10: begin priority_sel_4b_2way = case1; end 2'b00: begin priority_sel_4b_2way = default_value; end default: begin // Propagate X priority_sel_4b_2way = 4'dx; end endcase end endfunction function automatic [4:0] priority_sel_5b_2way (input reg [1:0] sel, input reg [4:0] case0, input reg [4:0] case1, input reg [4:0] default_value); begin casez (sel) 2'b?1: begin priority_sel_5b_2way = case0; end 2'b10: begin priority_sel_5b_2way = case1; end 2'b00: begin priority_sel_5b_2way = default_value; end default: begin // Propagate X priority_sel_5b_2way = 5'dx; end endcase end endfunction wire [10:0] y_bexp__1; wire [10:0] x_bexp__1; wire [10:0] y_bexpnot; wire [11:0] x_bexp_extended__1; wire [11:0] y_bexpnot_extended; wire [11:0] full_result; wire overflow_detected; wire [51:0] tuple_index_32882; wire [51:0] tuple_index_32883; wire [10:0] x_bexp; wire [10:0] y_bexp; wire [51:0] x_fraction; wire [51:0] y_fraction; wire nc; wire [52:0] fraction_x; wire [52:0] fraction_y; wire [52:0] sign_ext_32896; wire [10:0] narrowed_result; wire [10:0] x_bexpor_mask; wire tuple_index_32900; wire tuple_index_32901; wire [52:0] fraction_x__1; wire [52:0] fraction_y__1; wire [2:0] xddend_x__1_squeezed_const_lsb_bits; wire [10:0] result; wire x_sign; wire y_sign; wire [53:0] wide_x_squeezed; wire [55:0] wide_y_shift_bits; wire [10:0] shift; wire [55:0] shrl_32915; wire [56:0] shll_32917; wire [53:0] xddend_x__1_squeezed; wire [54:0] add_32928; wire sticky; wire [56:0] concat_32934; wire [56:0] xbs_fraction; wire nor_32947; wire nor_32953; wire and_32978; wire nor_32980; wire carry_bit; wire and_32988; wire nor_32990; wire and_33029; wire nor_33030; wire nor_33032; wire and_33039; wire nor_33040; wire nor_33042; wire nor_33016; wire nor_33017; wire nor_33022; wire nor_33023; wire nor_33012; wire nor_33013; wire nor_33003; wire nor_33004; wire nor_33073; wire nor_33074; wire and_33076; wire nor_33077; wire nor_33084; wire nor_33085; wire and_33087; wire nor_33088; wire and_33064; wire nor_33066; wire and_33069; wire nor_33070; wire and_33061; wire nor_33062; wire nor_33056; wire nor_33058; wire and_33052; wire nor_33053; wire nor_33047; wire nor_33049; wire and_33117; wire and_33118; wire and_33120; wire and_33121; wire and_33129; wire and_33130; wire and_33132; wire and_33133; wire and_33153; wire nor_33155; wire priority_sel_33163; wire and_33165; wire nor_33167; wire priority_sel_33175; wire and_33150; wire [1:0] priority_sel_33151; wire and_33146; wire and_33142; wire [2:0] concat_33198; wire [2:0] concat_33210; wire [2:0] concat_33186; wire [2:0] concat_33183; wire [2:0] concat_33182; wire [2:0] concat_33180; wire [2:0] concat_33179; wire and_33219; wire and_33225; wire and_33216; wire [2:0] fraction_shift__3; wire and_33246; wire [3:0] priority_sel_33247; wire [3:0] priority_sel_33248; wire [3:0] sel_33360; wire [4:0] concat_33250; wire [5:0] leading_zeroes; wire [57:0] cancel_fraction; wire [55:0] cancel_fraction__1; wire [55:0] carry_fraction__1; wire [55:0] shifted_fraction; wire [2:0] normal_chunk; wire [1:0] half_way_chunk; wire do_round_up; wire [53:0] add_33278; wire rounding_carry; wire [11:0] add_33291; wire [6:0] sub_33292; wire fraction_is_zero; wire [12:0] wide_exponent_associative_element; wire [12:0] wide_exponent_associative_element__1; wire [12:0] wide_exponent; wire [12:0] wide_exponent__1; wire [10:0] MAX_EXPONENT; wire [11:0] wide_exponent__2; wire eq_33307; wire eq_33308; wire eq_33309; wire eq_33310; wire [2:0] fraction_shift__2; wire is_operand_inf; wire and_reduce_33328; wire has_pos_inf; wire has_neg_inf; wire [56:0] rounded_fraction; wire [2:0] fraction_shift__1; wire [56:0] shrl_33341; wire is_result_nan; wire result_sign; wire [51:0] result_fraction; wire [51:0] sign_ext_33347; wire result_sign__1; wire [51:0] result_fraction__3; wire [51:0] FRACTION_HIGH_BIT; wire result_sign__2; wire [10:0] result_exponent__2; wire [51:0] result_fraction__4; assign y_bexp__1 = y[62:52]; assign x_bexp__1 = x[62:52]; assign y_bexpnot = ~y_bexp__1; assign x_bexp_extended__1 = {1'h0, x_bexp__1}; assign y_bexpnot_extended = {1'h0, y_bexpnot}; assign full_result = x_bexp_extended__1 + y_bexpnot_extended; assign overflow_detected = full_result[11]; assign tuple_index_32882 = y[51:0]; assign tuple_index_32883 = x[51:0]; assign x_bexp = overflow_detected ? x_bexp__1 : y_bexp__1; assign y_bexp = overflow_detected ? y_bexp__1 : x_bexp__1; assign x_fraction = overflow_detected ? tuple_index_32883 : tuple_index_32882; assign y_fraction = overflow_detected ? tuple_index_32882 : tuple_index_32883; assign nc = ~overflow_detected; assign fraction_x = {1'h1, x_fraction}; assign fraction_y = {1'h1, y_fraction}; assign sign_ext_32896 = {53{y_bexp != 11'h000}}; assign narrowed_result = full_result[10:0]; assign x_bexpor_mask = {11{nc}}; assign tuple_index_32900 = y[63:63]; assign tuple_index_32901 = x[63:63]; assign fraction_x__1 = fraction_x & {53{x_bexp != 11'h000}}; assign fraction_y__1 = fraction_y & sign_ext_32896; assign xddend_x__1_squeezed_const_lsb_bits = 3'h0; assign result = narrowed_result ^ x_bexpor_mask; assign x_sign = overflow_detected ? tuple_index_32901 : tuple_index_32900; assign y_sign = overflow_detected ? tuple_index_32900 : tuple_index_32901; assign wide_x_squeezed = {1'h0, fraction_x__1}; assign wide_y_shift_bits = {fraction_y__1, xddend_x__1_squeezed_const_lsb_bits}; assign shift = result + {10'h000, overflow_detected}; assign shrl_32915 = shift >= 11'h038 ? 56'h00_0000_0000_0000 : wide_y_shift_bits >> shift; assign shll_32917 = shift >= 11'h039 ? 57'h000_0000_0000_0000 : 57'h1ff_ffff_ffff_ffff << shift; assign xddend_x__1_squeezed = x_sign ^ y_sign ? -wide_x_squeezed : wide_x_squeezed; assign add_32928 = {{1{xddend_x__1_squeezed[53]}}, xddend_x__1_squeezed} + {2'h0, shrl_32915[55:3]}; assign sticky = ~({1'h0, ~y_fraction} | ~sign_ext_32896 | shll_32917[55:3]) != 53'h00_0000_0000_0000; assign concat_32934 = {add_32928[53:0], shrl_32915[2:1], shrl_32915[0] | sticky}; assign xbs_fraction = add_32928[54] ? -concat_32934 : concat_32934; assign nor_32947 = ~(xbs_fraction[46] | xbs_fraction[45]); assign nor_32953 = ~(xbs_fraction[30] | xbs_fraction[29]); assign and_32978 = ~(xbs_fraction[48] | xbs_fraction[47]) & nor_32947; assign nor_32980 = ~(xbs_fraction[42] | xbs_fraction[41]); assign carry_bit = xbs_fraction[56]; assign and_32988 = ~(xbs_fraction[32] | xbs_fraction[31]) & nor_32953; assign nor_32990 = ~(xbs_fraction[26] | xbs_fraction[25]); assign and_33029 = ~(xbs_fraction[44] | xbs_fraction[43]) & nor_32980; assign nor_33030 = ~(xbs_fraction[44] | xbs_fraction[43] | nor_32980); assign nor_33032 = ~(xbs_fraction[54] | xbs_fraction[53]); assign and_33039 = ~(xbs_fraction[28] | xbs_fraction[27]) & nor_32990; assign nor_33040 = ~(xbs_fraction[28] | xbs_fraction[27] | nor_32990); assign nor_33042 = ~(xbs_fraction[38] | xbs_fraction[37]); assign nor_33016 = ~(xbs_fraction[24] | xbs_fraction[23]); assign nor_33017 = ~(xbs_fraction[22] | xbs_fraction[21]); assign nor_33022 = ~(xbs_fraction[18] | xbs_fraction[17]); assign nor_33023 = ~(xbs_fraction[20] | xbs_fraction[19]); assign nor_33012 = ~(xbs_fraction[14] | xbs_fraction[13]); assign nor_33013 = ~(xbs_fraction[16] | xbs_fraction[15]); assign nor_33003 = ~(xbs_fraction[6] | xbs_fraction[5]); assign nor_33004 = ~(xbs_fraction[8] | xbs_fraction[7]); assign nor_33073 = ~(xbs_fraction[50] | xbs_fraction[49]); assign nor_33074 = ~(~and_32978 | and_33029); assign and_33076 = ~(carry_bit | xbs_fraction[55]) & nor_33032; assign nor_33077 = ~(carry_bit | xbs_fraction[55] | nor_33032); assign nor_33084 = ~(xbs_fraction[34] | xbs_fraction[33]); assign nor_33085 = ~(~and_32988 | and_33039); assign and_33087 = ~(xbs_fraction[40] | xbs_fraction[39]) & nor_33042; assign nor_33088 = ~(xbs_fraction[40] | xbs_fraction[39] | nor_33042); assign and_33064 = nor_33016 & nor_33017; assign nor_33066 = ~(xbs_fraction[24] | ~xbs_fraction[23]); assign and_33069 = nor_33023 & nor_33022; assign nor_33070 = ~(xbs_fraction[20] | ~xbs_fraction[19]); assign and_33061 = nor_33013 & nor_33012; assign nor_33062 = ~(xbs_fraction[16] | ~xbs_fraction[15]); assign nor_33056 = ~(xbs_fraction[10] | xbs_fraction[9]); assign nor_33058 = ~(xbs_fraction[12] | xbs_fraction[11]); assign and_33052 = nor_33004 & nor_33003; assign nor_33053 = ~(xbs_fraction[8] | ~xbs_fraction[7]); assign nor_33047 = ~(xbs_fraction[2] | xbs_fraction[1]); assign nor_33049 = ~(xbs_fraction[4] | xbs_fraction[3]); assign and_33117 = ~(xbs_fraction[52] | xbs_fraction[51]) & nor_33073; assign and_33118 = and_32978 & and_33029; assign and_33120 = nor_33074 & ~nor_33030; assign and_33121 = nor_33074 & nor_33030; assign and_33129 = ~(xbs_fraction[36] | xbs_fraction[35]) & nor_33084; assign and_33130 = and_32988 & and_33039; assign and_33132 = nor_33085 & ~nor_33040; assign and_33133 = nor_33085 & nor_33040; assign and_33153 = and_33076 & and_33117; assign nor_33155 = ~(xbs_fraction[48] | xbs_fraction[47] | nor_32947); assign priority_sel_33163 = priority_sel_1b_2way({nor_33077, and_33076}, 1'h0, ~(xbs_fraction[54] | ~xbs_fraction[53]), ~(carry_bit | ~xbs_fraction[55])); assign and_33165 = and_33087 & and_33129; assign nor_33167 = ~(xbs_fraction[32] | xbs_fraction[31] | nor_32953); assign priority_sel_33175 = priority_sel_1b_2way({nor_33088, and_33087}, 1'h0, ~(xbs_fraction[38] | ~xbs_fraction[37]), ~(xbs_fraction[40] | ~xbs_fraction[39])); assign and_33150 = and_33064 & and_33069; assign priority_sel_33151 = priority_sel_2b_2way({~(xbs_fraction[24] | xbs_fraction[23] | nor_33017), and_33064}, {nor_33066, 1'h0}, {1'h1, ~(xbs_fraction[22] | ~xbs_fraction[21])}, {nor_33016, nor_33066}); assign and_33146 = nor_33058 & nor_33056; assign and_33142 = nor_33049 & nor_33047; assign concat_33198 = {1'h1, ~(xbs_fraction[52] | xbs_fraction[51] | nor_33073) ? {1'h1, ~(xbs_fraction[50] | ~xbs_fraction[49])} : {1'h0, ~(xbs_fraction[52] | ~xbs_fraction[51])}}; assign concat_33210 = {1'h1, ~(xbs_fraction[36] | xbs_fraction[35] | nor_33084) ? {1'h1, ~(xbs_fraction[34] | ~xbs_fraction[33])} : {1'h0, ~(xbs_fraction[36] | ~xbs_fraction[35])}}; assign concat_33186 = {1'h1, priority_sel_2b_2way({~(xbs_fraction[20] | xbs_fraction[19] | nor_33022), and_33069}, {nor_33070, 1'h0}, {1'h1, ~(xbs_fraction[18] | ~xbs_fraction[17])}, {nor_33023, nor_33070})}; assign concat_33183 = {and_33061, priority_sel_2b_2way({~(xbs_fraction[16] | xbs_fraction[15] | nor_33012), and_33061}, {nor_33062, 1'h0}, {1'h1, ~(xbs_fraction[14] | ~xbs_fraction[13])}, {nor_33013, nor_33062})}; assign concat_33182 = {1'h1, ~(xbs_fraction[12] | xbs_fraction[11] | nor_33056) ? {1'h1, ~(xbs_fraction[10] | ~xbs_fraction[9])} : {nor_33058, ~(xbs_fraction[12] | ~xbs_fraction[11])}}; assign concat_33180 = {and_33052, priority_sel_2b_2way({~(xbs_fraction[8] | xbs_fraction[7] | nor_33003), and_33052}, {nor_33053, 1'h0}, {1'h1, ~(xbs_fraction[6] | ~xbs_fraction[5])}, {nor_33004, nor_33053})}; assign concat_33179 = {1'h1, ~(xbs_fraction[4] | xbs_fraction[3] | nor_33047) ? {1'h1, ~(xbs_fraction[2] | ~xbs_fraction[1])} : {nor_33049, ~(xbs_fraction[4] | ~xbs_fraction[3])}}; assign and_33219 = and_33153 & and_33118; assign and_33225 = and_33165 & and_33130; assign and_33216 = and_33061 & and_33146; assign fraction_shift__3 = 3'h4; assign and_33246 = and_33219 & and_33225; assign priority_sel_33247 = priority_sel_4b_2way({~(~and_33153 | and_33118), and_33219}, 4'h0, {1'h1, nor_33074, and_33121 & ~and_33118 | nor_33155 & ~and_33120 & ~and_33121 & ~and_33118, priority_sel_1b_4way({nor_33155, and_33120, and_33121, and_33118}, 1'h0, ~(xbs_fraction[42] | ~xbs_fraction[41]), ~(xbs_fraction[44] | ~xbs_fraction[43]), ~(xbs_fraction[46] | ~xbs_fraction[45]), ~(xbs_fraction[48] | ~xbs_fraction[47]))}, {and_33153, priority_sel_3b_2way({~(~and_33076 | and_33117), and_33153}, {nor_33077, priority_sel_33163, 1'h0}, concat_33198, {1'h0, nor_33077, priority_sel_33163})}); assign priority_sel_33248 = priority_sel_4b_2way({~(~and_33165 | and_33130), and_33225}, 4'h0, {1'h1, nor_33085, and_33133 & ~and_33130 | nor_33167 & ~and_33132 & ~and_33133 & ~and_33130, priority_sel_1b_4way({nor_33167, and_33132, and_33133, and_33130}, 1'h0, ~(xbs_fraction[26] | ~xbs_fraction[25]), ~(xbs_fraction[28] | ~xbs_fraction[27]), ~(xbs_fraction[30] | ~xbs_fraction[29]), ~(xbs_fraction[32] | ~xbs_fraction[31]))}, {and_33165, priority_sel_3b_2way({~(~and_33087 | and_33129), and_33165}, {nor_33088, priority_sel_33175, 1'h0}, concat_33210, {1'h0, nor_33088, priority_sel_33175})}); assign sel_33360 = ~(~and_33150 | and_33216) ? {1'h1, ~(~and_33061 | and_33146) ? concat_33182 : concat_33183} : {and_33150, priority_sel_3b_2way({~(~and_33064 | and_33069), and_33150}, {priority_sel_33151, 1'h0}, concat_33186, {and_33064, priority_sel_33151})}; assign concat_33250 = {1'h1, and_33052 & and_33142 ? {fraction_shift__3, ~xbs_fraction[0]} : {1'h0, ~(~and_33052 | and_33142) ? concat_33179 : concat_33180}}; assign leading_zeroes = and_33219 & and_33246 ? {1'h1, and_33150 & and_33216 ? concat_33250 : {1'h0, sel_33360}} : {1'h0, priority_sel_5b_2way({~(~and_33219 | and_33225), and_33246}, {priority_sel_33247, 1'h0}, {1'h1, priority_sel_33248}, {and_33219, priority_sel_33247})}; assign cancel_fraction = leading_zeroes >= 6'h3a ? 58'h000_0000_0000_0000 : {1'h0, xbs_fraction} << leading_zeroes; assign cancel_fraction__1 = cancel_fraction[56:1]; assign carry_fraction__1 = {xbs_fraction[56:2], xbs_fraction[1] | xbs_fraction[0]}; assign shifted_fraction = carry_bit ? carry_fraction__1 : cancel_fraction__1; assign normal_chunk = shifted_fraction[2:0]; assign half_way_chunk = shifted_fraction[3:2]; assign do_round_up = normal_chunk > fraction_shift__3 | half_way_chunk == 2'h3; assign add_33278 = {1'h0, shifted_fraction[55:3]} + {53'h00_0000_0000_0000, do_round_up}; assign rounding_carry = add_33278[53]; assign add_33291 = {1'h0, x_bexp} + 12'h001; assign sub_33292 = {6'h00, rounding_carry} - {1'h0, leading_zeroes}; assign fraction_is_zero = add_32928 == 55'h00_0000_0000_0000 & ~(shrl_32915[1] | shrl_32915[2]) & ~(shrl_32915[0] | sticky); assign wide_exponent_associative_element = {1'h0, add_33291}; assign wide_exponent_associative_element__1 = {{6{sub_33292[6]}}, sub_33292}; assign wide_exponent = wide_exponent_associative_element + wide_exponent_associative_element__1; assign wide_exponent__1 = wide_exponent & {13{~fraction_is_zero}}; assign MAX_EXPONENT = 11'h7ff; assign wide_exponent__2 = wide_exponent__1[11:0] & {12{~wide_exponent__1[12]}}; assign eq_33307 = x_bexp == MAX_EXPONENT; assign eq_33308 = x_fraction == 52'h0_0000_0000_0000; assign eq_33309 = y_bexp == MAX_EXPONENT; assign eq_33310 = y_fraction == 52'h0_0000_0000_0000; assign fraction_shift__2 = 3'h3; assign is_operand_inf = eq_33307 & eq_33308 | eq_33309 & eq_33310; assign and_reduce_33328 = &wide_exponent__2[10:0]; assign has_pos_inf = ~(~eq_33307 | ~eq_33308 | x_sign) | ~(~eq_33309 | ~eq_33310 | y_sign); assign has_neg_inf = eq_33307 & eq_33308 & x_sign | eq_33309 & eq_33310 & y_sign; assign rounded_fraction = {add_33278, normal_chunk}; assign fraction_shift__1 = rounding_carry ? fraction_shift__3 : fraction_shift__2; assign shrl_33341 = rounded_fraction >> fraction_shift__1; assign is_result_nan = ~(~eq_33307 | eq_33308) | ~(~eq_33309 | eq_33310) | has_pos_inf & has_neg_inf; assign result_sign = priority_sel_1b_2way({add_32928[54], fraction_is_zero}, x_sign & y_sign, ~y_sign, y_sign); assign result_fraction = shrl_33341[51:0]; assign sign_ext_33347 = {52{~(is_operand_inf | wide_exponent__2[11] | and_reduce_33328 | ~((|wide_exponent__2[11:1]) | wide_exponent__2[0]))}}; assign result_sign__1 = is_operand_inf ? ~has_pos_inf : result_sign; assign result_fraction__3 = result_fraction & sign_ext_33347; assign FRACTION_HIGH_BIT = 52'h8_0000_0000_0000; assign result_sign__2 = ~is_result_nan & result_sign__1; assign result_exponent__2 = is_result_nan | is_operand_inf | wide_exponent__2[11] | and_reduce_33328 ? MAX_EXPONENT : wide_exponent__2[10:0]; assign result_fraction__4 = is_result_nan ? FRACTION_HIGH_BIT : result_fraction__3; assign out = {result_sign__2, result_exponent__2, result_fraction__4}; endmodule