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: Pad short functions for Atom


On Thu, Sep 23, 2010 at 2:11 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Thu, Sep 23, 2010 at 10:44 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>> On Fri, Sep 17, 2010 at 10:53 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>
>>> Here is the updated patch. ?OK for trunk?
>>
>>> gcc/
>>>
>>> 2010-09-17 ?H.J. Lu ?<hongjiu.lu@intel.com>
>>> ? ? ? ? ? ?Richard Henderson ?<rth@redhat.com>
>>>
>>> ? ? ? ?* config/i386/i386.c (initial_ix86_tune_features): Add
>>> ? ? ? ?X86_TUNE_PAD_SHORT_FUNCTION.
>>> ? ? ? ?(ix86_code_end): Pad with 8 NOPs for TARGET_PAD_SHORT_FUNCTION.
>>> ? ? ? ?(ix86_count_insn): New.
>>> ? ? ? ?(ix86_pad_short_function): Likewise.
>>> ? ? ? ?(ix86_reorg): Support TARGET_PAD_SHORT_FUNCTION.
>>>
>>> ? ? ? ?* config/i386/i386.h (ix86_tune_indices): Add
>>> ? ? ? ?X86_TUNE_PAD_SHORT_FUNCTION.
>>> ? ? ? ?(TARGET_PAD_SHORT_FUNCTION): New.
>>>
>>> ? ? ? ?* config/i386/i386.md (UNSPEC_NOPS): New.
>>> ? ? ? ?(nops): Likewise.
>>>
>>> gcc/testsuite/
>>>
>>> 2010-09-17 ?H.J. Lu ?<hongjiu.lu@intel.com>
>>>
>>> ? ? ? ?* gcc.target/i386/pad-1.c: New.
>>> ? ? ? ?* gcc.target/i386/pad-2.c: Likewise.
>>> ? ? ? ?* gcc.target/i386/pad-3.c: Likewise.
>>> ? ? ? ?* gcc.target/i386/pad-4.c: Likewise.
>>> ? ? ? ?* gcc.target/i386/pad-5a.c: Likewise.
>>> ? ? ? ?* gcc.target/i386/pad-5b.c: Likewise.
>>> ? ? ? ?* gcc.target/i386/pad-6a.c: Likewise.
>>> ? ? ? ?* gcc.target/i386/pad-6b.c: Likewise.
>>> ? ? ? ?* gcc.target/i386/pad-7.c: Likewise.
>>> ? ? ? ?* gcc.target/i386/pad-8.c: Likewise.
>>> ? ? ? ?* gcc.target/i386/pad-9.c: Likewise.
>>> ? ? ? ?* gcc.target/i386/pad-10.c: Likewise.
>>>
>>
>> Sorry for late review, but this patch has plenty of annoying issues:
>>
>> - "nops" pattern should be defined as unspec_volatile.
>> - generation of insn templates by case is ... ?well ... unusual at best.
>> - output_asm_insn is waay too complex to be used to output constant strings.
>>
>> Issues with test cases:
>>
>> - testing of the whole sequence of "nop"s in one line is not
>> effective, since scan-assembler-not is needed.
>> - testcases do not need to use "-S" in dg-options.
>> - the test should call "dg-require-effective-target pic" directive
>> before -fPIC is used
>>
>> Attached patch fixes all these annoyances (and a couple of similar
>> issues throughout i386 testsuite).
>
> On a related note, can four "xchgw %ax,%ax" be used instead of 8 "nop"
> instructions in the code below:
>

No, it needs 8 nops for 4 cycles.

-- 
H.J.


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