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]
Other format: [Raw text]

Need Help for a new target's assembly code


Dear sir,

I added a new Back-end in the GCC. After configuring GCC for this
Back-end, generated assembly code or intermediate code gives some
problem.

This is a C Program.
-----------------------------------------------------------------------
int main(void)
{
    int i,j;
    j=0;
    i=8;
    if(j)
        goto nitinj;
    j=i<222;
nitinj:
    return j;
}
-------------------------------------------------------------------------

This is a part of RTL code.
-------------------------------------------------------------------------
(insn 40 39 41 (set (reg/f:SI 0 ret [35])
               (reg/f:SI 0 ret [34])) 1 {*movsi_1} (nil)
               (nil))

(insn 41 40 42 (set (mem:SI (reg/f:SI 0 ret [35]) [0 S4 A32])
               (const_int 221 [0xdd])) 1 {*movsi_1} (nil)
               (nil))

(call_insn/u 42 41 44 (set (reg:SI 0 ret)
             (call (mem:QI (symbol_ref:SI ("__cmpsi2")) [0 S1 A8])
             (const_int 8 [0x8]))) 4 {call_value} (nil)
             (expr_list:REG_EH_REGION (const_int -1 [0xffffffff])
             (nil))
             (expr_list (clobber (reg/f:SI 10 sp))
             (nil)))

(insn 44 42 45 (set (reg:SI 0 ret [37])
               (reg:SI 0 ret)) 1 {*movsi_1} (nil)
               (nil))

(insn 45 44 46 (set (cc0)
               (compare (reg:SI 0 ret [37])
               (const_int 1 [0x1]))) 8 {*cmpsi_1} (nil)
               (nil))

-------------------------------------------------------------------------

My problem is that why there is a call to "__cmpsi2" while there is no
such thing in my .md file.

The part of the .md which is for `cmp op'.

-----------------------------------------------------------------------

( define_expand "cmpsi"
  [(set (cc0) (compare (match_operand:SI 0 "general_operand" "")
                       (match_operand:SI 1 "general_operand" "")))]
   ""
   "")

( define_insn "*cmpsi_1"
  [(set (cc0) (compare (match_operand:SI 0 "cmp_dest_op" "")
                       (match_operand:SI 1 "cmp_src_op" "i")))]
   ""
   "*
     toy_cmp_insn (operands[0], operands[1]);
   ")

`cmp_dest_op' checks that operand should be a memory or reg while
`cmp_src_op' checks that operand should be a const_int.

-----------------------------------------------------------------------

Please give me some suggestion.

Thanks a lot.

Nitin
---------------------------
Nitin Jain (H-12/#A-415)
Computer Science and Engg,
IIT BOMBAY,
POWAI, MUMBAI 400076
Phone : 4748 (Lab)
---------------------------



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