This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Unexpected result from svqdmulh_s32 with negative input values

Dear ARM Support Team,

I'm having trouble understanding how the svqdmulh_s32 intrinsic behaves when handling negative values.

Here's a specific case:

Fullscreen
1
2
3
int32_t a = 115998720;
int32_t b = -27704;
int32_t result = (a * b) >> 31; // Expected: -1497
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

However, when I use svqdmulh_s32, I get 2147483647 instead of -1497.

From what I understand, this intrinsic should behave similarly to the NEON vqdmulhq_s32, which gives the correct result for this case.

My build configuration:

Fullscreen
1
-g3 --debug -fno-inline -O0 -MD --target=aarch64-arm-none-eabi -march=armv8-a+sve2
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Is it possible that I need to explicitly specify the target processor to get correct behavior? I haven't defined a specific CPU in the toolchain so far.

Any clarification would be greatly appreciated.

Best regards,
Yevh

0