https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116507
Bug ID: 116507 Summary: [15 Regression] movhi_aarch64 should use fmov if FP16 Product: gcc Version: 15.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: target Assignee: pinskia at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- Target: aarch64 Take: ``` _Float16 fs(unsigned short a) { return __builtin_bit_cast(_Float16, a); } ``` GCC 14 produced: ``` fmov h0, w0 ret ``` Which is decent. While GCC 15 produces: ``` dup v0.4h, w0 ret ``` This is due to different mode being used in GCC 14 vs 15 for the allocated register. In GCC 14, HF was used while on the trunk, HI is used. Options used: `-O2 -march=armv9-a+fp16` . Note clang produces always: ``` fmov s0, w0 ret ``` But I am not sure if that is correct though. I will be fixing this one ...