Skip to content

Commit

Permalink
[nvptx] Improve help description of misa and mptx
Browse files Browse the repository at this point in the history
Currently we have:
...
$ gcc --target-help 2>&1 | egrep "misa|mptx"
  -misa=                      Specify the version of the ptx ISA to use.
  -mptx=                      Specify the version of the ptx version to use.
  Known PTX ISA versions (for use with the -misa= option):
  Known PTX versions (for use with the -mptx= option):
...

As reported in PR104818, the "version of the ptx version" doesn't make much
sense.

Furthermore, the description of misa (and 'Known ISA versions') is misleading
because it does not specify the version of the PTX ISA, but rather the PTX ISA
target architecture.

Fix this by printing instead:
...
$ gcc --target-help 2>&1 | egrep "misa|mptx"
  -misa=                      Specify the PTX ISA target architecture to use.
  -mptx=                      Specify the PTX ISA version to use.
  Known PTX ISA target architectures (for use with the -misa= option):
  Known PTX ISA versions (for use with the -mptx= option):
...

Tested on nvptx.

gcc/ChangeLog:

2022-03-28  Tom de Vries  <[email protected]>

	PR target/104818
	* config/nvptx/gen-opt.sh (ptx_isa): Improve help text.
	* config/nvptx/nvptx-gen.opt: Regenerate.
	* config/nvptx/nvptx.opt (misa, mptx, ptx_version): Improve help text.
	* config/nvptx/t-nvptx (s-nvptx-gen-opt): Add missing dependency on
	gen-opt.sh.
  • Loading branch information
vries committed Mar 28, 2022
1 parent fc50d9a commit 0127fb1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gcc/config/nvptx/gen-opt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ echo
cat <<EOF
Enum
Name(ptx_isa) Type(int)
Known PTX ISA versions (for use with the -misa= option):
Known PTX ISA target architectures (for use with the -misa= option):
EOF

# Separator.
Expand Down
2 changes: 1 addition & 1 deletion gcc/config/nvptx/nvptx-gen.opt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

Enum
Name(ptx_isa) Type(int)
Known PTX ISA versions (for use with the -misa= option):
Known PTX ISA target architectures (for use with the -misa= option):

EnumValue
Enum(ptx_isa) String(sm_30) Value(PTX_ISA_SM30)
Expand Down
6 changes: 3 additions & 3 deletions gcc/config/nvptx/nvptx.opt
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ Generate code for OpenMP offloading: enables -msoft-stack and -muniform-simt.
; Default needs to be in sync with default in ASM_SPEC in nvptx.h.
misa=
Target RejectNegative ToLower Joined Enum(ptx_isa) Var(ptx_isa_option) Init(PTX_ISA_SM30)
Specify the version of the ptx ISA to use.
Specify the PTX ISA target architecture to use.

Enum
Name(ptx_version) Type(int)
Known PTX versions (for use with the -mptx= option):
Known PTX ISA versions (for use with the -mptx= option):

EnumValue
Enum(ptx_version) String(3.1) Value(PTX_VERSION_3_1)
Expand All @@ -77,7 +77,7 @@ Enum(ptx_version) String(_) Value(PTX_VERSION_default)

mptx=
Target RejectNegative ToLower Joined Enum(ptx_version) Var(ptx_version_option)
Specify the version of the ptx version to use.
Specify the PTX ISA version to use.

minit-regs=
Target Var(nvptx_init_regs) IntegerRange(0, 3) Joined UInteger Init(3)
Expand Down
3 changes: 2 additions & 1 deletion gcc/config/nvptx/t-nvptx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ s-nvptx-gen-h: $(srcdir)/config/nvptx/nvptx-sm.def
$(STAMP) s-nvptx-gen-h

$(srcdir)/config/nvptx/nvptx-gen.opt: s-nvptx-gen-opt; @true
s-nvptx-gen-opt: $(srcdir)/config/nvptx/nvptx-sm.def
s-nvptx-gen-opt: $(srcdir)/config/nvptx/nvptx-sm.def \
$(srcdir)/config/nvptx/gen-opt.sh
$(SHELL) $(srcdir)/config/nvptx/gen-opt.sh "$(srcdir)/config/nvptx" \
> tmp-nvptx-gen.opt
$(SHELL) $(srcdir)/../move-if-change \
Expand Down

0 comments on commit 0127fb1

Please sign in to comment.