Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: arm64 .hword constants are filtered out #4434

Closed
dzaima opened this issue Dec 13, 2022 · 2 comments · Fixed by #4460
Closed

[BUG]: arm64 .hword constants are filtered out #4434

dzaima opened this issue Dec 13, 2022 · 2 comments · Fixed by #4460

Comments

@dzaima
Copy link
Contributor

dzaima commented Dec 13, 2022

Describe the bug

arm64 16-bit array constants, i.e. .hword directives, are filtered by Filter → Directives

Steps to reproduce

View the assembly output of the C code:

void f(short* p) {
    for (int i = 0; i < 8; i++) p[i] = i;
}

with -O3 in either armv8-a clang or ARM64 gcc

Expected behavior

Output like:

.LCPI0_0:
        .hword  0                               // 0x0
        .hword  1                               // 0x1
        .hword  2                               // 0x2
        .hword  3                               // 0x3
        .hword  4                               // 0x4
        .hword  5                               // 0x5
        .hword  6                               // 0x6
        .hword  7                               // 0x7
f:                                      // @f
        adrp    x8, .LCPI0_0
        ldr     q0, [x8, :lo12:.LCPI0_0]
        str     q0, [x0]
        ret

Reproduction link

https://godbolt.org/z/bnjP516r6

Screenshots

Not applicable

Operating System

No response

Browser version

No response

@dzaima dzaima added the bug label Dec 13, 2022
@RubenRBS
Copy link
Member

Oops, nice catch, thanks for the report, I'll submit a quick PR fixing it in a moment, thanks!

@partouf
Copy link
Contributor

partouf commented Dec 24, 2022

fix is now live

mattgodbolt pushed a commit that referenced this issue Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants