mirror of
https://github.com/matrix-construct/construct
synced 2024-12-27 07:54:05 +01:00
ircd::simd: Ensure return counts are bound to max values.
This commit is contained in:
parent
e39182be25
commit
13d267cefb
1 changed files with 10 additions and 2 deletions
|
@ -124,7 +124,11 @@ noexcept
|
||||||
count += consume;
|
count += consume;
|
||||||
}
|
}
|
||||||
|
|
||||||
return count;
|
return u64x2
|
||||||
|
{
|
||||||
|
std::min(count[0], max[0]),
|
||||||
|
std::min(count[1], max[1]),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Streaming consumer
|
/// Streaming consumer
|
||||||
|
@ -209,5 +213,9 @@ noexcept
|
||||||
count += consume;
|
count += consume;
|
||||||
}
|
}
|
||||||
|
|
||||||
return count;
|
return u64x2
|
||||||
|
{
|
||||||
|
count[0],
|
||||||
|
std::min(count[1], max[1])
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue