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]

Re: ARM emit jump insn


On 03/09/15 17:42, Marcos DÃaz wrote:
Hi I'm doing an investigation trying to modify the generation of
prologues and epilogues for ARM cross compiler.
So far I could successfully add some lines to the prologue generation,
but Im having problems with some thing: How do you suggest is the best
way to emit an assembler line that makes a branch (not branch with
link) to a certain label.
I've tried the following:

     char funcname[] ="funcname"; (global)

      rtx mylabel , from;
     LABEL_NAME(mylabel) = funcname;
         from = emit_jump_insn(gen_jump (mylabel));
         JUMP_LABEL (from) = mylabel;
         ++LABEL_NUSES (mylabel);

But this emits a jump to an internal label (for example .L0)

what I wanted to do is that those lines generate a jump to funcname:

b   funcname
Two approaches.

If you want to represent the call in RTL, emit_call_insn (...). That's generally the way to emit a function call.

However there are also cases where the call you're making does not necessarily confirm to the target ABI. In those cases most folks have an insn in their backend (a define_insn) that internally performs the call. If you have a named pattern fubar, you can emit an insn with that pattern using emit_insn (gen_fubar (arguments)))

jeff


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