module __bfloat16__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 [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_763; wire [6:0] f_fraction__1; wire [6:0] fractional_mask__1; wire [7:0] fraction_up__2; wire [7:0] literal_771; wire [6:0] literal_772; wire [7:0] EXPR_MASK; wire and_reduce_777; wire eq_779; wire eq_780; wire f_sign__1; wire [6:0] fraction_integral__2; wire [6:0] fraction_integral__4; wire and_786; wire [7:0] sign_ext_790; wire or_794; wire nor_795; wire ult_798; wire [7:0] add_802; wire [6:0] sel_804; wire [15:0] tuple_820; assign f_bexp__1 = f[14:7]; assign exp__1 = f_bexp__1 + 8'h81; assign literal_763 = 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_763, f_fraction__1} + {literal_763, fractional_mask__1}; assign literal_771 = 8'h00; assign literal_772 = 7'h00; assign EXPR_MASK = 8'hff; assign and_reduce_777 = &f_bexp__1[6:0]; assign eq_779 = f_fraction__1 == literal_772; assign eq_780 = f_bexp__1 == EXPR_MASK; assign f_sign__1 = f[15:15]; assign fraction_integral__2 = ~(~f_fraction__1 | fractional_mask__1); assign fraction_integral__4 = ~(~fraction_up__2[6:0] | fractional_mask__1); assign and_786 = f_bexp__1 == literal_771 & eq_779; assign sign_ext_790 = {8{f_sign__1}}; assign or_794 = and_786 | eq_780 & eq_779; assign nor_795 = ~(~eq_780 | eq_779); assign ult_798 = f_bexp__1 < 8'h86; assign add_802 = f_bexp__1 + ({literal_772, fraction_up__2[7]} & sign_ext_790); assign sel_804 = ult_798 ? (f_sign__1 ? fraction_integral__4 : fraction_integral__2) & {7{f_bexp__1[7] | and_reduce_777}} : f_fraction__1; assign tuple_820 = {~(nor_795 | ~f_sign__1), priority_sel_8b_2way({and_786, eq_780}, EXPR_MASK, literal_771, ult_798 ? (~(f_bexp__1[7] | and_reduce_777) ? {literal_763, sign_ext_790[6:0]} : add_802) : f_bexp__1), {priority_sel_1b_2way({or_794, nor_795}, 1'h1, literal_763, sel_804[6]), sel_804[5:0] & {6{~(or_794 | nor_795)}}}}; assign out = tuple_820; endmodule