This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/35866] Vector load/store from a packed struct does not work (without -mstrict-align)



------- Comment #4 from froydnj at gcc dot gnu dot org  2008-05-09 03:14 -------
If I understand correctly, one would just need to add vector modes with
appropriate alignment restrictions to SLOW_UNALIGNED_ACCESS.  If I add an extra

|| (((MODE) == V4SFmode || (MODE) == V2DFmode) && (ALIGN) < 128)

to SLOW_UNALIGNED_ACCESS, and compile without -mstrict-align, I get
semi-reasonable looking code at -O2:

f:
       stwu 1,-48(1)
       addi 9,1,16
       stw 28,32(1)
       stw 29,36(1)
       stvx 2,0,9
       lwz 8,12(9)
       lwz 5,0(9)
       lwz 6,4(9)
       mr 0,8
       lwz 7,8(9)
       stw 8,13(3)
       addi 8,1,16
       stw 5,1(3)
       stw 7,9(3)
       stw 6,5(3)
       stw 5,0(8)
       stw 6,4(8)
       stw 7,8(8)
       stw 0,12(8)
       lvx 2,0,8
       lwz 28,32(1)
       lwz 29,36(1)
       addi 1,1,48
       blr

It could be improved, but it's a lot better than -mstrict-align code.


-- 

froydnj at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |froydnj at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35866


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]