module __hfloat16__floor_with_denorms( input wire [15:0] f, output wire [15: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 [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 [4:0] f_bexp__1; wire [4:0] exp; wire [9:0] f_fraction__1; wire [9:0] fractional_mask__2; wire [10:0] fraction_up__2; wire [4:0] EXPR_MASK; wire and_reduce_685; wire eq_687; wire eq_688; wire f_sign__1; wire [9:0] fraction_integral__2; wire [9:0] fraction_integral__4; wire and_695; wire [4:0] sign_ext_699; wire or_703; wire nor_704; wire ult_707; wire [4:0] add_711; wire [9:0] sel_713; wire [15:0] tuple_729; assign f_bexp__1 = f[14:10]; assign exp = f_bexp__1 + 5'h11; assign f_fraction__1 = f[9:0]; assign fractional_mask__2 = {{27{exp[4]}}, exp} >= 32'h0000_000a ? 10'h000 : 10'h3ff >> {{27{exp[4]}}, exp}; assign fraction_up__2 = {1'h0, f_fraction__1} + {1'h0, fractional_mask__2}; assign EXPR_MASK = 5'h1f; assign and_reduce_685 = &f_bexp__1[3:0]; assign eq_687 = f_fraction__1 == 10'h000; assign eq_688 = f_bexp__1 == EXPR_MASK; assign f_sign__1 = f[15:15]; assign fraction_integral__2 = ~(~f_fraction__1 | fractional_mask__2); assign fraction_integral__4 = ~(~fraction_up__2[9:0] | fractional_mask__2); assign and_695 = f_bexp__1 == 5'h00 & eq_687; assign sign_ext_699 = {5{f_sign__1}}; assign or_703 = and_695 | eq_688 & eq_687; assign nor_704 = ~(~eq_688 | eq_687); assign ult_707 = f_bexp__1 < 5'h19; assign add_711 = f_bexp__1 + ({4'h0, fraction_up__2[10]} & sign_ext_699); assign sel_713 = ult_707 ? (f_sign__1 ? fraction_integral__4 : fraction_integral__2) & {10{f_bexp__1[4] | and_reduce_685}} : f_fraction__1; assign tuple_729 = {~(nor_704 | ~f_sign__1), priority_sel_5b_2way({and_695, eq_688}, EXPR_MASK, 5'h00, ult_707 ? (~(f_bexp__1[4] | and_reduce_685) ? {1'h0, sign_ext_699[3:0]} : add_711) : f_bexp__1), {priority_sel_1b_2way({or_703, nor_704}, 1'h1, 1'h0, sel_713[9]), sel_713[8:0] & {9{~(or_703 | nor_704)}}}}; assign out = tuple_729; endmodule