home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / gnu / gcc-2.3.3-src.lha / GNU / src / amiga / gcc-2.3.3 / config / we32k.md < prev    next >
Text File  |  1994-02-06  |  37KB  |  1,232 lines

  1. ;;- Machine description for GNU compiler
  2. ;;- AT&T we32000 Version
  3. ;;  Contributed by John Wehle (john@feith1.uucp)
  4. ;;   Copyright (C) 1991-1992 Free Software Foundation, Inc.
  5.  
  6. ;; This file is part of GNU CC.
  7.  
  8. ;; GNU CC is free software; you can redistribute it and/or modify
  9. ;; it under the terms of the GNU General Public License as published by
  10. ;; the Free Software Foundation; either version 1, or (at your option)
  11. ;; any later version.
  12.  
  13. ;; GNU CC is distributed in the hope that it will be useful,
  14. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. ;; GNU General Public License for more details.
  17.  
  18. ;; You should have received a copy of the GNU General Public License
  19. ;; along with GNU CC; see the file COPYING.  If not, write to
  20. ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  
  22.  
  23. ;;- instruction definitions
  24.  
  25. ;;- @@The original PO technology requires these to be ordered by speed,
  26. ;;- @@    so that assigner will pick the fastest.
  27.  
  28. ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
  29.  
  30. ;;- When naming insn's (operand 0 of define_insn) be careful about using
  31. ;;- names from other targets machine descriptions.
  32.  
  33. ;; move instructions
  34.  
  35. (define_insn ""
  36.   [(set (match_operand:DF 0 "push_operand" "=m")
  37.         (match_operand:DF 1 "general_operand" "mrF"))]
  38.   ""
  39.   "*
  40.   {
  41.   output_push_double(&operands[1]);
  42.  
  43.   return \"\";
  44.   }")
  45.  
  46. (define_insn "movdf"
  47.   [(set (match_operand:DF 0 "nonimmediate_operand" "=mr")
  48.         (match_operand:DF 1 "general_operand" "mrF"))]
  49.   ""
  50.   "*
  51.   {
  52.   output_move_double(operands);
  53.  
  54.   return \"\";
  55.   }")
  56.  
  57. (define_insn ""
  58.   [(set (match_operand:SF 0 "push_operand" "=m")
  59.         (match_operand:SF 1 "general_operand" "mrF"))]
  60.   ""
  61.   "pushw %1")
  62.  
  63. (define_insn "movsf"
  64.   [(set (match_operand:SF 0 "nonimmediate_operand" "=mr")
  65.         (match_operand:SF 1 "general_operand" "mrF"))]
  66.   ""
  67.   "movw %1, %0")
  68.  
  69. (define_insn ""
  70.   [(set (match_operand:DI 0 "push_operand" "=m")
  71.         (match_operand:DI 1 "general_operand" "mriF"))]
  72.   ""
  73.   "*
  74.   {
  75.   output_push_double(&operands[1]);
  76.  
  77.   return \"\";
  78.   }")
  79.  
  80. (define_insn "movdi"
  81.   [(set (match_operand:DI 0 "nonimmediate_operand" "=mr")
  82.         (match_operand:DI 1 "general_operand" "mriF"))]
  83.   ""
  84.   "*
  85.   {
  86.   output_move_double(operands);
  87.  
  88.   return \"\";
  89.   }")
  90.  
  91. (define_insn ""
  92.   [(set (match_operand:SI 0 "push_operand" "=m")
  93.         (match_operand:SI 1 "general_operand" "mri"))]
  94.   ""
  95.   "pushw %1")
  96.  
  97. (define_insn "movsi"
  98.   [(set (match_operand:SI 0 "nonimmediate_operand" "=mr")
  99.         (match_operand:SI 1 "general_operand" "mri"))]
  100.   ""
  101.   "movw %1, %0")
  102.  
  103. (define_insn "movhi"
  104.   [(set (match_operand:HI 0 "nonimmediate_operand" "=mr")
  105.         (match_operand:HI 1 "general_operand" "mri"))]
  106.   ""
  107.   "movh %1, %0")
  108.  
  109. (define_insn "movqi"
  110.   [(set (match_operand:QI 0 "nonimmediate_operand" "=mr")
  111.         (match_operand:QI 1 "general_operand" "mri"))]
  112.   ""
  113.   "movb %1, %0")
  114.  
  115. ;; add instructions
  116.  
  117. (define_insn ""
  118.   [(set (match_operand:DI 0 "nonimmediate_operand" "=&or")
  119.         (plus:DI (match_operand:DI 1 "nonimmediate_operand" "0")
  120.                  (match_operand:DI 2 "general_operand" "oriF")))]
  121.   ""
  122.   "*
  123.   {
  124.   rtx label[1];
  125.   rtx lsw_operands[3];
  126.  
  127.   if (GET_CODE (operands[0]) == REG)
  128.     lsw_operands[0] = gen_rtx(REG, SImode, REGNO (operands[0]) + 1);
  129.   else
  130.     if (GET_CODE (operands[0]) == MEM && offsettable_memref_p (operands[0]))
  131.       lsw_operands[0] = adj_offsettable_operand(operands[0], 4);
  132.     else
  133.       abort();
  134.  
  135.   if (GET_CODE (operands[2]) == REG)
  136.     lsw_operands[2] = gen_rtx(REG, SImode, REGNO (operands[2]) + 1);
  137.   else
  138.     if (GET_CODE (operands[2]) == MEM && offsettable_memref_p (operands[2]))
  139.       lsw_operands[2] = adj_offsettable_operand(operands[2], 4);
  140.     else
  141.       if (GET_CODE (operands[2]) == CONST_DOUBLE)
  142.         {
  143.         lsw_operands[2] = gen_rtx(CONST_INT, SImode,
  144.                                   CONST_DOUBLE_HIGH(operands[2]));
  145.         operands[2] = gen_rtx(CONST_INT, SImode,
  146.                               CONST_DOUBLE_LOW(operands[2]));
  147.         }
  148.       else
  149.         if (GET_CODE (operands[2]) == CONST_INT)
  150.           {
  151.           lsw_operands[2] = operands[2];
  152.           operands[2] = const0_rtx;
  153.           }
  154.         else
  155.           abort();
  156.  
  157.   label[0] = gen_label_rtx();
  158.   LABEL_NUSES(label[0]) = 1;
  159.  
  160.   output_asm_insn(\"addw2 %2, %0\", operands);
  161.   output_asm_insn(\"addw2 %2, %0\", lsw_operands);
  162.   output_asm_insn(\"BCCB %l0\", label);
  163.   output_asm_insn(\"INCW %0\", operands);
  164.   output_asm_insn(\"%l0:\", label);
  165.  
  166.   return \"\";
  167.   }")
  168.  
  169. (define_insn "adddi3"
  170.   [(set (match_operand:DI 0 "nonimmediate_operand" "=&or")
  171.         (plus:DI (match_operand:DI 1 "general_operand" "oriF")
  172.                  (match_operand:DI 2 "general_operand" "oriF")))]
  173.   ""
  174.   "*
  175.   {
  176.   rtx label[1];
  177.   rtx lsw_operands[3];
  178.  
  179.   if (GET_CODE (operands[0]) == REG)
  180.     lsw_operands[0] = gen_rtx(REG, SImode, REGNO (operands[0]) + 1);
  181.   else
  182.     if (GET_CODE (operands[0]) == MEM && offsettable_memref_p (operands[0]))
  183.       lsw_operands[0] = adj_offsettable_operand(operands[0], 4);
  184.     else
  185.       abort();
  186.  
  187.   if (GET_CODE (operands[1]) == REG)
  188.     lsw_operands[1] = gen_rtx(REG, SImode, REGNO (operands[1]) + 1);
  189.   else
  190.     if (GET_CODE (operands[1]) == MEM && offsettable_memref_p (operands[1]))
  191.       lsw_operands[1] = adj_offsettable_operand(operands[1], 4);
  192.     else
  193.       if (GET_CODE (operands[1]) == CONST_DOUBLE)
  194.         {
  195.         lsw_operands[1] = gen_rtx(CONST_INT, SImode,
  196.                                   CONST_DOUBLE_HIGH(operands[1]));
  197.         operands[1] = gen_rtx(CONST_INT, SImode,
  198.                               CONST_DOUBLE_LOW(operands[1]));
  199.         }
  200.       else
  201.         if (GET_CODE (operands[1]) == CONST_INT)
  202.           {
  203.           lsw_operands[1] = operands[1];
  204.           operands[1] = const0_rtx;
  205.           }
  206.         else
  207.           abort();
  208.  
  209.   if (GET_CODE (operands[2]) == REG)
  210.     lsw_operands[2] = gen_rtx(REG, SImode, REGNO (operands[2]) + 1);
  211.   else
  212.     if (GET_CODE (operands[2]) == MEM && offsettable_memref_p (operands[2]))
  213.       lsw_operands[2] = adj_offsettable_operand(operands[2], 4);
  214.     else
  215.       if (GET_CODE (operands[2]) == CONST_DOUBLE)
  216.         {
  217.         lsw_operands[2] = gen_rtx(CONST_INT, SImode,
  218.                                   CONST_DOUBLE_HIGH(operands[2]));
  219.         operands[2] = gen_rtx(CONST_INT, SImode,
  220.                               CONST_DOUBLE_LOW(operands[2]));
  221.         }
  222.       else
  223.         if (GET_CODE (operands[2]) == CONST_INT)
  224.           {
  225.           lsw_operands[2] = operands[2];
  226.           operands[2] = const0_rtx;
  227.           }
  228.         else
  229.           abort();
  230.  
  231.   label[0] = gen_label_rtx();
  232.   LABEL_NUSES(label[0]) = 1;
  233.  
  234.   output_asm_insn(\"addw3 %2, %1, %0\", operands);
  235.   output_asm_insn(\"addw3 %2, %1, %0\", lsw_operands);
  236.   output_asm_insn(\"BCCB %l0\", label);
  237.   output_asm_insn(\"INCW %0\", operands);
  238.   output_asm_insn(\"%l0:\", label);
  239.  
  240.   return \"\";
  241.   }")
  242.  
  243. (define_insn ""
  244.   [(set (match_operand:SI 0 "nonimmediate_operand" "=mr")
  245.         (plus:SI (match_operand:SI 1 "nonimmediate_operand" "0")
  246.                  (match_operand:SI 2 "general_operand" "mri")))]
  247.   ""
  248.   "addw2 %2, %0")
  249.  
  250. (define_insn "addsi3"
  251.   [(set (match_operand:SI 0 "nonimmediate_operand" "=mr")
  252.         (plus:SI (match_operand:SI 1 "general_operand" "mri")
  253.                  (match_operand:SI 2 "general_operand" "mri")))]
  254.   ""
  255.   "addw3 %2, %1, %0")
  256.  
  257. (define_insn ""
  258.   [(set (match_operand:HI 0 "nonimmediate_operand" "=mr")
  259.         (plus:HI (match_operand:HI 1 "nonimmediate_operand" "0")
  260.                  (match_operand:HI 2 "general_operand" "mri")))]
  261.   ""
  262.   "addh2 %2, %0")
  263.  
  264. (define_insn "addhi3"
  265.   [(set (match_operand:HI 0 "nonimmediate_operand" "=mr")
  266.         (plus:HI (match_operand:HI 1 "general_operand" "mri")
  267.                  (match_operand:HI 2 "general_operand" "mri")))]
  268.   ""
  269.   "addh3 %2, %1, %0")
  270.  
  271. (define_insn ""
  272.   [(set (match_operand:QI 0 "nonimmediate_operand" "=mr")
  273.         (plus:QI (match_operand:QI 1 "nonimmediate_operand" "0")
  274.                  (match_operand:QI 2 "general_operand" "mri")))]
  275.   ""
  276.   "addb2 %2, %0")
  277.  
  278. (define_insn "addqi3"
  279.   [(set (match_operand:QI 0 "nonimmediate_operand" "=mr")
  280.