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]

Blcopy for outgoing arguments.


Hi All,
Good day there.

We are porting the gcc 4.8.1 and defined the  calling conventions like
                If(sizeof(arg) < = 2)
                                Pass with reg.
                Else
                                Pass by stack.

The problem is that  the code is bloated for the datatype where
sizeof(datatype) > 2 .i.e

We see  the sequences of load from  the stack (for local)  and store
to stack(outgoiing args) like

ld reg,(fp-d-1)
ld (sp+d),reg
ld reg,(fp-d-2)
ld (sp+d+1),reg
ld reg,(fp-d-3)
ld (sp+d+2),reg
ld reg,(fp-d-4)
ld (sp+d+3),reg
ââââââ.
and goes on for large type size â..

So we thought of having blkcopy intrinsic function which takes the
address of src and dst  along size and the  alignment info.

Se we defined the  some of the gcc macros like

#defined MOVE_MAX  2
#define MOVE_BY_PIECES_P(SIZE, ALIGN)         \
          ( (SIZE) == 1 || (SIZE) == 2  )

And define movmemhi pattern( word size is 2 byte) as

;; Argument 0 is the destination
;; Argument 1 is the source
;; Argument 2 is the length
;; Argument 3 is the alignment

(define_expand "movmemhi"
  [(match_operand 0 "general_operand" "")
   (match_operand 1 "general_operand" "")
   (match_operand 2 "register_operand" "")
   (match_operand 3 "" "")
   ]
  ""
        {
                rtx libfunc = init_one_libfunc ("blkcopy ");
                emit_library_call_value (libfunc,NULL_RTX, LCT_NORMAL, VOIDmode,
                                               2, operands[0],
HImode,operands[1], HImode);
                DONE;
        }

  )

After all this ,we still see the sequences of load from  the stack
(for local)  and store to stack(outgoiing args) and backend is not
able to emit the libcall for the blockcopy.

We are debugging the issue and the  meanwhile appreciate any help from
the group .


Thank you and waiting for a any reply
~Umesh


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