public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, GCC/testsuite/ARM] Add MOVT testing for ARMv8-M Baseline
@ 2017-05-11 15:21 Thomas Preudhomme
  2017-05-22  8:17 ` Thomas Preudhomme
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Preudhomme @ 2017-05-11 15:21 UTC (permalink / raw)
  To: Kyrill Tkachov, Ramana Radhakrishnan, Richard Earnshaw, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 967 bytes --]

Hi,

When ARMv8-M Baseline support was introduced no testcase was added for
support of the MOVT instruction because GCC would always prefer a load
from literal pool. With the recent work to fix -mslow-flash-data by
Andre Simoes Dias Vieira and Prakhar Bahuguna it is now possible to
test that support.

This commit adds a test for MOVT based on the MOVW test by using
-mslow-flash-data to ensure that GCC does not do a literal load of the
immediate. As such, this test is restricted to Cortex-M devices (where
-mslow-flash-data is available) with MOVT instruction.

ChangeLog entry is as follows:

*** gcc/testsuite/ChangeLog ***

2017-05-2017  Thomas Preud'homme  <thomas.preudhomme@arm.com>

	* gcc.target/arm/movsi_movt.c: New test.
	* gcc.target/arm/movdi_movt.c: New test.

Testing: the new tests have been tested to pass for ARMv7-M and
ARMv8-M (Baseline and Mainline) on arm-none-eabi and armeb-none-eabi
targets.

Is this ok for trunk?

Best regards,

Thomas

[-- Attachment #2: add_movt_test.patch --]
[-- Type: text/x-patch, Size: 1312 bytes --]

diff --git a/gcc/testsuite/gcc.target/arm/movdi_movt.c b/gcc/testsuite/gcc.target/arm/movdi_movt.c
new file mode 100644
index 0000000000000000000000000000000000000000..e2a28ccbd994ed0e4d0b9ac432df32138820432c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/movdi_movt.c
@@ -0,0 +1,18 @@
+/* { dg-do compile { target { arm_cortex_m && { arm_thumb2_ok || arm_thumb1_movt_ok } } } } */
+/* { dg-options "-O2 -mslow-flash-data" } */
+
+unsigned long long
+movdi_1 (int a)
+{
+  return 0xF0F00000LLU;
+}
+
+unsigned long long
+movdi_2 (int a)
+{
+  return 0xF0F0000000000000LLU;
+}
+
+/* Accept r1 because big endian targets put the low bits in the highest
+   numbered register of a pair.  */
+/* { dg-final { scan-assembler-times "movt\tr\[01\], 61680" 2 } } */
diff --git a/gcc/testsuite/gcc.target/arm/movsi_movt.c b/gcc/testsuite/gcc.target/arm/movsi_movt.c
new file mode 100644
index 0000000000000000000000000000000000000000..3cf46e2fd172ee1728b7b50c1cead90924962dca
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/movsi_movt.c
@@ -0,0 +1,10 @@
+/* { dg-do compile { target { arm_cortex_m && { arm_thumb2_ok || arm_thumb1_movt_ok } } } } */
+/* { dg-options "-O2 -mslow-flash-data" } */
+
+unsigned
+movsi (void)
+{
+  return 0xF0F00000U;
+}
+
+/* { dg-final { scan-assembler-times "movt\tr0, 61680" 1 } } */

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-22  8:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-11 15:21 [PATCH, GCC/testsuite/ARM] Add MOVT testing for ARMv8-M Baseline Thomas Preudhomme
2017-05-22  8:17 ` Thomas Preudhomme
2017-05-22  9:24   ` Kyrill Tkachov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).