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__1; wire literal_766; wire [6:0] f_fraction__1; wire [6:0] fractional_mask__1; wire [7:0] fraction_up__2; wire [7:0] literal_774; wire [6:0] literal_775; wire [7:0] EXPR_MASK; wire f_sign__1; wire and_reduce_781; wire eq_783; wire eq_784; wire [6:0] fraction_integral__4; wire [6:0] fraction_integral__2; wire and_790; wire [7:0] sign_ext_794; wire or_798; wire nor_799; wire ult_802; wire [7:0] add_806; wire [6:0] sel_808; wire [15:0] tuple_823; assign f_bexp__1 = f[14:7]; assign exp__1 = f_bexp__1 + 8'h81; assign literal_766 = 1'h0; assign f_fraction__1 = f[6:0]; assign fractional_mask__1 = {{24{exp__1[7]}}, exp__1} >= 32'h0000_0007 ? 7'h00 : 7'h7f >> {{24{exp__1[7]}}, exp__1}; assign fraction_up__2 = {literal_766, f_fraction__1} + {literal_766, fractional_mask__1}; assign literal_774 = 8'h00; assign literal_775 = 7'h00; assign EXPR_MASK = 8'hff; assign f_sign__1 = f[15:15]; assign and_reduce_781 = &f_bexp__1[6:0]; assign eq_783 = f_fraction__1 == literal_775; assign eq_784 = f_bexp__1 == EXPR_MASK; assign fraction_integral__4 = ~(~fraction_up__2[6:0] | fractional_mask__1); assign fraction_integral__2 = ~(~f_fraction__1 | fractional_mask__1); assign and_790 = f_bexp__1 == literal_774 & eq_783; assign sign_ext_794 = {8{~f_sign__1}}; assign or_798 = and_790 | eq_784 & eq_783; assign nor_799 = ~(~eq_784 | eq_783); assign ult_802 = f_bexp__1 < 8'h86; assign add_806 = f_bexp__1 + ({literal_775, fraction_up__2[7]} & sign_ext_794); assign sel_808 = ult_802 ? (f_sign__1 ? fraction_integral__2 : fraction_integral__4) & {7{f_bexp__1[7] | and_reduce_781}} : f_fraction__1; assign tuple_823 = {~(nor_799 | ~f_sign__1), priority_sel_8b_2way({and_790, eq_784}, EXPR_MASK, literal_774, ult_802 ? (~(f_bexp__1[7] | and_reduce_781) ? {literal_766, sign_ext_794[6:0]} : add_806) : f_bexp__1), {priority_sel_1b_2way({or_798, nor_799}, 1'h1, literal_766, sel_808[6]), sel_808[5:0] & {6{~(or_798 | nor_799)}}}}; assign out = tuple_823; endmodule