/* Chars that mean this number is a floating point constant.
As in 0f12.456 or 0d1.2345e12. */
-const char FLT_CHARS[] = "rRsSfFdDxXpP";
+const char FLT_CHARS[] = "rRsSfFdDxXpPhH";
/* Indicate we are already assemble any instructions or not. */
static bool start_assemble = false;
{"sleb128", s_riscv_leb128, 1},
{"insn", s_riscv_insn, 0},
{"attribute", s_riscv_attribute, 0},
+ {"float16", float_cons, 'h'},
{ NULL, NULL, 0 },
};
run_dump_tests "vector-insns-fail-permutation"
run_dump_tests "vector-insns-fail-zvamo"
run_dump_tests "fp-zfh-insns"
+ run_dump_tests "float16"
run_dump_tests "extended-csr"
}
--- /dev/null
+# source: float16.s
+# objdump: -sj .data
+# as:
+
+.*:[ ]+file format .*
+
+Contents of section \.data:
+ 0000 004adf2f 191cff7b 0100ff03 0004003c.*
+ 0010 013cff7f 007c00fc 00000080 00bce7bb.*
+ 0020 fffb0042 004a3e60 007e017e.*
--- /dev/null
+.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
+ .float16 0h:7e00 # qNaNh
+ .float16 0h:7e01 # sNaNh