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: Wed, 17 May 2006 20:39:56 +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")
>
> ;; 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")
I think you'll have to add "s" alternatives to the *movhi pattern instead of
adding two new patterns, since otherwise there will be two nearly identical
patterns and GCC might use the wrong one. If you need patterns named
"store_seg" and "load_seg", use an expander.
--
Rask Ingemann Lambertsen