https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122823

            Bug ID: 122823
           Summary: AArch64 big-endian sve miscompiled. Does GCC support
                    SVE in big-endian really?
           Product: gcc
           Version: 15.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hanwei62 at huawei dot com
  Target Milestone: ---

aarch64 big-endian sve miscompiled. Does GCC support SVE in big-endian really?

we expect print these info below:
```shell
5555
14443
5555
14443
```

but i get info below, it seens wrong. does GCC support SVE in big-endian
really?
```shell
283182290
574428718
283182290
574428718
```

demo:
```c
#include <arm_sve.h>
#include <stdio.h>

#ifdef SVE_OVERLOADED_FORMS
#define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
#else
#define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
#endif

int main()
{
    int arr[4] = {1234, 5678, 1234, 5678};

    // data2
    svbool_t pg32 = svptrue_b32();;
    svint32_t data2 = svld1_s32(pg32, arr);

    // src
    int base1[4] = {4321, 8765, 4321, 8765};
    // des
    int base2[4] = {0};

    // data1
    svbool_t pg16 = svptrue_b16();;
    svuint16_t data1 = SVE_ACLE_FUNC(svld1,_u16,,)(pg16, (uint16_t const
*)base1);

    // bitcast
    svint32_t data = SVE_ACLE_FUNC(svreinterpret_s32,_u16,,)(data1);

    svint32_t data3 = SVE_ACLE_FUNC(svadd,_s32,_m,)(pg32, data, data2); // add
    // svint32_t data3 = SVE_ACLE_FUNC(svmul,_s32,_m,)(pg32, data, data2); //
mul

    SVE_ACLE_FUNC(svst1,_s32,,)(pg32, base2, data3);

    for (int i = 0; i < 4; i++) {
        printf("%d\n", base2[i]);
    }

     return 0;
}

```

Reply via email to