aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorBarnaby Wilks <barnaby.wilks@arm.com>2019-08-22 11:13:23 +0100
committerNick Clifton <nickc@redhat.com>2019-08-22 11:13:23 +0100
commitb20d385926d84f7daa8cd7c54f748f3d6a81bfc6 (patch)
treeb1c5502cd2b83ecc951d43912a012fbca3aa1276 /gas/testsuite
parenta051e2f3e0c1cedf4be0e1fedcd383fd203c769c (diff)
downloadgdb-b20d385926d84f7daa8cd7c54f748f3d6a81bfc6.zip
gdb-b20d385926d84f7daa8cd7c54f748f3d6a81bfc6.tar.gz
gdb-b20d385926d84f7daa8cd7c54f748f3d6a81bfc6.tar.bz2
Implement a float16 directive for assembling 16 bit IEEE 754 floating point numbers for the AArch64 assembler.
The syntax of the directive is: .float16 <0-n decimal numbers> e.g. .float16 0.5 .float16 10.2, NaN, 452.09 The floats will always be encoded using the binary16 format as described in the IEEE 754-2008 standard. There is no need to support Arm's alternative half-precision format since AArch64 only supports the IEEE format. gas * config/tc-aarch64.c: Add float16 directive and add "Hh" to acceptable float characters. * doc/c-aarch64.texi: Documentation for float16 directive. * testsuite/gas/aarch64/float16-be.d: New test. * testsuite/gas/aarch64/float16-le.d: New test. * testsuite/gas/aarch64/float16.s: New test. * NEWS: Add NEWS entry.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/aarch64/float16-be.d11
-rw-r--r--gas/testsuite/gas/aarch64/float16-le.d11
-rw-r--r--gas/testsuite/gas/aarch64/float16.s19
3 files changed, 41 insertions, 0 deletions
diff --git a/gas/testsuite/gas/aarch64/float16-be.d b/gas/testsuite/gas/aarch64/float16-be.d
new file mode 100644
index 0000000..f47962f
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/float16-be.d
@@ -0,0 +1,11 @@
+# name: Big endian float16 literals (IEEE 754 format)
+# source: float16.s
+# objdump: -s --section=.data
+# as: -mbig-endian
+
+.*: +file format .*
+
+Contents of section \.data:
+ 0000 4a002fdf 1c197bff 000103ff 04003c00.*
+ 0010 3c017fff 7c00fc00 00008000 bc00bbe7.*
+ 0020 fbff4200 4a00603e.*
diff --git a/gas/testsuite/gas/aarch64/float16-le.d b/gas/testsuite/gas/aarch64/float16-le.d
new file mode 100644
index 0000000..873d967
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/float16-le.d
@@ -0,0 +1,11 @@
+# name: Little endian float16 literals (IEEE 754 format)
+# source: float16.s
+# objdump: -s --section=.data
+# as: -mlittle-endian
+
+.*: +file format .*
+
+Contents of section \.data:
+ 0000 004adf2f 191cff7b 0100ff03 0004003c.*
+ 0010 013cff7f 007c00fc 00000080 00bce7bb.*
+ 0020 fffb0042 004a3e60.*
diff --git a/gas/testsuite/gas/aarch64/float16.s b/gas/testsuite/gas/aarch64/float16.s
new file mode 100644
index 0000000..d2cf6b5
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/float16.s
@@ -0,0 +1,19 @@
+.data
+ .float16 12.0
+ .float16 0.123
+ .float16 0.004
+ .float16 65504
+ .float16 5.9605e-8
+ .float16 6.0976e-5
+ .float16 6.1035e-5
+ .float16 1
+ .float16 1.001
+ .float16 NaN
+ .float16 +Inf
+ .float16 -Inf
+ .float16 +0
+ .float16 -0
+ .float16 -1
+ .float16 -0.98765
+ .float16 -65504
+ .float16 3.0, 12.0, 543.123