This is the mail archive of the gcc@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]

rtl generation & predicates


hi,
can anybody give me an insight into the following matter?
does GCC (version 2.8.1)  check the predicate (given in a
match_operand) when it constructs an insn at RTL Generation pass? 

as far as my understanding goes, the document "Using and Porting GNU
CC" (section: Machine Descriptions, subsection: RTL Template) says that
predicates play no role in 'insn' construction. but...... with this i'm
not able to explain the following experience of porting GCC to an
arbitrary machine:

when 'addsi3' is defined in md file in the following way

;;'reg_or_int' accepts a 'reg' or a 'const_int'
(define_insn "addsi3"
[(set (match_operand:SI 0 "s_register_operand" "")
(plus:SI (match_operand:SI 1 "s_register_operand" "")
(match_operand:SI 2 "reg_or_int_operand" "")))]
""
"something"
)    

i see following 'insn' in the dump after RTL generation pass while
compiling a simple c program:

(insn 20 18 23 (set (reg/v:SI 33)
(plus:SI (reg/v:SI 33)
(const_int 17))) -1 (nil)
(nil))

if the md pattern for 'addsi3' is changed to following:

(define_insn "addsi3"
[(set (match_operand:SI 0 "s_register_operand" "")
(plus:SI (match_operand:SI 1 "s_register_operand" "")
(match_operand:SI 2 "register_operand" "")))]
""
"something"
) 

i see the following pair of 'insn's, instead of the one mentioned above,
in the dump after RTL generation, while compiling the same c prog:

(insn 21 18 22 (set (reg:SI 36)
(const_int 17)) -1 (nil)
(nil))

(insn 22 21 25 (set (reg/v:SI 33)
(plus:SI (reg/v:SI 33)
(reg:SI 36))) -1 (nil)
(nil)) 

pl throw some light on this problem.....

thank you in advance.

--soubhik.


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