This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH][binutils][Arm] Float16: Fix test failures for non ELF targets.
- From: Barnaby Wilks <Barnaby dot Wilks at arm dot com>
- To: Alan Modra <amodra at gmail dot com>, "nickc at redhat dot com" <nickc at redhat dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>
- Cc: nd <nd at arm dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, Ramana Radhakrishnan <Ramana dot Radhakrishnan at arm dot com>
- Date: Thu, 15 Aug 2019 16:21:59 +0000
- Subject: [PATCH][binutils][Arm] Float16: Fix test failures for non ELF targets.
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+8LkISnxayfEr/x6evulmBDvcK7fILeIv6aDneUFcFI=; b=BIK7Kow6d4XT3scTMzDpeTOirFZ8z9mABVAc7g17h4UpudSST1X0nnfMbCHDnpljS/AtUSPpvtXZcyZtKxwA3y8Cew/o1tcJhxGTozTuAs7pKNXSc0hY8CYdqYySN+stx7u1Nv8fu3yndHhMDkLyT6a1NAWL+TkTICBNDUjJd2+78xrrYvdOxKLesKzg0QrmjzdSDukiJqzGBAKK9WraWZItVy5PN1/knH2LqjhBmDOVhrEhk2PawDJ0c2Ji9wBQe+RcRkAqRXpM5eKwe7/4oKywM450oBwyT8Jw8Id0OpQHKbzef3HbdCpZNpLu/re1pr0HH99ueP/Z4ACLa9cNMA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ap4HjEIyftzOLwLWr8zPwdZ16pgp9az4QKTka9oBi4fCBFSathAkSvrvqrnX77qH0pWjwpHxJpZDQftF0wsTB9PW/C27BxglfM1spQb7h7hQrv5Wu266nVTs4gRazegDpb2W7ARPvfEejlc1Us6+MWFq5yup7/0JcQKJnMlZ749ZIQWBWtATlMBJf+7L0luJnF5GJk1pS4qN7DLXYZu1WP0vZIJfb/y+hd0SZjP7tISKOmHBi7+TqPgUFxEMNl8Jf0y8usQjxqYjwhggC4Q9r8c2RY/25NetIexFiv2oRRI8Zc0LNt/3hH4BALRvO/SCiGkRyQr7itImk3HaqC7Ctw==
- Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Barnaby dot Wilks at arm dot com;
- References: <bf60fccd-0268-43e9-5cea-343649acb733@arm.com> <853c8195-148e-9c21-7a5a-59b8cdaeeafc@arm.com> <3f3060a9-3fcc-4c9f-7211-aa72a8fa02fb@arm.com> <bd4ef2cf-2d22-929c-fe19-7332154d8d1e@redhat.com> <9c27e3fa-2b9b-fb1d-c319-8e90440616e6@arm.com> <0234fbd4-f130-ee6b-801d-4204bce24cfd@redhat.com> <20190814044952.GE1969@bubble.grove.modra.org>
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