Commit 95f1c2ab authored by Steinar Midtskogen's avatar Steinar Midtskogen

Fix -fsanitize=integer warnings in v64_intrinsics_c.h

Change-Id: I8134c0ac4bd18478b266a0058e00bc6b1e6f8e9e
parent 6c795765
......@@ -191,8 +191,8 @@ SIMD_INLINE c_v64 c_v64_sadd_s16(c_v64 a, c_v64 b) {
SIMD_INLINE c_v64 c_v64_add_32(c_v64 a, c_v64 b) {
c_v64 t;
t.u32[0] = a.u32[0] + b.u32[0];
t.u32[1] = a.u32[1] + b.u32[1];
t.u32[0] = (uint32_t)((uint64_t)a.u32[0] + b.u32[0]);
t.u32[1] = (uint32_t)((uint64_t)a.u32[1] + b.u32[1]);
return t;
}
......@@ -207,9 +207,7 @@ SIMD_INLINE c_v64 c_v64_ssub_u8(c_v64 a, c_v64 b) {
c_v64 t;
int c;
for (c = 0; c < 8; c++)
t.u8[c] = (int32_t)((uint32_t)a.u8[c] - (uint32_t)b.u8[c]) < 0
? 0
: a.u8[c] - b.u8[c];
t.u8[c] = (int32_t)a.u8[c] - (int32_t)b.u8[c] < 0 ? 0 : a.u8[c] - b.u8[c];
return t;
}
......@@ -244,8 +242,8 @@ SIMD_INLINE c_v64 c_v64_ssub_s16(c_v64 a, c_v64 b) {
SIMD_INLINE c_v64 c_v64_sub_32(c_v64 a, c_v64 b) {
c_v64 t;
t.u32[0] = a.u32[0] - b.u32[0];
t.u32[1] = a.u32[1] - b.u32[1];
t.u32[0] = (uint32_t)((int64_t)a.u32[0] - b.u32[0]);
t.u32[1] = (uint32_t)((int64_t)a.u32[1] - b.u32[1]);
return t;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment