* [committed][nvptx] Add march alias for misa
@ 2022-03-29 10:58 Tom de Vries
0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2022-03-29 10:58 UTC (permalink / raw)
To: gcc-patches
Hi,
The target option misa has the following description:
...
$ gcc --target-help 2>&1 | grep misa
-misa= Specify the PTX ISA target architecture to use.
...
The name misa is somewhat poorly chosen. It suggests that for a use
-misa=sm_30, sm_30 is the name of a specific Instruction Set Architecture.
Instead, sm_30 is the name of a specific target architecture in the generic
PTX Instruction Set Architecture.
Futhermore, there's mptx, which also has ISA in the description:
...
-mptx= Specify the PTX ISA version to use.
...
Add the more intuitive alias march for misa:
...
$ gcc --target-help 2>&1 | grep march
-march= Alias: Same as -misa=.
...
Tested on nvptx.
Committed to trunk.
Thanks,
- Tom
[nvptx] Add march alias for misa
gcc/ChangeLog:
2022-03-29 Tom de Vries <tdevries@suse.de>
* config/nvptx/nvptx.opt (march): Add alias of misa.
gcc/testsuite/ChangeLog:
2022-03-29 Tom de Vries <tdevries@suse.de>
* gcc.target/nvptx/main.c: New test.
* gcc.target/nvptx/march.c: New test.
---
gcc/config/nvptx/nvptx.opt | 4 ++++
gcc/testsuite/gcc.target/nvptx/main.c | 7 +++++++
gcc/testsuite/gcc.target/nvptx/march.c | 5 +++++
3 files changed, 16 insertions(+)
diff --git a/gcc/config/nvptx/nvptx.opt b/gcc/config/nvptx/nvptx.opt
index 1f684ed8860..b5d0170e9e9 100644
--- a/gcc/config/nvptx/nvptx.opt
+++ b/gcc/config/nvptx/nvptx.opt
@@ -56,6 +56,10 @@ misa=
Target RejectNegative ToLower Joined Enum(ptx_isa) Var(ptx_isa_option) Init(PTX_ISA_SM30)
Specify the PTX ISA target architecture to use.
+march=
+Target RejectNegative Joined Alias(misa=)
+Alias:
+
Enum
Name(ptx_version) Type(int)
Known PTX ISA versions (for use with the -mptx= option):
diff --git a/gcc/testsuite/gcc.target/nvptx/main.c b/gcc/testsuite/gcc.target/nvptx/main.c
new file mode 100644
index 00000000000..3af2b575842
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/main.c
@@ -0,0 +1,7 @@
+/* { dg-do link } */
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/nvptx/march.c b/gcc/testsuite/gcc.target/nvptx/march.c
new file mode 100644
index 00000000000..ec91f21c903
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/march.c
@@ -0,0 +1,5 @@
+/* { dg-options "-march=sm_30"} */
+
+#include "main.c"
+
+/* { dg-final { scan-assembler-times "\\.target\tsm_30" 1 } } */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-29 10:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-29 10:58 [committed][nvptx] Add march alias for misa Tom de Vries
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).