aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2021-02-03 14:32:04 +0100
committerMartin Liska <mliska@suse.cz>2021-02-04 10:42:10 +0100
commit5eb792e7a12ad214e5295e3f664637078936213f (patch)
tree78c3047316c7d190ca468025fd9a94982f5a5b9b
parent787f3ebf00d4e1f741ea03b6ddea9cf07a6f94ac (diff)
downloadgcc-5eb792e7a12ad214e5295e3f664637078936213f.zip
gcc-5eb792e7a12ad214e5295e3f664637078936213f.tar.gz
gcc-5eb792e7a12ad214e5295e3f664637078936213f.tar.bz2
doc: mention -mprefer-vector-width in target attrs
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.
-rw-r--r--gcc/doc/extend.texi22
-rw-r--r--gcc/testsuite/gcc.target/i386/prefer-vector-width-attr.c11
2 files changed, 33 insertions, 0 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 8daa1c6..2cfd8cd 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 informs the
+compiler to use @var{OPT}-bit vector width in instructions
+instead of the 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 0000000..3929f90
--- /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;
+}