movsi on 16-bit machine: how to?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am implementing movsi on a 16-bit machine.
I did it this way:

;; ---- 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"))]
  ""
  "#"
)

(define_split
  [(set (match_operand:SI 0 "nonimmediate_operand" "")
        (match_operand:SI 1 "general_operand" ""))]
  "reload_completed
  && !extra_constraint (operands[1], 'R')"
  [(set (match_dup 2)
        (match_dup 3))
   (set (match_dup 4)
        (match_dup 5))]
  {
    operands[2] = simplify_gen_subreg(HImode,operands[0],SImode,0);
    operands[4] = simplify_gen_subreg(HImode,operands[0],SImode,2);
    operands[3] = simplify_gen_subreg(HImode,operands[1],SImode,0);
    operands[5] = simplify_gen_subreg(HImode,operands[1],SImode,2);
  }
)


And I tried many other code. But each time I have some " insn does not
satisfy its constraints".

../../../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))


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.

I will be grateful for any advice.

Florent


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux