diff mbox

[rs6000,testsuite] Changes for unaligned vector load/store support on POWER8

Message ID 1423617508.32509.46.camel@gnopaine
State New
Headers show

Commit Message

Bill Schmidt Feb. 11, 2015, 1:18 a.m. UTC
Hi David,

Sorry I haven't gotten back to this sooner.  I've tried to address your
comments about the previous patch.  Please let me know if I'm off base.
Test results are the same as previously.

Thanks,
Bill


[gcc]

2015-02-10  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* config/rs6000/rs6000.c (rs6000_option_override_internal):  For
	VSX + POWER8, enable TARGET_ALLOW_MOVMISALIGN and
	TARGET_EFFICIENT_UNALIGNED_VSX if not selected by command line
	option.
	(rs6000_builtin_mask_for_load): Return 0 for targets with
	efficient unaligned VSX accesses so that the vectorizer will use
	direct unaligned loads.
	(rs6000_builtin_support_vector_misalignment): Always return true
	for targets with efficient unaligned VSX accesses.
	(rs6000_builtin_vectorization_cost): Cost of unaligned loads and
	stores on targets with efficient unaligned VSX accesses is almost
	always the same as the cost of an aligned load or store, so model
	it that way.
	* config/rs6000/rs6000.opt (mefficient-unaligned-vector): New
	undocumented option.

[gcc/testsuite]

2015-02-10  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gcc.dg/vect/bb-slp-24.c: Exclude test for POWER8.
	* gcc.dg/vect/bb-slp-25.c: Likewise.
	* gcc.dg/vect/bb-slp-29.c: Likewise.
	* gcc.dg/vect/bb-slp-32.c: Replace vect_no_align with
	vect_no_align && { ! vect_hw_misalign }.
	* gcc.dg/vect/bb-slp-9.c: Likewise.
	* gcc.dg/vect/costmodel/ppc/costmodel-slp-33.c: Exclude test for
	vect_hw_misalign.
	* gcc.dg/vect/costmodel/ppc/costmodel-vect-31a.c: Likewise.
	* gcc.dg/vect/costmodel/ppc/costmodel-vect-76b.c: Adjust tests to
	account for POWER8, where peeling for alignment is not needed.
	* gcc.dg/vect/costmodel/ppc/costmodel-vect-outer-fir.c: Replace
	vect_no_align with vect_no_align && { ! vect_hw_misalign }.
	* gcc.dg.vect.if-cvt-stores-vect-ifcvt-18.c: Likewise.
	* gcc.dg/vect/no-scevccp-outer-6-global.c: Likewise.
	* gcc.dg/vect/no-scevccp-outer-6.c: Likewise.
	* gcc.dg/vect/no-vfa-vect-43.c: Likewise.
	* gcc.dg/vect/no-vfa-vect-57.c: Likewise.
	* gcc.dg/vect/no-vfa-vect-61.c: Likewise.
	* gcc.dg/vect/no-vfa-vect-depend-1.c: Likewise.
	* gcc.dg/vect/no-vfa-vect-depend-2.c: Likewise.
	* gcc.dg/vect/no-vfa-vect-depend-3.c: Likewise.
	* gcc.dg/vect/pr16105.c: Likewise.
	* gcc.dg/vect/pr20122.c: Likewise.
	* gcc.dg/vect/pr33804.c: Likewise.
	* gcc.dg/vect/pr33953.c: Likewise.
	* gcc.dg/vect/pr56787.c: Likewise.
	* gcc.dg/vect/pr58508.c: Likewise.
	* gcc.dg/vect/slp-25.c: Likewise.
	* gcc.dg/vect/vect-105-bit-array.c: Likewise.
	* gcc.dg/vect/vect-105.c: Likewise.
	* gcc.dg/vect/vect-27.c: Likewise.
	* gcc.dg/vect/vect-29.c: Likewise.
	* gcc.dg/vect/vect-33.c: Exclude unaligned access test for
	POWER8.
	* gcc.dg/vect/vect-42.c: Replace vect_no_align with vect_no_align
	&& { ! vect_hw_misalign }.
	* gcc.dg/vect/vect-44.c: Likewise.
	* gcc.dg/vect/vect-48.c: Likewise.
	* gcc.dg/vect/vect-50.c: Likewise.
	* gcc.dg/vect/vect-52.c: Likewise.
	* gcc.dg/vect/vect-56.c: Likewise.
	* gcc.dg/vect/vect-60.c: Likewise.
	* gcc.dg/vect/vect-72.c: Likewise.
	* gcc.dg/vect/vect-75-big-array.c: Likewise.
	* gcc.dg/vect/vect-75.c: Likewise.
	* gcc.dg/vect/vect-77-alignchecks.c: Likewise.
	* gcc.dg/vect/vect-77-global.c: Likewise.
	* gcc.dg/vect/vect-78-alignchecks.c: Likewise.
	* gcc.dg/vect/vect-78-global.c: Likewise.
	* gcc.dg/vect/vect-93.c: Likewise.
	* gcc.dg/vect/vect-95.c: Likewise.
	* gcc.dg/vect/vect-96.c: Likewise.
	* gcc.dg/vect/vect-cond-1.c: Likewise.
	* gcc.dg/vect/vect-cond-3.c: Likewise.
	* gcc.dg/vect/vect-cond-4.c: Likewise.
	* gcc.dg/vect/vect-cselim-1.c: Likewise.
	* gcc.dg/vect/vect-multitypes-1.c: Likewise.
	* gcc.dg/vect/vect-multitypes-3.c: Likewise.
	* gcc.dg/vect/vect-multitypes-4.c: Likewise.
	* gcc.dg/vect/vect-multitypes-6.c: Likewise.
	* gcc.dg/vect/vect-nest-cycle-1.c: Likewise.
	* gcc.dg/vect/vect-nest-cycle-2.c: Likewise.
	* gcc.dg/vect/vect-outer-3a-big-array.c: Likewise.
	* gcc.dg/vect/vect-outer-3a.c: Likewise.
	* gcc.dg/vect/vect-outer-5.c: Likewise.
	* gcc.dg/vect/vect-outer-fir-big-array.c: Likewise.
	* gcc.dg/vect/vect-outer-fir-lb-big-array.c: Likewise.
	* gcc.dg/vect/vect-outer-fir-lb.c: Likewise.
	* gcc.dg/vect/vect-outer-fir.c: Likewise.
	* gcc.dg/vect/vect-peel-3.c: Likewise.
	* gcc.dg/vect/vect-peel-4.c: Likewise.
	* gcc.dg/vect/vect-pre-interact.c: Likewise.
	* gcc.target/powerpc/vsx-vectorize-2.c: Exclude test for POWER8.
	* gcc.target/powerpc/vsx-vectorize-4.c: Likewise.
	* gcc.target/powerpc/vsx-vectorize-6.c: Likewise.
	* gcc.target/powerpc/vsx-vectorize-7.c: Likewise.
	* gfortran.dg/vect/vect-2.f90: Replace vect_no_align with
	vect_no_align && { ! vect_hw_misalign }.
	* gfortran.dg/vect/vect-3.f90: Likewise.
	* gfortran.dg/vect/vect-4.f90: Likewise.
	* gfortran.dg/vect/vect-5.f90: Likewise.
	* lib/target-supports.exp (check_effective_target_vect_no_align):
	Return 1 for POWER8.
	(check_effective_target_vect_hw_misalign): Return 1 for POWER8.




On Thu, 2015-01-29 at 14:39 -0500, David Edelsohn wrote:
> On Fri, Jan 23, 2015 at 12:23 PM, Bill Schmidt
> <wschmidt@linux.vnet.ibm.com> wrote:
> > Hi,
> >
> > The POWER8 processor greatly improves performance of unaligned vector
> > loads and stores.  Except for certain corner cases the compiler can't
> > readily track, an unaligned vector load or store performs equivalently
> > to an aligned one.
> >
> > To exploit this in the auto-vectorizer requires two changes.  The simple
> > one is to change the cost model to reflect the cheaper cost for POWER8
> > versus previous processors.  Additionally, we want to avoid generating
> > the masked-load sequence (load/load/lvsl/vperm) used to force alignment
> > of unaligned loads.  Of course we must be careful to still use this
> > sequence if -mno-vsx is selected for POWER8 for some reason.
> >
> > (Note that POWER7 supported unaligned vector memory references, but for
> > best performance we have chosen to use the masked-load sequence for that
> > processor.  This is no longer optimal for POWER8.)
> >
> > The code changes in the rs6000 back end are simple enough, but
> > unfortunately there is quite a bit of test case fallout.  There are two
> > predicates in target-supports.exp that need adjustment:
> >  * vect_no_align, which returns 1 iff the target plus current options
> > does not support a vector alignment mechanism; and
> >  * vect_hw_misalign, which returns 1 iff the target supports a
> > misaligned vector access.
> >
> > Unlike previous processors, for POWER8+VSX we want both of these
> > predicates to return 1.  In the former case, it isn't that we don't
> > support a vector alignment mechanism, but under no circumstances do we
> > want to use it when we have a misaligned vector access instruction that
> > performs well.
> >
> > As a result of these changes, many loops will now auto-vectorize on P8
> > that would not on P7.  Unfortunately, this causes many tests to fail,
> > even with the changes to target-supports.exp.  The primary reason is
> > that the tests are testing vect_no_align in many places, where the
> > correct thing to test is vect_no_align && !vect_hw_misalign.  That is,
> > the test condition should fire not just when there isn't a vector
> > alignment mechanism, but only when the target also doesn't support a
> > direct misaligned vector memory access.
> >
> > The reason this "shortcut" has worked up till now is that the set of
> > targets for which vect_no_align and vect_hw_misalign both return 1 has
> > been empty.  Thus vect_no_align has been functionally equivalent to
> > vect_no-align && !vect_hw_misalign.  Happily, this means it is also safe
> > to make that substitution in the failing tests without affecting other
> > targets.
> >
> > So, this patch contains three parts:
> >  * Changes to rs6000.c and vector.md for the vectorization support;
> >  * Changes to target-supports.exp to reflect POWER8's characteristics;
> > and
> >  * Numerous changes to fix test cases to make them pass/fail correctly
> > for POWER8.
> >
> > I've tested this on POWER8 BE, POWER8 LE, and POWER7 BE, with no
> > regressions.  A handful of existing POWER8 failures are also corrected
> > as a happy side effect.
> >
> > Since we're in stage 4, I obviously need to hold off till the next
> > release, but pending that, will this be ok for trunk?  After it burns in
> > I would like to backport it to 4.8, 4.9, and 5.
> >
> > Thanks!
> >
> > Bill
> >
> >
> > [gcc]
> >
> > 2015-01-23  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
> >
> >         * config/rs6000/rs6000.c (rs6000_builtin_mask_for_load): Return 0
> >         for POWER8 so that the vectorizer will use direct unaligned loads.
> >         (rs6000_builtin_support_vector_misalignment): Always return true
> >         for VSX + POWER8.
> >         (rs6000_builtin_vectorization_cost): Cost of unaligned loads and
> >         stores on VSX + POWER8 is almost always the same as the cost of an
> >         aligned load or store, so model it that way.
> 
> The processor test should be centralized in option_override instead
> explicitly testing POWER8.  We don't want to have to hunt for and
> update multiple, explicit processor tuning references if a potential
> future processor with the same characteristics is supported.
> 
> >         * config/rs6000/vector.md (movmisalign<mode>): Misaligned loads
> >         and stores are always permissible for VSX + POWER8.
> 
> Why test POWER8 separately in this pattern instead of setting
> TARGET_ALLOW_MOVMISALIGN for POWER8, if the use did not explicitly
> invoke the option?
> 
> >
> > [gcc/testsuite]
> >
> > 2015-01-23  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
> >
> >         * gcc.dg/vect/bb-slp-24.c: Exclude test for POWER8.
> >         * gcc.dg/vect/bb-slp-25.c: Likewise.
> >         * gcc.dg/vect/bb-slp-29.c: Likewise.
> >         * gcc.dg/vect/bb-slp-32.c: Replace vect_no_align with
> >         vect_no_align && { ! vect_hw_misalign }.
> >         * gcc.dg/vect/bb-slp-9.c: Likewise.
> >         * gcc.dg/vect/costmodel/ppc/costmodel-slp-33.c: Exclude test for
> >         vect_hw_misalign.
> >         * gcc.dg/vect/costmodel/ppc/costmodel-vect-31a.c: Likewise.
> >         * gcc.dg/vect/costmodel/ppc/costmodel-vect-76b.c: Adjust tests to
> >         account for POWER8, where peeling for alignment is not needed.
> >         * gcc.dg/vect/costmodel/ppc/costmodel-vect-outer-fir.c: Replace
> >         vect_no_align with vect_no_align && { ! vect_hw_misalign }.
> >         * gcc.dg.vect.if-cvt-stores-vect-ifcvt-18.c: Likewise.
> >         * gcc.dg/vect/no-scevccp-outer-6-global.c: Likewise.
> >         * gcc.dg/vect/no-scevccp-outer-6.c: Likewise.
> >         * gcc.dg/vect/no-vfa-vect-43.c: Likewise.
> >         * gcc.dg/vect/no-vfa-vect-57.c: Likewise.
> >         * gcc.dg/vect/no-vfa-vect-61.c: Likewise.
> >         * gcc.dg/vect/no-vfa-vect-depend-1.c: Likewise.
> >         * gcc.dg/vect/no-vfa-vect-depend-2.c: Likewise.
> >         * gcc.dg/vect/no-vfa-vect-depend-3.c: Likewise.
> >         * gcc.dg/vect/pr16105.c: Likewise.
> >         * gcc.dg/vect/pr20122.c: Likewise.
> >         * gcc.dg/vect/pr33804.c: Likewise.
> >         * gcc.dg/vect/pr33953.c: Likewise.
> >         * gcc.dg/vect/pr56787.c: Likewise.
> >         * gcc.dg/vect/pr58508.c: Likewise.
> >         * gcc.dg/vect/slp-25.c: Likewise.
> >         * gcc.dg/vect/vect-105-bit-array.c: Likewise.
> >         * gcc.dg/vect/vect-105.c: Likewise.
> >         * gcc.dg/vect/vect-27.c: Likewise.
> >         * gcc.dg/vect/vect-29.c: Likewise.
> >         * gcc.dg/vect/vect-33.c: Exclude unaligned access test for
> >         POWER8.
> >         * gcc.dg/vect/vect-42.c: Replace vect_no_align with vect_no_align
> >         && { ! vect_hw_misalign }.
> >         * gcc.dg/vect/vect-44.c: Likewise.
> >         * gcc.dg/vect/vect-48.c: Likewise.
> >         * gcc.dg/vect/vect-50.c: Likewise.
> >         * gcc.dg/vect/vect-52.c: Likewise.
> >         * gcc.dg/vect/vect-56.c: Likewise.
> >         * gcc.dg/vect/vect-60.c: Likewise.
> >         * gcc.dg/vect/vect-72.c: Likewise.
> >         * gcc.dg/vect/vect-75-big-array.c: Likewise.
> >         * gcc.dg/vect/vect-75.c: Likewise.
> >         * gcc.dg/vect/vect-77-alignchecks.c: Likewise.
> >         * gcc.dg/vect/vect-77-global.c: Likewise.
> >         * gcc.dg/vect/vect-78-alignchecks.c: Likewise.
> >         * gcc.dg/vect/vect-78-global.c: Likewise.
> >         * gcc.dg/vect/vect-93.c: Likewise.
> >         * gcc.dg/vect/vect-95.c: Likewise.
> >         * gcc.dg/vect/vect-96.c: Likewise.
> >         * gcc.dg/vect/vect-cond-1.c: Likewise.
> >         * gcc.dg/vect/vect-cond-3.c: Likewise.
> >         * gcc.dg/vect/vect-cond-4.c: Likewise.
> >         * gcc.dg/vect/vect-cselim-1.c: Likewise.
> >         * gcc.dg/vect/vect-multitypes-1.c: Likewise.
> >         * gcc.dg/vect/vect-multitypes-3.c: Likewise.This would be better implemented as a test of a new variable set in option_override instead of explicitly testing POWER8 because
> >         * gcc.dg/vect/vect-multitypes-4.c: Likewise.
> >         * gcc.dg/vect/vect-multitypes-6.c: Likewise.
> >         * gcc.dg/vect/vect-nest-cycle-1.c: Likewise.
> >         * gcc.dg/vect/vect-nest-cycle-2.c: Likewise.
> >         * gcc.dg/vect/vect-outer-3a-big-array.c: Likewise.
> >         * gcc.dg/vect/vect-outer-3a.c: Likewise.
> >         * gcc.dg/vect/vect-outer-5.c: Likewise.
> >         * gcc.dg/vect/vect-outer-fir-big-array.c: Likewise.
> >         * gcc.dg/vect/vect-outer-fir-lb-big-array.c: Likewise.
> >         * gcc.dg/vect/vect-outer-fir-lb.c: Likewise.
> >         * gcc.dg/vect/vect-outer-fir.c: Likewise.
> >         * gcc.dg/vect/vect-peel-3.c: Likewise.
> >         * gcc.dg/vect/vect-peel-4.c: Likewise.
> >         * gcc.dg/vect/vect-pre-interact.c: Likewise.
> >         * gcc.target/powerpc/vsx-vectorize-2.c: Exclude test for POWER8.
> >         * gcc.target/powerpc/vsx-vectorize-4.c: Likewise.
> >         * gcc.target/powerpc/vsx-vectorize-6.c: LikewisThis would be better implemented as a test of a new variable set in option_override instead of explicitly testing POWER8 becausee.
> >         * gcc.target/powerpc/vsx-vectorize-7.c: Likewise.
> >         * gfortran.dg/vect/vect-2.f90: Replace vect_no_align with
> >         vect_no_align && { ! vect_hw_misalign }.
> >         * gfortran.dg/vect/vect-3.f90: Likewise.
> >         * gfortran.dg/vect/vect-4.f90: Likewise.
> >         * gfortran.dg/vect/vect-5.f90: Likewise.
> >         * lib/target-supports.exp (check_effective_target_vect_no_align):
> >         Return 1 for POWER8.
> >         (check_effective_target_vect_hw_misalign): Return 1 for POWER8.
> 
> This is a reasonable change, but please ask a vect maintainer like
> Richi or a testsuite maintainer to approve.
> 
> Thanks, David
>

Comments

David Edelsohn Feb. 26, 2015, 3:36 p.m. UTC | #1
On Tue, Feb 10, 2015 at 8:18 PM, Bill Schmidt
<wschmidt@linux.vnet.ibm.com> wrote:
> Hi David,
>
> Sorry I haven't gotten back to this sooner.  I've tried to address your
> comments about the previous patch.  Please let me know if I'm off base.
> Test results are the same as previously.
>
> Thanks,
> Bill
>
>
> [gcc]
>
> 2015-02-10  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
>
>         * config/rs6000/rs6000.c (rs6000_option_override_internal):  For
>         VSX + POWER8, enable TARGET_ALLOW_MOVMISALIGN and
>         TARGET_EFFICIENT_UNALIGNED_VSX if not selected by command line
>         option.
>         (rs6000_builtin_mask_for_load): Return 0 for targets with
>         efficient unaligned VSX accesses so that the vectorizer will use
>         direct unaligned loads.
>         (rs6000_builtin_support_vector_misalignment): Always return true
>         for targets with efficient unaligned VSX accesses.
>         (rs6000_builtin_vectorization_cost): Cost of unaligned loads and
>         stores on targets with efficient unaligned VSX accesses is almost
>         always the same as the cost of an aligned load or store, so model
>         it that way.
>         * config/rs6000/rs6000.opt (mefficient-unaligned-vector): New
>         undocumented option.
>
> [gcc/testsuite]
>
> 2015-02-10  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
>
>         * gcc.dg/vect/bb-slp-24.c: Exclude test for POWER8.
>         * gcc.dg/vect/bb-slp-25.c: Likewise.
>         * gcc.dg/vect/bb-slp-29.c: Likewise.
>         * gcc.dg/vect/bb-slp-32.c: Replace vect_no_align with
>         vect_no_align && { ! vect_hw_misalign }.
>         * gcc.dg/vect/bb-slp-9.c: Likewise.
>         * gcc.dg/vect/costmodel/ppc/costmodel-slp-33.c: Exclude test for
>         vect_hw_misalign.
>         * gcc.dg/vect/costmodel/ppc/costmodel-vect-31a.c: Likewise.
>         * gcc.dg/vect/costmodel/ppc/costmodel-vect-76b.c: Adjust tests to
>         account for POWER8, where peeling for alignment is not needed.
>         * gcc.dg/vect/costmodel/ppc/costmodel-vect-outer-fir.c: Replace
>         vect_no_align with vect_no_align && { ! vect_hw_misalign }.
>         * gcc.dg.vect.if-cvt-stores-vect-ifcvt-18.c: Likewise.
>         * gcc.dg/vect/no-scevccp-outer-6-global.c: Likewise.
>         * gcc.dg/vect/no-scevccp-outer-6.c: Likewise.
>         * gcc.dg/vect/no-vfa-vect-43.c: Likewise.
>         * gcc.dg/vect/no-vfa-vect-57.c: Likewise.
>         * gcc.dg/vect/no-vfa-vect-61.c: Likewise.
>         * gcc.dg/vect/no-vfa-vect-depend-1.c: Likewise.
>         * gcc.dg/vect/no-vfa-vect-depend-2.c: Likewise.
>         * gcc.dg/vect/no-vfa-vect-depend-3.c: Likewise.
>         * gcc.dg/vect/pr16105.c: Likewise.
>         * gcc.dg/vect/pr20122.c: Likewise.
>         * gcc.dg/vect/pr33804.c: Likewise.
>         * gcc.dg/vect/pr33953.c: Likewise.
>         * gcc.dg/vect/pr56787.c: Likewise.
>         * gcc.dg/vect/pr58508.c: Likewise.
>         * gcc.dg/vect/slp-25.c: Likewise.
>         * gcc.dg/vect/vect-105-bit-array.c: Likewise.
>         * gcc.dg/vect/vect-105.c: Likewise.
>         * gcc.dg/vect/vect-27.c: Likewise.
>         * gcc.dg/vect/vect-29.c: Likewise.
>         * gcc.dg/vect/vect-33.c: Exclude unaligned access test for
>         POWER8.
>         * gcc.dg/vect/vect-42.c: Replace vect_no_align with vect_no_align
>         && { ! vect_hw_misalign }.
>         * gcc.dg/vect/vect-44.c: Likewise.
>         * gcc.dg/vect/vect-48.c: Likewise.
>         * gcc.dg/vect/vect-50.c: Likewise.
>         * gcc.dg/vect/vect-52.c: Likewise.
>         * gcc.dg/vect/vect-56.c: Likewise.
>         * gcc.dg/vect/vect-60.c: Likewise.
>         * gcc.dg/vect/vect-72.c: Likewise.
>         * gcc.dg/vect/vect-75-big-array.c: Likewise.
>         * gcc.dg/vect/vect-75.c: Likewise.
>         * gcc.dg/vect/vect-77-alignchecks.c: Likewise.
>         * gcc.dg/vect/vect-77-global.c: Likewise.
>         * gcc.dg/vect/vect-78-alignchecks.c: Likewise.
>         * gcc.dg/vect/vect-78-global.c: Likewise.
>         * gcc.dg/vect/vect-93.c: Likewise.
>         * gcc.dg/vect/vect-95.c: Likewise.
>         * gcc.dg/vect/vect-96.c: Likewise.
>         * gcc.dg/vect/vect-cond-1.c: Likewise.
>         * gcc.dg/vect/vect-cond-3.c: Likewise.
>         * gcc.dg/vect/vect-cond-4.c: Likewise.
>         * gcc.dg/vect/vect-cselim-1.c: Likewise.
>         * gcc.dg/vect/vect-multitypes-1.c: Likewise.
>         * gcc.dg/vect/vect-multitypes-3.c: Likewise.
>         * gcc.dg/vect/vect-multitypes-4.c: Likewise.
>         * gcc.dg/vect/vect-multitypes-6.c: Likewise.
>         * gcc.dg/vect/vect-nest-cycle-1.c: Likewise.
>         * gcc.dg/vect/vect-nest-cycle-2.c: Likewise.
>         * gcc.dg/vect/vect-outer-3a-big-array.c: Likewise.
>         * gcc.dg/vect/vect-outer-3a.c: Likewise.
>         * gcc.dg/vect/vect-outer-5.c: Likewise.
>         * gcc.dg/vect/vect-outer-fir-big-array.c: Likewise.
>         * gcc.dg/vect/vect-outer-fir-lb-big-array.c: Likewise.
>         * gcc.dg/vect/vect-outer-fir-lb.c: Likewise.
>         * gcc.dg/vect/vect-outer-fir.c: Likewise.
>         * gcc.dg/vect/vect-peel-3.c: Likewise.
>         * gcc.dg/vect/vect-peel-4.c: Likewise.
>         * gcc.dg/vect/vect-pre-interact.c: Likewise.
>         * gcc.target/powerpc/vsx-vectorize-2.c: Exclude test for POWER8.
>         * gcc.target/powerpc/vsx-vectorize-4.c: Likewise.
>         * gcc.target/powerpc/vsx-vectorize-6.c: Likewise.
>         * gcc.target/powerpc/vsx-vectorize-7.c: Likewise.
>         * gfortran.dg/vect/vect-2.f90: Replace vect_no_align with
>         vect_no_align && { ! vect_hw_misalign }.
>         * gfortran.dg/vect/vect-3.f90: Likewise.
>         * gfortran.dg/vect/vect-4.f90: Likewise.
>         * gfortran.dg/vect/vect-5.f90: Likewise.
>         * lib/target-supports.exp (check_effective_target_vect_no_align):
>         Return 1 for POWER8.
>         (check_effective_target_vect_hw_misalign): Return 1 for POWER8.

This is much more what I had in mind.

My one concern is the interaction between TARGET_ALLOW_MOVMISALIGN and
TARGET_EFFICIENT_UNALIGNED_VSX in the movmisalign<mode> pattern in
vector.md.  Your patch changes
rs6000_builtin_support_vector_misalignment to return TRUE if
TARGET_EFFICIENT_UNALIGNED_VSX is enabled, which seems to enable the
use of the movmisalign<mode> pattern, but the pattern final condition
depends on TARGET_ALLOW_MOVMISALIGN.

-mcpu=power8 will enable both flags, but if a user manually overrides
one or both flags, the hook could return TRUE while the pattern is
disabled, which would lead to an ICE.  The relationship between the
hook and the pattern need to be consistent.  I'm not sure about the
best way to rationalize it.

Thanks, David
Bill Schmidt Feb. 26, 2015, 8:40 p.m. UTC | #2
On Thu, 2015-02-26 at 10:36 -0500, David Edelsohn wrote:

> My one concern is the interaction between TARGET_ALLOW_MOVMISALIGN and
> TARGET_EFFICIENT_UNALIGNED_VSX in the movmisalign<mode> pattern in
> vector.md.  Your patch changes
> rs6000_builtin_support_vector_misalignment to return TRUE if
> TARGET_EFFICIENT_UNALIGNED_VSX is enabled, which seems to enable the
> use of the movmisalign<mode> pattern, but the pattern final condition
> depends on TARGET_ALLOW_MOVMISALIGN.
> 
> -mcpu=power8 will enable both flags, but if a user manually overrides
> one or both flags, the hook could return TRUE while the pattern is
> disabled, which would lead to an ICE.  The relationship between the
> hook and the pattern need to be consistent.  I'm not sure about the
> best way to rationalize it.
> 
> Thanks, David
> 

This is a good point.  I think the following is probably the right way
to fix this:

  /* Determine when unaligned vector accesses are permitted, and when           
     they are preferred over masked Altivec loads.  Note that if                
     TARGET_ALLOW_MOVMISALIGN has been disabled by the user, then               
     TARGET_EFFICIENT_UNALIGNED_VSX must be as well.  The converse              
     is not true.  */

  if (TARGET_EFFICIENT_UNALIGNED_VSX == -1) {
    if (TARGET_VSX && rs6000_cpu == PROCESSOR_POWER8
        && TARGET_ALLOW_MOVMISALIGN != 0)
      TARGET_EFFICIENT_UNALIGNED_VSX = 1;
    else
      TARGET_EFFICIENT_UNALIGNED_VSX = 0;
  }

  if (TARGET_ALLOW_MOVMISALIGN == -1 && rs6000_cpu == PROCESSOR_POWER8)
    TARGET_ALLOW_MOVMISALIGN = 1;


That is, determine TARGET_EFFICIENT_UNALIGNED_VSX first, and only allow
it if TARGET_ALLOW_MOVMISALIGN hasn't been specifically disabled.  Sound
reasonable?

Bill
Bill Schmidt Feb. 26, 2015, 10:48 p.m. UTC | #3
On Thu, 2015-02-26 at 14:40 -0600, Bill Schmidt wrote:
> On Thu, 2015-02-26 at 10:36 -0500, David Edelsohn wrote:
> 
> > My one concern is the interaction between TARGET_ALLOW_MOVMISALIGN and
> > TARGET_EFFICIENT_UNALIGNED_VSX in the movmisalign<mode> pattern in
> > vector.md.  Your patch changes
> > rs6000_builtin_support_vector_misalignment to return TRUE if
> > TARGET_EFFICIENT_UNALIGNED_VSX is enabled, which seems to enable the
> > use of the movmisalign<mode> pattern, but the pattern final condition
> > depends on TARGET_ALLOW_MOVMISALIGN.
> > 
> > -mcpu=power8 will enable both flags, but if a user manually overrides
> > one or both flags, the hook could return TRUE while the pattern is
> > disabled, which would lead to an ICE.  The relationship between the
> > hook and the pattern need to be consistent.  I'm not sure about the
> > best way to rationalize it.
> > 
> > Thanks, David
> > 
> 
> This is a good point.  I think the following is probably the right way
> to fix this:
> 
>   /* Determine when unaligned vector accesses are permitted, and when           
>      they are preferred over masked Altivec loads.  Note that if                
>      TARGET_ALLOW_MOVMISALIGN has been disabled by the user, then               
>      TARGET_EFFICIENT_UNALIGNED_VSX must be as well.  The converse              
>      is not true.  */
> 
>   if (TARGET_EFFICIENT_UNALIGNED_VSX == -1) {
>     if (TARGET_VSX && rs6000_cpu == PROCESSOR_POWER8
>         && TARGET_ALLOW_MOVMISALIGN != 0)
>       TARGET_EFFICIENT_UNALIGNED_VSX = 1;
>     else
>       TARGET_EFFICIENT_UNALIGNED_VSX = 0;
>   }
> 
>   if (TARGET_ALLOW_MOVMISALIGN == -1 && rs6000_cpu == PROCESSOR_POWER8)
>     TARGET_ALLOW_MOVMISALIGN = 1;
> 
> 
> That is, determine TARGET_EFFICIENT_UNALIGNED_VSX first, and only allow
> it if TARGET_ALLOW_MOVMISALIGN hasn't been specifically disabled.  Sound
> reasonable?

Except this didn't pass regression testing.  I'll continue to poke at
it.

Bill

> 
> Bill
>
diff mbox

Patch

Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 219999)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -4196,6 +4196,18 @@  rs6000_option_override_internal (bool global_init_
 	}
     }
 
+  /* Determine when unaligned vector accesses are permitted, and when
+     they are preferred over masked Altivec loads.  */
+  if (TARGET_ALLOW_MOVMISALIGN == -1 && rs6000_cpu == PROCESSOR_POWER8)
+    TARGET_ALLOW_MOVMISALIGN = 1;
+
+  if (TARGET_EFFICIENT_UNALIGNED_VSX == -1) {
+    if (TARGET_VSX && rs6000_cpu == PROCESSOR_POWER8)
+      TARGET_EFFICIENT_UNALIGNED_VSX = 1;
+    else
+      TARGET_EFFICIENT_UNALIGNED_VSX = 0;
+  }
+
   /* Set the builtin mask of the various options used that could affect which
      builtins were used.  In the past we used target_flags, but we've run out
      of bits, and some options like SPE and PAIRED are no longer in
@@ -4248,7 +4260,9 @@  rs6000_option_override (void)
 static tree
 rs6000_builtin_mask_for_load (void)
 {
-  if (TARGET_ALTIVEC || TARGET_VSX)
+  /* Don't use lvsl/vperm for P8 and similarly efficient machines.  */
+  if ((TARGET_ALTIVEC && !TARGET_VSX)
+      || (TARGET_VSX && !TARGET_EFFICIENT_UNALIGNED_VSX))
     return altivec_builtin_mask_for_load;
   else
     return 0;
@@ -4327,6 +4341,9 @@  rs6000_builtin_support_vector_misalignment (machin
 {
   if (TARGET_VSX)
     {
+      if (TARGET_EFFICIENT_UNALIGNED_VSX)
+	return true;
+
       /* Return if movmisalign pattern is not supported for this mode.  */
       if (optab_handler (movmisalign_optab, mode) == CODE_FOR_nothing)
         return false;
@@ -4390,6 +4407,9 @@  rs6000_builtin_vectorization_cost (enum vect_cost_
         return 3;
 
       case unaligned_load:
+	if (TARGET_EFFICIENT_UNALIGNED_VSX)
+	  return 1;
+
         if (TARGET_VSX && TARGET_ALLOW_MOVMISALIGN)
           {
             elements = TYPE_VECTOR_SUBPARTS (vectype);
@@ -4425,6 +4445,9 @@  rs6000_builtin_vectorization_cost (enum vect_cost_
         return 2;
 
       case unaligned_store:
+	if (TARGET_EFFICIENT_UNALIGNED_VSX)
+	  return 1;
+
         if (TARGET_VSX && TARGET_ALLOW_MOVMISALIGN)
           {
             elements = TYPE_VECTOR_SUBPARTS (vectype);
Index: gcc/config/rs6000/rs6000.opt
===================================================================
--- gcc/config/rs6000/rs6000.opt	(revision 219999)
+++ gcc/config/rs6000/rs6000.opt	(working copy)
@@ -211,6 +211,10 @@  mallow-movmisalign
 Target Undocumented Var(TARGET_ALLOW_MOVMISALIGN) Init(-1)
 ; Allow/disallow the movmisalign in DF/DI vectors
 
+mefficient-unaligned-vector
+Target Undocumented Report Var(TARGET_EFFICIENT_UNALIGNED_VSX) Init(-1)
+; Consider unaligned VSX accesses to be efficient/inefficient
+
 mallow-df-permute
 Target Undocumented Var(TARGET_ALLOW_DF_PERMUTE)
 ; Allow/disallow permutation of DF/DI vectors
Index: gcc/testsuite/gcc.dg/vect/bb-slp-24.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/bb-slp-24.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/bb-slp-24.c	(working copy)
@@ -54,7 +54,9 @@  int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp1" { target vect_element_align } } } */
+/* Exclude POWER8 (only POWER cpu for which vect_element_align is true)
+   because loops have vectorized before SLP gets a shot.  */
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp1" { target { vect_element_align && { ! powerpc*-*-* } } } } } */
 /* { dg-final { cleanup-tree-dump "slp1" } } */
 /* { dg-final { cleanup-tree-dump "slp2" } } */
 
Index: gcc/testsuite/gcc.dg/vect/bb-slp-25.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/bb-slp-25.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/bb-slp-25.c	(working copy)
@@ -54,7 +54,9 @@  int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp1" { target vect_element_align } } } */
+/* Exclude POWER8 (only POWER cpu for which vect_element_align is true)
+   because loops have vectorized before SLP gets a shot.  */
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp1" { target { vect_element_align && { ! powerpc*-*-* } } } } } */
 /* { dg-final { cleanup-tree-dump "slp1" } } */
 /* { dg-final { cleanup-tree-dump "slp2" } } */
 
Index: gcc/testsuite/gcc.dg/vect/bb-slp-29.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/bb-slp-29.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/bb-slp-29.c	(working copy)
@@ -54,7 +54,9 @@  int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp1"  { target { vect_int_mult &&  vect_element_align } } } } */
+/* Exclude POWER8 (only POWER cpu for which vect_element_align is true)
+   because loops have vectorized before SLP gets a shot.  */
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp1"  { target { { vect_int_mult && vect_element_align } && { ! powerpc*-*-* } } } } } */
 /* { dg-final { cleanup-tree-dump "slp1" } } */
 /* { dg-final { cleanup-tree-dump "slp2" } } */
 
Index: gcc/testsuite/gcc.dg/vect/bb-slp-32.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/bb-slp-32.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/bb-slp-32.c	(working copy)
@@ -19,5 +19,5 @@  int foo (int *p)
   return tem0 + tem1 + tem2 + tem3;
 }
 
-/* { dg-final { scan-tree-dump "vectorization is not profitable" "slp2" { xfail  vect_no_align } } } */
+/* { dg-final { scan-tree-dump "vectorization is not profitable" "slp2" { xfail  { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "slp2" } } */
Index: gcc/testsuite/gcc.dg/vect/bb-slp-9.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/bb-slp-9.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/bb-slp-9.c	(working copy)
@@ -46,6 +46,6 @@  int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp2"  { xfail  vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp2"  { xfail  { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "slp2" } } */
   
Index: gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-33.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-33.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-33.c	(working copy)
@@ -40,5 +40,5 @@  int main (void)
   return main1 ();
 } 
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { ! vect_hw_misalign } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-31a.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-31a.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-31a.c	(working copy)
@@ -47,5 +47,5 @@  int main (void)
 } 
 
 /* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { ! vect_hw_misalign } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76b.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76b.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76b.c	(working copy)
@@ -43,8 +43,8 @@  int main (void)
 }
 
 /* Peeling to align the store is used. Overhead of peeling is too high.  */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target vector_alignment_reachable } } } */
-/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { target { vector_alignment_reachable && {! vect_no_align} } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { vector_alignment_reachable && {! vect_no_align} } } } } */
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { target { vector_alignment_reachable && {! vect_hw_misalign} } } } } */
 
 /* Versioning to align the store is used. Overhead of versioning is not too high.  */
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_no_align || {! vector_alignment_reachable} } } } } */
Index: gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-outer-fir.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-outer-fir.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-outer-fir.c	(working copy)
@@ -67,5 +67,5 @@  int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 2 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 2 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/if-cvt-stores-vect-ifcvt-18.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/if-cvt-stores-vect-ifcvt-18.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/if-cvt-stores-vect-ifcvt-18.c	(working copy)
@@ -65,5 +65,5 @@  main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  { xfail { vect_no_align || { ! vect_strided2 } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  { xfail { { vect_no_align && { ! vect_hw_misalign } } || { ! vect_strided2 } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/no-scevccp-outer-6-global.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/no-scevccp-outer-6-global.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/no-scevccp-outer-6-global.c	(working copy)
@@ -52,5 +52,5 @@  int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/no-scevccp-outer-6.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/no-scevccp-outer-6.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/no-scevccp-outer-6.c	(working copy)
@@ -51,6 +51,6 @@  int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail { unaligned_stack || vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail { unaligned_stack || { vect_no_align && { ! vect_hw_misalign } } } } } } */
 /* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 1 "vect" { xfail *-*-* } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/no-vfa-vect-43.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/no-vfa-vect-43.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/no-vfa-vect-43.c	(working copy)
@@ -90,5 +90,5 @@  int main (void)
 }
 
 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 2 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 6 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 6 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/no-vfa-vect-57.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/no-vfa-vect-57.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/no-vfa-vect-57.c	(working copy)
@@ -71,5 +71,5 @@  int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/no-vfa-vect-61.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/no-vfa-vect-61.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/no-vfa-vect-61.c	(working copy)
@@ -73,5 +73,5 @@  int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-1.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-1.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-1.c	(working copy)
@@ -50,7 +50,7 @@  int main (void)
   return main1 ();
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "dependence distance negative" 1 "vect"  } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
 
Index: gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-2.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-2.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-2.c	(working copy)
@@ -50,6 +50,6 @@  int main (void)
   return main1 ();
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "dependence distance negative" 1 "vect"  } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-3.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-3.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-3.c	(working copy)
@@ -182,6 +182,6 @@  int main ()
   return main1 ();
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 4 "vect" {xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 4 "vect" {xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "dependence distance negative" 4 "vect"  } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/pr16105.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/pr16105.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/pr16105.c	(working copy)
@@ -18,5 +18,5 @@  void square(const float * __restrict__ a,
 }
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/*  { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 2 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 2 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/pr20122.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/pr20122.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/pr20122.c	(working copy)
@@ -52,5 +52,5 @@  int main (int argc, char **argv)
 /* The loops in VecBug and VecBug2 require versioning for alignment.
    The loop in main is aligned.  */
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" } } */
-/*  { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 2 "vect" { target vect_no_align } } } */
+/*  { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 2 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/pr33804.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/pr33804.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/pr33804.c	(working copy)
@@ -11,6 +11,6 @@  void f(unsigned char *s, unsigned char *d, int n)
     }
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/pr33953.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/pr33953.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/pr33953.c	(working copy)
@@ -28,8 +28,8 @@  void blockmove_NtoN_blend_noremap32 (const UINT32
    }
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {xfail vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" {xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
 
 
Index: gcc/testsuite/gcc.dg/vect/pr56787.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/pr56787.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/pr56787.c	(working copy)
@@ -31,5 +31,5 @@  foo (unsigned long n, const float *__restrict u0,
     }
 }
 
-/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/pr58508.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/pr58508.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/pr58508.c	(working copy)
@@ -67,5 +67,5 @@  void test5 (int* a, int* b)
 }
 
 /* { dg-final { scan-tree-dump-times "hoist" 8 "vect" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "hoist" 3 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "hoist" 3 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/slp-25.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/slp-25.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/slp-25.c	(working copy)
@@ -57,5 +57,5 @@  int main (void)
 
 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect"  } } */
 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { vect_no_align || { ! vect_natural_alignment } } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { { vect_no_align && { ! vect_hw_misalign } } || { ! vect_natural_alignment } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-105-big-array.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-105-big-array.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-105-big-array.c	(working copy)
@@ -100,7 +100,7 @@  int main (void)
 }
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 2 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 2 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 0 "vect" } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
 
Index: gcc/testsuite/gcc.dg/vect/vect-105.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-105.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-105.c	(working copy)
@@ -66,7 +66,7 @@  int main (void)
 }
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/*  { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 2 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 2 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 0 "vect" } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
 
Index: gcc/testsuite/gcc.dg/vect/vect-27.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-27.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-27.c	(working copy)
@@ -44,8 +44,8 @@  int main (void)
 }
 
 /* The initialization induction loop (with aligned access) is also vectorized.  */
-/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { xfail vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-29.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-29.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-29.c	(working copy)
@@ -51,7 +51,7 @@  int main (void)
 
 /* The initialization induction loop (with aligned access) is also vectorized.  */
 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" {target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" {target { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-33.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-33.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-33.c	(working copy)
@@ -36,9 +36,10 @@  int main (void)
   return main1 ();
 } 
 
+/* vect_hw_misalign && { ! vect64 } */
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  } } */
-/* { dg-final { scan-tree-dump "Vectorizing an unaligned access" "vect" { target { vect_hw_misalign && { ! vect64 } } } } } */
+/* { dg-final { scan-tree-dump "Vectorizing an unaligned access" "vect" { target { { { ! powerpc*-*-* } && vect_hw_misalign } && { ! vect64 } } } } }  */
 /* { dg-final { scan-tree-dump "Alignment of access forced using peeling" "vect" { target { vector_alignment_reachable && vect64 } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { { {! vector_alignment_reachable} || {! vect64} } && {! vect_hw_misalign} } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-42.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-42.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-42.c	(working copy)
@@ -64,7 +64,7 @@  int main (void)
 }
 
 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { { ! vector_alignment_reachable } && { ! vect_element_align } } } } } */
 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail { vect_no_align || { { !  vector_alignment_reachable } || vect_element_align  } } } } }  */
 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_element_align } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-44.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-44.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-44.c	(working copy)
@@ -65,8 +65,8 @@  int main (void)
    two loads to be aligned).  */
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || {! vector_alignment_reachable} } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align && { ! vect_hw_misalign } } || {! vector_alignment_reachable} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { {! vector_alignment_reachable} && {{! vect_no_align} && {! vect_hw_misalign} } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-48.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-48.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-48.c	(working copy)
@@ -55,7 +55,7 @@  int main (void)
    (The store is aligned).  */
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-50.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-50.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-50.c	(working copy)
@@ -61,9 +61,9 @@  int main (void)
    align the store will not force the two loads to be aligned).  */
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align } } } }  */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || {! vector_alignment_reachable} } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align && { ! vect_hw_misalign } } || {! vector_alignment_reachable} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { {! vector_alignment_reachable} && { {! vect_no_align } && {! vect_hw_misalign } } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-52.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-52.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-52.c	(working copy)
@@ -56,7 +56,7 @@  int main (void)
    (The store is aligned).  */
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-56.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-56.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-56.c	(working copy)
@@ -67,7 +67,7 @@  int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_element_align } } } } */
 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { vect_element_align } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { xfail { vect_element_align } } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-60.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-60.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-60.c	(working copy)
@@ -68,7 +68,7 @@  int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_element_align } } } } */
 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { vect_element_align } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { xfail { vect_element_align } } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-72.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-72.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-72.c	(working copy)
@@ -46,7 +46,7 @@  int main (void)
   return main1 ();
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-75-big-array.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-75-big-array.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-75-big-array.c	(working copy)
@@ -52,6 +52,6 @@  int main (void)
 
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/*  { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail vect_no_align } } } */
+/*  { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-75.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-75.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-75.c	(working copy)
@@ -44,6 +44,6 @@  int main (void)
 
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/*  { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-77-alignchecks.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-77-alignchecks.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-77-alignchecks.c	(working copy)
@@ -49,8 +49,8 @@  int main (void)
    both for the load and the store.  */
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { {! vect_no_align} && { unaligned_stack && vector_alignment_reachable } } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { { {! unaligned_stack} && vect_no_align } || {unaligned_stack && { {! vector_alignment_reachable} && {! vect_no_align} } } } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { { {! unaligned_stack} && { vect_no_align && { ! vect_hw_misalign } } } || {unaligned_stack && { {! vector_alignment_reachable} && {! vect_no_align } } } } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target { { unaligned_stack && { vector_alignment_reachable && vect_no_align } } || {unaligned_stack && { {! vector_alignment_reachable} && vect_no_align } } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-77-global.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-77-global.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-77-global.c	(working copy)
@@ -48,7 +48,7 @@  int main (void)
 /* Requires versioning for aliasing.  */
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-78-alignchecks.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-78-alignchecks.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-78-alignchecks.c	(working copy)
@@ -50,8 +50,8 @@  int main (void)
    both for the load and the store.  */
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align } } } } */ 
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ 
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { {! vect_no_align} && { unaligned_stack && vector_alignment_reachable } } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { { {! unaligned_stack} && vect_no_align } || {unaligned_stack && { {! vector_alignment_reachable} && {! vect_no_align} } } } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { { {! unaligned_stack} && { vect_no_align && { ! vect_hw_misalign } } } || {unaligned_stack && { {! vector_alignment_reachable} && { ! vect_no_align } } } } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target { { unaligned_stack && { vector_alignment_reachable && vect_no_align } } || {unaligned_stack && { {! vector_alignment_reachable} && vect_no_align } } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-78-global.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-78-global.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-78-global.c	(working copy)
@@ -48,7 +48,7 @@  int main (void)
    (The store is aligned).  */
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-93.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-93.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-93.c	(working copy)
@@ -76,10 +76,10 @@  int main (void)
 
 /* in main1: */
 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target !powerpc*-*-* !i?86-*-* !x86_64-*-* } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
 
 /* in main: */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-95.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-95.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-95.c	(working copy)
@@ -64,6 +64,6 @@  int main (void)
 
 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_element_align} } } }  */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 2 "vect" { xfail { vect_no_align || vect_element_align } } } } */
-/*  { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target vect_no_align } } } */
-/*  { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 4 "vect" { target vect_no_align } } } */
+/*  { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
+/*  { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 4 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-96.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-96.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-96.c	(working copy)
@@ -46,5 +46,5 @@  int main (void)
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { {! vect_no_align} && vector_alignment_reachable } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align } || { { ! vector_alignment_reachable} || vect_element_align } } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { vect_no_align || { {! vector_alignment_reachable} && {! vect_element_align} } } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { { vect_no_align && { ! vect_hw_misalign } } || { {! vector_alignment_reachable} && {! vect_element_align} } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-cond-1.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-cond-1.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-cond-1.c	(working copy)
@@ -51,7 +51,7 @@  int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
 
 
Index: gcc/testsuite/gcc.dg/vect/vect-cond-3.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-cond-3.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-cond-3.c	(working copy)
@@ -59,7 +59,7 @@  int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
 
 
Index: gcc/testsuite/gcc.dg/vect/vect-cond-4.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-cond-4.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-cond-4.c	(working copy)
@@ -56,7 +56,7 @@  int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
 
 
Index: gcc/testsuite/gcc.dg/vect/vect-cselim-1.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-cselim-1.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-cselim-1.c	(working copy)
@@ -82,5 +82,5 @@  main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  { xfail { vect_no_align || { ! vect_strided2 } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  { xfail { { vect_no_align && { ! vect_hw_misalign } } || { ! vect_strided2 } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c	(working copy)
@@ -81,8 +81,8 @@  int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail { vect_no_align } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail {{ vect_no_align } || {vect_sizes_32B_16B }}} } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail {{ vect_no_align } || {vect_sizes_32B_16B }}} } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail {{ vect_no_align && { ! vect_hw_misalign } } || {vect_sizes_32B_16B }}} } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail {{ vect_no_align && { ! vect_hw_misalign } } || {vect_sizes_32B_16B }}} } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
 
Index: gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c	(working copy)
@@ -54,7 +54,7 @@  int main (void)
 }
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/*  { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" {xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" {xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
 
Index: gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c	(working copy)
@@ -92,7 +92,7 @@  int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { target { vect_element_align}  } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { vect_no_align || vect_element_align } } } } */
 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 8 "vect" { xfail { vect_no_align || vect_element_align } } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c	(working copy)
@@ -61,7 +61,7 @@  int main (void)
 }
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { sparc*-*-* && ilp32 } }} } */
-/*  { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 6 "vect" { target vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 6 "vect" {xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 6 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 6 "vect" {xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
 
Index: gcc/testsuite/gcc.dg/vect/vect-nest-cycle-1.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-nest-cycle-1.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-nest-cycle-1.c	(working copy)
@@ -43,6 +43,6 @@  int main ()
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
 
Index: gcc/testsuite/gcc.dg/vect/vect-nest-cycle-2.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-nest-cycle-2.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-nest-cycle-2.c	(working copy)
@@ -42,6 +42,6 @@  int main ()
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
 
Index: gcc/testsuite/gcc.dg/vect/vect-outer-3a-big-array.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-outer-3a-big-array.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-outer-3a-big-array.c	(working copy)
@@ -48,6 +48,6 @@  int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "step doesn't divide the vector-size" 1 "vect" } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-outer-3a.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-outer-3a.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-outer-3a.c	(working copy)
@@ -48,6 +48,6 @@  int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "step doesn't divide the vector-size" 1 "vect" } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-outer-5.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-outer-5.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-outer-5.c	(working copy)
@@ -78,5 +78,5 @@  int main ()
    is known.  */
 /* { dg-final { scan-tree-dump-times "not vectorized: possible dependence between data-refs" 1 "vect" { xfail *-*-* } } } */
 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
-/* { dg-final { scan-tree-dump "zero step in outer loop." "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump "zero step in outer loop." "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-outer-fir-big-array.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-outer-fir-big-array.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-outer-fir-big-array.c	(working copy)
@@ -70,5 +70,5 @@  int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 2 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 2 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-outer-fir-lb-big-array.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-outer-fir-lb-big-array.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-outer-fir-lb-big-array.c	(working copy)
@@ -74,5 +74,5 @@  int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 2 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 2 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-outer-fir-lb.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-outer-fir-lb.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-outer-fir-lb.c	(working copy)
@@ -74,5 +74,5 @@  int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 2 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 2 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-outer-fir.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-outer-fir.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-outer-fir.c	(working copy)
@@ -70,5 +70,5 @@  int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 2 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 2 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-peel-3.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-peel-3.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-peel-3.c	(working copy)
@@ -48,7 +48,7 @@  int main (void)
   return main1 ();
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect"  { xfail { { vect_no_align } || {vect_sizes_32B_16B } } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align } || {vect_sizes_32B_16B } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect"  { xfail { { vect_no_align && { ! vect_hw_misalign } } || {vect_sizes_32B_16B } } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align && { ! vect_hw_misalign } } || {vect_sizes_32B_16B } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-peel-4.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-peel-4.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-peel-4.c	(working copy)
@@ -45,7 +45,7 @@  int main (void)
   return main1 ();
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect"  { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect"  { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.dg/vect/vect-pre-interact.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-pre-interact.c	(revision 219999)
+++ gcc/testsuite/gcc.dg/vect/vect-pre-interact.c	(working copy)
@@ -12,5 +12,5 @@  void foo (void)
     res[i] = data[i] + data[i + 1];
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.target/powerpc/vsx-vectorize-2.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/vsx-vectorize-2.c	(revision 219999)
+++ gcc/testsuite/gcc.target/powerpc/vsx-vectorize-2.c	(working copy)
@@ -59,7 +59,7 @@  int main (void)
 }
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" {xfail {! vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" {xfail { {! vect_hw_misalign } || powerpc*-*-* } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" {xfail {! vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" {xfail { {! vect_hw_misalign } || powerpc*-*-* } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.target/powerpc/vsx-vectorize-4.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/vsx-vectorize-4.c	(revision 219999)
+++ gcc/testsuite/gcc.target/powerpc/vsx-vectorize-4.c	(working copy)
@@ -55,7 +55,7 @@  int main (void)
 }
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" {xfail {! vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" {xfail { {! vect_hw_misalign } || powerpc*-*-* } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" {xfail {! vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" {xfail { {! vect_hw_misalign } || powerpc*-*-* } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.target/powerpc/vsx-vectorize-6.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/vsx-vectorize-6.c	(revision 219999)
+++ gcc/testsuite/gcc.target/powerpc/vsx-vectorize-6.c	(working copy)
@@ -59,7 +59,7 @@  int main (void)
 }
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" {xfail {! vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" {xfail { {! vect_hw_misalign } || powerpc*-*-* } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" {xfail {! vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" {xfail { {! vect_hw_misalign } || powerpc*-*-* } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gcc.target/powerpc/vsx-vectorize-7.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/vsx-vectorize-7.c	(revision 219999)
+++ gcc/testsuite/gcc.target/powerpc/vsx-vectorize-7.c	(working copy)
@@ -59,7 +59,7 @@  int main (void)
 }
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" {xfail {! vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" {xfail { {! vect_hw_misalign } || powerpc*-*-* } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" {xfail {! vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" {xfail { {! vect_hw_misalign } || powerpc*-*-* } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc/testsuite/gfortran.dg/vect/vect-2.f90
===================================================================
--- gcc/testsuite/gfortran.dg/vect/vect-2.f90	(revision 219999)
+++ gcc/testsuite/gfortran.dg/vect/vect-2.f90	(working copy)
@@ -15,8 +15,8 @@  END
 ! support unaligned loads).
 
 ! { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } }
-! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" { xfail { vect_no_align || { ! vector_alignment_reachable } } } } }
-! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { target { vect_no_align && { ! vector_alignment_reachable } } } } }
-! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align } } } }
-! { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" {target { vect_no_align || { { ! vector_alignment_reachable  } && { ! vect_hw_misalign } } } } } } 
+! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" { xfail { { vect_no_align && { ! vect_hw_misalign } } || { ! vector_alignment_reachable } } } } }
+! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { target { { vect_no_align && { ! vect_hw_misalign } } && { ! vector_alignment_reachable } } } } }
+! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } }
+! { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" {target { { vect_no_align && { ! vect_hw_misalign } } || { { ! vector_alignment_reachable  } && { ! vect_hw_misalign } } } } } }
 ! { dg-final { cleanup-tree-dump "vect" } }
Index: gcc/testsuite/gfortran.dg/vect/vect-3.f90
===================================================================
--- gcc/testsuite/gfortran.dg/vect/vect-3.f90	(revision 219999)
+++ gcc/testsuite/gfortran.dg/vect/vect-3.f90	(working copy)
@@ -6,10 +6,10 @@  DIMENSION X(N), Y(N)
 Y = Y + A * X
 END
 
-! { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target vect_no_align } } }
+! { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } }
 ! { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { {! vect_no_align} && { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } }
 ! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { {! vect_no_align} && { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } }
-! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || {! vector_alignment_reachable}} } } }
-! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { { vect_no_align } || { ! vector_alignment_reachable} } } } }
+! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align && { ! vect_hw_misalign } } || {! vector_alignment_reachable}} } } }
+! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { { vect_no_align && { ! vect_hw_misalign } } || { ! vector_alignment_reachable} } } } }
 
 ! { dg-final { cleanup-tree-dump "vect" } }
Index: gcc/testsuite/gfortran.dg/vect/vect-4.f90
===================================================================
--- gcc/testsuite/gfortran.dg/vect/vect-4.f90	(revision 219999)
+++ gcc/testsuite/gfortran.dg/vect/vect-4.f90	(working copy)
@@ -10,8 +10,8 @@  Y = Y + A * X
 END
 
 ! { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } 
-! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align } || {! vector_alignment_reachable} } } } }
-! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { { vect_no_align } || {! vector_alignment_reachable} } } } }
+! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align && { ! vect_hw_misalign } } || {! vector_alignment_reachable} } } } }
+! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { { vect_no_align && { ! vect_hw_misalign } } || {! vector_alignment_reachable} } } } }
 ! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } }
 ! { dg-final { scan-tree-dump-times "accesses have the same alignment." 1 "vect" } }
 ! { dg-final { cleanup-tree-dump "vect" } }
Index: gcc/testsuite/gfortran.dg/vect/vect-5.f90
===================================================================
--- gcc/testsuite/gfortran.dg/vect/vect-5.f90	(revision 219999)
+++ gcc/testsuite/gfortran.dg/vect/vect-5.f90	(working copy)
@@ -36,8 +36,8 @@ 
         end
 
 ! { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  } }
-! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || {! vector_alignment_reachable} } } } }
-! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align } } } }
-! { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target { vect_no_align } } } }
+! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align && { ! vect_hw_misalign } } || {! vector_alignment_reachable} } } } }
+! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } }
+! { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } }
 ! { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } }
 ! { dg-final { cleanup-tree-dump "vect" } }
Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	(revision 219999)
+++ gcc/testsuite/lib/target-supports.exp	(working copy)
@@ -4164,6 +4164,7 @@  proc check_effective_target_vect_no_align { } {
 	     || [istarget sparc*-*-*]
 	     || [istarget ia64-*-*]
 	     || [check_effective_target_arm_vect_no_misalign]
+	     || ([istarget powerpc*-*-*] && [check_p8vector_hw_available])
 	     || ([istarget mips*-*-*]
 		 && [check_effective_target_mips_loongson]) } {
 	    set et_vect_no_align_saved 1
@@ -4185,6 +4186,7 @@  proc check_effective_target_vect_hw_misalign { } {
     } else {
         set et_vect_hw_misalign_saved 0
        if { [istarget i?86-*-*] || [istarget x86_64-*-*]
+            || ([istarget powerpc*-*-*] && [check_p8vector_hw_available])
 	    || [istarget aarch64*-*-*] } {
           set et_vect_hw_misalign_saved 1
        }