Discussion:
define_subst question
Andrew Stubbs
2018-11-27 17:30:13 UTC
Permalink
I want to use define_subst like this:

(define_subst "vec_merge_with_vcc"
[(set (match_operand 0)
(match_operand 1))
(set (match_operand 2)
(match_operand 3))]
""
[(parallel
[(set (match_dup 0)
(vec_merge
(match_dup 1)
(match_operand 4 "" "0")
(match_operand 5 "" "e")))
(set (match_dup 2)
(and (match_dup 3)
(match_operand 5 "" "e")))])])

(Predicates and modes removed for brevity.)

This works perfectly except for operand 5. :-(

The problem is that I can't find a way to make them "match". As it is
the substitution creates two operands, with different numbers, which
obviously is not what I want.

The manual says that I can't do (match_dup 5), and indeed trying that
results in a segmentation fault.

The "e" register class actually contains only one register, so I tried
using (reg:DI EXEC_REG) for the second instance, but that caused an ICE
elsewhere.

I could use an unspec to make the second reference implicit, or just lie
to the compiler and pretend it's not there, but ....

How can I do this properly, please?

Thanks

Andrew

Loading...