aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2021-08-11 08:35:18 +0200
committerJan Beulich <jbeulich@suse.com>2021-08-11 08:35:18 +0200
commit2557e081af9fde5552b1b96df04166d1a2df620c (patch)
tree90fe58536834b9a24cbf6ebe3a6a1b096942d465
parentbcd17d4f518dcd9ffa8b2217f3e215df331bfb1b (diff)
downloadfsf-binutils-gdb-2557e081af9fde5552b1b96df04166d1a2df620c.zip
fsf-binutils-gdb-2557e081af9fde5552b1b96df04166d1a2df620c.tar.gz
fsf-binutils-gdb-2557e081af9fde5552b1b96df04166d1a2df620c.tar.bz2
Arm32: leave more .bfloat16 processing to common code
With x86 support having been implemented by extending atof-ieee.c, avoid unnecessary code duplication in md_atof(). This will then also allow to take advantage of adjustments made there without needing to mirror them here.
-rw-r--r--gas/config/tc-arm.c49
1 files changed, 3 insertions, 46 deletions
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index c9e6558..21a2e2d 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -1247,55 +1247,12 @@ md_atof (int type, char * litP, int * sizeP)
{
case 'H':
case 'h':
+ /* bfloat16, despite not being part of the IEEE specification, can also
+ be handled by atof_ieee(). */
+ case 'b':
prec = 1;
break;
- /* If this is a bfloat16, then parse it slightly differently, as it
- does not follow the IEEE specification for floating point numbers
- exactly. */
- case 'b':
- {
- FLONUM_TYPE generic_float;
-
- t = atof_ieee_detail (input_line_pointer, 1, 8, words, &generic_float);
-
- if (t)
- input_line_pointer = t;
- else
- return _("invalid floating point number");
-
- switch (generic_float.sign)
- {
- /* Is +Inf. */
- case 'P':
- words[0] = 0x7f80;
- break;
-
- /* Is -Inf. */
- case 'N':
- words[0] = 0xff80;
- break;
-
- /* Is NaN. */
- /* bfloat16 has two types of NaN - quiet and signalling.
- Quiet NaN has bit[6] == 1 && faction != 0, whereas
- signalling NaN's have bit[0] == 0 && fraction != 0.
- Chosen this specific encoding as it is the same form
- as used by other IEEE 754 encodings in GAS. */
- case 0:
- words[0] = 0x7fff;
- break;
-
- default:
- break;
- }
-
- *sizeP = 2;
-
- md_number_to_chars (litP, (valueT) words[0], sizeof (LITTLENUM_TYPE));
-
- return NULL;
- }
case 'f':
case 'F':
case 's':