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: Remove SLOW_BYTE_ACCESS from get_best_mode



I don't understand why we use byte instruction to access 32bit field.
There may be some hardwares where 4 byte accesses are faster than one
32bit access. But I am not aware any x86 one. I tried this patch on
Prescott, Nocona, Core and Core 2. There are no regressions in gcc
testsuites nor negative performance impact on SPEC CPU 2K.

First, the patch should have subject "Rename ..." rather than "Remove". As it is, it conveys the idea that there is no differentiation anymore in get_best_mode.


Second, I don't like the name FAST_BYTE_ACCESS_BITFIELD. It could be named SLOW_BYTE_ACCESS_BITFIELD (switching the default definition and use to remove the !), or WORD_ACCESS_BITFIELD.

Third, documentation is needed for the new macro.

Fourth, the default value for the new target macro should be in defaults.h rather than in stor-layout.c.

Fifth, it seems plausible to me that SLOW_BYTE_ACCESS would still win if there was only one bitfield accessed. dojump.c is using byte instructions when jumping, i.e. when obviously you access only one field, and it is a win there. I think the changes in twolf should be analyzed more carefully before proposing a patch, to identify the pessimization there and whether it could happen with the proposed patch on similar code.

Paolo


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