<commit_before>/* clear flags */
static inline void clr_flags(void)
{
  FLAGR.flags = 0;
}

/* set flags */
static inline void set_flags(const uint32_t value)
{
  FLAGR.zero = !value;
  FLAGR.parity = ~(value & 1);
  FLAGR.sign = msb(value);
}

static inline void set_flags_add(const uint32_t result, const uint32_t dest, const uint32_t src)
{
  clr_flags();

  FLAGR.carry = ((uint64_t)dest + (uint64_t)src) >> 32;
  //FLAGR.carry = msb((dest & src) | (~result & (dest | src)));
  FLAGR.overflow = msb(~(dest ^ src) & (dest ^ result));

  set_flags(result);
}

static inline void set_flags_sub(const uint32_t result, const uint32_t dest, const uint32_t src)<commit_msg>changed overflow flag logic<commit_after>/* clear flags */
static inline void clr_flags(void)
{
  FLAGR.flags = 0;
}

/* set flags */
static inline void set_flags(const uint32_t value)
{
  FLAGR.zero = !value;
  FLAGR.parity = ~(value & 1);
  FLAGR.sign = msb(value);
}

static inline void set_flags_add(const uint32_t result, const uint32_t dest, const uint32_t src)
{
  clr_flags();

  FLAGR.carry = ((uint64_t)dest + (uint64_t)src) >> 32;
  //FLAGR.carry = msb((dest & src) | (~result & (dest | src)));
  //FLAGR.overflow = msb(~(dest ^ src) & (dest ^ result));
  FLAGR.overflow = msb((dest ^ result) & (src ^ result));

  set_flags(result);
}

static inline void set_flags_sub(const uint32_t result, const uint32_t dest, const uint32_t src)
{'fraction_non_alphanumeric': 0.1471004243281471, 'fraction_numerical': 0.031117397454031116, 'mean_word_length': 4.2407407407407405, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5838453', 'n_tokens_mistral': 577, 'n_tokens_neox': 531, 'n_words': 137}