This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Segment registers support for i386
- From: Rask Ingemann Lambertsen <rask at sygehus dot dk>
- To: Rémy Saissy <remy dot saissy at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 14 May 2006 19:54:31 +0200
- Subject: Re: Segment registers support for i386
- References: <17fd5360605140909q2b9fb220j2dce5cb8524d6f90@mail.gmail.com>
On Mon, May 15, 2006 at 12:09:00AM +0800, Rémy Saissy wrote:
> To manage the manipulation of the register class, I added entries in
> the i386.md file.
>
> ;; get a value from a segment register.
> (define_insn "store_seg"
> [(set (match_operand:SI 0 "nonimmediate_operand" "")
> (match_operand:SI 1 "general_operand" "s"))]
> ""
> "movl\t%1,%0")
Operand 0 should have a constraint of "=rm" or so. Operand 1 should have a
predicate of "register_operand".
> ;; set a value in a segment register.
> (define_insn "load_seg"
> [(set (match_operand:SI 0 "general_operand" "=s")
> (match_operand:SI 1 "register_operand" ""))]
> ""
> "movl\t%1,%0")
Operand 1 should have a predicate of "nonimmediate_operand" and a constraint
of "rm".
Also, aren't the segment registers HImode registers? Above, you wrote:
> register short a __asm__ ("es");
^^^^^
And have you adjusted HARD_REGNO_MODE_OK() and HARD_REGNO_NREGS() accordingly?
--
Rask Ingemann Lambertsen