diff mbox series

doc: mention -mprefer-vector-width in target attrs

Message ID e2947ed2-5f8b-5bac-13bf-95addbbd9633@suse.cz
State New
Headers show
Series doc: mention -mprefer-vector-width in target attrs | expand

Commit Message

Martin Liška Feb. 3, 2021, 3:15 p.m. UTC
The patch documents -mprefer-vector-width which is a valid target attribute/pragma.

Ready for master?
Thanks,
Martin

gcc/ChangeLog:

	* doc/extend.texi: Mention -mprefer-vector-width in target
	attributes.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/prefer-vector-width-attr.c: New test.
---
  gcc/doc/extend.texi                           | 22 +++++++++++++++++++
  .../i386/prefer-vector-width-attr.c           | 11 ++++++++++
  2 files changed, 33 insertions(+)
  create mode 100644 gcc/testsuite/gcc.target/i386/prefer-vector-width-attr.c

Comments

Marek Polacek Feb. 3, 2021, 3:34 p.m. UTC | #1
On Wed, Feb 03, 2021 at 04:15:24PM +0100, Martin Liška wrote:
> The patch documents -mprefer-vector-width which is a valid target attribute/pragma.

> diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
> index 8daa1c67974..a14875cec37 100644
> --- a/gcc/doc/extend.texi
> +++ b/gcc/doc/extend.texi
> @@ -7020,6 +7020,28 @@ On x86 targets, the @code{fentry_section} attribute sets the name
>  of the section to record function entry instrumentation calls in when
>  enabled with @option{-pg -mrecord-mcount}
> +@item prefer-vector-width=@var{OPT}
> +@cindex @code{prefer-vector-width} function attribute, x86
> +On x86 targets, the @code{prefer-vector-width} attribute inform the

"informs"

> +compiler to use @var{OPT}-bit vector width in instructions
> +instead of default on the selected platform.

"the default"

Marek
Jeff Law Feb. 3, 2021, 9:17 p.m. UTC | #2
On 2/3/21 8:15 AM, Martin Liška wrote:
> The patch documents -mprefer-vector-width which is a valid target
> attribute/pragma.
>
> Ready for master?
> Thanks,
> Martin
>
> gcc/ChangeLog:
>
>     * doc/extend.texi: Mention -mprefer-vector-width in target
>     attributes.
>
> gcc/testsuite/ChangeLog:
>
>     * gcc.target/i386/prefer-vector-width-attr.c: New test.
OK
jeff
Martin Liška Feb. 4, 2021, 9:42 a.m. UTC | #3
On 2/3/21 4:34 PM, Marek Polacek wrote:
> On Wed, Feb 03, 2021 at 04:15:24PM +0100, Martin Liška wrote:
>> The patch documents -mprefer-vector-width which is a valid target attribute/pragma.
> 
>> diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
>> index 8daa1c67974..a14875cec37 100644
>> --- a/gcc/doc/extend.texi
>> +++ b/gcc/doc/extend.texi
>> @@ -7020,6 +7020,28 @@ On x86 targets, the @code{fentry_section} attribute sets the name
>>   of the section to record function entry instrumentation calls in when
>>   enabled with @option{-pg -mrecord-mcount}
>> +@item prefer-vector-width=@var{OPT}
>> +@cindex @code{prefer-vector-width} function attribute, x86
>> +On x86 targets, the @code{prefer-vector-width} attribute inform the
> 
> "informs"
> 
>> +compiler to use @var{OPT}-bit vector width in instructions
>> +instead of default on the selected platform.
> 
> "the default"
> 
> Marek
> 

Thanks Marek for the review.

Installed to master.
Martin
diff mbox series

Patch

diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 8daa1c67974..a14875cec37 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -7020,6 +7020,28 @@  On x86 targets, the @code{fentry_section} attribute sets the name
  of the section to record function entry instrumentation calls in when
  enabled with @option{-pg -mrecord-mcount}
  
+@item prefer-vector-width=@var{OPT}
+@cindex @code{prefer-vector-width} function attribute, x86
+On x86 targets, the @code{prefer-vector-width} attribute inform the
+compiler to use @var{OPT}-bit vector width in instructions
+instead of default on the selected platform.
+
+Valid @var{OPT} values are:
+
+@table @samp
+@item none
+No extra limitations applied to GCC other than defined by the selected platform.
+
+@item 128
+Prefer 128-bit vector width for instructions.
+
+@item 256
+Prefer 256-bit vector width for instructions.
+
+@item 512
+Prefer 512-bit vector width for instructions.
+@end table
+
  @end table
  
  On the x86, the inliner does not inline a
diff --git a/gcc/testsuite/gcc.target/i386/prefer-vector-width-attr.c b/gcc/testsuite/gcc.target/i386/prefer-vector-width-attr.c
new file mode 100644
index 00000000000..3929f909a44
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/prefer-vector-width-attr.c
@@ -0,0 +1,11 @@ 
+/* { dg-do compile } */
+
+#pragma GCC push_options
+#pragma GCC target("prefer-vector-width=512")
+
+int
+__attribute__((target("prefer-vector-width=none")))
+main()
+{
+  return 0;
+}