Skip to content

[AArch64] codegen for vector init #137447

@k-arrows

Description

@k-arrows

Consider the following two functions:
https://godbolt.org/z/a9az3h6oq

#include <arm_neon.h>

int8x16_t f(int8_t x)
{
  return (int8x16_t) { x, 0, x, 1, x, 2, x, 3,
                       x, 4, x, 5, x, 6, x, 7 };
}

int8x16_t g(int8_t x)
{
  return (int8x16_t) { 0, x, 1, x, 2, x, 3, x,
                       4, x, 5, x, 6, x, 7, x };
}

The difference between functions f and g is only in the parity of the indices, so the assembler output for both functions should be similar.

This issue is motivated by the program in GCC testsuite:
https://github.com/gcc-mirror/gcc/blob/master/gcc/testsuite/gcc.target/aarch64/vec-init-20.c

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions