[Mono-dev] How do I use scratch registers in op code implementation

Braddock Gaskill (Contractor) braddock.gaskill at apx-labs.com
Tue Aug 21 22:53:43 UTC 2012


Oh, I see -  There is both a MONO_ARCH_CALLEE_REGS (for callER saved regs) and a MONO_ARCH_CALLEE_SAVED_REGS.  The names threw me.

By convention on TILE-Gx our r52 register is the frame pointer.  Does the frame pointer also need to be removed from the CALLEE_REGS/CALLEE_SAVED_REGS masks?  Or does the allocator handle that (since we already explicitly set cfg->frame_reg)?

Thanks for the pointers,
Braddock

________________________________
From: Rodrigo Kumpera [kumpera at gmail.com]
Sent: Tuesday, August 21, 2012 3:34 PM
To: Braddock Gaskill (Contractor)
Cc: mono-devel-list at lists.ximian.com; Michael Sciscenti
Subject: Re: [Mono-dev] How do I use scratch registers in op code implementation

You have to take it from the appropriate set (callee/caller) saved it belongs to.
The regalloc ask the arch code for a mask of available registers so, for example, pic code
can save a register for the GOT pointer.

On Tue, Aug 21, 2012 at 7:21 PM, Braddock Gaskill (Contractor) <braddock.gaskill at apx-labs.com<mailto:braddock.gaskill at apx-labs.com>> wrote:
Hi Rodrigo,

How do I take a general purpose register out of the available set for the register allocator?

I see with xmm15 on amd64 that you cleared the corresponding bit in MONO_ARCH_CALLEE_FREGS.

Can I just do the same with MONO_ARCH_CALLEE_REGS?  The allocator never touches callER saved regs?  (why not?)

Thanks,
Braddock


________________________________
From: Rodrigo Kumpera [kumpera at gmail.com<mailto:kumpera at gmail.com>]
Sent: Thursday, August 16, 2012 8:39 AM
To: Braddock Gaskill (Contractor)
Cc: mono-devel-list at lists.ximian.com<mailto:mono-devel-list at lists.ximian.com>
Subject: Re: [Mono-dev] How do I use scratch registers in op code implementation

You can take a register out of the available set and the register allocator will never use it.

We do that with xmm reg 15 on amd64.

On Thu, Aug 16, 2012 at 11:04 AM, Braddock Gaskill (Contractor) <braddock.gaskill at apx-labs.com<mailto:braddock.gaskill at apx-labs.com>> wrote:
Hi folks,
We're working on the mono port to the Tilera TILE-Gx cpu.

When implementing IR op codes in mono_arch_output_basic_block() we sometimes need to use a scratch register.  For example, TILE-Gx has no single membase + offset load instruction - we must do the address addition as a separate step.

How do we inform the runtime that we have/will clobber a register?  I know that if we clobber a source register we can set the clob field in the machine description file, but what if we use another register?  Is it possible to reserve a register for this purpose?

Thanks,
Braddock Gaskill


_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com<mailto:Mono-devel-list at lists.ximian.com>
http://lists.ximian.com/mailman/listinfo/mono-devel-list



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20120821/14464045/attachment.html>


More information about the Mono-devel-list mailing list