module __bfloat16__ceil_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 [7:0] priority_sel_8b_2way (input reg [1:0] sel, input reg [7:0] case0, input reg [7:0] case1, input reg [7:0] default_value); begin casez (sel) 2'b?1: begin priority_sel_8b_2way = case0; end 2'b10: begin priority_sel_8b_2way = case1; end 2'b00: begin priority_sel_8b_2way = default_value; end default: begin // Propagate X priority_sel_8b_2way = 8'dx; end endcase end endfunction wire [7:0] f_bexp__1; wire [7:0] exp; wire [6:0] f_fraction__1; wire [6:0] fractional_mask__2; wire [7:0] fraction_up__2; wire [7:0] EXPR_MASK; wire and_reduce_691; wire eq_693; wire eq_694; wire f_sign__1; wire [6:0] fraction_integral__4; wire [6:0] fraction_integral__2; wire and_700; wire or_708; wire nor_709; wire ult_712; wire [7:0] add_716; wire [6:0] sel_718; wire [7:0] priority_sel_731; wire [15:0] tuple_733; assign f_bexp__1 = f[14:7]; assign exp = f_bexp__1 + 8'h81; assign f_fraction__1 = f[6:0]; assign fractional_mask__2 = {{24{exp[7]}}, exp} >= 32'h0000_0007 ? 7'h00 : 7'h7f >> {{24{exp[7]}}, exp}; assign fraction_up__2 = {1'h0, f_fraction__1} + {1'h0, fractional_mask__2}; assign EXPR_MASK = 8'hff; assign and_reduce_691 = &f_bexp__1[6:0]; assign eq_693 = f_fraction__1 == 7'h00; assign eq_694 = f_bexp__1 == EXPR_MASK; assign f_sign__1 = f[15:15]; assign fraction_integral__4 = ~(~fraction_up__2[6:0] | fractional_mask__2); assign fraction_integral__2 = ~(~f_fraction__1 | fractional_mask__2); assign and_700 = f_bexp__1 == 8'h00 & eq_693; assign or_708 = and_700 | eq_694 & eq_693; assign nor_709 = ~(~eq_694 | eq_693); assign ult_712 = f_bexp__1 < 8'h86; assign add_716 = f_bexp__1 + {7'h00, ~(f_sign__1 | ~fraction_up__2[7])}; assign sel_718 = ult_712 ? (f_sign__1 ? fraction_integral__2 : fraction_integral__4) & {7{f_bexp__1[7] | and_reduce_691}} : f_fraction__1; assign priority_sel_731 = priority_sel_8b_2way({and_700, eq_694}, EXPR_MASK, 8'h00, ult_712 ? (~(f_bexp__1[7] | and_reduce_691) ? {1'h0, {7{~f_sign__1}}} : add_716) : f_bexp__1); assign tuple_733 = {~(nor_709 | ~f_sign__1), priority_sel_731, {priority_sel_1b_2way({or_708, nor_709}, 1'h1, 1'h0, sel_718[6]), sel_718[5:0] & {6{~(or_708 | nor_709)}}}}; assign out = tuple_733; endmodule