0
votes

How to access lower 32bits or upper 32 bits from a 64 bit signed integer using ARM Neon Intrinsics? Also, I want to assign this extracted data into another 32bit variable. Is it possible?

2

2 Answers

1
votes
static inline int32x2_t low32(int64x2_t in)
{
    int32x2_t out;

    out = vmovn_s64(in); // vqmovn for saturating

    return out;
}

static inline int32x2_t high32(int64x2_t in)
{
    int32x2_t out;

    out = vshrn_n_s64(in, 32);

    return out;
}
-2
votes

Hey In That Case You have to Do and operation with your 64 bit variable. Have look at this example: suppose we have 64 bit variable having value 0b0000000000000000000000000000001100000000000000000000000000000001

if we split above variable then we will get

00000000000000000000000000000011 = 3 and 00000000000000000000000000000001 = 1 so here first 32 bits(MSB) value is 3 and next 32 bits(LSB) value is 1

first32_bit = 64bit_var>>32;
next32_bit = 64bit_var&0000000000000000000000000000000011111111111111111111111111111111;