@@ -5148,6 +5148,14 @@ set_fp16_format (int dummy ATTRIBUTE_UNUSED)
ignore_rest_of_line ();
}
+static void s_arm_float_cons (int float_type)
+{
+ /* We still parse the directive on error, so that any syntactic issues
+ are picked up. */
+ if (ARM_FEATURE_ZERO (selected_fpu))
+ as_bad (_("the floating-point format has not been set (or has been disabled)"));
+ float_cons (float_type);
+}
/* This table describes all the machine specific pseudo-ops the assembler
has to support. The fields are:
pseudo-op name without dot
@@ -5212,10 +5220,17 @@ const pseudo_typeS md_pseudo_table[] =
{ "loc", dwarf2_directive_loc, 0 },
{ "loc_mark_labels", dwarf2_directive_loc_mark_labels, 0 },
#endif
- { "extend", float_cons, 'x' },
- { "ldouble", float_cons, 'x' },
- { "packed", float_cons, 'p' },
- { "bfloat16", float_cons, 'b' },
+ /* Override the default float_cons handling so that we can validate
+ the FPU setting. */
+ { "float", s_arm_float_cons, 'f' },
+ { "single", s_arm_float_cons, 'f' },
+ { "double", s_arm_float_cons, 'd' },
+ { "dc.s", s_arm_float_cons, 'f' },
+ { "dc.d", s_arm_float_cons, 'd' },
+ { "extend", s_arm_float_cons, 'x' },
+ { "ldouble", s_arm_float_cons, 'x' },
+ { "packed", s_arm_float_cons, 'p' },
+ { "bfloat16", s_arm_float_cons, 'b' },
#ifdef TE_PE
{"secrel32", pe_directive_secrel, 0},
#endif
@@ -5226,7 +5241,7 @@ const pseudo_typeS md_pseudo_table[] =
{"asmfunc", s_ccs_asmfunc, 0},
{"endasmfunc", s_ccs_endasmfunc, 0},
- {"float16", float_cons, 'h' },
+ {"float16", s_arm_float_cons, 'h' },
{"float16_format", set_fp16_format, 0 },
{ 0, 0, 0 }
@@ -47,6 +47,8 @@ if { ![istarget cris-*-*] && ![istarget crisv32-*-*]
&& ![istarget z80-*-*] } then {
if { [istarget tic4x-*-*] } then {
set as_opt ""
+ } elseif { [istarget arm*-*-pe ] } then {
+ set as_opt "--defsym hasnan=1 -mfpu=softvfp"
} else {
set as_opt "--defsym hasnan=1"
}
@@ -1,7 +1,7 @@
# name: Big endian bfloat16 literal directives
# source: bfloat16-directive.s
# objdump: -s --section=.data
-# as: -mbig-endian
+# as: -mbig-endian -mfpu=softvfp
.*: +file format .*
@@ -1,7 +1,7 @@
# name: Little endian bfloat16 literal directives
# source: bfloat16-directive.s
# objdump: -s --section=.data
-# as: -mlittle-endian
+# as: -mlittle-endian -mfpu=softvfp
.*: +file format .*
@@ -1,3 +1,4 @@
# name: Invalid float16 literals (IEEE 754 & Alternative)
# source: float16-bad.s
# error_output: float16-bad.l
+# as: -mfpu=softvfp
@@ -1,7 +1,7 @@
# name: Big endian float16 literals (IEEE 754 & Alternative)
# source: float16.s
# objdump: -s --section=.data
-# as: -mbig-endian
+# as: -mbig-endian -mfpu=softvfp
.*: +file format .*arm.*
@@ -1,4 +1,4 @@
# name: Invalid combination of command line arguments and directives
# source: float16.s
# error_output: float16-format-opt-bad.l
-# as: -mfp16-format=ieee
+# as: -mfpu=softvfp -mfp16-format=ieee
@@ -1,7 +1,7 @@
# name: Little endian float16 literals (IEEE 754 & Alternative)
# source: float16.s
# objdump: -s --section=.data
-# as: -mlittle-endian
+# as: -mlittle-endian -mfpu=softvfp
.*: +file format .*arm.*
new file mode 100644
@@ -0,0 +1,4 @@
+#name: floating-point directives disabled
+#source: fp-directive.s
+#as: -mno-warn-deprecated -mno-fpu
+#error_output: fp-directive-bad.l
\ No newline at end of file
new file mode 100644
@@ -0,0 +1,7 @@
+[^:]*: Assembler messages:
+[^:]*:2: Error: the floating-point format has not been set \(or has been disabled\)
+[^:]*:3: Error: the floating-point format has not been set \(or has been disabled\)
+[^:]*:4: Error: the floating-point format has not been set \(or has been disabled\)
+[^:]*:5: Error: the floating-point format has not been set \(or has been disabled\)
+[^:]*:6: Error: the floating-point format has not been set \(or has been disabled\)
+[^:]*:7: Error: the floating-point format has not been set \(or has been disabled\)
new file mode 100644
@@ -0,0 +1,9 @@
+#name: floating-point directives
+#objdump: -s --section=.data
+#as: -mfpu=softvfp
+
+.*: +file format .*arm.*
+
+Contents of section \.data:
+ 0000 .*
+ 0010 .*
new file mode 100644
@@ -0,0 +1,7 @@
+ .data
+ .float 1.0
+ .double 2.0
+ .single 3.0
+ .dc.s 5.3
+ .dc.d 6
+ .float16 4.0