[PATCH][GCC][mid-end] Allow larger copies when target supports unaligned access [Patch (1/2)]

Tamar Christina Tamar.Christina@arm.com
Thu Nov 16 11:46:00 GMT 2017


> > > 
> > > I see.  But then the slow_unaligned_access implementation should use
> > > non_strict_align as default somehow as SLOW_UNALIGNED_ACCESS is
> > > defaulted to STRICT_ALIGN.
> > > 
> > > Given that SLOW_UNALIGNED_ACCESS has different values for different
> > > modes it would also make sense to be more specific for the testcase in
> > > question, like word_mode_slow_unaligned_access to tell this only applies to
> > > word_mode?
> > 
> > Ah, that's fair enough. I've updated the patch and the new changelog is:
> 
> Did you attach the old patch? I don't see strict_aling being tested in
> the word_mode_np_slow_unalign test.
> 

Sorry! I misunderstood your previous email. I've added the check accordingly.

But this also raises a question, some targets have defined SLOW_UNALIGNED_ACCESS
in a way that uses only internal state to determine the value where STRICT_ALIGNMENT
is essentially ignored. e.g. PowerPC and riscv.

The code generation *might* change for them but the tests won't run. I see now way to
make the test accurate (as in, runs in all cases where the codegen changed)
unless I expose SLOW_UNALIGNED_ACCESS as a define so I can test for it.

Would this be the way to go?

Thanks,
Tamar

> Richard.
> 
> > 
> > gcc/
> > 2017-11-15  Tamar Christina  <tamar.christina@arm.com>
> > 
> > 	* expr.c (copy_blkmode_to_reg): Fix bitsize for targets
> > 	with fast unaligned access.
> > 	* doc/sourcebuild.texi (word_mode_no_slow_unalign): New.
> > 	
> > gcc/testsuite/
> > 2017-11-15  Tamar Christina  <tamar.christina@arm.com>
> > 
> > 	* gcc.dg/struct-simple.c: New.
> > 	* lib/target-supports.exp
> > 	(check_effective_target_word_mode_no_slow_unalign): New.
> > 
> > Ok for trunk?
> > 
> > Thanks,
> > Tamar
> > 
> > > 
> > > Thanks,
> > > Richard.
> > > 
> > > > Thanks,
> > > > Tamar
> > > > >
> > > > > Otherwise the expr.c change looks ok.
> > > > >
> > > > > Thanks,
> > > > > Richard.
> > > > >
> > > > > > Thanks,
> > > > > > Tamar
> > > > > >
> > > > > >
> > > > > > gcc/
> > > > > > 2017-11-14  Tamar Christina  <tamar.christina@arm.com>
> > > > > >
> > > > > > 	* expr.c (copy_blkmode_to_reg): Fix bitsize for targets
> > > > > > 	with fast unaligned access.
> > > > > > 	* doc/sourcebuild.texi (no_slow_unalign): New.
> > > > > >
> > > > > > gcc/testsuite/
> > > > > > 2017-11-14  Tamar Christina  <tamar.christina@arm.com>
> > > > > >
> > > > > > 	* gcc.dg/struct-simple.c: New.
> > > > > > 	* lib/target-supports.exp
> > > > > > 	(check_effective_target_no_slow_unalign): New.
> > > > > >
> > > > > >
> > > > >
> > > > > --
> > > > > Richard Biener <rguenther@suse.de>
> > > > > SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham
> > > > > Norton, HRB 21284 (AG Nuernberg)
> > > >
> > > >
> > > 
> > > --
> > > Richard Biener <rguenther@suse.de>
> > > SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton,
> > > HRB 21284 (AG Nuernberg)
> > 
> 
> -- 
> Richard Biener <rguenther@suse.de>
> SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)

-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: memcopy-midend-3.patch
Type: text/x-diff
Size: 4486 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20171116/bd263f33/attachment.bin>


More information about the Gcc-patches mailing list