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: PR target/44615: -mtune=atom failed on sse2-vec-2.c and amd64-abi-3.c


On Mon, Jun 21, 2010 at 11:54 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Mon, Jun 21, 2010 at 8:47 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>
>>>> When --with-cpu=atom is used to configure gcc, -mtune=atom is used by
>>>> default. I got
>>>>
>>>> FAIL: gcc.target/i386/amd64-abi-3.c scan-assembler subq[\\t ]*\\$88,[\\t ]*%rsp
>>>>
>>>> This is due to -mtune=atom generates:
>>>>
>>>> ? ? ? ?leaq ? ?-88(%rsp), %rsp
>>>>
>>>> instead of
>>>>
>>>> ? ? ? ?subq ? ?$88, %rsp
>>>>
>>>> also
>>>>
>>>> /export/build/gnu/gcc-atom/build-x86_64-linux/gcc/xgcc
>>>> -B/export/build/gnu/gcc-atom/build-x86_64-linux/gcc/
>>>> /export/gnu/import/git/gcc/gcc/testsuite/gcc.target/i386/sse2-vec-2.c
>>>> -O2
>>>> -msse2 -mtune=atom
>>>> In file included from
>>>> /export/gnu/import/git/gcc/gcc/testsuite/gcc.target/i386/sse2-vec-2.c:5:0:
>>>> /export/gnu/import/git/gcc/gcc/testsuite/gcc.target/i386/sse2-check.h:
>>>> In
>>>> function ‘do_test’:
>>>> /export/gnu/import/git/gcc/gcc/testsuite/gcc.target/i386/sse2-check.h:12:1:
>>>> internal compiler error: Segmentation fault
>>>> Please submit a full bug report,
>>>> with preprocessed source if appropriate.
>>>> See <http://gcc.gnu.org/bugs.html> for instructions.
>>>>
>>>> The problem is
>>>>
>>>> ;; if palignr or psrldq
>>>> (define_insn_reservation ?"atom_sseishft_2" 1
>>>> ?(and (eq_attr "cpu" "atom")
>>>> ? ? ? (and (eq_attr "type" "sseishft")
>>>> ? ? ? ? ? ?(and (eq_attr "atom_unit" "sishuf")
>>>> ? ? ? ? ? ? ? ? (match_operand 2 "immediate_operand"))))
>>>> ?"atom-simple-0")
>>>>
>>>> ;; if reg/mem op
>>>> (define_insn_reservation ?"atom_sseishft_3" 2
>>>> ?(and (eq_attr "cpu" "atom")
>>>> ? ? ? (and (eq_attr "type" "sseishft")
>>>> ? ? ? ? ? ?(not (match_operand 2 "immediate_operand"))))
>>>> ?"atom-complex, atom-all-eu")
>>>>
>>>> in atom.md. Some sseishft patterns, which generate psrldq, don't
>>>> have the 3rd operand as shift count.
>>>>
>>>> This patch fixes amd64-abi-3.c by adding -mtune=k8 to generate subq
>>>> instead of leaq. For sse2-vec-2.c, I added a new type for psrldq.
>>>> There is no need to check for psrldq when it is the only alternative.
>>>> OK for trunk if no regressions and 4.4/4.5 after a few days?
>>>>
>>
>>> No need for new define_insn_reservation, please merge this
>>> functionality into existing atom_sseishft_2.
>>>
>>> Also, please rename new psrldq type to sseishft1, this is more
>>> consistent with existing naming scheme..
>>>
>>> Uros.
>>>
>>
>> Here is the updated patch. ?OK for trunk and 4.5?
>>
>> Thanks.
>>
>> --
>> H.J.
>> ---
>> gcc/
>>
>> 2010-06-21 ?H.J. Lu ?<hongjiu.lu@intel.com>
>>
>> ? ? ? ?PR target/44615
>> ? ? ? ?* config/i386/atom.md (atom_sseishft_2): Also check sseishft1.
>>
>> ? ? ? ?* config/i386/i386.md (type): Add sseishft1
>>
>> ? ? ? ?* config/i386/ppro_insn (ppro_insn): Also check sseishft1.
>> ? ? ? ?(ppro_insn_load): Likewise.
>> ? ? ? ?(ppro_insn_store): Likewise.
>> ? ? ? ?(ppro_insn_both): Likewise.
>>
>> ? ? ? ?* config/i386/sse.md (avx_lshrv1ti3): Replace sseishft with
>> ? ? ? ?sseishft1 for type.
>> ? ? ? ?(sse2_lshrv1ti3): Likewise.
>
> No need to change above two patterns, they do have operand 2.
>

The condition is

;; if palignr or psrldq
(define_insn_reservation  "atom_sseishft_2" 1
  (and (eq_attr "cpu" "atom")
       (ior (eq_attr "type" "sseishft1")
            (and (eq_attr "type" "sseishft")
                 (and (eq_attr "atom_unit" "sishuf")
                      (match_operand 2 "immediate_operand")))))
  "atom-simple-0")

XXX_shrv1ti3 don't have atom_unit. I can either add atom_unit
or use sseishft1 I choose sseishft1 for consistency. I can set
atom_unit to sishuf if it is preferred.

Thanks.

-- 
H.J.


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