This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][binutils][Arm] Float16: Fix test failures for non ELF targets.


Hello,

This patch fixes test failures for non ELF targets caused by
https://sourceware.org/ml/binutils/2019-08/msg00080.html.

The tests were failing due to md_atof trying to do word-wise endian
switching on the float16 (for little-endian targets sometimes
multi word values have their word order changed).
However since a float16 is only 1 word wide, it would end up writing
incorrect data, as you cannot switch the word order of just one word.

Fixed this by introducing a check (for little-endian targets) for if the
float has a precision of 1 (aka 1 word or 2 bytes in size) then just
emit the value in normal little-endian order and don't try to do the
word wise switching that applies for multi word values.

Cross compiled and regtested on arm-none-eabi, arm-none-linux-gnueabihf,
arm-wince-pe, arm-pe and arm-nto.

Regards,
Barney

gas/ChangeLog:

2019-08-15  Barnaby Wilks  <barnaby.wilks@arm.com>

	* config/tc-arm.c (md_atof): Add precision check.



Attachment: arm-float16-regressions-fix.txt
Description: arm-float16-regressions-fix.txt


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]