NEON vector comparaison

hi,

Is it possible to compare two vectors and get a boolean answer?

example : uint642_t a; uint642_t b; .../... if(a == b) .../...

how to do it ? thank

Answered by DTS Engineer in 841972022

I generally do this sort of thing using the simd module. In C:

#include <simd/simd.h>

static int test(simd_double4 a, simd_double4 b) {
    return simd_equal(a, b);
}

The advantage of simd is that you don’t need specialist code for each architecture.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I generally do this sort of thing using the simd module. In C:

#include <simd/simd.h>

static int test(simd_double4 a, simd_double4 b) {
    return simd_equal(a, b);
}

The advantage of simd is that you don’t need specialist code for each architecture.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I don't understand.

My first message should read uint64x2_t Arm-specific 128-bit wide vector of two packed u64

NEON vector comparaison
 
 
Q