On Thursday, 12 April 2018 at 10:14:55 UTC, rikki cattermole
wrote:
Just checked, change int to float and it uses ucomiss (SIMD,
ldc -O3).
There may not be an instruction for int's.
Yep logic is much easier with floats and is available on SSE.
It's hard to do logic on ints until SSE4.1 as
On 12/04/2018 7:25 PM, Per Nordlöw wrote:
Neither GCC, LLVM nor ICC can auto-vectorize (and use SIMD) the seemly
simple function
bool is_sorted(const int32_t* input, size_t n) {
if (n < 2) {
return true;
}
for (size_t i=0; i < n - 1; i++) {
if (input[i] >
Am Thu, 12 Apr 2018 09:37:58 +
schrieb Stefan Koch :
> On Thursday, 12 April 2018 at 07:25:27 UTC, Per Nordlöw wrote:
> > Neither GCC, LLVM nor ICC can auto-vectorize (and use SIMD) the
> > seemly simple function
> >
> > bool is_sorted(const int32_t* input,
On Thursday, 12 April 2018 at 07:25:27 UTC, Per Nordlöw wrote:
Neither GCC, LLVM nor ICC can auto-vectorize (and use SIMD) the
seemly simple function
bool is_sorted(const int32_t* input, size_t n) {
if (n < 2) {
return true;
}
for (size_t i=0; i < n - 1; i++) {
if
Neither GCC, LLVM nor ICC can auto-vectorize (and use SIMD) the
seemly simple function
bool is_sorted(const int32_t* input, size_t n) {
if (n < 2) {
return true;
}
for (size_t i=0; i < n - 1; i++) {
if (input[i] > input[i + 1])
return false;
}