diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index 000a81c64f8e95eef920fe447358f99bb68b84f9..fa25dce0730794d8d7af41f6d26e854c8210b504 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -529,7 +529,7 @@ const char EXP_CHARS[] = "eE"; /* As in 0f12.456 */ /* or 0d1.2345e12 */ -const char FLT_CHARS[] = "rRsSfFdDxXeEpP"; +const char FLT_CHARS[] = "rRsSfFdDxXeEpPhH"; /* Prefix character that indicates the start of an immediate value. */ #define is_immediate_prefix(C) ((C) == '#') @@ -2106,6 +2106,7 @@ const pseudo_typeS md_pseudo_table[] = { {"dword", s_aarch64_elf_cons, 8}, {"variant_pcs", s_variant_pcs, 0}, #endif + {"float16", float_cons, 'h'}, {0, 0, 0} }; diff --git a/gas/testsuite/gas/aarch64/float16-be.d b/gas/testsuite/gas/aarch64/float16-be.d new file mode 100644 index 0000000000000000000000000000000000000000..0dfc66b0d1234384f6a3c135acd20cd7f6d8e397 --- /dev/null +++ b/gas/testsuite/gas/aarch64/float16-be.d @@ -0,0 +1,11 @@ +# name: Big endian float16 literals (IEEE 754 format) +# source: float16-be.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-be.s b/gas/testsuite/gas/aarch64/float16-be.s new file mode 100644 index 0000000000000000000000000000000000000000..d2cf6b51a6367ed3e87456d1544bb291c9cdce49 --- /dev/null +++ b/gas/testsuite/gas/aarch64/float16-be.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 diff --git a/gas/testsuite/gas/aarch64/float16-le.d b/gas/testsuite/gas/aarch64/float16-le.d new file mode 100644 index 0000000000000000000000000000000000000000..64d02f736f0da56086f22326b21c83418bd68dcb --- /dev/null +++ b/gas/testsuite/gas/aarch64/float16-le.d @@ -0,0 +1,11 @@ +# name: Little endian float16 literals (IEEE 754 format) +# source: float16-le.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-le.s b/gas/testsuite/gas/aarch64/float16-le.s new file mode 100644 index 0000000000000000000000000000000000000000..d2cf6b51a6367ed3e87456d1544bb291c9cdce49 --- /dev/null +++ b/gas/testsuite/gas/aarch64/float16-le.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