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

            Bug ID: 126983
           Summary: AArch64 emits fp16 fmov when fp16 is not available
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: assemble-failure
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ktkachov at gcc dot gnu.org
  Target Milestone: ---

typedef _Float16 v2hf __attribute__((vector_size (4)));

v2hf g;

void f (_Float16 x) { g = (v2hf) { x, 0 }; }

at plain -O2 emits:
f:
        fmov    h0, h0
        adrp    x0, .LANCHOR0
        str     s0, [x0, #:lo12:.LANCHOR0]
        ret
        .set    .LANCHOR0,. + 0
g:
        .zero   4

The fmov is not available without +fp16 and the assembler would complain.

Reply via email to