This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: movsi on 16-bit machine: how to?
- From: Ian Lance Taylor <iant at google dot com>
- To: Florent DEFAY <spira dot inhabitant at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 27 Mar 2009 09:37:52 -0700
- Subject: Re: movsi on 16-bit machine: how to?
- References: <8502af3c0903270156v63cc8edcw571e15442a8a23be@mail.gmail.com>
Florent DEFAY <spira.inhabitant@gmail.com> writes:
> ;; ---- movsi
>
> (define_insn "movsi"
> [(set (match_operand:SI 0 "nonimmediate_operand" "=r,m,r,r")
> (match_operand:SI 1 "general_operand" "r,r,m,i"))]
> ""
> "#"
> )
...
> ../../../gcc-4.3.3/libgcc/../gcc/libgcc2.c: In function â__lshrsi3â:
> ../../../gcc-4.3.3/libgcc/../gcc/libgcc2.c:435: error: insn does not
> satisfy its constraints:
> (insn 8 98 80 ../../../gcc-4.3.3/libgcc/../gcc/libgcc2.c:415 (set
> (mem/c/i:SI (reg:HI 0 r0) [0 <result>+0 S4 A16])
> (reg:SI 1 r1)) 6 {movsi} (nil))
As far as I can see, the only way that this insn could fail to satisfy
its constraints would be if (mem:SI (reg:HI 0)) does not satisfy the 'm'
constraint. That implies that that address is not recognized by
GO_IF_LEGITIMATE_ADDRESS. Look there first.
> I am looking for a great and simple example of movsi for 16-bit
> machine or movdi for 32-bit machine (because I think it is the same
> mechanism);
> or a basic method to do this.
There are many examples in the existing gcc backends.
Ian