aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorTamar Christina <tamar.christina@arm.com>2017-10-05 11:38:06 +0000
committerTamar Christina <tnfchris@gcc.gnu.org>2017-10-05 11:38:06 +0000
commit9eabdc5e16a1fe10028244f779cde7b01bca7629 (patch)
treed4c60f606aae9447922f7d1e32aa6ad2e7f327f7 /gcc/config
parentbf4df9e6b488c9f1a27652dfa2b60f85a2376fdc (diff)
downloadgcc-9eabdc5e16a1fe10028244f779cde7b01bca7629.zip
gcc-9eabdc5e16a1fe10028244f779cde7b01bca7629.tar.gz
gcc-9eabdc5e16a1fe10028244f779cde7b01bca7629.tar.bz2
arm.c (arm_test_fpu_data): New.
2017-10-05 Tamar Christina <tamar.christina@arm.com> * config/arm/arm.c (arm_test_fpu_data): New. (arm_run_selftests): Call arm_test_fpu_data. From-SVN: r253443
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/arm/arm.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 4cddf3b..bece1f7 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -31393,10 +31393,43 @@ arm_test_cpu_arch_data (void)
}
}
+/* Scan the static data tables generated by parsecpu.awk looking for
+ potential issues with the data. Here we check for consistency between the
+ fpu bits, in particular we check that ISA_ALL_FPU_INTERNAL does not contain
+ a feature bit that is not defined by any FPU flag. */
+static void
+arm_test_fpu_data (void)
+{
+ auto_sbitmap isa_all_fpubits (isa_num_bits);
+ auto_sbitmap fpubits (isa_num_bits);
+ auto_sbitmap tmpset (isa_num_bits);
+
+ static const enum isa_feature fpu_bitlist[]
+ = { ISA_ALL_FPU_INTERNAL, isa_nobit };
+ arm_initialize_isa (isa_all_fpubits, fpu_bitlist);
+
+ for (unsigned int i = 0; i < TARGET_FPU_auto; i++)
+ {
+ arm_initialize_isa (fpubits, all_fpus[i].isa_bits);
+ bitmap_and_compl (tmpset, isa_all_fpubits, fpubits);
+ bitmap_clear (isa_all_fpubits);
+ bitmap_copy (isa_all_fpubits, tmpset);
+ }
+
+ if (!bitmap_empty_p (isa_all_fpubits))
+ {
+ fprintf (stderr, "Error: found feature bits in the ALL_FPU_INTERAL"
+ " group that are not defined by any FPU.\n"
+ " Check your arm-cpus.in.\n");
+ ASSERT_TRUE (bitmap_empty_p (isa_all_fpubits));
+ }
+}
+
static void
arm_run_selftests (void)
{
arm_test_cpu_arch_data ();
+ arm_test_fpu_data ();
}
} /* Namespace selftest. */