This is the mail archive of the 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, fortran, 4.9] Improve efficiency of array constructor operators

Am 29.03.2013 14:42, schrieb Thomas Koenig:
I wrote:

PS: Regarding the string comparison patch: As Janne, think it should be
fine with also supporting kind=4 (don't forget to multiply the length by
the kind, e.g. ts.kind or more properly (but equivalently)

I'll do that.

Oops, it turns out we can't do this, at least not on little-endian

I somehow completely missed that "<" is permitted for characters.* Thanks for the reminder. Actually, we still can do use memcpy for "==" and "/=" - but admittedly not for <, <=, >= and >=.

Thus, how about using memcmp for kind=4 for == and /= only - and for kind=1 also for <, > etc.?

Side note: The elemental intrinsic functions lge, lgt, lle and llt work likewise. Thus, they could also profit from the same optimization. However, I do not know whether anyone one uses these. The difference between "<" and llt() seems to be that llt takes a default-kind (or F2008: also ASCII kind) and uses the ASCII collating sequence while < etc use the collating sequence. As our default-kind character is the ASCII character, the distinction does not matter.


* For <, >= etc., see Fortran 2003, "7.2.3 Relational intrinsic operations", 7th paragraph; Fortran 2008, 9th paragraph of " Interpretation of relational intrinsic operations"

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