Commit b8f39a8
Fix FIPS delocator handling of floating-point immediates on aarch63 (#3029)
Addresses #3028
When GCC 15 compiles the FIPS module at `-O3` on aarch64, it emits
`fmov` instructions with floating-point immediates (e.g. `fmov v8.4s,
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.
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.
- 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.
(cherry picked from commit 7b2a86c)1 parent e732603 commit b8f39a8
5 files changed
Lines changed: 1788 additions & 1650 deletions
File tree
- util/fipstools/delocate
- testdata/aarch64-Basic
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
553 | 553 | | |
554 | 554 | | |
555 | 555 | | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
556 | 564 | | |
557 | 565 | | |
558 | 566 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| |||
0 commit comments