<commit_before>// This file implements most of IEEE-754 single-precision
// floating-point addition, with the following exceptions:
//  - Both input and output denormals are treated as/flushed to 0.
//  - Only round-to-nearest mode is supported.
//  - No exception flags are raised/reported.
// In all other cases, results should be identical to other
// conforming implementations (modulo exact significand
// values in the NaN case.
import float32

type F32 = float32::F32;

fn fpadd_2x32(x: F32, y: F32) -> F32 {
  // Step 1: align the significands.
  //  - Bit widths: Base significant: u23.
  //  - Add the implied/leading 1 bit: u23 -> u24
  //  - Add a sign bit: u24 -> u25
  let wide_x = ((x.sfd as u28) | u28:0x800000) << u28:3 in
  let wide_y = ((y.sfd as u28) | u28:0x800000) << u28:3 in

  // Flush denormals to 0.
  let wide_x = u28:0 if x.bexp == u8:0 else wide_x in
  let wide_y = u28:0 if y.bexp == u8:0 else wide_y in

  // Shift the significands to align with the largest exponent.
  let greater_exp = x if x.bexp > y.bexp else y in
  let shift_x = greater_exp.bexp - x.bexp in
  let shift_y = greater_exp.bexp - y.bexp in
  let shifted_x = (wide_x >> (shift_x as u28)) as s28 in
  let shifted_y = (wide_y >> (shift_y as u28)) as s28 in

  // Calculate the sticky bits - set to 1 if any set bits were
  // shifted out of the significands.
  let dropped_x = wide_x << ((u8:28 - shift_x) as u28) in
  let dropped_y = wide_y << ((u8:28 - shift_y) as u28) in
  let sticky_x = dropped_x > u28:0 in<commit_msg>Trivial - fixing misspelling in comment.<commit_after>// This file implements most of IEEE-754 single-precision
// floating-point addition, with the following exceptions:
//  - Both input and output denormals are treated as/flushed to 0.
//  - Only round-to-nearest mode is supported.
//  - No exception flags are raised/reported.
// In all other cases, results should be identical to other
// conforming implementations (modulo exact significand
// values in the NaN case.
import float32

type F32 = float32::F32;

fn fpadd_2x32(x: F32, y: F32) -> F32 {
  // Step 1: align the significands.
  //  - Bit widths: Base significand: u23.
  //  - Add the implied/leading 1 bit: u23 -> u24
  //  - Add a sign bit: u24 -> u25
  let wide_x = ((x.sfd as u28) | u28:0x800000) << u28:3 in
  let wide_y = ((y.sfd as u28) | u28:0x800000) << u28:3 in

  // Flush denormals to 0.
  let wide_x = u28:0 if x.bexp == u8:0 else wide_x in
  let wide_y = u28:0 if y.bexp == u8:0 else wide_y in

  // Shift the significands to align with the largest exponent.
  let greater_exp = x if x.bexp > y.bexp else y in
  let shift_x = greater_exp.bexp - x.bexp in
  let shift_y = greater_exp.bexp - y.bexp in
  let shifted_x = (wide_x >> (shift_x as u28)) as s28 in
  let shifted_y = (wide_y >> (shift_y as u28)) as s28 in

  // Calculate the sticky bits - set to 1 if any set bits were
  // shifted out of the significands.
  let dropped_x = wide_x << ((u8:28 - shift_x) as u28) in
  let dropped_y = wide_y << ((u8:28 - shift_y) as u28) in
  let sticky_x = dropped_x > u28:0 in
{'fraction_non_alphanumeric': 0.10810810810810811, 'fraction_numerical': 0.06121784435037447, 'mean_word_length': 2.9183673469387754, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3795337', 'n_tokens_mistral': 1224, 'n_tokens_neox': 1107, 'n_words': 423}