Hi Ian,

On Wed, Apr 21, 2010 at 5:42 PM, Ian Lance Taylor <i...@google.com> wrote:
> Frank Isamov <frank.isa...@gmail.com> writes:
>
>>  2. A peephole for such case just repeats instruction definition
>>  pattern. As all information already available for such peephole,
>>  wouldn’t it be useful to implement the pass to be a part of the
>>  standard infrastructure?
>
> See define_peephole and define_peephole2.  If that doesn't answer your
> question, can you rephrase it?
>
> Ian
>

I think I understood the points from Jeff’s reply and I am going to
look at PA implementation now. Just for this email thread
completeness, I’ll try to rephrase the initial question:

Instructions which manipulate with data in parallel and have no data
dependency automatically require peephole2 definition or/and machine
dependent reorg pass. (Please see an example at the bottom of this
email). Peephole2 pattern, in this case, just repeats instruction’s
RTL pattern.
As such instructions can appear in SIMD architectures, I just thought
that it would be profitable to have this pass to be a part of the
common infrastructure.


(define_insn "assi6"
 [(parallel [
    (set (match_operand:SI 0 "register_operand" "=r")
         (minus:SI (match_operand:SI 1 "register_operand" "r")
                   (match_operand:SI 2 "register_operand" "r")))
    (set (match_operand:SI 3 "register_operand" "=r")
         (plus:SI (match_operand:SI 4 "register_operand" "r")
                  (match_operand:SI 5 "register_operand" "r")))
 ])]
 ""
 "as\t%5, %4, %3, %2, %1, %0 %!"
)

(define_peephole2
 [
    (set (match_operand:SI 0 "register_operand")
         (minus:SI (match_operand:SI 1 "register_operand")
                   (match_operand:SI 2 "register_operand")))
    (set (match_operand:SI 3 "register_operand")
         (plus:SI (match_operand:SI 4 "register_operand")
                  (match_operand:SI 5 "register_operand")))
 ]
 ""
 [(parallel [
    (set (match_dup 0)
         (minus:SI (match_dup 1)
                   (match_dup 2)))
    (set (match_dup 3)
         (plus:SI (match_dup 4)
                  (match_dup 5)))
 ])]
 ""
)

Reply via email to