public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* docs: document early break support and pragma novector
@ 2024-04-16  5:23 Tamar Christina
  2024-04-16  6:59 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Tamar Christina @ 2024-04-16  5:23 UTC (permalink / raw)
  To: gcc-patches, rguenther; +Cc: nd

[-- Attachment #1: Type: text/plain, Size: 2158 bytes --]

docs: document early break support and pragma novector

---
diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html
index b4c602a523717c1d64333e44aefb60ba0ed02e7a..aceecb86f17443cfae637e90987427b98c42f6eb 100644
--- a/htdocs/gcc-14/changes.html
+++ b/htdocs/gcc-14/changes.html
@@ -200,6 +200,34 @@ a work-in-progress.</p>
     for indicating parameters that are expected to be null-terminated
     strings.
   </li>
+  <li>
+    The vectorizer now supports vectorizing loops which contain any number of early breaks.
+    This means loops such as:
+    <pre>
+	int z[100], y[100], x[100];
+	int foo (int n)
+	{
+	  int res = 0;
+	  for (int i = 0; i < n; i++)
+	    {
+	       y[i] = x[i] * 2;
+	       res += x[i] + y[i];
+
+	       if (x[i] > 5)
+		 break;
+
+	       if (z[i] > 5)
+		 break;
+
+	    }
+	  return res;
+	}
+    </pre>
+    can now be vectorized on a number of targets.  In this first version any
+    input data sources must either have a statically known size at compile time
+    or the vectorizer must be able to determine based on auxillary information
+    that the accesses are aligned.
+  </li>
 </ul>
 <!-- .................................................................. -->
 <h2 id="languages">New Languages and Language specific improvements</h2>
@@ -231,6 +259,9 @@ a work-in-progress.</p>
   previous options <code>-std=c2x</code>, <code>-std=gnu2x</code>
   and <code>-Wc11-c2x-compat</code>, which are deprecated but remain
   supported.</li>
+  <li>GCC supports a new pragma <code>&#x23;pragma GCC novector</code> to
+      indicate to the vectorizer not to vectorize the loop annotated with the
+      pragma.</li>
 </ul>
 
 <h3 id="cxx">C++</h3>
@@ -400,6 +431,9 @@ a work-in-progress.</p>
       warnings are enabled for C++ as well</li>
   <li>The DR 2237 code no longer gives an error, it emits
       a <code>-Wtemplate-id-cdtor</code> warning instead</li>
+  <li>GCC supports a new pragma <code>&#x23;pragma GCC novector</code> to
+      indicate to the vectorizer not to vectorize the loop annotated with the
+      pragma.</li>
 </ul>
 
 <h4 id="libstdcxx">Runtime Library (libstdc++)</h4>




-- 

[-- Attachment #2: rb18416.patch --]
[-- Type: text/x-diff, Size: 2093 bytes --]

diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html
index b4c602a523717c1d64333e44aefb60ba0ed02e7a..aceecb86f17443cfae637e90987427b98c42f6eb 100644
--- a/htdocs/gcc-14/changes.html
+++ b/htdocs/gcc-14/changes.html
@@ -200,6 +200,34 @@ a work-in-progress.</p>
     for indicating parameters that are expected to be null-terminated
     strings.
   </li>
+  <li>
+    The vectorizer now supports vectorizing loops which contain any number of early breaks.
+    This means loops such as:
+    <pre>
+	int z[100], y[100], x[100];
+	int foo (int n)
+	{
+	  int res = 0;
+	  for (int i = 0; i < n; i++)
+	    {
+	       y[i] = x[i] * 2;
+	       res += x[i] + y[i];
+
+	       if (x[i] > 5)
+		 break;
+
+	       if (z[i] > 5)
+		 break;
+
+	    }
+	  return res;
+	}
+    </pre>
+    can now be vectorized on a number of targets.  In this first version any
+    input data sources must either have a statically known size at compile time
+    or the vectorizer must be able to determine based on auxillary information
+    that the accesses are aligned.
+  </li>
 </ul>
 <!-- .................................................................. -->
 <h2 id="languages">New Languages and Language specific improvements</h2>
@@ -231,6 +259,9 @@ a work-in-progress.</p>
   previous options <code>-std=c2x</code>, <code>-std=gnu2x</code>
   and <code>-Wc11-c2x-compat</code>, which are deprecated but remain
   supported.</li>
+  <li>GCC supports a new pragma <code>&#x23;pragma GCC novector</code> to
+      indicate to the vectorizer not to vectorize the loop annotated with the
+      pragma.</li>
 </ul>
 
 <h3 id="cxx">C++</h3>
@@ -400,6 +431,9 @@ a work-in-progress.</p>
       warnings are enabled for C++ as well</li>
   <li>The DR 2237 code no longer gives an error, it emits
       a <code>-Wtemplate-id-cdtor</code> warning instead</li>
+  <li>GCC supports a new pragma <code>&#x23;pragma GCC novector</code> to
+      indicate to the vectorizer not to vectorize the loop annotated with the
+      pragma.</li>
 </ul>
 
 <h4 id="libstdcxx">Runtime Library (libstdc++)</h4>




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: docs: document early break support and pragma novector
  2024-04-16  5:23 docs: document early break support and pragma novector Tamar Christina
@ 2024-04-16  6:59 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2024-04-16  6:59 UTC (permalink / raw)
  To: Tamar Christina; +Cc: gcc-patches, nd

On Tue, 16 Apr 2024, Tamar Christina wrote:

> docs: document early break support and pragma novector

OK.

> ---
> diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html
> index b4c602a523717c1d64333e44aefb60ba0ed02e7a..aceecb86f17443cfae637e90987427b98c42f6eb 100644
> --- a/htdocs/gcc-14/changes.html
> +++ b/htdocs/gcc-14/changes.html
> @@ -200,6 +200,34 @@ a work-in-progress.</p>
>      for indicating parameters that are expected to be null-terminated
>      strings.
>    </li>
> +  <li>
> +    The vectorizer now supports vectorizing loops which contain any number of early breaks.
> +    This means loops such as:
> +    <pre>
> +	int z[100], y[100], x[100];
> +	int foo (int n)
> +	{
> +	  int res = 0;
> +	  for (int i = 0; i < n; i++)
> +	    {
> +	       y[i] = x[i] * 2;
> +	       res += x[i] + y[i];
> +
> +	       if (x[i] > 5)
> +		 break;
> +
> +	       if (z[i] > 5)
> +		 break;
> +
> +	    }
> +	  return res;
> +	}
> +    </pre>
> +    can now be vectorized on a number of targets.  In this first version any
> +    input data sources must either have a statically known size at compile time
> +    or the vectorizer must be able to determine based on auxillary information
> +    that the accesses are aligned.
> +  </li>
>  </ul>
>  <!-- .................................................................. -->
>  <h2 id="languages">New Languages and Language specific improvements</h2>
> @@ -231,6 +259,9 @@ a work-in-progress.</p>
>    previous options <code>-std=c2x</code>, <code>-std=gnu2x</code>
>    and <code>-Wc11-c2x-compat</code>, which are deprecated but remain
>    supported.</li>
> +  <li>GCC supports a new pragma <code>&#x23;pragma GCC novector</code> to
> +      indicate to the vectorizer not to vectorize the loop annotated with the
> +      pragma.</li>
>  </ul>
>  
>  <h3 id="cxx">C++</h3>
> @@ -400,6 +431,9 @@ a work-in-progress.</p>
>        warnings are enabled for C++ as well</li>
>    <li>The DR 2237 code no longer gives an error, it emits
>        a <code>-Wtemplate-id-cdtor</code> warning instead</li>
> +  <li>GCC supports a new pragma <code>&#x23;pragma GCC novector</code> to
> +      indicate to the vectorizer not to vectorize the loop annotated with the
> +      pragma.</li>
>  </ul>
>  
>  <h4 id="libstdcxx">Runtime Library (libstdc++)</h4>
> 
> 
> 
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-16  6:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-16  5:23 docs: document early break support and pragma novector Tamar Christina
2024-04-16  6:59 ` Richard Biener

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).