Message ID | AANLkTinazE6UQu_WE_iwCFscjasV-CHNqNHZ5bO2zhdT@mail.gmail.com |
---|---|
State | New |
Headers | show |
On 31 March 2011 14:28, Joseph S. Myers <joseph@codesourcery.com> wrote: > On Thu, 31 Mar 2011, Ira Rosen wrote: > >> +Illegal values are ignored. The default is 128. > > See the GNU Coding Standards > <http://www.gnu.org/prep/standards/html_node/GNU-Manuals.html>: > > Please do not use the term "illegal" to refer to erroneous input to a > computer program. Please use "invalid" for this, and reserve the term > "illegal" for activities prohibited by law. I'll fix this. Thanks, Ira > > -- > Joseph S. Myers > joseph@codesourcery.com >
On Thu, Mar 31, 2011 at 01:39:05PM +0200, Ira Rosen wrote:
> This patch changes NEON's default vector size from 64 to 128 bits.
No comments about the patch itself, but this change should be noted in
changes.html.
-Nathan
On 31 March 2011 15:11, Nathan Froyd <froydnj@codesourcery.com> wrote: > On Thu, Mar 31, 2011 at 01:39:05PM +0200, Ira Rosen wrote: >> This patch changes NEON's default vector size from 64 to 128 bits. > > No comments about the patch itself, but this change should be noted in > changes.html. I'll do that. Thanks, Ira > > -Nathan >
On 31/03/11 12:39, Ira Rosen wrote: > Hi, > > This patch changes NEON's default vector size from 64 to 128 bits. > > The patch doesn't touch mvectorize-with-neon-quad, but removes the > uses of TARGET_NEON_VECTORIZE_QUAD. > Following Julian's suggestion I added a param preferred-vector-size > for testing and debugging purposes. IIUC, this patch makes mvectorize-with-neon-quad effectively a no-op which is ok with me. If this is now the default, what is the behaviour of -mno-vectorize-with-neon-quad now ? Should that set the value of the parameter to 64 or should we be rejecting the negative of that option ? If not, we should then consider adding a RejectNegative to that option. cheers Ramana -- Ramana Radhakrishnan
On 6 April 2011 16:07, Hans-Peter Nilsson <hans-peter.nilsson@axis.com> wrote: >> Date: Thu, 31 Mar 2011 13:39:05 +0200 >> From: Ira Rosen <ira.rosen@linaro.org> > >> This patch changes NEON's default vector size from 64 to 128 bits. > > I'm wondering, are there NEON-specific measurements to support > this change? > > A colleague of mine implemented support for 64- and 128-bit NEON > for RAPP <http://savannah.nongnu.org/projects/rapp/>, but found > that the 128-bit version was slower. The best vector size depends on the particular target (a version of ARM) and the benchmark. The vectorizer has a cost model that allows it to fall back to 64-bit vectors if 128-bit version is not profitable (-fvect-cost-model). We plan to enhance the cost model to estimate both versions and vectorize with the most profitable vector size. For now, you can use preferred-vector-size param if needed. Having 64 as a default doesn't allow us to use different NEON instructions that use both types of vectors. Ira > > brgds, H-P >
Index: doc/invoke.texi =================================================================== --- doc/invoke.texi (revision 171723) +++ doc/invoke.texi (working copy) @@ -8874,6 +8874,10 @@ The maximum number of conditional stores paires th if either vectorization (@option{-ftree-vectorize}) or if-conversion (@option{-ftree-loop-if-convert}) is disabled. The default is 2. +@item preferred-vector-size +Preferred vector size in bits for targets that support multiple vector sizes. +Illegal values are ignored. The default is 128. + @end table @end table Index: params.h =================================================================== --- params.h (revision 171723) +++ params.h (working copy) @@ -204,6 +204,8 @@ extern void init_param_values (int *params); PARAM_VALUE (PARAM_PREFETCH_MIN_INSN_TO_MEM_RATIO) #define MIN_NONDEBUG_INSN_UID \ PARAM_VALUE (PARAM_MIN_NONDEBUG_INSN_UID) +#define PREFERRED_VECTOR_SIZE \ + PARAM_VALUE (PARAM_PREFERRED_VECTOR_SIZE) #define MAX_STORES_TO_SINK \ PARAM_VALUE (PARAM_MAX_STORES_TO_SINK) #endif /* ! GCC_PARAMS_H */ Index: config/arm/arm.c =================================================================== --- config/arm/arm.c (revision 171723) +++ config/arm/arm.c (working copy) @@ -22297,17 +22297,16 @@ arm_preferred_simd_mode (enum machine_mode mode) switch (mode) { case SFmode: - return TARGET_NEON_VECTORIZE_QUAD ? V4SFmode : V2SFmode; + return (PREFERRED_VECTOR_SIZE == 64) ? V2SFmode : V4SFmode; case SImode: - return TARGET_NEON_VECTORIZE_QUAD ? V4SImode : V2SImode; + return (PREFERRED_VECTOR_SIZE == 64) ? V2SImode : V4SImode; case HImode: - return TARGET_NEON_VECTORIZE_QUAD ? V8HImode : V4HImode; + return (PREFERRED_VECTOR_SIZE == 64) ? V4HImode : V8HImode; case QImode: - return TARGET_NEON_VECTORIZE_QUAD ? V16QImode : V8QImode; + return (PREFERRED_VECTOR_SIZE == 64)? V8QImode : V16QImode; case DImode: - if (TARGET_NEON_VECTORIZE_QUAD) - return V2DImode; - break; + if (PREFERRED_VECTOR_SIZE != 64) + return V2DImode; default:; } @@ -23535,7 +23534,7 @@ arm_expand_sync (enum machine_mode mode, static unsigned int arm_autovectorize_vector_sizes (void) { - return TARGET_NEON_VECTORIZE_QUAD ? 16 | 8 : 0; + return (PREFERRED_VECTOR_SIZE != 64) ? 16 | 8 : 0; } static bool Index: params.def =================================================================== --- params.def (revision 171723) +++ params.def (working copy) @@ -880,6 +880,12 @@ DEFPARAM (PARAM_MAX_STORES_TO_SINK, 2, 0, 0) +/* Preferred vector size in bits. Illegal values are ignored. */ +DEFPARAM (PARAM_PREFERRED_VECTOR_SIZE, + "preferred-vector-size", + "Preferred vector size in bits", + 128, 0, 0) + /* Local variables: mode:c