Skip to content

Fix FIPS delocator handling of floating-point immediates on aarch64#3029

Merged
justsmth merged 1 commit intoaws:mainfrom
justsmth:issue-3028
Feb 24, 2026
Merged

Fix FIPS delocator handling of floating-point immediates on aarch64#3029
justsmth merged 1 commit intoaws:mainfrom
justsmth:issue-3028

Conversation

@justsmth
Copy link
Copy Markdown
Contributor

@justsmth justsmth commented Feb 23, 2026

Issues:

Addresses #3028

Description of changes:

When GCC 15 compiles the FIPS module at -O3 on aarch64, it emits fmov instructions with floating-point immediates (e.g. fmov v8.4s, #2.0e+0). The delocator's PEG grammar only supports integer immediates, so it parses #2.0e+0 as the integer #2 followed by what it thinks is a symbol reference .0e. This gets turned into a redirector (.Lbcm_redirector_.0e), producing invalid assembly.

This change fixes the issue in two ways:

  • Grammar fix: Adds a floating-point immediate alternative to the RegisterOrConstant rule in delocate.peg, so values like #2.0e+0 are parsed as a single token.
  • Pass-through: Adds fmov to the special-case instruction list in processAarch64Instruction(). Since fmov only operates on registers and immediates (never memory), it never needs delocating and can safely be written through unchanged.

The GCC 15 + FIPS exclusion in arm-gcc-tests CI is also removed now that the underlying issue is resolved.

Call-outs:

The delocate.peg.go file is regenerated from the grammar using the peg tool. The grammar change is the one line in delocate.peg; the rest of that file is mechanical.

Testing:

  • Added 6 test cases to testdata/aarch64-Basic/in.s covering float immediates with exponent notation, simple decimals, negative values, fractional values, scalar forms, and register-to-register fmov.
  • All 19 existing delocator tests continue to pass.
  • Re-enabled the arm-gcc-tests CI matrix entry for GCC 15 + FIPS on arm64 which will validate the end-to-end build.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.34%. Comparing base (0628190) to head (95eacde).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3029      +/-   ##
==========================================
- Coverage   78.35%   78.34%   -0.02%     
==========================================
  Files         689      689              
  Lines      121010   121010              
  Branches    16992    16990       -2     
==========================================
- Hits        94813    94800      -13     
- Misses      25302    25314      +12     
- Partials      895      896       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@justsmth justsmth requested a review from nebeid February 24, 2026 11:51
@justsmth justsmth changed the title [DRAFT] Fix FIPS delocator handling of floating-point immediates on aarch64 Fix FIPS delocator handling of floating-point immediates on aarch64 Feb 24, 2026
@justsmth justsmth marked this pull request as ready for review February 24, 2026 11:51
@justsmth justsmth merged commit 7b2a86c into aws:main Feb 24, 2026
592 of 598 checks passed
@justsmth justsmth deleted the issue-3028 branch February 24, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants