This is the mail archive of the gcc-patches@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] |
> > *naturally* aligned (i.e. aligned on their type-size boundary). Uros, can > > we redefine this function in a way that would fit both spu and x86_64? Say, > > that data-types are guaranteed to be at least naturally aligned? > > Hm, for x86_64 we have: > > /* x86-64 ABI requires arrays greater than 16 bytes to be aligned > to 16byte boundary. */ > if (TARGET_64BIT) > { > if (AGGREGATE_TYPE_P (type) > && TYPE_SIZE (type) > && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST > && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 128 > || TREE_INT_CST_HIGH (TYPE_SIZE (type))) && align < 128) > return 128; > } > > So this alignment exception applies only to arrays. There is no > guarantee, that i.e. some unrelated sequence of floats will be aligned > to vector alignement boundary. > > ok, I used a separate keyword, and committed the patch that makes the same fix for the spu. Attached is the patch I committed. thanks, dorit * lib/target-support.exp (check_effective_target_natural_alignment): (check_effective_target_vector_alignment_reachable): New. * config/spu/spu.c (spu_vector_alignment_reachable): New. (TARGET_VECTOR_ALIGNMENT_REACHABLE): Define. * gcc.dg/vect/pr25413a.c: Use vector_alignment_reachable target check. * gcc.dg/vect/pr25413.c: Likewise. * gcc.dg/vect/pr31699.c: Likewise. (See attached file: pr25413spu) > > (**) by the way, I think we should either define > > check_effective_target_vect_aligned_arrays as checking if things are > > "naturally aligned" or as checking if things are "aligned to the vector > > alignment boundary", but not as it is currently defined, which mixes both > > ("naturally aligned to the vector alignment boundary"). > > Of course. I'll just remove "naturally" from the description. > > Uros.
Attachment:
pr25413spu
Description: Binary data
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |