"VLDR S0,=1.0" rejected, but accepts "VLDR S0,=1" and generates bad code.

Bug #1695572 reported by Dan Lewis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Arm Embedded Toolchain
New
Undecided
Unassigned

Bug Description

The pseudo-instruction (identified as a pseudo-instruction by the equals sign)

    VLDR S0,=constant

should be replaced by one of:

    VMOV S0,#constant // "#" may be omitted using directive, ".syntax unified"

or:

    VLDR S0,label
    ...
label: .float constant

However, it only "seems" to work when the constant is an integer. The assembler rejects "VLDR S0,=1.0" with the error message:

    "Error: garbage following instruction -- 'vldr S0,=1.0'

but happily accepts "VLDR S0,=1" (Note: It also happily accepts "VLDR S0,=label", where "label" is the label on a .float directive, and is apparently loading the address of the label into S0!) However the latter does NOT load the floating-point representation of 1.0 (0x3F800000) into S0. It loads the integer representation of 1 (0x00000001) into S0.

This is using the 8-2018-q4-update of GNU ARM Embedded Toolchain.

Dan Lewis (danielwlewis)
description: updated
description: updated
Dan Lewis (danielwlewis)
description: updated
summary: - VLDR pseudo instruction only works with integer constants
+ VLDR pseudo instruction accepts integers but generates incorrect code;
+ does NOT accept f.p. constants.
summary: - VLDR pseudo instruction accepts integers but generates incorrect code;
- does NOT accept f.p. constants.
+ "VLDR S0,=1.0" rejected, but "VLDR S0,=1" accepted but generates
+ incorrect code.
summary: - "VLDR S0,=1.0" rejected, but "VLDR S0,=1" accepted but generates
- incorrect code.
+ "VLDR S0,=1.0" rejected, but "VLDR S0,=1" accepted but generates bad
+ code.
Dan Lewis (danielwlewis)
summary: - "VLDR S0,=1.0" rejected, but "VLDR S0,=1" accepted but generates bad
+ "VLDR S0,=1.0" rejected, but "VLDR S0,=1" accepted and generates bad
code.
summary: - "VLDR S0,=1.0" rejected, but "VLDR S0,=1" accepted and generates bad
+ "VLDR S0,=1.0" rejected, but accepts "VLDR S0,=1" and generates bad
code.
description: updated
Dan Lewis (danielwlewis)
description: updated
Dan Lewis (danielwlewis)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.