This is the mail archive of the gcc-help@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: movsi on 16-bit machine: how to?


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


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