Skip to content

Compilation Error with ARM Cortex-M55 MVE Function in Zephyr SDK v0.17 #87018

@ZhiyuanTang17

Description

@ZhiyuanTang17

Describe the bug

I encountered a compilation error related to an ARM Cortex-M55 MVE function while using the Zephyr SDK toolchain version 0.17. The error message is: error: argument 3 must be a constant immediate. This issue does not occur when using the GNU Arm Embedded toolchain, suggesting that the Zephyr SDK toolchain might not support the function correctly.

Target platform: ARM Cortex-M55
Workaround attempts: Switched to GNU Arm Embedded toolchain, which resolved the issue
Regression: Occurs with Zephyr SDK version 0.17

To Reproduce

Steps to reproduce the behavior:

  1. Set up the environment with Zephyr SDK v0.17.
  2. choose a CM55 board with MVE enabled.
  3. Use the following test code:
#include <arm_mve.h>
const int d = 5;
int main(void)
{
    uint16x8_t a = vdupq_n_u16(0xff);
    uint16x8_t b = vdupq_n_u16(0xff);
    uint16x8_t c;
    c = vsriq_n_u16(a, b, d);
}
  1. Compile the code.
    You will see the error regarding the third argument needing to be a constant immediate.
    Expected behavior
    The code should compile without error, as it does when using the GNU Arm Embedded toolchain.

Impact

This issue prevents the successful compilation of applications using the ARM Cortex-M55 MVE functions with Zephyr SDK v0.17, obstructing progress on development.

Logs and console output

This is the relevant part of the error message:

In file included from C:/ACODE/bb2u-zephyr/zephyrproject/samples/hello_world/src/main.c:8:
In function '__arm_vsriq_n_u16',
    inlined from 'main' at C:/ACODE/bb2u-zephyr/zephyrproject/samples/hello_world/src/main.c:15:7:
c:\users\zhiyuan_tang\zephyr-sdk-0.17.0\arm-zephyr-eabi\lib\gcc\arm-zephyr-eabi\12.2.0\include\arm_mve.h:7678:10: error: argument 3 must be a constant immediate 
7678 |   return __builtin_mve_vsriq_n_uv8hi (__a, __b, __imm);
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Environment:

OS: Windows
Toolchain: Zephyr SDK v0.17
Commit SHA or Version used: Zephyr v4.0.0

Additional context

The issue is circumvented by using the GNU Arm Embedded toolchain, which suggests an incompatibility or lack of support in the Zephyr SDK toolchain for this specific function.

Metadata

Metadata

Assignees

Labels

area: ToolchainsToolchainsbugThe issue is a bug, or the PR is fixing a bugpriority: mediumMedium impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions