Skip to content

Instantly share code, notes, and snippets.

@luctrudeau
Created February 28, 2018 03:39
Show Gist options
  • Save luctrudeau/7e6ca1ce23c44afe64c7dd271886c98c to your computer and use it in GitHub Desktop.
Save luctrudeau/7e6ca1ce23c44afe64c7dd271886c98c to your computer and use it in GitHub Desktop.
int16x4_t vqadd_s16_c(int16x4_t a, int16x4_t b) {
int16x4_t c;
for (int i = 0; i < 4; i++) {
int32_t tmp = a[i] + b[i];
tmp = (tmp > INT16_MAX) ? INT16_MAX : tmp;
tmp = (tmp < INT16_MIN) ? INT16_MIN : tmp;
c[i] = (int16_t)tmp;
}
return c;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment