public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Tom de Vries <vries@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-7891] [nvptx] Add march-map Date: Tue, 29 Mar 2022 12:02:27 +0000 (GMT) [thread overview] Message-ID: <20220329120227.9B00B3858C50@sourceware.org> (raw) https://gcc.gnu.org/g:de0ef04419e90eacf0d1ddb265552a1b08c18d4b commit r12-7891-gde0ef04419e90eacf0d1ddb265552a1b08c18d4b Author: Tom de Vries <tdevries@suse.de> Date: Tue Mar 29 10:32:13 2022 +0200 [nvptx] Add march-map Say we have an sm_50 board, and we want to run a benchmark using the highest possible march setting. Currently there's march=sm_30, march=sm_35, march=sm_53, but no march=sm_50. So, we'd need to pick march=sm_35. Likewise, for a test script that handles multiple boards, we'd need a mapping from native board sm_xx to march, which might have to be updated with newer gcc releases. Add an option march-map, such that we can just specify march-map=sm_50, and let the compiler map this to the appropriate march. The option is implemented as a list of aliases, such that we have a somewhat lengthy (17 lines in total): ... $ gcc --help=target ... -march-map=sm_30 Same as -misa=sm_30. -march-map=sm_32 Same as -misa=sm_30. ... -march-map=sm_87 Same as -misa=sm_80. -march-map=sm_90 Same as -misa=sm_80. ... This implementation was chosen in the hope that it'll be easier if we end up with some misa multilib. It would be nice to have the mapping list generated from an updated nvptx-sm.def, but for now it's spelled out in nvptx.opt. Tested on nvptx. gcc/ChangeLog: 2022-03-29 Tom de Vries <tdevries@suse.de> PR target/104714 * config/nvptx/nvptx.opt (march-map=*): Add aliases. gcc/testsuite/ChangeLog: 2022-03-29 Tom de Vries <tdevries@suse.de> PR target/104714 * gcc.target/nvptx/march-map.c: New test. Diff: --- gcc/config/nvptx/nvptx.opt | 51 ++++++++++++++++++++++++++++++ gcc/testsuite/gcc.target/nvptx/march-map.c | 5 +++ 2 files changed, 56 insertions(+) diff --git a/gcc/config/nvptx/nvptx.opt b/gcc/config/nvptx/nvptx.opt index b5d0170e9e9..58eddeeabf4 100644 --- a/gcc/config/nvptx/nvptx.opt +++ b/gcc/config/nvptx/nvptx.opt @@ -60,6 +60,57 @@ march= Target RejectNegative Joined Alias(misa=) Alias: +march-map=sm_30 +Target RejectNegative Alias(misa=,sm_30) + +march-map=sm_32 +Target RejectNegative Alias(misa=,sm_30) + +march-map=sm_35 +Target RejectNegative Alias(misa=,sm_35) + +march-map=sm_37 +Target RejectNegative Alias(misa=,sm_35) + +march-map=sm_50 +Target RejectNegative Alias(misa=,sm_35) + +march-map=sm_52 +Target RejectNegative Alias(misa=,sm_35) + +march-map=sm_53 +Target RejectNegative Alias(misa=,sm_53) + +march-map=sm_60 +Target RejectNegative Alias(misa=,sm_53) + +march-map=sm_61 +Target RejectNegative Alias(misa=,sm_53) + +march-map=sm_62 +Target RejectNegative Alias(misa=,sm_53) + +march-map=sm_70 +Target RejectNegative Alias(misa=,sm_70) + +march-map=sm_72 +Target RejectNegative Alias(misa=,sm_70) + +march-map=sm_75 +Target RejectNegative Alias(misa=,sm_75) + +march-map=sm_80 +Target RejectNegative Alias(misa=,sm_80) + +march-map=sm_86 +Target RejectNegative Alias(misa=,sm_80) + +march-map=sm_87 +Target RejectNegative Alias(misa=,sm_80) + +march-map=sm_90 +Target RejectNegative Alias(misa=,sm_80) + Enum Name(ptx_version) Type(int) Known PTX ISA versions (for use with the -mptx= option): diff --git a/gcc/testsuite/gcc.target/nvptx/march-map.c b/gcc/testsuite/gcc.target/nvptx/march-map.c new file mode 100644 index 00000000000..00838e55fc0 --- /dev/null +++ b/gcc/testsuite/gcc.target/nvptx/march-map.c @@ -0,0 +1,5 @@ +/* { dg-options "-march-map=sm_50" } */ + +#include "main.c" + +/* { dg-final { scan-assembler-times "\\.target\tsm_35" 1 } } */
reply other threads:[~2022-03-29 12:02 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220329120227.9B00B3858C50@sourceware.org \ --to=vries@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).