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]

Re: patch: Re: rfc: auto-casted vector types


Yes, indeed I was confusing intrinsics with builtins. The builtins are V2SI, the intrinsics are opaque types.

Changing the intrinsic definitions in spe.h to cast the result to the right
type does sound like an easy solution to the problem. The ABI defines the
behaviour of the intrinsics, but does not define the behaviour of the gcc
builtins, so all that really matters is that we get the intrinsics right.

Easy is good.


Graham is suggesting that we change the builtin function expanders in rs6000.c
to use the correct type. Maybe we can change the builtin function types
without having to change the RTL modes. This would mean using an opaque
vector type instead of V2SI_type_node in the rs6000.c file. This should have
the same effect as adding casts to the intrinsics. This means defining
the opaque vector type as a builtin type instead of in spe.h.

Now I see. Yes, I looked at this approach as well, but this one is more error prone. V2SI_type_node is all over the place. We'd add a new type, change the builtins accordingly, and then change is_ev64_opaque_type to recognize this new type as well. What I am trying to avoid with my approach is changing the back end at all, and just change the user header file. I also don't want to touch too much what ain't broke (in the back end).


One place where Graham's approach would be superior would be for the load intrinsics which currently cast to (void *). With Graham's approach we could remove the cast, and then accept only vector types that are compatible with the opaque type, not just *any* pointer like it is now. But I'm willing to live with that.

Does this sound like a reasonable approach Jim?

Aldy


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