home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 6 / FreshFish_September1994.bin / bbs / gnu / gcc-2.6.0-src.lha / GNU / src / amiga / gcc-2.6.0 / config / pa / pa.md < prev    next >
Encoding:
Text File  |  1994-06-28  |  109.6 KB  |  3,605 lines

  1. ;;- Machine description for HP PA-RISC architecture for GNU C compiler
  2. ;;   Copyright (C) 1992 Free Software Foundation, Inc.
  3. ;;   Contributed by the Center for Software Science at the University
  4. ;;   of Utah.
  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 2, 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. ;; This gcc Version 2 machine description is inspired by sparc.md and
  23. ;; mips.md.
  24.  
  25. ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
  26.  
  27. ;; Insn type.  Used to default other attribute values.
  28.  
  29. ;; type "unary" insns have one input operand (1) and one output operand (0)
  30. ;; type "binary" insns have two input operands (1,2) and one output (0)
  31.  
  32. (define_attr "type"
  33.   "move,unary,binary,compare,load,store,uncond_branch,branch,cbranch,fbranch,call,dyncall,fpload,fpstore,fpalu,fpcc,fpmul,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,multi,misc,milli"
  34.   (const_string "binary"))
  35.  
  36. ;; Length (in # of insns).
  37. (define_attr "length" ""
  38.   (cond [(eq_attr "type" "load,fpload")
  39.      (if_then_else (match_operand 1 "symbolic_memory_operand" "")
  40.                (const_int 8) (const_int 4))
  41.  
  42.      (eq_attr "type" "store,fpstore")
  43.      (if_then_else (match_operand 0 "symbolic_memory_operand" "")
  44.                (const_int 8) (const_int 4))
  45.  
  46.      (eq_attr "type" "binary")
  47.      (if_then_else (match_operand 2 "arith_operand" "")
  48.                (const_int 4) (const_int 12))
  49.  
  50.      (eq_attr "type" "move,unary")
  51.      (if_then_else (match_operand 1 "arith_operand" "")
  52.                (const_int 4) (const_int 8))]
  53.  
  54.     (const_int 4)))
  55.  
  56. (define_asm_attributes
  57.   [(set_attr "length" "4")
  58.    (set_attr "type" "multi")])
  59.  
  60. ;; Attributes for instruction and branch scheduling
  61.  
  62. ;; For conditional branches.
  63. (define_attr "in_branch_delay" "false,true"
  64.   (if_then_else (and (eq_attr "type" "!uncond_branch,branch,cbranch,fbranch,call,dyncall,multi,milli")
  65.              (eq_attr "length" "4"))
  66.         (const_string "true")
  67.         (const_string "false")))
  68.  
  69. ;; Disallow instructions which use the FPU since they will tie up the FPU
  70. ;; even if the instruction is nullified.
  71. (define_attr "in_nullified_branch_delay" "false,true"
  72.   (if_then_else (and (eq_attr "type" "!uncond_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,fpcc,fpalu,fpmul,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl")
  73.              (eq_attr "length" "4"))
  74.         (const_string "true")
  75.         (const_string "false")))
  76.  
  77. ;; For calls and millicode calls.  Allow unconditional branches in the
  78. ;; delay slot.
  79. (define_attr "in_call_delay" "false,true"
  80.   (cond [(and (eq_attr "type" "!uncond_branch,branch,cbranch,fbranch,call,dyncall,multi,milli")
  81.           (eq_attr "length" "4"))
  82.        (const_string "true")
  83.      (eq_attr "type" "uncond_branch")
  84.        (if_then_else (ne (symbol_ref "TARGET_JUMP_IN_DELAY")
  85.                  (const_int 0))
  86.              (const_string "true")
  87.              (const_string "false"))]
  88.     (const_string "false")))
  89.  
  90.  
  91. ;; Unconditional branch and call delay slot description.
  92. (define_delay (eq_attr "type" "uncond_branch,branch,call")
  93.   [(eq_attr "in_call_delay" "true") (nil) (nil)])
  94.  
  95. ;; millicode call delay slot description.  Note it disallows delay slot
  96. ;; when TARGET_LONG_CALLS is true.
  97. (define_delay (eq_attr "type" "milli")
  98.   [(and (eq_attr "in_call_delay" "true")
  99.     (eq (symbol_ref "TARGET_LONG_CALLS") (const_int 0)))
  100.    (nil) (nil)])
  101.  
  102. ;; Unconditional branch, return and other similar instructions.
  103. (define_delay (eq_attr "type" "uncond_branch,branch")
  104.   [(eq_attr "in_branch_delay" "true") (nil) (nil)])
  105.  
  106. ;; Floating point conditional branch delay slot description and
  107. (define_delay (eq_attr "type" "fbranch")
  108.   [(eq_attr "in_branch_delay" "true")
  109.    (eq_attr "in_nullified_branch_delay" "true")
  110.    (nil)])
  111.  
  112. ;; Integer conditional branch delay slot description.
  113. ;; Nullification of conditional branches on the PA is dependent on the
  114. ;; direction of the branch.  Forward branches nullify true and
  115. ;; backward branches nullify false.  If the direction is unknown
  116. ;; then nullification is not allowed.
  117. (define_delay (eq_attr "type" "cbranch")
  118.   [(eq_attr "in_branch_delay" "true")
  119.    (and (eq_attr "in_nullified_branch_delay" "true")
  120.     (attr_flag "forward"))
  121.    (and (eq_attr "in_nullified_branch_delay" "true")
  122.     (attr_flag "backward"))])
  123.  
  124. ;; Function units of the HPPA. The following data is for the "Snake"
  125. ;; (Mustang CPU + Timex FPU) because that's what I have the docs for.
  126. ;; Scheduling instructions for PA-83 machines according to the Snake
  127. ;; constraints shouldn't hurt.
  128.  
  129. ;; (define_function_unit {name} {num-units} {n-users} {test}
  130. ;;                       {ready-delay} {issue-delay} [{conflict-list}])
  131.  
  132. ;; The integer ALU.
  133. ;; (Noted only for documentation; units that take one cycle do not need to
  134. ;; be specified.)
  135.  
  136. ;; (define_function_unit "alu" 1 0
  137. ;;  (eq_attr "type" "unary,binary,move,address") 1 0)
  138.  
  139.  
  140. ;; Memory. Disregarding Cache misses, the Mustang memory times are:
  141. ;; load: 2
  142. ;; store, fpstore: 3, no D-cache operations should be scheduled.
  143. ;; fpload: 3 (really 2 for flops, but I don't think we can specify that).
  144.  
  145. (define_function_unit "memory" 1 0 (eq_attr "type" "load") 2 0)
  146. (define_function_unit "memory" 1 0 (eq_attr "type" "store,fpstore") 3 3)
  147. (define_function_unit "memory" 1 0 (eq_attr "type" "fpload") 2 0)
  148.  
  149. ;; The Timex has two floating-point units: ALU, and MUL/DIV/SQRT unit.
  150. ;; Timings:
  151. ;; Instruction    Time    Unit    Minimum Distance (unit contention)
  152. ;; fcpy        3    ALU    2
  153. ;; fabs        3    ALU    2
  154. ;; fadd        3    ALU    2
  155. ;; fsub        3    ALU    2
  156. ;; fcmp        3    ALU    2
  157. ;; fcnv        3    ALU    2
  158. ;; fmpyadd    3    ALU,MPY    2
  159. ;; fmpysub    3    ALU,MPY 2
  160. ;; fmpycfxt    3    ALU,MPY 2
  161. ;; fmpy        3    MPY    2
  162. ;; fmpyi    3    MPY    2
  163. ;; fdiv,sgl    10    MPY    10
  164. ;; fdiv,dbl    12    MPY    12
  165. ;; fsqrt,sgl    14    MPY    14
  166. ;; fsqrt,dbl    18    MPY    18
  167.  
  168. (define_function_unit "fp_alu" 1 0 (eq_attr "type" "fpcc") 4 2)
  169. (define_function_unit "fp_alu" 1 0 (eq_attr "type" "fpalu") 3 2)
  170. (define_function_unit "fp_mpy" 1 0 (eq_attr "type" "fpmul") 3 2)
  171. (define_function_unit "fp_mpy" 1 0 (eq_attr "type" "fpdivsgl") 10 10)
  172. (define_function_unit "fp_mpy" 1 0 (eq_attr "type" "fpdivdbl") 12 12)
  173. (define_function_unit "fp_mpy" 1 0 (eq_attr "type" "fpsqrtsgl") 14 14)
  174. (define_function_unit "fp_mpy" 1 0 (eq_attr "type" "fpsqrtdbl") 18 18)
  175.  
  176. ;; Compare instructions.
  177. ;; This controls RTL generation and register allocation.
  178.  
  179. ;; We generate RTL for comparisons and branches by having the cmpxx
  180. ;; patterns store away the operands.  Then, the scc and bcc patterns
  181. ;; emit RTL for both the compare and the branch.
  182. ;;
  183.  
  184. (define_expand "cmpsi"
  185.   [(set (reg:CC 0)
  186.     (compare:CC (match_operand:SI 0 "reg_or_0_operand" "")
  187.             (match_operand:SI 1 "arith5_operand" "")))]
  188.   ""
  189.   "
  190. {
  191.  hppa_compare_op0 = operands[0];
  192.  hppa_compare_op1 = operands[1];
  193.  hppa_branch_type = CMP_SI;
  194.  DONE;
  195. }")
  196.  
  197. (define_expand "cmpsf"
  198.   [(set (reg:CCFP 0)
  199.     (compare:CCFP (match_operand:SF 0 "reg_or_0_operand" "")
  200.               (match_operand:SF 1 "reg_or_0_operand" "")))]
  201.   ""
  202.   "
  203. {
  204.   hppa_compare_op0 = operands[0];
  205.   hppa_compare_op1 = operands[1];
  206.   hppa_branch_type = CMP_SF;
  207.   DONE;
  208. }")
  209.  
  210. (define_expand "cmpdf"
  211.   [(set (reg:CCFP 0)
  212.       (compare:CCFP (match_operand:DF 0 "reg_or_0_operand" "")
  213.                     (match_operand:DF 1 "reg_or_0_operand" "")))]
  214.   ""
  215.   "
  216. {
  217.   hppa_compare_op0 = operands[0];
  218.   hppa_compare_op1 = operands[1];
  219.   hppa_branch_type = CMP_DF;
  220.   DONE;
  221. }")
  222.  
  223. (define_insn ""
  224.   [(set (reg:CCFP 0)
  225.     (match_operator:CCFP 2 "comparison_operator"
  226.                  [(match_operand:SF 0 "reg_or_0_operand" "fG")
  227.                   (match_operand:SF 1 "reg_or_0_operand" "fG")]))]
  228.   ""
  229.   "fcmp,sgl,%Y2 %r0,%r1"
  230.   [(set_attr "type" "fpcc")])
  231.  
  232. (define_insn ""
  233.   [(set (reg:CCFP 0)
  234.     (match_operator:CCFP 2 "comparison_operator"
  235.                  [(match_operand:DF 0 "reg_or_0_operand" "fG")
  236.                   (match_operand:DF 1 "reg_or_0_operand" "fG")]))]
  237.   ""
  238.   "fcmp,dbl,%Y2 %r0,%r1"
  239.   [(set_attr "type" "fpcc")])
  240.  
  241. ;; scc insns.
  242.  
  243. (define_expand "seq"
  244.   [(set (match_operand:SI 0 "register_operand" "")
  245.     (eq:SI (match_dup 1)
  246.            (match_dup 2)))]
  247.   ""
  248.   "
  249. {
  250.   /* fp scc patterns rarely match, and are not a win on the PA.  */
  251.   if (hppa_branch_type != CMP_SI)
  252.     FAIL;
  253.   /* set up operands from compare.  */
  254.   operands[1] = hppa_compare_op0;
  255.   operands[2] = hppa_compare_op1;
  256.   /* fall through and generate default code */
  257. }")
  258.  
  259. (define_expand "sne"
  260.   [(set (match_operand:SI 0 "register_operand" "")
  261.     (ne:SI (match_dup 1)
  262.            (match_dup 2)))]
  263.   ""
  264.   "
  265. {
  266.   /* fp scc patterns rarely match, and are not a win on the PA.  */
  267.   if (hppa_branch_type != CMP_SI)
  268.     FAIL;
  269.   operands[1] = hppa_compare_op0;
  270.   operands[2] = hppa_compare_op1;
  271. }")
  272.  
  273. (define_expand "slt"
  274.   [(set (match_operand:SI 0 "register_operand" "")
  275.     (lt:SI (match_dup 1)
  276.            (match_dup 2)))]
  277.   ""
  278.   "
  279. {
  280.   /* fp scc patterns rarely match, and are not a win on the PA.  */
  281.   if (hppa_branch_type != CMP_SI)
  282.     FAIL;
  283.   operands[1] = hppa_compare_op0;
  284.   operands[2] = hppa_compare_op1;
  285. }")
  286.  
  287. (define_expand "sgt"
  288.   [(set (match_operand:SI 0 "register_operand" "")
  289.     (gt:SI (match_dup 1)
  290.            (match_dup 2)))]
  291.   ""
  292.   "
  293. {
  294.   /* fp scc patterns rarely match, and are not a win on the PA.  */
  295.   if (hppa_branch_type != CMP_SI)
  296.     FAIL;
  297.   operands[1] = hppa_compare_op0;
  298.   operands[2] = hppa_compare_op1;
  299. }")
  300.  
  301. (define_expand "sle"
  302.   [(set (match_operand:SI 0 "register_operand" "")
  303.     (le:SI (match_dup 1)
  304.            (match_dup 2)))]
  305.   ""
  306.   "
  307. {
  308.   /* fp scc patterns rarely match, and are not a win on the PA.  */
  309.   if (hppa_branch_type != CMP_SI)
  310.     FAIL;
  311.   operands[1] = hppa_compare_op0;
  312.   operands[2] = hppa_compare_op1;
  313. }")
  314.  
  315. (define_expand "sge"
  316.   [(set (match_operand:SI 0 "register_operand" "")
  317.     (ge:SI (match_dup 1)
  318.            (match_dup 2)))]
  319.   ""
  320.   "
  321. {
  322.   /* fp scc patterns rarely match, and are not a win on the PA.  */
  323.   if (hppa_branch_type != CMP_SI)
  324.     FAIL;
  325.   operands[1] = hppa_compare_op0;
  326.   operands[2] = hppa_compare_op1;
  327. }")
  328.  
  329. (define_expand "sltu"
  330.   [(set (match_operand:SI 0 "register_operand" "")
  331.     (ltu:SI (match_dup 1)
  332.             (match_dup 2)))]
  333.   ""
  334.   "
  335. {
  336.   if (hppa_branch_type != CMP_SI)
  337.     FAIL;
  338.   operands[1] = hppa_compare_op0;
  339.   operands[2] = hppa_compare_op1;
  340. }")
  341.  
  342. (define_expand "sgtu"
  343.   [(set (match_operand:SI 0 "register_operand" "")
  344.     (gtu:SI (match_dup 1)
  345.             (match_dup 2)))]
  346.   ""
  347.   "
  348. {
  349.   if (hppa_branch_type != CMP_SI)
  350.     FAIL;
  351.   operands[1] = hppa_compare_op0;
  352.   operands[2] = hppa_compare_op1;
  353. }")
  354.  
  355. (define_expand "sleu"
  356.   [(set (match_operand:SI 0 "register_operand" "")
  357.     (leu:SI (match_dup 1)
  358.             (match_dup 2)))]
  359.   ""
  360.   "
  361. {
  362.   if (hppa_branch_type != CMP_SI)
  363.     FAIL;
  364.   operands[1] = hppa_compare_op0;
  365.   operands[2] = hppa_compare_op1;
  366. }")
  367.  
  368. (define_expand "sgeu"
  369.   [(set (match_operand:SI 0 "register_operand" "")
  370.     (geu:SI (match_dup 1)
  371.             (match_dup 2)))]
  372.   ""
  373.   "
  374. {
  375.   if (hppa_branch_type != CMP_SI)
  376.     FAIL;
  377.   operands[1] = hppa_compare_op0;
  378.   operands[2] = hppa_compare_op1;
  379. }")
  380.  
  381. ;; Instruction canonicalization puts immediate operands second, which
  382. ;; is the reverse of what we want.
  383.  
  384. (define_insn "scc"
  385.   [(set (match_operand:SI 0 "register_operand" "=r")
  386.     (match_operator:SI 3 "comparison_operator"
  387.                [(match_operand:SI 1 "register_operand" "r")
  388.                 (match_operand:SI 2 "arith11_operand" "rI")]))]
  389.   ""
  390.   "com%I2clr,%B3 %2,%1,%0\;ldi 1,%0"
  391.   [(set_attr "type" "binary")
  392.    (set_attr "length" "8")])
  393.  
  394. (define_insn "iorscc"
  395.   [(set (match_operand:SI 0 "register_operand" "=r")
  396.     (ior:SI (match_operator:SI 3 "comparison_operator"
  397.                    [(match_operand:SI 1 "register_operand" "r")
  398.                     (match_operand:SI 2 "arith11_operand" "rI")])
  399.         (match_operator:SI 6 "comparison_operator"
  400.                    [(match_operand:SI 4 "register_operand" "r")
  401.                     (match_operand:SI 5 "arith11_operand" "rI")])))]
  402.   ""
  403.   "com%I2clr,%S3 %2,%1,0\;com%I5clr,%B6 %5,%4,%0\;ldi 1,%0"
  404.   [(set_attr "type" "binary")
  405.    (set_attr "length" "8")])
  406.  
  407. ;; Combiner patterns for common operations performed with the output
  408. ;; from an scc insn (negscc and incscc).
  409. (define_insn "negscc"
  410.   [(set (match_operand:SI 0 "register_operand" "=r")
  411.     (neg:SI (match_operator:SI 3 "comparison_operator"
  412.            [(match_operand:SI 1 "register_operand" "r")
  413.         (match_operand:SI 2 "arith11_operand" "rI")])))]
  414.   ""
  415.   "com%I2clr,%B3 %2,%1,%0\;ldi -1,%0"
  416.   [(set_attr "type" "binary")
  417.    (set_attr "length" "8")])
  418.  
  419. ;; Patterns for adding/subtracting the result of a boolean expression from
  420. ;; a register.  First we have special patterns that make use of the carry
  421. ;; bit, and output only two instructions.  For the cases we can't in
  422. ;; general do in two instructions, the incscc pattern at the end outputs
  423. ;; two or three instructions.
  424.  
  425. (define_insn ""
  426.   [(set (match_operand:SI 0 "register_operand" "=r")
  427.     (plus:SI (leu:SI (match_operand:SI 2 "register_operand" "r")
  428.              (match_operand:SI 3 "arith11_operand" "rI"))
  429.          (match_operand:SI 1 "register_operand" "r")))]
  430.   ""
  431.   "sub%I3 %3,%2,0\;addc 0,%1,%0"
  432.   [(set_attr "type" "binary")
  433.    (set_attr "length" "8")])
  434.  
  435. ; This need only accept registers for op3, since canonicalization
  436. ; replaces geu with gtu when op3 is an integer.
  437. (define_insn ""
  438.   [(set (match_operand:SI 0 "register_operand" "=r")
  439.     (plus:SI (geu:SI (match_operand:SI 2 "register_operand" "r")
  440.              (match_operand:SI 3 "register_operand" "r"))
  441.          (match_operand:SI 1 "register_operand" "r")))]
  442.   ""
  443.   "sub %2,%3,0\;addc 0,%1,%0"
  444.   [(set_attr "type" "binary")
  445.    (set_attr "length" "8")])
  446.  
  447. ; Match only integers for op3 here.  This is used as canonical form of the
  448. ; geu pattern when op3 is an integer.  Don't match registers since we can't
  449. ; make better code than the general incscc pattern.
  450. (define_insn ""
  451.   [(set (match_operand:SI 0 "register_operand" "=r")
  452.     (plus:SI (gtu:SI (match_operand:SI 2 "register_operand" "r")
  453.              (match_operand:SI 3 "int11_operand" "I"))
  454.          (match_operand:SI 1 "register_operand" "r")))]
  455.   ""
  456.   "addi %k3,%2,0\;addc 0,%1,%0"
  457.   [(set_attr "type" "binary")
  458.    (set_attr "length" "8")])
  459.  
  460. (define_insn "incscc"
  461.   [(set (match_operand:SI 0 "register_operand" "=r,r")
  462.      (plus:SI (match_operator:SI 4 "comparison_operator"
  463.             [(match_operand:SI 2 "register_operand" "r,r")
  464.              (match_operand:SI 3 "arith11_operand" "rI,rI")])
  465.          (match_operand:SI 1 "register_operand" "0,?r")))]
  466.   ""
  467.   "@
  468.    com%I3clr,%B4 %3,%2,0\;addi 1,%0,%0
  469.    com%I3clr,%B4 %3,%2,0\;addi,tr 1,%1,%0\;copy %1,%0"
  470.   [(set_attr "type" "binary,binary")
  471.    (set_attr "length" "8,12")])
  472.  
  473. (define_insn ""
  474.   [(set (match_operand:SI 0 "register_operand" "=r")
  475.     (minus:SI (match_operand:SI 1 "register_operand" "r")
  476.           (gtu:SI (match_operand:SI 2 "register_operand" "r")
  477.               (match_operand:SI 3 "arith11_operand" "rI"))))]
  478.   ""
  479.   "sub%I3 %3,%2,0\;subb %1,0,%0"
  480.   [(set_attr "type" "binary")
  481.    (set_attr "length" "8")])
  482.  
  483. (define_insn ""
  484.   [(set (match_operand:SI 0 "register_operand" "=r")
  485.     (minus:SI (minus:SI (match_operand:SI 1 "register_operand" "r")
  486.                 (gtu:SI (match_operand:SI 2 "register_operand" "r")
  487.                     (match_operand:SI 3 "arith11_operand" "rI")))
  488.           (match_operand:SI 4 "register_operand" "r")))]
  489.   ""
  490.   "sub%I3 %3,%2,0\;subb %1,%4,%0"
  491.   [(set_attr "type" "binary")
  492.    (set_attr "length" "8")])
  493.  
  494. ; This need only accept registers for op3, since canonicalization
  495. ; replaces ltu with leu when op3 is an integer.
  496. (define_insn ""
  497.   [(set (match_operand:SI 0 "register_operand" "=r")
  498.     (minus:SI (match_operand:SI 1 "register_operand" "r")
  499.           (ltu:SI (match_operand:SI 2 "register_operand" "r")
  500.               (match_operand:SI 3 "register_operand" "r"))))]
  501.   ""
  502.   "sub %2,%3,0\;subb %1,0,%0"
  503.   [(set_attr "type" "binary")
  504.    (set_attr "length" "8")])
  505.  
  506. (define_insn ""
  507.   [(set (match_operand:SI 0 "register_operand" "=r")
  508.     (minus:SI (minus:SI (match_operand:SI 1 "register_operand" "r")
  509.                 (ltu:SI (match_operand:SI 2 "register_operand" "r")
  510.                     (match_operand:SI 3 "register_operand" "r")))
  511.           (match_operand:SI 4 "register_operand" "r")))]
  512.   ""
  513.   "sub %2,%3,0\;subb %1,%4,%0"
  514.   [(set_attr "type" "binary")
  515.    (set_attr "length" "8")])
  516.  
  517. ; Match only integers for op3 here.  This is used as canonical form of the
  518. ; ltu pattern when op3 is an integer.  Don't match registers since we can't
  519. ; make better code than the general incscc pattern.
  520. (define_insn ""
  521.   [(set (match_operand:SI 0 "register_operand" "=r")
  522.     (minus:SI (match_operand:SI 1 "register_operand" "r")
  523.           (leu:SI (match_operand:SI 2 "register_operand" "r")
  524.               (match_operand:SI 3 "int11_operand" "I"))))]
  525.   ""
  526.   "addi %k3,%2,0\;subb %1,0,%0"
  527.   [(set_attr "type" "binary")
  528.    (set_attr "length" "8")])
  529.  
  530. (define_insn ""
  531.   [(set (match_operand:SI 0 "register_operand" "=r")
  532.     (minus:SI (minus:SI (match_operand:SI 1 "register_operand" "r")
  533.                 (leu:SI (match_operand:SI 2 "register_operand" "r")
  534.                     (match_operand:SI 3 "int11_operand" "I")))
  535.           (match_operand:SI 4 "register_operand" "r")))]
  536.   ""
  537.   "addi %k3,%2,0\;subb %1,%4,%0"
  538.   [(set_attr "type" "binary")
  539.    (set_attr "length" "8")])
  540.  
  541. (define_insn "decscc"
  542.   [(set (match_operand:SI 0 "register_operand" "=r,r")
  543.     (minus:SI (match_operand:SI 1 "register_operand" "0,?r")
  544.           (match_operator:SI 4 "comparison_operator"
  545.              [(match_operand:SI 2 "register_operand" "r,r")
  546.               (match_operand:SI 3 "arith11_operand" "rI,rI")])))]
  547.   ""
  548.   "@
  549.    com%I3clr,%B4 %3,%2,0\;addi -1,%0,%0
  550.    com%I3clr,%B4 %3,%2,0\;addi,tr -1,%1,%0\;copy %1,%0"
  551.   [(set_attr "type" "binary,binary")
  552.    (set_attr "length" "8,12")])
  553.  
  554. ; Patterns for max and min.  (There is no need for an earlyclobber in the
  555. ; last alternative since the middle alternative will match if op0 == op1.)
  556.  
  557. (define_insn "sminsi3"
  558.   [(set (match_operand:SI 0 "register_operand" "=r,r,r")
  559.     (smin:SI (match_operand:SI 1 "register_operand" "%0,0,r")
  560.          (match_operand:SI 2 "arith11_operand" "r,I,M")))]
  561.   ""
  562.   "@
  563.   comclr,> %2,%0,0\;copy %2,%0
  564.   comiclr,> %2,%0,0\;ldi %2,%0
  565.   comclr,> %1,%2,%0\;copy %1,%0"
  566. [(set_attr "type" "multi,multi,multi")
  567.  (set_attr "length" "8,8,8")])
  568.  
  569. (define_insn "uminsi3"
  570.   [(set (match_operand:SI 0 "register_operand" "=r,r")
  571.     (umin:SI (match_operand:SI 1 "register_operand" "%0,0")
  572.          (match_operand:SI 2 "arith11_operand" "r,I")))]
  573.   ""
  574.   "@
  575.   comclr,>> %2,%0,0\;copy %2,%0
  576.   comiclr,>> %2,%0,0\;ldi %2,%0"
  577. [(set_attr "type" "multi,multi")
  578.  (set_attr "length" "8,8")])
  579.  
  580. (define_insn "smaxsi3"
  581.   [(set (match_operand:SI 0 "register_operand" "=r,r,r")
  582.     (smax:SI (match_operand:SI 1 "register_operand" "%0,0,r")
  583.          (match_operand:SI 2 "arith11_operand" "r,I,M")))]
  584.   ""
  585.   "@
  586.   comclr,< %2,%0,0\;copy %2,%0
  587.   comiclr,< %2,%0,0\;ldi %2,%0
  588.   comclr,< %1,%2,%0\;copy %1,%0"
  589. [(set_attr "type" "multi,multi,multi")
  590.  (set_attr "length" "8,8,8")])
  591.  
  592. (define_insn "umaxsi3"
  593.   [(set (match_operand:SI 0 "register_operand" "=r,r")
  594.     (umax:SI (match_operand:SI 1 "register_operand" "%0,0")
  595.          (match_operand:SI 2 "arith11_operand" "r,I")))]
  596.   ""
  597.   "@
  598.   comclr,<< %2,%0,0\;copy %2,%0
  599.   comiclr,<< %2,%0,0\;ldi %2,%0"
  600. [(set_attr "type" "multi,multi")
  601.  (set_attr "length" "8,8")])
  602. ;;; Experimental conditional move patterns
  603.  
  604. ; We need the first constraint alternative in order to avoid
  605. ; earlyclobbers on all other alternatives.
  606. (define_insn ""
  607.   [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r")
  608.     (if_then_else:SI
  609.      (match_operator 5 "comparison_operator"
  610.         [(match_operand:SI 3 "register_operand" "r,r,r,r,r")
  611.          (match_operand:SI 4 "arith11_operand" "rI,rI,rI,rI,rI")])
  612.      (match_operand:SI 1 "reg_or_cint_move_operand" "0,r,J,N,K")
  613.      (const_int 0)))]
  614.   ""
  615.   "@
  616.    com%I4clr,%S5 %4,%3,0\;ldi 0,%0
  617.    com%I4clr,%B5 %4,%3,%0\;copy %1,%0
  618.    com%I4clr,%B5 %4,%3,%0\;ldi %1,%0
  619.    com%I4clr,%B5 %4,%3,%0\;ldil L'%1,%0
  620.    com%I4clr,%B5 %4,%3,%0\;zdepi %Z1,%0"
  621.   [(set_attr "type" "multi,multi,multi,multi,multi")
  622.    (set_attr "length" "8,8,8,8,8")])
  623.  
  624. (define_insn ""
  625.   [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r,r,r")
  626.     (if_then_else:SI
  627.      (match_operator 5 "comparison_operator"
  628.         [(match_operand:SI 3 "register_operand" "r,r,r,r,r,r,r,r")
  629.          (match_operand:SI 4 "arith11_operand" "rI,rI,rI,rI,rI,rI,rI,rI")])
  630.      (match_operand:SI 1 "reg_or_cint_move_operand" "0,0,0,0,r,J,N,K")
  631.      (match_operand:SI 2 "reg_or_cint_move_operand" "r,J,N,K,0,0,0,0")))]
  632.   ""
  633.   "@
  634.    com%I4clr,%S5 %4,%3,0\;copy %2,%0
  635.    com%I4clr,%S5 %4,%3,0\;ldi %2,%0
  636.    com%I4clr,%S5 %4,%3,0\;ldil L'%2,%0
  637.    com%I4clr,%S5 %4,%3,0\;zdepi %Z2,%0
  638.    com%I4clr,%B5 %4,%3,0\;copy %1,%0
  639.    com%I4clr,%B5 %4,%3,0\;ldi %1,%0
  640.    com%I4clr,%B5 %4,%3,0\;ldil L'%1,%0
  641.    com%I4clr,%B5 %4,%3,0\;zdepi %Z1,%0"
  642.   [(set_attr "type" "multi,multi,multi,multi,multi,multi,multi,multi")
  643.    (set_attr "length" "8,8,8,8,8,8,8,8")])
  644.  
  645. ;; Conditional Branches
  646.  
  647. (define_expand "beq"
  648.   [(set (pc)
  649.     (if_then_else (eq (match_dup 1) (match_dup 2))
  650.               (label_ref (match_operand 0 "" ""))
  651.               (pc)))]
  652.   ""
  653.   "
  654. {
  655.   if (hppa_branch_type != CMP_SI)
  656.     {
  657.       emit_insn (gen_cmp_fp (EQ, hppa_compare_op0, hppa_compare_op1));
  658.       emit_bcond_fp (NE, operands[0]);
  659.       DONE;
  660.     }
  661.   /* set up operands from compare.  */
  662.   operands[1] = hppa_compare_op0;
  663.   operands[2] = hppa_compare_op1;
  664.   /* fall through and generate default code */
  665. }")
  666.  
  667. (define_expand "bne"
  668.   [(set (pc)
  669.     (if_then_else (ne (match_dup 1) (match_dup 2))
  670.               (label_ref (match_operand 0 "" ""))
  671.               (pc)))]
  672.   ""
  673.   "
  674. {
  675.   if (hppa_branch_type != CMP_SI)
  676.     {
  677.       emit_insn (gen_cmp_fp (NE, hppa_compare_op0, hppa_compare_op1));
  678.       emit_bcond_fp (NE, operands[0]);
  679.       DONE;
  680.     }
  681.   operands[1] = hppa_compare_op0;
  682.   operands[2] = hppa_compare_op1;
  683. }")
  684.  
  685. (define_expand "bgt"
  686.   [(set (pc)
  687.     (if_then_else (gt (match_dup 1) (match_dup 2))
  688.               (label_ref (match_operand 0 "" ""))
  689.               (pc)))]
  690.   ""
  691.   "
  692. {
  693.   if (hppa_branch_type != CMP_SI)
  694.     {
  695.       emit_insn (gen_cmp_fp (GT, hppa_compare_op0, hppa_compare_op1));
  696.       emit_bcond_fp (NE, operands[0]);
  697.       DONE;
  698.     }
  699.   operands[1] = hppa_compare_op0;
  700.   operands[2] = hppa_compare_op1;
  701. }")
  702.  
  703. (define_expand "blt"
  704.   [(set (pc)
  705.     (if_then_else (lt (match_dup 1) (match_dup 2))
  706.               (label_ref (match_operand 0 "" ""))
  707.               (pc)))]
  708.   ""
  709.   "
  710. {
  711.   if (hppa_branch_type != CMP_SI)
  712.     {
  713.       emit_insn (gen_cmp_fp (LT, hppa_compare_op0, hppa_compare_op1));
  714.       emit_bcond_fp (NE, operands[0]);
  715.       DONE;
  716.     }
  717.   operands[1] = hppa_compare_op0;
  718.   operands[2] = hppa_compare_op1;
  719. }")
  720.  
  721. (define_expand "bge"
  722.   [(set (pc)
  723.     (if_then_else (ge (match_dup 1) (match_dup 2))
  724.               (label_ref (match_operand 0 "" ""))
  725.               (pc)))]
  726.   ""
  727.   "
  728. {
  729.   if (hppa_branch_type != CMP_SI)
  730.     {
  731.       emit_insn (gen_cmp_fp (GE, hppa_compare_op0, hppa_compare_op1));
  732.       emit_bcond_fp (NE, operands[0]);
  733.       DONE;
  734.     }
  735.   operands[1] = hppa_compare_op0;
  736.   operands[2] = hppa_compare_op1;
  737. }")
  738.  
  739. (define_expand "ble"
  740.   [(set (pc)
  741.     (if_then_else (le (match_dup 1) (match_dup 2))
  742.               (label_ref (match_operand 0 "" ""))
  743.               (pc)))]
  744.   ""
  745.   "
  746. {
  747.   if (hppa_branch_type != CMP_SI)
  748.     {
  749.       emit_insn (gen_cmp_fp (LE, hppa_compare_op0, hppa_compare_op1));
  750.       emit_bcond_fp (NE, operands[0]);
  751.       DONE;
  752.     }
  753.   operands[1] = hppa_compare_op0;
  754.   operands[2] = hppa_compare_op1;
  755. }")
  756.  
  757. (define_expand "bgtu"
  758.   [(set (pc)
  759.     (if_then_else (gtu (match_dup 1) (match_dup 2))
  760.               (label_ref (match_operand 0 "" ""))
  761.               (pc)))]
  762.   ""
  763.   "
  764. {
  765.   if (hppa_branch_type != CMP_SI)
  766.     FAIL;
  767.   operands[1] = hppa_compare_op0;
  768.   operands[2] = hppa_compare_op1;
  769. }")
  770.  
  771. (define_expand "bltu"
  772.   [(set (pc)
  773.     (if_then_else (ltu (match_dup 1) (match_dup 2))
  774.               (label_ref (match_operand 0 "" ""))
  775.               (pc)))]
  776.   ""
  777.   "
  778. {
  779.   if (hppa_branch_type != CMP_SI)
  780.     FAIL;
  781.   operands[1] = hppa_compare_op0;
  782.   operands[2] = hppa_compare_op1;
  783. }")
  784.  
  785. (define_expand "bgeu"
  786.   [(set (pc)
  787.     (if_then_else (geu (match_dup 1) (match_dup 2))
  788.               (label_ref (match_operand 0 "" ""))
  789.               (pc)))]
  790.   ""
  791.   "
  792. {
  793.   if (hppa_branch_type != CMP_SI)
  794.     FAIL;
  795.   operands[1] = hppa_compare_op0;
  796.   operands[2] = hppa_compare_op1;
  797. }")
  798.  
  799. (define_expand "bleu"
  800.   [(set (pc)
  801.     (if_then_else (leu (match_dup 1) (match_dup 2))
  802.               (label_ref (match_operand 0 "" ""))
  803.               (pc)))]
  804.   ""
  805.   "
  806. {
  807.   if (hppa_branch_type != CMP_SI)
  808.     FAIL;
  809.   operands[1] = hppa_compare_op0;
  810.   operands[2] = hppa_compare_op1;
  811. }")
  812.  
  813. ;; Match the branch patterns.
  814.  
  815.  
  816. ;; Note a long backward conditional branch with an annulled delay slot
  817. ;; has a length of 12.
  818. (define_insn ""
  819.   [(set (pc)
  820.     (if_then_else
  821.      (match_operator 3 "comparison_operator"
  822.              [(match_operand:SI 1 "register_operand" "r")
  823.               (match_operand:SI 2 "arith5_operand" "rL")])
  824.      (label_ref (match_operand 0 "" ""))
  825.      (pc)))]
  826.   ""
  827.   "*
  828. {
  829.   return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
  830.              get_attr_length (insn), 0, insn);
  831. }"
  832. [(set_attr "type" "cbranch")
  833.  (set (attr "length")
  834.     (if_then_else (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
  835.               (const_int 8188))
  836.            (const_int 4)
  837.        (const_int 8)))])
  838.  
  839. ;; Match the negated branch.
  840.  
  841. (define_insn ""
  842.   [(set (pc)
  843.     (if_then_else
  844.      (match_operator 3 "comparison_operator"
  845.              [(match_operand:SI 1 "register_operand" "r")
  846.               (match_operand:SI 2 "arith5_operand" "rL")])
  847.      (pc)
  848.      (label_ref (match_operand 0 "" ""))))]
  849.   ""
  850.   "*
  851. {
  852.   return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
  853.              get_attr_length (insn), 1, insn);
  854. }"
  855. [(set_attr "type" "cbranch")
  856.  (set (attr "length")
  857.     (if_then_else (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
  858.               (const_int 8188))
  859.            (const_int 4)
  860.        (const_int 8)))])
  861.  
  862. ;; Branch on Bit patterns.
  863. (define_insn ""
  864.   [(set (pc)
  865.     (if_then_else
  866.      (ne (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
  867.                   (const_int 1)
  868.                   (match_operand:SI 1 "uint5_operand" ""))
  869.          (const_int 0))
  870.      (match_operand 2 "pc_or_label_operand" "")
  871.      (match_operand 3 "pc_or_label_operand" "")))]
  872.   ""
  873.   "*
  874. {
  875.   return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
  876.              get_attr_length (insn),
  877.              (operands[3] != pc_rtx),
  878.              insn, 0);
  879. }"
  880. [(set_attr "type" "cbranch")
  881.  (set (attr "length")
  882.     (if_then_else (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
  883.               (const_int 8188))
  884.            (const_int 4)
  885.        (const_int 8)))])
  886.  
  887. (define_insn ""
  888.   [(set (pc)
  889.     (if_then_else
  890.      (eq (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
  891.                   (const_int 1)
  892.                   (match_operand:SI 1 "uint5_operand" ""))
  893.          (const_int 0))
  894.      (match_operand 2 "pc_or_label_operand" "")
  895.      (match_operand 3 "pc_or_label_operand" "")))]
  896.   ""
  897.   "*
  898. {
  899.   return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
  900.              get_attr_length (insn),
  901.              (operands[3] != pc_rtx),
  902.              insn, 1);
  903. }"
  904. [(set_attr "type" "cbranch")
  905.  (set (attr "length")
  906.     (if_then_else (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
  907.               (const_int 8188))
  908.            (const_int 4)
  909.        (const_int 8)))])
  910.  
  911. ;; Floating point branches
  912. (define_insn ""
  913.   [(set (pc) (if_then_else (ne (reg:CCFP 0) (const_int 0))
  914.                (label_ref (match_operand 0 "" ""))
  915.                (pc)))]
  916.   ""
  917.   "*
  918. {
  919.   if (INSN_ANNULLED_BRANCH_P (insn))
  920.     return \"ftest\;bl,n %0,0\";
  921.   else
  922.     return \"ftest\;bl%* %0,0\";
  923. }"
  924.   [(set_attr "type" "fbranch")
  925.    (set_attr "length" "8")])
  926.  
  927. (define_insn ""
  928.   [(set (pc) (if_then_else (ne (reg:CCFP 0) (const_int 0))
  929.                (pc)
  930.                (label_ref (match_operand 0 "" ""))))]
  931.   ""
  932.   "*
  933. {
  934.   if (INSN_ANNULLED_BRANCH_P (insn))
  935.     return \"ftest\;add,tr 0,0,0\;bl,n %0,0\";
  936.   else
  937.     return \"ftest\;add,tr 0,0,0\;bl%* %0,0\";
  938. }"
  939.   [(set_attr "type" "fbranch")
  940.    (set_attr "length" "12")])
  941.  
  942. ;; Move instructions
  943.  
  944. (define_expand "movsi"
  945.   [(set (match_operand:SI 0 "general_operand" "")
  946.     (match_operand:SI 1 "general_operand" ""))]
  947.   ""
  948.   "
  949. {
  950.   if (emit_move_sequence (operands, SImode, 0))
  951.     DONE;
  952. }")
  953.  
  954. ;; Reloading an SImode or DImode value requires a scratch register if
  955. ;; going in to or out of float point registers.
  956.  
  957. (define_expand "reload_insi"
  958.   [(set (match_operand:SI 0 "register_operand" "=Z")
  959.     (match_operand:SI 1 "general_operand" ""))
  960.    (clobber (match_operand:SI 2 "register_operand" "=&r"))]
  961.   ""
  962.   "
  963. {
  964.   if (emit_move_sequence (operands, SImode, operands[2]))
  965.     DONE;
  966.  
  967.   /* We don't want the clobber emitted, so handle this ourselves.  */
  968.   emit_insn (gen_rtx (SET, VOIDmode, operands[0], operands[1]));
  969.   DONE;
  970. }")
  971.  
  972. (define_expand "reload_outsi"
  973.   [(set (match_operand:SI 0 "general_operand" "")
  974.     (match_operand:SI 1  "register_operand" "Z"))
  975.    (clobber (match_operand:SI 2 "register_operand" "=&r"))]
  976.   ""
  977.   "
  978. {
  979.   if (emit_move_sequence (operands, SImode, operands[2]))
  980.     DONE;
  981.  
  982.   /* We don't want the clobber emitted, so handle this ourselves.  */
  983.   emit_insn (gen_rtx (SET, VOIDmode, operands[0], operands[1]));
  984.   DONE;
  985. }")
  986.  
  987. ;;; pic symbol references
  988.  
  989. (define_insn ""
  990.   [(set (match_operand:SI 0 "register_operand" "=r")
  991.     (mem:SI (plus:SI (match_operand:SI 1 "register_operand" "r")
  992.              (match_operand:SI 2 "symbolic_operand" ""))))]
  993.   "flag_pic && operands[1] == pic_offset_table_rtx"
  994.   "ldw T'%2(%1),%0"
  995.   [(set_attr "type" "load")
  996.    (set_attr "length" "4")])
  997.  
  998. (define_insn ""
  999.   [(set (match_operand:SI 0 "reg_or_nonsymb_mem_operand"
  1000.                 "=r,r,r,r,r,Q,*q,!f,f,*T")
  1001.     (match_operand:SI 1 "move_operand"
  1002.                 "r,J,N,K,Q,rM,rM,!fM,*T,f"))]
  1003.   "register_operand (operands[0], SImode)
  1004.    || reg_or_0_operand (operands[1], SImode)"
  1005.   "@
  1006.    copy %1,%0
  1007.    ldi %1,%0
  1008.    ldil L'%1,%0
  1009.    zdepi %Z1,%0
  1010.    ldw%M1 %1,%0
  1011.    stw%M0 %r1,%0
  1012.    mtsar %r1
  1013.    fcpy,sgl %r1,%0
  1014.    fldws%F1 %1,%0
  1015.    fstws%F0 %1,%0"
  1016.   [(set_attr "type" "move,move,move,move,load,store,move,fpalu,fpload,fpstore")
  1017.    (set_attr "length" "4,4,4,4,4,4,4,4,4,4")])
  1018.  
  1019. ;; Load indexed.  We don't use unscaled modes since they can't be used
  1020. ;; unless we can tell which of the registers is the base and which is
  1021. ;; the index, due to PA's idea of segment selection using the top bits
  1022. ;; of the base register.
  1023.  
  1024. (define_insn ""
  1025.   [(set (match_operand:SI 0 "register_operand" "=r")
  1026.     (mem:SI (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "r")
  1027.                   (const_int 4))
  1028.              (match_operand:SI 2 "register_operand" "r"))))]
  1029.   "! TARGET_DISABLE_INDEXING"
  1030.   "ldwx,s %1(0,%2),%0"
  1031.   [(set_attr "type" "load")
  1032.    (set_attr "length" "4")])
  1033.  
  1034. ;; This variant of the above insn can occur if the second operand
  1035. ;; is the frame pointer.  This is a kludge, but there doesn't
  1036. ;; seem to be a way around it.  Only recognize it while reloading.
  1037. ;; Note how operand 3 uses a predicate of "const_int_operand", but 
  1038. ;; has constraints allowing a register.  I don't know how this works,
  1039. ;; but it somehow makes sure that out-of-range constants are placed
  1040. ;; in a register which somehow magically is a "const_int_operand".
  1041. ;; (this was stolen from alpha.md, I'm not going to try and change it.
  1042. (define_insn ""
  1043.   [(set (match_operand:SI 0 "register_operand" "&=r")
  1044.     (mem:SI (plus:SI (plus:SI
  1045.                 (mult:SI (match_operand:SI 1 "register_operand" "r")
  1046.                      (const_int 4))
  1047.                 (match_operand:SI 2 "register_operand" "r"))
  1048.              (match_operand:SI 3 "const_int_operand" "rI"))))]
  1049.   "! TARGET_DISABLE_INDEXING && reload_in_progress"
  1050.   "*
  1051. {
  1052.   if (GET_CODE (operands[3]) == CONST_INT)
  1053.     return \"sh2addl %1,%2,%0\;ldw %3(0,%0),%0\";
  1054.   else
  1055.     return \"sh2addl %1,%2,%0\;ldwx %3(0,%0),%0\";
  1056. }"
  1057.   [(set_attr "type" "load")
  1058.    (set_attr "length" "8")])
  1059.  
  1060. ;; Load or store with base-register modification.
  1061.  
  1062. (define_insn "pre_ldwm"
  1063.   [(set (match_operand:SI 3 "register_operand" "=r")
  1064.     (mem:SI (plus:SI (match_operand:SI 1 "register_operand" "0")
  1065.              (match_operand:SI 2 "pre_cint_operand" ""))))
  1066.    (set (match_operand:SI 0 "register_operand" "=r")
  1067.     (plus:SI (match_dup 1) (match_dup 2)))]
  1068.   ""
  1069.   "*
  1070. {
  1071.   if (INTVAL (operands[2]) < 0)
  1072.     return \"ldwm %2(0,%0),%3\";
  1073.   return \"ldws,mb %2(0,%0),%3\";
  1074. }"
  1075.   [(set_attr "type" "load")
  1076.    (set_attr "length" "4")])
  1077.  
  1078. (define_insn "pre_stwm"
  1079.   [(set (mem:SI (plus:SI (match_operand:SI 1 "register_operand" "0")
  1080.              (match_operand:SI 2 "pre_cint_operand" "")))
  1081.     (match_operand:SI 3 "reg_or_0_operand" "rM"))
  1082.    (set (match_operand:SI 0 "register_operand" "=r")
  1083.     (plus:SI (match_dup 1) (match_dup 2)))]
  1084.   ""
  1085.   "*
  1086. {
  1087.   if (INTVAL (operands[2]) < 0)
  1088.     return \"stwm %r3,%2(0,%0)\";
  1089.   return \"stws,mb %r3,%2(0,%0)\";
  1090. }"
  1091.   [(set_attr "type" "store")
  1092.    (set_attr "length" "4")])
  1093.  
  1094. (define_insn "post_ldwm"
  1095.   [(set (match_operand:SI 3 "register_operand" "r")
  1096.     (mem:SI (match_operand:SI 1 "register_operand" "0")))
  1097.    (set (match_operand:SI 0 "register_operand" "=r")
  1098.     (plus:SI (match_dup 1)
  1099.          (match_operand:SI 2 "post_cint_operand" "")))]
  1100.   ""
  1101.   "*
  1102. {
  1103.   if (INTVAL (operands[2]) > 0)
  1104.     return \"ldwm %2(0,%0),%3\";
  1105.   return \"ldws,ma %2(0,%0),%3\";
  1106. }"
  1107.   [(set_attr "type" "load")
  1108.    (set_attr "length" "4")])
  1109.  
  1110. (define_insn "post_stwm"
  1111.   [(set (mem:SI (match_operand:SI 1 "register_operand" "0"))
  1112.     (match_operand:SI 3 "reg_or_0_operand" "rM"))
  1113.    (set (match_operand:SI 0 "register_operand" "=r")
  1114.     (plus:SI (match_dup 1)
  1115.          (match_operand:SI 2 "post_cint_operand" "")))]
  1116.   ""
  1117.   "*
  1118. {
  1119.   if (INTVAL (operands[2]) > 0)
  1120.     return \"stwm %r3,%2(0,%0)\";
  1121.   return \"stws,ma %r3,%2(0,%0)\";
  1122. }"
  1123.   [(set_attr "type" "store")
  1124.    (set_attr "length" "4")])
  1125.  
  1126. ;; For pic
  1127. (define_insn ""
  1128.   [(set (match_operand:SI 0 "register_operand" "=r")
  1129.     (match_operand:SI 1 "pic_operand" "i"))
  1130.    (clobber (match_scratch:SI 2 "=a"))]
  1131.   ""
  1132.   "*
  1133. {
  1134.   rtx label_rtx = gen_label_rtx ();
  1135.   rtx xoperands[3];
  1136.   extern FILE *asm_out_file;
  1137.  
  1138.   xoperands[0] = operands[0];
  1139.   xoperands[1] = operands[1];
  1140.   xoperands[2] = label_rtx;
  1141.   output_asm_insn (\"bl .+8,%0\;addil L'%1-%2,%0\", xoperands);
  1142.   ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (label_rtx));
  1143.   output_asm_insn (\"ldo R'%1-%2(1),%0\", xoperands);
  1144.   return \"\";
  1145.   }
  1146. "
  1147.   [(set_attr "type" "multi")
  1148.    (set_attr "length" "12")])
  1149.  
  1150. ;; Always use addil rather than ldil;add sequences.  This allows the
  1151. ;; HP linker to eliminate the dp relocation if the symbolic operand
  1152. ;; lives in the TEXT space.
  1153. (define_insn ""
  1154.   [(set (match_operand:SI 0 "register_operand" "=a")
  1155.     (high:SI (match_operand 1 "" "")))]
  1156.   "symbolic_operand (operands[1], Pmode)
  1157.    && ! function_label_operand (operands[1])
  1158.    && ! read_only_operand (operands[1])"
  1159.   "@
  1160.    addil L'%G1,%%r27"
  1161.   [(set_attr "type" "binary")
  1162.    (set_attr "length" "4")])
  1163.  
  1164. ;; This is for use in the prologue/epilogue code.  We need it
  1165. ;; to add large constants to a stack pointer or frame pointer.
  1166. ;; Because of the additional %r1 pressure, we probably do not
  1167. ;; want to use this in general code, so make it available
  1168. ;; only after reload.
  1169. (define_insn "add_high_const"
  1170.   [(set (match_operand:SI 0 "register_operand" "=!a,*r")
  1171.     (plus (match_operand:SI 1 "register_operand" "r,r")
  1172.           (high:SI (match_operand 2 "const_int_operand" ""))))]
  1173.   "reload_completed"
  1174.   "@
  1175.    addil L'%G2,%1
  1176.    ldil L'%G2,%0\;addl %0,%1,%0"
  1177.   [(set_attr "type" "binary,binary")
  1178.    (set_attr "length" "4,8")])
  1179.  
  1180. ;; For function addresses.
  1181. (define_insn ""
  1182.   [(set (match_operand:SI 0 "register_operand" "=r")
  1183.     (high:SI (match_operand:SI 1 "function_label_operand" "")))]
  1184.   "!TARGET_PORTABLE_RUNTIME"
  1185.   "ldil LP'%G1,%0"
  1186.   [(set_attr "type" "move")
  1187.    (set_attr "length" "4")])
  1188.  
  1189. ;; This version is used only for the portable runtime conventions model
  1190. ;; (it does not use/support plabels)
  1191. (define_insn ""
  1192.   [(set (match_operand:SI 0 "register_operand" "=r")
  1193.     (high:SI (match_operand:SI 1 "function_label_operand" "")))]
  1194.   "TARGET_PORTABLE_RUNTIME"
  1195.   "ldil L'%G1,%0"
  1196.   [(set_attr "type" "move")
  1197.    (set_attr "length" "4")])
  1198.  
  1199. (define_insn ""
  1200.   [(set (match_operand:SI 0 "register_operand" "=r")
  1201.     (high:SI (match_operand 1 "" "")))]
  1202.   "check_pic (1)"
  1203.   "ldil L'%G1,%0"
  1204.   [(set_attr "type" "move")
  1205.    (set_attr "length" "4")])
  1206.  
  1207. ;; lo_sum of a function address.
  1208. ;;
  1209. ;; Note since we are not supporting MPE style external calls we can
  1210. ;; use the short ldil;ldo sequence.  If one wanted to support
  1211. ;; MPE external calls you would want to generate something like
  1212. ;; ldil;ldo;extru;ldw;add.  See the HP compiler's output for details.
  1213. (define_insn ""
  1214.   [(set (match_operand:SI 0 "register_operand" "=r")
  1215.     (lo_sum:SI (match_operand:SI 1 "register_operand" "r")
  1216.            (match_operand:SI 2 "function_label_operand" "")))]
  1217.   "!TARGET_PORTABLE_RUNTIME"
  1218.   "ldo RP'%G2(%1),%0"
  1219.   [(set_attr "length" "4")])
  1220.  
  1221. ;; This version is used only for the portable runtime conventions model
  1222. ;; (it does not use/support plabels)
  1223. (define_insn ""
  1224.   [(set (match_operand:SI 0 "register_operand" "=r")
  1225.     (lo_sum:SI (match_operand:SI 1 "register_operand" "r")
  1226.            (match_operand:SI 2 "function_label_operand" "")))]
  1227.   "TARGET_PORTABLE_RUNTIME"
  1228.   "ldo R'%G2(%1),%0"
  1229.   [(set_attr "length" "4")])
  1230.  
  1231. (define_insn ""
  1232.   [(set (match_operand:SI 0 "register_operand" "=r")
  1233.     (lo_sum:SI (match_operand:SI 1 "register_operand" "r")
  1234.            (match_operand:SI 2 "immediate_operand" "i")))]
  1235.   ""
  1236.   "ldo R'%G2(%1),%0"
  1237.   [(set_attr "length" "4")])
  1238.  
  1239. ;; Now that a symbolic_address plus a constant is broken up early
  1240. ;; in the compilation phase (for better CSE) we need a special
  1241. ;; combiner pattern to load the symbolic address plus the constant
  1242. ;; in only 2 instructions. (For cases where the symbolic address
  1243. ;; was not a common subexpression.)
  1244. (define_split
  1245.   [(set (match_operand:SI 0 "register_operand" "")
  1246.     (match_operand:SI 1 "symbolic_operand" ""))
  1247.    (clobber (match_operand:SI 2 "register_operand" ""))]
  1248.   ""
  1249.   [(set (match_dup 2) (high:SI (match_dup 1)))
  1250.    (set (match_dup 0) (lo_sum:SI (match_dup 2) (match_dup 1)))]
  1251.   "")
  1252.  
  1253. (define_expand "movhi"
  1254.   [(set (match_operand:HI 0 "general_operand" "")
  1255.     (match_operand:HI 1 "general_operand" ""))]
  1256.   ""
  1257.   "
  1258. {
  1259.   if (emit_move_sequence (operands, HImode, 0))
  1260.     DONE;
  1261. }")
  1262.  
  1263. (define_insn ""
  1264.   [(set (match_operand:HI 0 "reg_or_nonsymb_mem_operand" "=r,r,r,r,r,Q,*q,!f")
  1265.     (match_operand:HI 1 "move_operand" "r,J,N,K,Q,rM,rM,!fM"))]
  1266.   "register_operand (operands[0], HImode)
  1267.    || reg_or_0_operand (operands[1], HImode)"
  1268.   "@
  1269.    copy %1,%0
  1270.    ldi %1,%0
  1271.    ldil L'%1,%0
  1272.    zdepi %Z1,%0
  1273.    ldh%M1 %1,%0
  1274.    sth%M0 %r1,%0
  1275.    mtsar %r1
  1276.    fcpy,sgl %r1,%0"
  1277.   [(set_attr "type" "move,move,move,move,load,store,move,fpalu")
  1278.    (set_attr "length" "4,4,4,4,4,4,4,4")])
  1279.  
  1280. (define_insn ""
  1281.   [(set (match_operand:HI 0 "register_operand" "=r")
  1282.     (mem:HI (plus:SI (mult:SI (match_operand:SI 2 "register_operand" "r")
  1283.                   (const_int 2))
  1284.              (match_operand:SI 1 "register_operand" "r"))))]
  1285.   "! TARGET_DISABLE_INDEXING"
  1286.   "ldhx,s %2(0,%1),%0"
  1287.   [(set_attr "type" "load")
  1288.    (set_attr "length" "4")])
  1289.  
  1290. ;; This variant of the above insn can occur if the second operand
  1291. ;; is the frame pointer.  This is a kludge, but there doesn't
  1292. ;; seem to be a way around it.  Only recognize it while reloading.
  1293. ;; Note how operand 3 uses a predicate of "const_int_operand", but 
  1294. ;; has constraints allowing a register.  I don't know how this works,
  1295. ;; but it somehow makes sure that out-of-range constants are placed
  1296. ;; in a register which somehow magically is a "const_int_operand".
  1297. ;; (this was stolen from alpha.md, I'm not going to try and change it.
  1298. (define_insn ""
  1299.   [(set (match_operand:HI 0 "register_operand" "=&r")
  1300.     (mem:HI (plus:SI (plus:SI
  1301.                 (mult:SI (match_operand:SI 2 "register_operand" "r")
  1302.                      (const_int 2))
  1303.                 (match_operand:SI 1 "register_operand" "r"))
  1304.              (match_operand:SI 3 "const_int_operand" "rI"))))]
  1305.   "! TARGET_DISABLE_INDEXING && reload_in_progress"
  1306.   "*
  1307. {
  1308.   if (GET_CODE (operands[3]) == CONST_INT)
  1309.     return \"sh1addl %2,%1,%0\;ldh %3(0,%0),%0\";
  1310.   else
  1311.     return \"sh1addl %2,%1,%0\;ldhx %3(0,%0),%0\";
  1312. }"
  1313.   [(set_attr "type" "load")
  1314.    (set_attr "length" "8")])
  1315.  
  1316. (define_insn ""
  1317.   [(set (match_operand:HI 3 "register_operand" "=r")
  1318.     (mem:HI (plus:SI (match_operand:SI 1 "register_operand" "0")
  1319.              (match_operand:SI 2 "int5_operand" "L"))))
  1320.    (set (match_operand:SI 0 "register_operand" "=r")
  1321.     (plus:SI (match_dup 1) (match_dup 2)))]
  1322.   ""
  1323.   "ldhs,mb %2(0,%0),%3"
  1324.   [(set_attr "type" "load")
  1325.    (set_attr "length" "4")])
  1326.  
  1327. (define_insn ""
  1328.   [(set (mem:HI (plus:SI (match_operand:SI 1 "register_operand" "0")
  1329.              (match_operand:SI 2 "int5_operand" "L")))
  1330.     (match_operand:HI 3 "reg_or_0_operand" "rM"))
  1331.    (set (match_operand:SI 0 "register_operand" "=r")
  1332.     (plus:SI (match_dup 1) (match_dup 2)))]
  1333.   ""
  1334.   "sths,mb %r3,%2(0,%0)"
  1335.   [(set_attr "type" "store")
  1336.    (set_attr "length" "4")])
  1337.  
  1338. (define_insn ""
  1339.   [(set (match_operand:HI 0 "register_operand" "=r")
  1340.     (high:HI (match_operand 1 "" "")))]
  1341.   "check_pic (1)"
  1342.   "ldil L'%G1,%0"
  1343.   [(set_attr "type" "move")
  1344.    (set_attr "length" "4")])
  1345.  
  1346. (define_insn ""
  1347.   [(set (match_operand:HI 0 "register_operand" "=r")
  1348.     (lo_sum:HI (match_operand:HI 1 "register_operand" "r")
  1349.            (match_operand 2 "immediate_operand" "i")))]
  1350.   ""
  1351.   "ldo R'%G2(%1),%0"
  1352.   [(set_attr "length" "4")])
  1353.  
  1354. (define_expand "movqi"
  1355.   [(set (match_operand:QI 0 "general_operand" "")
  1356.     (match_operand:QI 1 "general_operand" ""))]
  1357.   ""
  1358.   "
  1359. {
  1360.   if (emit_move_sequence (operands, QImode, 0))
  1361.     DONE;
  1362. }")
  1363.  
  1364. (define_insn ""
  1365.   [(set (match_operand:QI 0 "reg_or_nonsymb_mem_operand" "=r,r,r,r,r,Q,*q,!f")
  1366.     (match_operand:QI 1 "move_operand" "r,J,N,K,Q,rM,rM,!fM"))]
  1367.   "register_operand (operands[0], QImode)
  1368.    || reg_or_0_operand (operands[1], QImode)"
  1369.   "@
  1370.    copy %1,%0
  1371.    ldi %1,%0
  1372.    ldil L'%1,%0
  1373.    zdepi %Z1,%0
  1374.    ldb%M1 %1,%0
  1375.    stb%M0 %r1,%0
  1376.    mtsar %r1
  1377.    fcpy,sgl %r1,%0"
  1378.   [(set_attr "type" "move,move,move,move,load,store,move,fpalu")
  1379.    (set_attr "length" "4,4,4,4,4,4,4,4")])
  1380.  
  1381. (define_insn ""
  1382.   [(set (match_operand:QI 3 "register_operand" "=r")
  1383.     (mem:QI (plus:SI (match_operand:SI 1 "register_operand" "0")
  1384.              (match_operand:SI 2 "int5_operand" "L"))))
  1385.    (set (match_operand:SI 0 "register_operand" "=r")
  1386.     (plus:SI (match_dup 1) (match_dup 2)))]
  1387.   ""
  1388.   "ldbs,mb %2(0,%0),%3"
  1389.   [(set_attr "type" "load")
  1390.    (set_attr "length" "4")])
  1391.  
  1392. (define_insn ""
  1393.   [(set (mem:QI (plus:SI (match_operand:SI 1 "register_operand" "0")
  1394.              (match_operand:SI 2 "int5_operand" "L")))
  1395.     (match_operand:QI 3 "reg_or_0_operand" "rM"))
  1396.    (set (match_operand:SI 0 "register_operand" "=r")
  1397.     (plus:SI (match_dup 1) (match_dup 2)))]
  1398.   ""
  1399.   "stbs,mb %r3,%2(0,%0)"
  1400.   [(set_attr "type" "store")
  1401.    (set_attr "length" "4")])
  1402.  
  1403. ;; The definition of this insn does not really explain what it does,
  1404. ;; but it should suffice
  1405. ;; that anything generated as this insn will be recognized as one
  1406. ;; and that it will not successfully combine with anything.
  1407. (define_expand "movstrsi"
  1408.   [(parallel [(set (mem:BLK (match_operand:BLK 0 "" ""))
  1409.            (mem:BLK (match_operand:BLK 1 "" "")))
  1410.           (clobber (match_dup 0))
  1411.           (clobber (match_dup 1))
  1412.           (clobber (match_dup 4))
  1413.           (clobber (match_dup 5))
  1414.           (use (match_operand:SI 2 "arith_operand" ""))
  1415.           (use (match_operand:SI 3 "const_int_operand" ""))])]
  1416.   ""
  1417.   "
  1418. {
  1419.   /* If the blocks are not at least word-aligned and rather big (>16 items),
  1420.      or the size is indeterminate, don't inline the copy code.  A
  1421.      procedure call is better since it can check the alignment at
  1422.      runtime and make the optimal decisions.  */
  1423.      if (INTVAL (operands[3]) < 4
  1424.      && (GET_CODE (operands[2]) != CONST_INT
  1425.          || (INTVAL (operands[2]) / INTVAL (operands[3]) > 8)))
  1426.        FAIL;
  1427.  
  1428.   operands[0] = copy_to_mode_reg (SImode, XEXP (operands[0], 0));
  1429.   operands[1] = copy_to_mode_reg (SImode, XEXP (operands[1], 0));
  1430.   operands[4] = gen_reg_rtx (SImode);
  1431.   operands[5] = gen_reg_rtx (SImode);
  1432. }")
  1433.  
  1434. ;; The operand constraints are written like this to support both compile-time
  1435. ;; and run-time determined byte count.  If the count is run-time determined,
  1436. ;; the register with the byte count is clobbered by the copying code, and
  1437. ;; therefore it is forced to operand 2.  If the count is compile-time
  1438. ;; determined, we need two scratch registers for the unrolled code.
  1439. (define_insn ""
  1440.   [(set (mem:BLK (match_operand:SI 0 "register_operand" "+r,r"))
  1441.     (mem:BLK (match_operand:SI 1 "register_operand" "+r,r")))
  1442.    (clobber (match_dup 0))
  1443.    (clobber (match_dup 1))
  1444.    (clobber (match_operand:SI 2 "register_operand" "=r,r"))    ;loop cnt/tmp
  1445.    (clobber (match_operand:SI 3 "register_operand" "=&r,&r"))    ;item tmp
  1446.    (use (match_operand:SI 4 "arith_operand" "J,2"))     ;byte count
  1447.    (use (match_operand:SI 5 "const_int_operand" "n,n"))] ;alignment
  1448.   ""
  1449.   "* return output_block_move (operands, !which_alternative);"
  1450.   [(set_attr "type" "multi,multi")])
  1451.  
  1452. ;; Floating point move insns
  1453.  
  1454. ;; This pattern forces (set (reg:DF ...) (const_double ...))
  1455. ;; to be reloaded by putting the constant into memory when
  1456. ;; reg is a floating point register.
  1457. ;;
  1458. ;; For integer registers we use ldil;ldo to set the appropriate
  1459. ;; value.
  1460. ;;
  1461. ;; This must come before the movdf pattern, and it must be present
  1462. ;; to handle obscure reloading cases.
  1463. (define_insn ""
  1464.   [(set (match_operand:DF 0 "general_operand" "=?r,f")
  1465.     (match_operand:DF 1 "" "?E,m"))]
  1466.   "GET_CODE (operands[1]) == CONST_DOUBLE
  1467.    && operands[1] != CONST0_RTX (DFmode)"
  1468.   "* return (which_alternative == 0 ? output_move_double (operands)
  1469.                     : \" fldds%F1 %1,%0\");"
  1470.   [(set_attr "type" "move,fpload")
  1471.    (set_attr "length" "16,4")])
  1472.  
  1473. (define_expand "movdf"
  1474.   [(set (match_operand:DF 0 "general_operand" "")
  1475.     (match_operand:DF 1 "general_operand" ""))]
  1476.   ""
  1477.   "
  1478. {
  1479.   if (emit_move_sequence (operands, DFmode, 0))
  1480.     DONE;
  1481. }")
  1482.  
  1483. (define_insn ""
  1484.   [(set (match_operand:DF 0 "reg_or_nonsymb_mem_operand"
  1485.               "=f,*r,Q,?o,?Q,f,*&r,*&r")
  1486.     (match_operand:DF 1 "reg_or_0_or_nonsymb_mem_operand"
  1487.               "fG,*rG,f,*r,*r,Q,o,Q"))]
  1488.   "register_operand (operands[0], DFmode)
  1489.    || reg_or_0_operand (operands[1], DFmode)"
  1490.   "*
  1491. {
  1492.   if (FP_REG_P (operands[0]) || FP_REG_P (operands[1])
  1493.       || operands[1] == CONST0_RTX (DFmode))
  1494.     return output_fp_move_double (operands);
  1495.   return output_move_double (operands);
  1496. }"
  1497.   [(set_attr "type" "fpalu,move,fpstore,store,store,fpload,load,load")
  1498.    (set_attr "length" "4,8,4,8,16,4,8,16")])
  1499.  
  1500. (define_insn ""
  1501.   [(set (match_operand:DF 0 "register_operand" "=f")
  1502.     (mem:DF (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "r")
  1503.                   (const_int 8))
  1504.              (match_operand:SI 2 "register_operand" "r"))))]
  1505.   "! TARGET_DISABLE_INDEXING"
  1506.   "flddx,s %1(0,%2),%0"
  1507.   [(set_attr "type" "fpload")
  1508.    (set_attr "length" "4")])
  1509.  
  1510. ;; This variant of the above insn can occur if the second operand
  1511. ;; is the frame pointer.  This is a kludge, but there doesn't
  1512. ;; seem to be a way around it.  Only recognize it while reloading.
  1513. ;; Note how operand 3 uses a predicate of "const_int_operand", but 
  1514. ;; has constraints allowing a register.  I don't know how this works,
  1515. ;; but it somehow makes sure that out-of-range constants are placed
  1516. ;; in a register which somehow magically is a "const_int_operand".
  1517. ;; (this was stolen from alpha.md, I'm not going to try and change it.
  1518. ;; Ugh. Output is a FP register; so we need to earlyclobber something
  1519. ;; else as a temporary.
  1520. (define_insn ""
  1521.   [(set (match_operand:DF 0 "register_operand" "=f")
  1522.     (mem:DF (plus:SI
  1523.           (plus:SI
  1524.             (mult:SI (match_operand:SI 1 "register_operand" "+&r")
  1525.                  (const_int 8))
  1526.             (match_operand:SI 2 "register_operand" "r"))
  1527.           (match_operand:SI 3 "const_int_operand" "rL"))))]
  1528.   "! TARGET_DISABLE_INDEXING && reload_in_progress"
  1529.   "*
  1530. {
  1531.   if (GET_CODE (operands[3]) == CONST_INT)
  1532.     return \"sh3addl %1,%2,%1\;fldds %3(0,%1),%0\";
  1533.   else
  1534.     return \"sh3addl %1,%2,%1\;flddx %3(0,%1),%0\";
  1535. }"
  1536.   [(set_attr "type" "fpload")
  1537.    (set_attr "length" "8")])
  1538.  
  1539. (define_insn ""
  1540.   [(set (mem:DF (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "r")
  1541.                   (const_int 8))
  1542.              (match_operand:SI 2 "register_operand" "r")))
  1543.     (match_operand:DF 0 "register_operand" "f"))]
  1544.   "! TARGET_DISABLE_INDEXING"
  1545.   "fstdx,s %0,%1(0,%2)"
  1546.   [(set_attr "type" "fpstore")
  1547.    (set_attr "length" "4")])
  1548.  
  1549. ;; This variant of the above insn can occur if the second operand
  1550. ;; is the frame pointer.  This is a kludge, but there doesn't
  1551. ;; seem to be a way around it.  Only recognize it while reloading.
  1552. ;; Note how operand 3 uses a predicate of "const_int_operand", but 
  1553. ;; has constraints allowing a register.  I don't know how this works,
  1554. ;; but it somehow makes sure that out-of-range constants are placed
  1555. ;; in a register which somehow magically is a "const_int_operand".
  1556. ;; (this was stolen from alpha.md, I'm not going to try and change it.
  1557. ;; Ugh. Output is a FP register; so we need to earlyclobber something
  1558. ;; else as a temporary.
  1559. (define_insn ""
  1560.   [(set (mem:DF (plus:SI
  1561.           (plus:SI
  1562.              (mult:SI (match_operand:SI 1 "register_operand" "+&r")
  1563.                   (const_int 8))
  1564.              (match_operand:SI 2 "register_operand" "r"))
  1565.           (match_operand:SI 3 "const_int_operand" "rL")))
  1566.     (match_operand:DF 0 "register_operand" "f"))]
  1567.   "! TARGET_DISABLE_INDEXING && reload_in_progress"
  1568.   "*
  1569. {
  1570.   if (GET_CODE (operands[3]) == CONST_INT)
  1571.     return \"sh3addl %1,%2,%1\;fstds %0,%3(0,%1)\";
  1572.   else
  1573.     return \"sh3addl %1,%2,%1\;fstdx %0,%3(0,%1)\";
  1574. }"
  1575.   [(set_attr "type" "fpstore")
  1576.    (set_attr "length" "8")])
  1577.  
  1578. (define_expand "movdi"
  1579.   [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand" "")
  1580.     (match_operand:DI 1 "general_operand" ""))]
  1581.   ""
  1582.   "
  1583. {
  1584.   if (emit_move_sequence (operands, DImode, 0))
  1585.     DONE;
  1586. }")
  1587.  
  1588. (define_expand "reload_indi"
  1589.   [(set (match_operand:DI 0 "register_operand" "=f")
  1590.     (match_operand:DI 1 "general_operand" ""))
  1591.    (clobber (match_operand:SI 2 "register_operand" "=&r"))]
  1592.   ""
  1593.   "
  1594. {
  1595.   if (emit_move_sequence (operands, DImode, operands[2]))
  1596.     DONE;
  1597.  
  1598.   /* We don't want the clobber emitted, so handle this ourselves.  */
  1599.   emit_insn (gen_rtx (SET, VOIDmode, operands[0], operands[1]));
  1600.   DONE;
  1601. }")
  1602.  
  1603. (define_expand "reload_outdi"
  1604.   [(set (match_operand:DI 0 "general_operand" "")
  1605.     (match_operand:DI 1 "register_operand" "f"))
  1606.    (clobber (match_operand:SI 2 "register_operand" "=&r"))]
  1607.   ""
  1608.   "
  1609. {
  1610.   if (emit_move_sequence (operands, DImode, operands[2]))
  1611.     DONE;
  1612.  
  1613.   /* We don't want the clobber emitted, so handle this ourselves.  */
  1614.   emit_insn (gen_rtx (SET, VOIDmode, operands[0], operands[1]));
  1615.   DONE;
  1616. }")
  1617.  
  1618. (define_insn ""
  1619.   [(set (match_operand:DI 0 "register_operand" "=r")
  1620.     (high:DI (match_operand 1 "" "")))]
  1621.   "check_pic (1)"
  1622.   "*
  1623. {
  1624.   rtx op0 = operands[0];
  1625.   rtx op1 = operands[1];
  1626.  
  1627.   if (GET_CODE (op1) == CONST_INT)
  1628.     {
  1629.       operands[0] = operand_subword (op0, 1, 0, DImode);
  1630.       output_asm_insn (\"ldil L'%1,%0\", operands);
  1631.  
  1632.       operands[0] = operand_subword (op0, 0, 0, DImode);
  1633.       if (INTVAL (op1) < 0)
  1634.     output_asm_insn (\"ldi -1,%0\", operands);
  1635.       else
  1636.     output_asm_insn (\"ldi 0,%0\", operands);
  1637.       return \"\";
  1638.     }
  1639.   else if (GET_CODE (op1) == CONST_DOUBLE)
  1640.     {
  1641.       operands[0] = operand_subword (op0, 1, 0, DImode);
  1642.       operands[1] = gen_rtx (CONST_INT, VOIDmode, CONST_DOUBLE_LOW (op1));
  1643.       output_asm_insn (\"ldil L'%1,%0\", operands);
  1644.  
  1645.       operands[0] = operand_subword (op0, 0, 0, DImode);
  1646.       operands[1] = gen_rtx (CONST_INT, VOIDmode, CONST_DOUBLE_HIGH (op1));
  1647.       output_asm_insn (singlemove_string (operands), operands);
  1648.       return \"\";
  1649.     }
  1650.   else
  1651.     abort ();
  1652. }"
  1653.   [(set_attr "type" "move")
  1654.    (set_attr "length" "8")])
  1655.  
  1656. ;;; Experimental
  1657.  
  1658. (define_insn ""
  1659.   [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand"
  1660.               "=r,o,Q,&r,&r,&r,f,f,*T")
  1661.     (match_operand:DI 1 "general_operand"
  1662.               "rM,r,r,o,Q,i,fM,*T,f"))]
  1663.   "register_operand (operands[0], DImode)
  1664.    || reg_or_0_operand (operands[1], DImode)"
  1665.   "*
  1666. {
  1667.   if (FP_REG_P (operands[0]) || FP_REG_P (operands[1])
  1668.       || (operands[1] == CONST0_RTX (DImode)))
  1669.     return output_fp_move_double (operands);
  1670.   return output_move_double (operands);
  1671. }"
  1672.   [(set_attr "type" "move,store,store,load,load,misc,fpalu,fpload,fpstore")
  1673.    (set_attr "length" "8,8,16,8,16,16,4,4,4")])
  1674.  
  1675. (define_insn ""
  1676.   [(set (match_operand:DI 0 "register_operand" "=r,&r")
  1677.     (lo_sum:DI (match_operand:DI 1 "register_operand" "0,r")
  1678.            (match_operand:DI 2 "immediate_operand" "i,i")))]
  1679.   ""
  1680.   "*
  1681. {
  1682.   /* Don't output a 64 bit constant, since we can't trust the assembler to
  1683.      handle it correctly.  */
  1684.   if (GET_CODE (operands[2]) == CONST_DOUBLE)
  1685.     operands[2] = gen_rtx (CONST_INT, VOIDmode, CONST_DOUBLE_LOW (operands[2]));
  1686.   if (which_alternative == 1)
  1687.     output_asm_insn (\"copy %1,%0\", operands);
  1688.   return \"ldo R'%G2(%R1),%R0\";
  1689. }"
  1690.   ;; Need to set length for this arith insn because operand2
  1691.   ;; is not an "arith_operand".
  1692.   [(set_attr "length" "4,8")])
  1693.  
  1694. ;; This pattern forces (set (reg:SF ...) (const_double ...))
  1695. ;; to be reloaded by putting the constant into memory when
  1696. ;; reg is a floating point register.
  1697. ;;
  1698. ;; For integer registers we use ldil;ldo to set the appropriate
  1699. ;; value.
  1700. ;;
  1701. ;; This must come before the movsf pattern, and it must be present
  1702. ;; to handle obscure reloading cases.
  1703. (define_insn ""
  1704.   [(set (match_operand:SF 0 "general_operand" "=?r,f")
  1705.     (match_operand:SF 1 "" "?E,m"))]
  1706.   "GET_CODE (operands[1]) == CONST_DOUBLE
  1707.    && operands[1] != CONST0_RTX (SFmode)"
  1708.   "* return (which_alternative == 0 ? singlemove_string (operands)
  1709.                     : \" fldws%F1 %1,%0\");"
  1710.   [(set_attr "type" "move,fpload")
  1711.    (set_attr "length" "8,4")])
  1712.  
  1713. (define_expand "movsf"
  1714.   [(set (match_operand:SF 0 "general_operand" "")
  1715.     (match_operand:SF 1 "general_operand" ""))]
  1716.   ""
  1717.   "
  1718. {
  1719.   if (emit_move_sequence (operands, SFmode, 0))
  1720.     DONE;
  1721. }")
  1722.  
  1723. (define_insn ""
  1724.   [(set (match_operand:SF 0 "reg_or_nonsymb_mem_operand"
  1725.               "=f,r,f,r,Q,Q")
  1726.     (match_operand:SF 1 "reg_or_0_or_nonsymb_mem_operand"
  1727.               "fG,rG,Q,Q,f,rG"))]
  1728.   "register_operand (operands[0], SFmode)
  1729.    || reg_or_0_operand (operands[1], SFmode)"
  1730.   "@
  1731.    fcpy,sgl %r1,%0
  1732.    copy %r1,%0
  1733.    fldws%F1 %1,%0
  1734.    ldw%M1 %1,%0
  1735.    fstws%F0 %r1,%0
  1736.    stw%M0 %r1,%0"
  1737.   [(set_attr "type" "fpalu,move,fpload,load,fpstore,store")
  1738.    (set_attr "length" "4,4,4,4,4,4")])
  1739.  
  1740. (define_insn ""
  1741.   [(set (match_operand:SF 0 "register_operand" "=f")
  1742.     (mem:SF (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "r")
  1743.                   (const_int 4))
  1744.              (match_operand:SI 2 "register_operand" "r"))))]
  1745.   "! TARGET_DISABLE_INDEXING"
  1746.   "fldwx,s %1(0,%2),%0"
  1747.   [(set_attr "type" "fpload")
  1748.    (set_attr "length" "4")])
  1749.  
  1750. ;; This variant of the above insn can occur if the second operand
  1751. ;; is the frame pointer.  This is a kludge, but there doesn't
  1752. ;; seem to be a way around it.  Only recognize it while reloading.
  1753. ;; Note how operand 3 uses a predicate of "const_int_operand", but 
  1754. ;; has constraints allowing a register.  I don't know how this works,
  1755. ;; but it somehow makes sure that out-of-range constants are placed
  1756. ;; in a register which somehow magically is a "const_int_operand".
  1757. ;; (this was stolen from alpha.md, I'm not going to try and change it.
  1758. ;; Ugh. Output is a FP register; so we need to earlyclobber something
  1759. ;; else as a temporary.
  1760. (define_insn ""
  1761.   [(set (match_operand:SF 0 "register_operand" "=f")
  1762.     (mem:SF (plus:SI
  1763.           (plus:SI
  1764.             (mult:SI (match_operand:SI 1 "register_operand" "+&r")
  1765.                  (const_int 4))
  1766.             (match_operand:SI 2 "register_operand" "r"))
  1767.           (match_operand:SI 3 "const_int_operand" "rL"))))]
  1768.   "! TARGET_DISABLE_INDEXING && reload_in_progress"
  1769.   "*
  1770. {
  1771.   if (GET_CODE (operands[3]) == CONST_INT)
  1772.     return \"sh2addl %1,%2,%1\;fldws %3(0,%1),%0\";
  1773.   else
  1774.     return \"sh2addl %1,%2,%1\;fldwx %3(0,%1),%0\";
  1775. }"
  1776.   [(set_attr "type" "fpload")
  1777.    (set_attr "length" "8")])
  1778.  
  1779. (define_insn ""
  1780.   [(set (mem:SF (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "r")
  1781.                   (const_int 4))
  1782.              (match_operand:SI 2 "register_operand" "r")))
  1783.     (match_operand:SF 0 "register_operand" "f"))]
  1784.   "! TARGET_DISABLE_INDEXING"
  1785.   "fstwx,s %0,%1(0,%2)"
  1786.   [(set_attr "type" "fpstore")
  1787.    (set_attr "length" "4")])
  1788.  
  1789. ;; This variant of the above insn can occur if the second operand
  1790. ;; is the frame pointer.  This is a kludge, but there doesn't
  1791. ;; seem to be a way around it.  Only recognize it while reloading.
  1792. ;; Note how operand 3 uses a predicate of "const_int_operand", but 
  1793. ;; has constraints allowing a register.  I don't know how this works,
  1794. ;; but it somehow makes sure that out-of-range constants are placed
  1795. ;; in a register which somehow magically is a "const_int_operand".
  1796. ;; (this was stolen from alpha.md, I'm not going to try and change it.
  1797. ;; Ugh. Output is a FP register; so we need to earlyclobber something
  1798. ;; else as a temporary.
  1799. (define_insn ""
  1800.   [(set (mem:SF (plus:SI
  1801.           (plus:SI
  1802.              (mult:SI (match_operand:SI 1 "register_operand" "+&r")
  1803.                   (const_int 4))
  1804.              (match_operand:SI 2 "register_operand" "r"))
  1805.           (match_operand:SI 3 "const_int_operand" "rL")))
  1806.     (match_operand:SF 0 "register_operand" "f"))]
  1807.   "! TARGET_DISABLE_INDEXING && reload_in_progress"
  1808.   "*
  1809. {
  1810.   if (GET_CODE (operands[3]) == CONST_INT)
  1811.     return \"sh2addl %1,%2,%1\;fstws %0,%3(0,%1)\";
  1812.   else
  1813.     return \"sh2addl %1,%2,%1\;fstwx %0,%3(0,%1)\";
  1814. }"
  1815.   [(set_attr "type" "fpstore")
  1816.    (set_attr "length" "8")])
  1817.  
  1818. ;;- zero extension instructions
  1819.  
  1820. (define_insn "zero_extendhisi2"
  1821.   [(set (match_operand:SI 0 "register_operand" "=r,r")
  1822.     (zero_extend:SI
  1823.      (match_operand:HI 1 "reg_or_nonsymb_mem_operand" "r,Q")))]
  1824.   ""
  1825.   "@
  1826.    extru %1,31,16,%0
  1827.    ldh%M1 %1,%0"
  1828.   [(set_attr "type" "unary,load")])
  1829.  
  1830. (define_insn "zero_extendqihi2"
  1831.   [(set (match_operand:HI 0 "register_operand" "=r,r")
  1832.     (zero_extend:HI
  1833.      (match_operand:QI 1 "reg_or_nonsymb_mem_operand" "r,Q")))]
  1834.   ""
  1835.   "@
  1836.    extru %1,31,8,%0
  1837.    ldb%M1 %1,%0"
  1838.   [(set_attr "type" "unary,load")])
  1839.  
  1840. (define_insn "zero_extendqisi2"
  1841.   [(set (match_operand:SI 0 "register_operand" "=r,r")
  1842.     (zero_extend:SI
  1843.      (match_operand:QI 1 "reg_or_nonsymb_mem_operand" "r,Q")))]
  1844.   ""
  1845.   "@
  1846.    extru %1,31,8,%0
  1847.    ldb%M1 %1,%0"
  1848.   [(set_attr "type" "unary,load")])
  1849.  
  1850. ;;- sign extension instructions
  1851.  
  1852. (define_insn "extendhisi2"
  1853.   [(set (match_operand:SI 0 "register_operand" "=r")
  1854.     (sign_extend:SI (match_operand:HI 1 "register_operand" "r")))]
  1855.   ""
  1856.   "extrs %1,31,16,%0"
  1857.   [(set_attr "type" "unary")])
  1858.  
  1859. (define_insn "extendqihi2"
  1860.   [(set (match_operand:HI 0 "register_operand" "=r")
  1861.     (sign_extend:HI (match_operand:QI 1 "register_operand" "r")))]
  1862.   ""
  1863.   "extrs %1,31,8,%0"
  1864.   [(set_attr "type" "unary")])
  1865.  
  1866. (define_insn "extendqisi2"
  1867.   [(set (match_operand:SI 0 "register_operand" "=r")
  1868.     (sign_extend:SI (match_operand:QI 1 "register_operand" "r")))]
  1869.   ""
  1870.   "extrs %1,31,8,%0"
  1871.   [(set_attr "type" "unary")])
  1872.  
  1873. ;; Conversions between float and double.
  1874.  
  1875. (define_insn "extendsfdf2"
  1876.   [(set (match_operand:DF 0 "register_operand" "=f")
  1877.     (float_extend:DF
  1878.      (match_operand:SF 1 "register_operand" "f")))]
  1879.   ""
  1880.   "fcnvff,sgl,dbl %1,%0"
  1881.   [(set_attr "type" "fpalu")])
  1882.  
  1883. (define_insn "truncdfsf2"
  1884.   [(set (match_operand:SF 0 "register_operand" "=f")
  1885.     (float_truncate:SF
  1886.      (match_operand:DF 1 "register_operand" "f")))]
  1887.   ""
  1888.   "fcnvff,dbl,sgl %1,%0"
  1889.   [(set_attr "type" "fpalu")])
  1890.  
  1891. ;; Conversion between fixed point and floating point.
  1892. ;; Note that among the fix-to-float insns
  1893. ;; the ones that start with SImode come first.
  1894. ;; That is so that an operand that is a CONST_INT
  1895. ;; (and therefore lacks a specific machine mode).
  1896. ;; will be recognized as SImode (which is always valid)
  1897. ;; rather than as QImode or HImode.
  1898.  
  1899. ;; This pattern forces (set (reg:SF ...) (float:SF (const_int ...)))
  1900. ;; to be reloaded by putting the constant into memory.
  1901. ;; It must come before the more general floatsisf2 pattern.
  1902. (define_insn ""
  1903.   [(set (match_operand:SF 0 "general_operand" "=f")
  1904.     (float:SF (match_operand:SI 1 "const_int_operand" "m")))]
  1905.   ""
  1906.   "fldws %1,%0\;fcnvxf,sgl,sgl %0,%0"
  1907.   [(set_attr "type" "fpalu")
  1908.    (set_attr "length" "8")])
  1909.  
  1910. (define_insn "floatsisf2"
  1911.   [(set (match_operand:SF 0 "general_operand" "=f")
  1912.     (float:SF (match_operand:SI 1 "register_operand" "f")))]
  1913.   ""
  1914.   "fcnvxf,sgl,sgl %1,%0"
  1915.   [(set_attr "type" "fpalu")])
  1916.  
  1917. ;; This pattern forces (set (reg:DF ...) (float:DF (const_int ...)))
  1918. ;; to be reloaded by putting the constant into memory.
  1919. ;; It must come before the more general floatsidf2 pattern.
  1920. (define_insn ""
  1921.   [(set (match_operand:DF 0 "general_operand" "=f")
  1922.     (float:DF (match_operand:SI 1 "const_int_operand" "m")))]
  1923.   ""
  1924.   "fldws %1,%0\;fcnvxf,sgl,dbl %0,%0"
  1925.   [(set_attr "type" "fpalu")
  1926.    (set_attr "length" "8")])
  1927.  
  1928. (define_insn "floatsidf2"
  1929.   [(set (match_operand:DF 0 "general_operand" "=f")
  1930.     (float:DF (match_operand:SI 1 "register_operand" "f")))]
  1931.   ""
  1932.   "fcnvxf,sgl,dbl %1,%0"
  1933.   [(set_attr "type" "fpalu")])
  1934.  
  1935. (define_expand "floatunssisf2"
  1936.   [(set (subreg:SI (match_dup 2) 1)
  1937.     (match_operand:SI 1 "register_operand" ""))
  1938.    (set (subreg:SI (match_dup 2) 0)
  1939.     (const_int 0))
  1940.    (set (match_operand:SF 0 "general_operand" "")
  1941.     (float:SF (match_dup 2)))]
  1942.   "TARGET_SNAKE"
  1943.   "operands[2] = gen_reg_rtx (DImode);")
  1944.  
  1945. (define_expand "floatunssidf2"
  1946.   [(set (subreg:SI (match_dup 2) 1)
  1947.     (match_operand:SI 1 "register_operand" ""))
  1948.    (set (subreg:SI (match_dup 2) 0)
  1949.     (const_int 0))
  1950.    (set (match_operand:DF 0 "general_operand" "")
  1951.     (float:DF (match_dup 2)))]
  1952.   "TARGET_SNAKE"
  1953.   "operands[2] = gen_reg_rtx (DImode);")
  1954.  
  1955. (define_insn "floatdisf2"
  1956.   [(set (match_operand:SF 0 "general_operand" "=f")
  1957.     (float:SF (match_operand:DI 1 "register_operand" "f")))]
  1958.   "TARGET_SNAKE"
  1959.   "fcnvxf,dbl,sgl %1,%0"
  1960.   [(set_attr "type" "fpalu")])
  1961.  
  1962. (define_insn "floatdidf2"
  1963.   [(set (match_operand:DF 0 "general_operand" "=f")
  1964.     (float:DF (match_operand:DI 1 "register_operand" "f")))]
  1965.   "TARGET_SNAKE"
  1966.   "fcnvxf,dbl,dbl %1,%0"
  1967.   [(set_attr "type" "fpalu")])
  1968.  
  1969. ;; Convert a float to an actual integer.
  1970. ;; Truncation is performed as part of the conversion.
  1971.  
  1972. (define_insn "fix_truncsfsi2"
  1973.   [(set (match_operand:SI 0 "register_operand" "=f")
  1974.     (fix:SI (fix:SF (match_operand:SF 1 "register_operand" "f"))))]
  1975.   ""
  1976.   "fcnvfxt,sgl,sgl %1,%0"
  1977.   [(set_attr "type" "fpalu")])
  1978.  
  1979. (define_insn "fix_truncdfsi2"
  1980.   [(set (match_operand:SI 0 "register_operand" "=f")
  1981.     (fix:SI (fix:DF (match_operand:DF 1 "register_operand" "f"))))]
  1982.   ""
  1983.   "fcnvfxt,dbl,sgl %1,%0"
  1984.   [(set_attr "type" "fpalu")])
  1985.  
  1986. (define_insn "fix_truncsfdi2"
  1987.   [(set (match_operand:DI 0 "register_operand" "=f")
  1988.     (fix:DI (fix:SF (match_operand:SF 1 "register_operand" "f"))))]
  1989.   "TARGET_SNAKE"
  1990.   "fcnvfxt,sgl,dbl %1,%0"
  1991.   [(set_attr "type" "fpalu")])
  1992.  
  1993. (define_insn "fix_truncdfdi2"
  1994.   [(set (match_operand:DI 0 "register_operand" "=f")
  1995.     (fix:DI (fix:DF (match_operand:DF 1 "register_operand" "f"))))]
  1996.   "TARGET_SNAKE"
  1997.   "fcnvfxt,dbl,dbl %1,%0"
  1998.   [(set_attr "type" "fpalu")])
  1999.  
  2000. ;;- arithmetic instructions
  2001.  
  2002. (define_insn "adddi3"
  2003.   [(set (match_operand:DI 0 "register_operand" "=r")
  2004.     (plus:DI (match_operand:DI 1 "register_operand" "%r")
  2005.          (match_operand:DI 2 "arith11_operand" "rI")))]
  2006.   ""
  2007.   "*
  2008. {
  2009.   if (GET_CODE (operands[2]) == CONST_INT)
  2010.     {
  2011.       if (INTVAL (operands[2]) >= 0)
  2012.     return \"addi %2,%R1,%R0\;addc %1,0,%0\";
  2013.       else
  2014.     return \"addi %2,%R1,%R0\;subb %1,0,%0\";
  2015.     }
  2016.   else
  2017.     return \"add %R2,%R1,%R0\;addc %2,%1,%0\";
  2018. }"
  2019.   [(set_attr "length" "8")])
  2020.  
  2021. (define_insn ""
  2022.   [(set (match_operand:SI 0 "register_operand" "=r")
  2023.     (plus:SI (not:SI (match_operand:SI 1 "register_operand" "r"))
  2024.          (match_operand:SI 2 "register_operand" "r")))]
  2025.   ""
  2026.   "uaddcm %2,%1,%0")
  2027.  
  2028. ;; define_splits to optimize cases of adding a constant integer
  2029. ;; to a register when the constant does not fit in 14 bits.  */
  2030. (define_split
  2031.   [(set (match_operand:SI 0 "register_operand" "")
  2032.     (plus:SI (match_operand:SI 1 "register_operand" "")
  2033.          (match_operand:SI 2 "const_int_operand" "")))
  2034.    (clobber (match_operand:SI 4 "register_operand" ""))]
  2035.   "! cint_ok_for_move (INTVAL (operands[2]))
  2036.    && VAL_14_BITS_P (INTVAL (operands[2]) >> 1)"
  2037.   [(set (match_dup 4) (plus:SI (match_dup 1) (match_dup 2)))
  2038.    (set (match_dup 0) (plus:SI (match_dup 4) (match_dup 3)))]
  2039.   "
  2040. {
  2041.   int val = INTVAL (operands[2]);
  2042.   int low = (val < 0) ? -0x2000 : 0x1fff;
  2043.   int rest = val - low;
  2044.  
  2045.   operands[2] = GEN_INT (rest);
  2046.   operands[3] = GEN_INT (low);
  2047. }")
  2048.  
  2049. (define_split
  2050.   [(set (match_operand:SI 0 "register_operand" "")
  2051.     (plus:SI (match_operand:SI 1 "register_operand" "")
  2052.          (match_operand:SI 2 "const_int_operand" "")))
  2053.    (clobber (match_operand:SI 4 "register_operand" ""))]
  2054.   "! cint_ok_for_move (INTVAL (operands[2]))"
  2055.   [(set (match_dup 4) (match_dup 2))
  2056.    (set (match_dup 0) (plus:SI (mult:SI (match_dup 4) (match_dup 3))
  2057.                    (match_dup 1)))]
  2058.   "
  2059. {
  2060.   HOST_WIDE_INT intval = INTVAL (operands[2]);
  2061.  
  2062.   /* Try dividing the constant by 2, then 4, and finally 8 to see
  2063.      if we can get a constant which can be loaded into a register
  2064.      in a single instruction (cint_ok_for_move).  */
  2065.   if (intval % 2 == 0 && cint_ok_for_move (intval / 2))
  2066.     {
  2067.       operands[2] = GEN_INT (intval / 2);
  2068.       operands[3] = GEN_INT (2);
  2069.     }
  2070.   else if (intval % 4 == 0 && cint_ok_for_move (intval / 4))
  2071.     {
  2072.       operands[2] = GEN_INT (intval / 4);
  2073.       operands[3] = GEN_INT (4);
  2074.     }
  2075.   else if (intval % 8 == 0 && cint_ok_for_move (intval / 8))
  2076.     {
  2077.       operands[2] = GEN_INT (intval / 8);
  2078.       operands[3] = GEN_INT (8);
  2079.     }
  2080.   else
  2081.     FAIL;
  2082. }")
  2083.  
  2084. (define_insn "addsi3"
  2085.   [(set (match_operand:SI 0 "register_operand" "=r,r")
  2086.     (plus:SI (match_operand:SI 1 "register_operand" "%r,r")
  2087.          (match_operand:SI 2 "arith_operand" "r,J")))]
  2088.   ""
  2089.   "@
  2090.    addl %1,%2,%0
  2091.    ldo %2(%1),%0")
  2092.  
  2093. (define_insn "subdi3"
  2094.   [(set (match_operand:DI 0 "register_operand" "=r")
  2095.     (minus:DI (match_operand:DI 1 "register_operand" "r")
  2096.           (match_operand:DI 2 "register_operand" "r")))]
  2097.   ""
  2098.   "sub %R1,%R2,%R0\;subb %1,%2,%0"
  2099.   [(set_attr "length" "8")])
  2100.  
  2101. (define_insn "subsi3"
  2102.   [(set (match_operand:SI 0 "register_operand" "=r,r")
  2103.     (minus:SI (match_operand:SI 1 "arith11_operand" "r,I")
  2104.           (match_operand:SI 2 "register_operand" "r,r")))]
  2105.   ""
  2106.   "@
  2107.    sub %1,%2,%0
  2108.    subi %1,%2,%0")
  2109.  
  2110. ;; Clobbering a "register_operand" instead of a match_scratch
  2111. ;; in operand3 of millicode calls avoids spilling %r1 and
  2112. ;; produces better code.
  2113.  
  2114. ;; The mulsi3 insns set up registers for the millicode call.
  2115. (define_expand "mulsi3"
  2116.   [(set (reg:SI 26) (match_operand:SI 1 "move_operand" ""))
  2117.    (set (reg:SI 25) (match_operand:SI 2 "move_operand" ""))
  2118.    (parallel [(set (reg:SI 29) (mult:SI (reg:SI 26) (reg:SI 25)))
  2119.           (clobber (match_dup 3))
  2120.           (clobber (reg:SI 26))
  2121.           (clobber (reg:SI 25))
  2122.           (clobber (reg:SI 31))])
  2123.    (set (match_operand:SI 0 "general_operand" "") (reg:SI 29))]
  2124.   ""
  2125.   "
  2126. {
  2127.   if (TARGET_SNAKE && ! TARGET_DISABLE_FPREGS)
  2128.     {
  2129.       rtx scratch = gen_reg_rtx (DImode);
  2130.       operands[1] = force_reg (SImode, operands[1]);
  2131.       operands[2] = force_reg (SImode, operands[2]);
  2132.       emit_insn (gen_umulsidi3 (scratch, operands[1], operands[2]));
  2133.       emit_insn (gen_rtx (SET, VOIDmode,
  2134.               operands[0],
  2135.               gen_rtx (SUBREG, SImode, scratch, 1)));
  2136.       DONE;
  2137.     }
  2138.   operands[3] = gen_reg_rtx (SImode);
  2139. }")
  2140.  
  2141. (define_insn "umulsidi3"
  2142.   [(set (match_operand:DI 0 "nonimmediate_operand" "=f")
  2143.     (mult:DI (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "f"))
  2144.          (zero_extend:DI (match_operand:SI 2 "nonimmediate_operand" "f"))))]
  2145.   "TARGET_SNAKE && ! TARGET_DISABLE_FPREGS"
  2146.   "xmpyu %1,%2,%0"
  2147.   [(set_attr "type" "fpmul")])
  2148.  
  2149. (define_insn ""
  2150.   [(set (match_operand:DI 0 "nonimmediate_operand" "=f")
  2151.     (mult:DI (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "f"))
  2152.          (match_operand:DI 2 "uint32_operand" "f")))]
  2153.   "TARGET_SNAKE && ! TARGET_DISABLE_FPREGS"
  2154.   "xmpyu %1,%R2,%0"
  2155.   [(set_attr "type" "fpmul")])
  2156.  
  2157. (define_insn ""
  2158.   [(set (reg:SI 29) (mult:SI (reg:SI 26) (reg:SI 25)))
  2159.    (clobber (match_operand:SI 0 "register_operand" "=a"))
  2160.    (clobber (reg:SI 26))
  2161.    (clobber (reg:SI 25))
  2162.    (clobber (reg:SI 31))]
  2163.   ""
  2164.   "* return output_mul_insn (0, insn);"
  2165.   [(set_attr "type" "milli")
  2166.    (set (attr "length") (if_then_else (ne (symbol_ref "TARGET_LONG_CALLS")
  2167.                       (const_int 0))
  2168.                       (const_int 4)
  2169.                       (const_int 24)))])
  2170.  
  2171. ;;; Division and mod.
  2172. (define_expand "divsi3"
  2173.   [(set (reg:SI 26) (match_operand:SI 1 "move_operand" ""))
  2174.    (set (reg:SI 25) (match_operand:SI 2 "move_operand" ""))
  2175.    (parallel [(set (reg:SI 29) (div:SI (reg:SI 26) (reg:SI 25)))
  2176.           (clobber (match_dup 3))
  2177.           (clobber (reg:SI 26))
  2178.           (clobber (reg:SI 25))
  2179.           (clobber (reg:SI 31))])
  2180.    (set (match_operand:SI 0 "general_operand" "") (reg:SI 29))]
  2181.   ""
  2182.   "
  2183. {
  2184.   operands[3] = gen_reg_rtx(SImode);
  2185.   if (!(GET_CODE (operands[2]) == CONST_INT && emit_hpdiv_const(operands, 0)))
  2186.     {
  2187.       emit_move_insn (gen_rtx (REG, SImode, 26), operands[1]);
  2188.       emit_move_insn (gen_rtx (REG, SImode, 25), operands[2]);
  2189.       emit
  2190.     (gen_rtx
  2191.      (PARALLEL, VOIDmode,
  2192.       gen_rtvec (5, gen_rtx (SET, VOIDmode, gen_rtx (REG, SImode, 29),
  2193.                  gen_rtx (DIV, SImode,
  2194.                       gen_rtx (REG, SImode, 26),
  2195.                       gen_rtx (REG, SImode, 25))),
  2196.              gen_rtx (CLOBBER, VOIDmode, operands[3]),
  2197.              gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 26)),
  2198.              gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 25)),
  2199.              gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 31)))));
  2200.       emit_move_insn (operands[0], gen_rtx (REG, SImode, 29));
  2201.     }
  2202.   DONE;
  2203. }")
  2204.  
  2205. (define_insn ""
  2206.   [(set (reg:SI 29)
  2207.     (div:SI (reg:SI 26) (match_operand:SI 0 "div_operand" "")))
  2208.    (clobber (match_operand:SI 1 "register_operand" "=a"))
  2209.    (clobber (reg:SI 26))
  2210.    (clobber (reg:SI 25))
  2211.    (clobber (reg:SI 31))]
  2212.   ""
  2213.   "*
  2214.    return output_div_insn (operands, 0, insn);"
  2215.   [(set_attr "type" "milli")
  2216.    (set (attr "length") (if_then_else (ne (symbol_ref "TARGET_LONG_CALLS")
  2217.                       (const_int 0))
  2218.                       (const_int 4)
  2219.                       (const_int 24)))])
  2220.  
  2221. (define_expand "udivsi3"
  2222.   [(set (reg:SI 26) (match_operand:SI 1 "move_operand" ""))
  2223.    (set (reg:SI 25) (match_operand:SI 2 "move_operand" ""))
  2224.    (parallel [(set (reg:SI 29) (udiv:SI (reg:SI 26) (reg:SI 25)))
  2225.           (clobber (match_dup 3))
  2226.           (clobber (reg:SI 26))
  2227.           (clobber (reg:SI 25))
  2228.           (clobber (reg:SI 31))])
  2229.    (set (match_operand:SI 0 "general_operand" "") (reg:SI 29))]
  2230.   ""
  2231.   "
  2232. {
  2233.   operands[3] = gen_reg_rtx(SImode);
  2234.   if (!(GET_CODE (operands[2]) == CONST_INT && emit_hpdiv_const(operands, 1)))
  2235.     {
  2236.       emit_move_insn (gen_rtx (REG, SImode, 26), operands[1]);
  2237.       emit_move_insn (gen_rtx (REG, SImode, 25), operands[2]);
  2238.       emit
  2239.     (gen_rtx
  2240.      (PARALLEL, VOIDmode,
  2241.       gen_rtvec (5, gen_rtx (SET, VOIDmode, gen_rtx (REG, SImode, 29),
  2242.                  gen_rtx (UDIV, SImode,
  2243.                       gen_rtx (REG, SImode, 26),
  2244.                       gen_rtx (REG, SImode, 25))),
  2245.              gen_rtx (CLOBBER, VOIDmode, operands[3]),
  2246.              gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 26)),
  2247.              gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 25)),
  2248.              gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 31)))));
  2249.       emit_move_insn (operands[0], gen_rtx (REG, SImode, 29));
  2250.     }
  2251.   DONE;
  2252. }")
  2253.  
  2254. (define_insn ""
  2255.   [(set (reg:SI 29)
  2256.     (udiv:SI (reg:SI 26) (match_operand:SI 0 "div_operand" "")))
  2257.    (clobber (match_operand:SI 1 "register_operand" "=a"))
  2258.    (clobber (reg:SI 26))
  2259.    (clobber (reg:SI 25))
  2260.    (clobber (reg:SI 31))]
  2261.   ""
  2262.   "*
  2263.    return output_div_insn (operands, 1, insn);"
  2264.   [(set_attr "type" "milli")
  2265.    (set (attr "length") (if_then_else (ne (symbol_ref "TARGET_LONG_CALLS")
  2266.                       (const_int 0))
  2267.                       (const_int 4)
  2268.                       (const_int 24)))])
  2269.  
  2270. (define_expand "modsi3"
  2271.   [(set (reg:SI 26) (match_operand:SI 1 "move_operand" ""))
  2272.    (set (reg:SI 25) (match_operand:SI 2 "move_operand" ""))
  2273.    (parallel [(set (reg:SI 29) (mod:SI (reg:SI 26) (reg:SI 25)))
  2274.           (clobber (match_dup 3))
  2275.           (clobber (reg:SI 26))
  2276.           (clobber (reg:SI 25))
  2277.           (clobber (reg:SI 31))])
  2278.    (set (match_operand:SI 0 "general_operand" "") (reg:SI 29))]
  2279.   ""
  2280.   "
  2281. {
  2282.   operands[3] = gen_reg_rtx(SImode);
  2283.   emit_move_insn (gen_rtx (REG, SImode, 26), operands[1]);
  2284.   emit_move_insn (gen_rtx (REG, SImode, 25), operands[2]);
  2285.   emit
  2286.     (gen_rtx
  2287.      (PARALLEL, VOIDmode,
  2288.       gen_rtvec (5, gen_rtx (SET, VOIDmode, gen_rtx (REG, SImode, 29),
  2289.                  gen_rtx (MOD, SImode,
  2290.                       gen_rtx (REG, SImode, 26),
  2291.                       gen_rtx (REG, SImode, 25))),
  2292.          gen_rtx (CLOBBER, VOIDmode, operands[3]),
  2293.          gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 26)),
  2294.          gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 25)),
  2295.          gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 31)))));
  2296.   emit_move_insn (operands[0], gen_rtx (REG, SImode, 29));
  2297.   DONE;
  2298. }")
  2299.  
  2300. (define_insn ""
  2301.   [(set (reg:SI 29) (mod:SI (reg:SI 26) (reg:SI 25)))
  2302.    (clobber (match_operand:SI 0 "register_operand" "=a"))
  2303.    (clobber (reg:SI 26))
  2304.    (clobber (reg:SI 25))
  2305.    (clobber (reg:SI 31))]
  2306.   ""
  2307.   "*
  2308.   return output_mod_insn (0, insn);"
  2309.   [(set_attr "type" "milli")
  2310.    (set (attr "length") (if_then_else (ne (symbol_ref "TARGET_LONG_CALLS")
  2311.                       (const_int 0))
  2312.                       (const_int 4)
  2313.                       (const_int 24)))])
  2314.  
  2315. (define_expand "umodsi3"
  2316.   [(set (reg:SI 26) (match_operand:SI 1 "move_operand" ""))
  2317.    (set (reg:SI 25) (match_operand:SI 2 "move_operand" ""))
  2318.    (parallel [(set (reg:SI 29) (umod:SI (reg:SI 26) (reg:SI 25)))
  2319.           (clobber (match_dup 3))
  2320.           (clobber (reg:SI 26))
  2321.           (clobber (reg:SI 25))
  2322.           (clobber (reg:SI 31))])
  2323.    (set (match_operand:SI 0 "general_operand" "") (reg:SI 29))]
  2324.   ""
  2325.   "
  2326. {
  2327.   operands[3] = gen_reg_rtx(SImode);
  2328.   emit_move_insn (gen_rtx (REG, SImode, 26), operands[1]);
  2329.   emit_move_insn (gen_rtx (REG, SImode, 25), operands[2]);
  2330.   emit
  2331.     (gen_rtx
  2332.      (PARALLEL, VOIDmode,
  2333.       gen_rtvec (5, gen_rtx (SET, VOIDmode, gen_rtx (REG, SImode, 29),
  2334.                  gen_rtx (UMOD, SImode,
  2335.                       gen_rtx (REG, SImode, 26),
  2336.                       gen_rtx (REG, SImode, 25))),
  2337.          gen_rtx (CLOBBER, VOIDmode, operands[3]),
  2338.          gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 26)),
  2339.          gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 25)),
  2340.          gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 31)))));
  2341.   emit_move_insn (operands[0], gen_rtx (REG, SImode, 29));
  2342.   DONE;
  2343. }")
  2344.  
  2345. (define_insn ""
  2346.   [(set (reg:SI 29) (umod:SI (reg:SI 26) (reg:SI 25)))
  2347.    (clobber (match_operand:SI 0 "register_operand" "=a"))
  2348.    (clobber (reg:SI 26))
  2349.    (clobber (reg:SI 25))
  2350.    (clobber (reg:SI 31))]
  2351.   ""
  2352.   "*
  2353.   return output_mod_insn (1, insn);"
  2354.   [(set_attr "type" "milli")
  2355.    (set (attr "length") (if_then_else (ne (symbol_ref "TARGET_LONG_CALLS")
  2356.                       (const_int 0))
  2357.                       (const_int 4)
  2358.                       (const_int 24)))])
  2359.  
  2360. ;;- and instructions
  2361. ;; We define DImode `and` so with DImode `not` we can get
  2362. ;; DImode `andn`.  Other combinations are possible.
  2363.  
  2364. (define_expand "anddi3"
  2365.   [(set (match_operand:DI 0 "register_operand" "")
  2366.     (and:DI (match_operand:DI 1 "arith_double_operand" "")
  2367.         (match_operand:DI 2 "arith_double_operand" "")))]
  2368.   ""
  2369.   "
  2370. {
  2371.   if (! register_operand (operands[1], DImode)
  2372.       || ! register_operand (operands[2], DImode))
  2373.     /* Let GCC break this into word-at-a-time operations.  */
  2374.     FAIL;
  2375. }")
  2376.  
  2377. (define_insn ""
  2378.   [(set (match_operand:DI 0 "register_operand" "=r")
  2379.     (and:DI (match_operand:DI 1 "register_operand" "%r")
  2380.         (match_operand:DI 2 "register_operand" "r")))]
  2381.   ""
  2382.   "and %1,%2,%0\;and %R1,%R2,%R0"
  2383.   [(set_attr "length" "8")])
  2384.  
  2385. ; The ? for op1 makes reload prefer zdepi instead of loading a huge
  2386. ; constant with ldil;ldo.
  2387. (define_insn "andsi3"
  2388.   [(set (match_operand:SI 0 "register_operand" "=r,r")
  2389.     (and:SI (match_operand:SI 1 "register_operand" "%?r,0")
  2390.         (match_operand:SI 2 "and_operand" "rO,P")))]
  2391.   ""
  2392.   "* return output_and (operands); "
  2393.   [(set_attr "type" "binary")
  2394.    (set_attr "length" "4")])
  2395.  
  2396. (define_insn ""
  2397.   [(set (match_operand:DI 0 "register_operand" "=r")
  2398.     (and:DI (not:DI (match_operand:DI 1 "register_operand" "r"))
  2399.         (match_operand:DI 2 "register_operand" "r")))]
  2400.   ""
  2401.   "andcm %2,%1,%0\;andcm %R2,%R1,%R0"
  2402.   [(set_attr "length" "8")])
  2403.  
  2404. (define_insn ""
  2405.   [(set (match_operand:SI 0 "register_operand" "=r")
  2406.     (and:SI (not:SI (match_operand:SI 1 "register_operand" "r"))
  2407.         (match_operand:SI 2 "register_operand" "r")))]
  2408.   ""
  2409.   "andcm %2,%1,%0")
  2410.  
  2411. (define_expand "iordi3"
  2412.   [(set (match_operand:DI 0 "register_operand" "")
  2413.     (ior:DI (match_operand:DI 1 "arith_double_operand" "")
  2414.         (match_operand:DI 2 "arith_double_operand" "")))]
  2415.   ""
  2416.   "
  2417. {
  2418.   if (! register_operand (operands[1], DImode)
  2419.       || ! register_operand (operands[2], DImode))
  2420.     /* Let GCC break this into word-at-a-time operations.  */
  2421.     FAIL;
  2422. }")
  2423.  
  2424. (define_insn ""
  2425.   [(set (match_operand:DI 0 "register_operand" "=r")
  2426.     (ior:DI (match_operand:DI 1 "register_operand" "%r")
  2427.         (match_operand:DI 2 "register_operand" "r")))]
  2428.   ""
  2429.   "or %1,%2,%0\;or %R1,%R2,%R0"
  2430.   [(set_attr "length" "8")])
  2431.  
  2432. ;; Need a define_expand because we've run out of CONST_OK... characters.
  2433. (define_expand "iorsi3"
  2434.   [(set (match_operand:SI 0 "register_operand" "")
  2435.     (ior:SI (match_operand:SI 1 "register_operand" "")
  2436.         (match_operand:SI 2 "arith32_operand" "")))]
  2437.   ""
  2438.   "
  2439. {
  2440.   if (! (ior_operand (operands[2]) || register_operand (operands[2])))
  2441.     operands[2] = force_reg (SImode, operands[2]);
  2442. }")
  2443.  
  2444. (define_insn ""
  2445.   [(set (match_operand:SI 0 "register_operand" "=r")
  2446.     (ior:SI (match_operand:SI 1 "register_operand" "0")
  2447.         (match_operand:SI 2 "ior_operand" "")))]
  2448.   ""
  2449.   "* return output_ior (operands); "
  2450.   [(set_attr "type" "binary")
  2451.    (set_attr "length" "4")])
  2452.  
  2453. (define_insn ""
  2454.   [(set (match_operand:SI 0 "register_operand" "=r")
  2455.     (ior:SI (match_operand:SI 1 "register_operand" "%r")
  2456.         (match_operand:SI 2 "register_operand" "r")))]
  2457.   ""
  2458.   "or %1,%2,%0")
  2459.  
  2460. (define_expand "xordi3"
  2461.   [(set (match_operand:DI 0 "register_operand" "")
  2462.     (xor:DI (match_operand:DI 1 "arith_double_operand" "")
  2463.         (match_operand:DI 2 "arith_double_operand" "")))]
  2464.   ""
  2465.   "
  2466. {
  2467.   if (! register_operand (operands[1], DImode)
  2468.       || ! register_operand (operands[2], DImode))
  2469.     /* Let GCC break this into word-at-a-time operations.  */
  2470.     FAIL;
  2471. }")
  2472.  
  2473. (define_insn ""
  2474.   [(set (match_operand:DI 0 "register_operand" "=r")
  2475.     (xor:DI (match_operand:DI 1 "register_operand" "%r")
  2476.         (match_operand:DI 2 "register_operand" "r")))]
  2477.   ""
  2478.   "xor %1,%2,%0\;xor %R1,%R2,%R0"
  2479.   [(set_attr "length" "8")])
  2480.  
  2481. (define_insn "xorsi3"
  2482.   [(set (match_operand:SI 0 "register_operand" "=r")
  2483.     (xor:SI (match_operand:SI 1 "register_operand" "%r")
  2484.         (match_operand:SI 2 "register_operand" "r")))]
  2485.   ""
  2486.   "xor %1,%2,%0")
  2487.  
  2488. (define_insn "negdi2"
  2489.   [(set (match_operand:DI 0 "register_operand" "=r")
  2490.     (neg:DI (match_operand:DI 1 "register_operand" "r")))]
  2491.   ""
  2492.   "sub 0,%R1,%R0\;subb 0,%1,%0"
  2493.   [(set_attr "type" "unary")
  2494.    (set_attr "length" "8")])
  2495.  
  2496. (define_insn "negsi2"
  2497.   [(set (match_operand:SI 0 "register_operand" "=r")
  2498.     (neg:SI (match_operand:SI 1 "register_operand" "r")))]
  2499.   ""
  2500.   "sub 0,%1,%0"
  2501.   [(set_attr "type" "unary")])
  2502.  
  2503. (define_expand "one_cmpldi2"
  2504.   [(set (match_operand:DI 0 "register_operand" "")
  2505.     (not:DI (match_operand:DI 1 "arith_double_operand" "")))]
  2506.   ""
  2507.   "
  2508. {
  2509.   if (! register_operand (operands[1], DImode))
  2510.     FAIL;
  2511. }")
  2512.  
  2513. (define_insn ""
  2514.   [(set (match_operand:DI 0 "register_operand" "=r")
  2515.     (not:DI (match_operand:DI 1 "register_operand" "r")))]
  2516.   ""
  2517.   "uaddcm 0,%1,%0\;uaddcm 0,%R1,%R0"
  2518.   [(set_attr "type" "unary")
  2519.    (set_attr "length" "8")])
  2520.  
  2521. (define_insn "one_cmplsi2"
  2522.   [(set (match_operand:SI 0 "register_operand" "=r")
  2523.     (not:SI (match_operand:SI 1 "register_operand" "r")))]
  2524.   ""
  2525.   "uaddcm 0,%1,%0"
  2526.   [(set_attr "type" "unary")])
  2527.  
  2528. ;; Floating point arithmetic instructions.
  2529.  
  2530. (define_insn "adddf3"
  2531.   [(set (match_operand:DF 0 "register_operand" "=f")
  2532.     (plus:DF (match_operand:DF 1 "register_operand" "f")
  2533.          (match_operand:DF 2 "register_operand" "f")))]
  2534.   ""
  2535.   "fadd,dbl %1,%2,%0"
  2536.   [(set_attr "type" "fpalu")])
  2537.  
  2538. (define_insn "addsf3"
  2539.   [(set (match_operand:SF 0 "register_operand" "=f")
  2540.     (plus:SF (match_operand:SF 1 "register_operand" "f")
  2541.          (match_operand:SF 2 "register_operand" "f")))]
  2542.   ""
  2543.   "fadd,sgl %1,%2,%0"
  2544.   [(set_attr "type" "fpalu")])
  2545.  
  2546. (define_insn "subdf3"
  2547.   [(set (match_operand:DF 0 "register_operand" "=f")
  2548.     (minus:DF (match_operand:DF 1 "register_operand" "f")
  2549.           (match_operand:DF 2 "register_operand" "f")))]
  2550.   ""
  2551.   "fsub,dbl %1,%2,%0"
  2552.   [(set_attr "type" "fpalu")])
  2553.  
  2554. (define_insn "subsf3"
  2555.   [(set (match_operand:SF 0 "register_operand" "=f")
  2556.     (minus:SF (match_operand:SF 1 "register_operand" "f")
  2557.           (match_operand:SF 2 "register_operand" "f")))]
  2558.   ""
  2559.   "fsub,sgl %1,%2,%0"
  2560.   [(set_attr "type" "fpalu")])
  2561.  
  2562. (define_insn "muldf3"
  2563.   [(set (match_operand:DF 0 "register_operand" "=f")
  2564.     (mult:DF (match_operand:DF 1 "register_operand" "f")
  2565.          (match_operand:DF 2 "register_operand" "f")))]
  2566.   ""
  2567.   "fmpy,dbl %1,%2,%0"
  2568.   [(set_attr "type" "fpmul")])
  2569.  
  2570. (define_insn "mulsf3"
  2571.   [(set (match_operand:SF 0 "register_operand" "=f")
  2572.     (mult:SF (match_operand:SF 1 "register_operand" "f")
  2573.          (match_operand:SF 2 "register_operand" "f")))]
  2574.   ""
  2575.   "fmpy,sgl %1,%2,%0"
  2576.   [(set_attr "type" "fpmul")])
  2577.  
  2578. (define_insn "divdf3"
  2579.   [(set (match_operand:DF 0 "register_operand" "=f")
  2580.     (div:DF (match_operand:DF 1 "register_operand" "f")
  2581.         (match_operand:DF 2 "register_operand" "f")))]
  2582.   ""
  2583.   "fdiv,dbl %1,%2,%0"
  2584.   [(set_attr "type" "fpdivdbl")])
  2585.  
  2586. (define_insn "divsf3"
  2587.   [(set (match_operand:SF 0 "register_operand" "=f")
  2588.     (div:SF (match_operand:SF 1 "register_operand" "f")
  2589.         (match_operand:SF 2 "register_operand" "f")))]
  2590.   ""
  2591.   "fdiv,sgl %1,%2,%0"
  2592.   [(set_attr "type" "fpdivsgl")])
  2593.  
  2594. (define_insn "negdf2"
  2595.   [(set (match_operand:DF 0 "register_operand" "=f")
  2596.     (neg:DF (match_operand:DF 1 "register_operand" "f")))]
  2597.   ""
  2598.   "fsub,dbl 0,%1,%0"
  2599.   [(set_attr "type" "fpalu")])
  2600.  
  2601. (define_insn "negsf2"
  2602.   [(set (match_operand:SF 0 "register_operand" "=f")
  2603.     (neg:SF (match_operand:SF 1 "register_operand" "f")))]
  2604.   ""
  2605.   "fsub,sgl 0,%1,%0"
  2606.   [(set_attr "type" "fpalu")])
  2607.  
  2608. (define_insn "absdf2"
  2609.   [(set (match_operand:DF 0 "register_operand" "=f")
  2610.     (abs:DF (match_operand:DF 1 "register_operand" "f")))]
  2611.   ""
  2612.   "fabs,dbl %1,%0"
  2613.   [(set_attr "type" "fpalu")])
  2614.  
  2615. (define_insn "abssf2"
  2616.   [(set (match_operand:SF 0 "register_operand" "=f")
  2617.     (abs:SF (match_operand:SF 1 "register_operand" "f")))]
  2618.   ""
  2619.   "fabs,sgl %1,%0"
  2620.   [(set_attr "type" "fpalu")])
  2621.  
  2622. (define_insn "sqrtdf2"
  2623.   [(set (match_operand:DF 0 "register_operand" "=f")
  2624.     (sqrt:DF (match_operand:DF 1 "register_operand" "f")))]
  2625.   ""
  2626.   "fsqrt,dbl %1,%0"
  2627.   [(set_attr "type" "fpsqrtdbl")])
  2628.  
  2629. (define_insn "sqrtsf2"
  2630.   [(set (match_operand:SF 0 "register_operand" "=f")
  2631.     (sqrt:SF (match_operand:SF 1 "register_operand" "f")))]
  2632.   ""
  2633.   "fsqrt,sgl %1,%0"
  2634.   [(set_attr "type" "fpsqrtsgl")])
  2635.  
  2636. ;;- Shift instructions
  2637.  
  2638. ;; Optimized special case of shifting.
  2639.  
  2640. (define_insn ""
  2641.   [(set (match_operand:SI 0 "register_operand" "=r")
  2642.     (lshiftrt:SI (match_operand:SI 1 "memory_operand" "m")
  2643.              (const_int 24)))]
  2644.   ""
  2645.   "ldb%M1 %1,%0"
  2646.   [(set_attr "type" "load")
  2647.    (set_attr "length" "4")])
  2648.  
  2649. (define_insn ""
  2650.   [(set (match_operand:SI 0 "register_operand" "=r")
  2651.     (lshiftrt:SI (match_operand:SI 1 "memory_operand" "m")
  2652.              (const_int 16)))]
  2653.   ""
  2654.   "ldh%M1 %1,%0"
  2655.   [(set_attr "type" "load")
  2656.    (set_attr "length" "4")])
  2657.  
  2658. (define_insn ""
  2659.   [(set (match_operand:SI 0 "register_operand" "=r")
  2660.     (plus:SI (mult:SI (match_operand:SI 2 "register_operand" "r")
  2661.               (match_operand:SI 3 "shadd_operand" ""))
  2662.          (match_operand:SI 1 "register_operand" "r")))]
  2663.   ""
  2664.   "sh%O3addl %2,%1,%0")
  2665.  
  2666. ;; This variant of the above insn can occur if the first operand
  2667. ;; is the frame pointer.  This is a kludge, but there doesn't
  2668. ;; seem to be a way around it.  Only recognize it while reloading.
  2669. ;; Note how operand 3 uses a predicate of "const_int_operand", but 
  2670. ;; has constraints allowing a register.  I don't know how this works,
  2671. ;; but it somehow makes sure that out-of-range constants are placed
  2672. ;; in a register which somehow magically is a "const_int_operand".
  2673. ;; (this was stolen from alpha.md, I'm not going to try and change it.
  2674.  
  2675. (define_insn ""
  2676.   [(set (match_operand:SI 0 "register_operand" "=&r,r")
  2677.     (plus:SI (plus:SI (mult:SI (match_operand:SI 2 "register_operand" "r,r")
  2678.                    (match_operand:SI 4 "shadd_operand" ""))
  2679.               (match_operand:SI 1 "register_operand" "r,r"))
  2680.          (match_operand:SI 3 "const_int_operand" "r,J")))]
  2681.   "reload_in_progress"
  2682.   "@
  2683.    sh%O4addl %2,%1,%0\;addl %3,%0,%0
  2684.    sh%O4addl %2,%1,%0\;ldo %3(%0),%0"
  2685.   [(set_attr "type" "multi")
  2686.    (set_attr "length" "8")])
  2687.  
  2688. (define_expand "ashlsi3"
  2689.   [(set (match_operand:SI 0 "register_operand" "")
  2690.     (ashift:SI (match_operand:SI 1 "lhs_lshift_operand" "")
  2691.            (match_operand:SI 2 "arith32_operand" "")))]
  2692.   ""
  2693.   "
  2694. {
  2695.   if (GET_CODE (operands[2]) != CONST_INT)
  2696.     {
  2697.       rtx temp = gen_reg_rtx (SImode);
  2698.       emit_insn (gen_subsi3 (temp, GEN_INT (31), operands[2]));
  2699.     if (GET_CODE (operands[1]) == CONST_INT)
  2700.       emit_insn (gen_zvdep_imm (operands[0], operands[1], temp));
  2701.     else
  2702.       emit_insn (gen_zvdep32 (operands[0], operands[1], temp));
  2703.       DONE;
  2704.     }
  2705.   /* Make sure both inputs are not constants,
  2706.      the recognizer can't handle that.  */
  2707.   operands[1] = force_reg (SImode, operands[1]);
  2708. }")
  2709.  
  2710. (define_insn ""
  2711.   [(set (match_operand:SI 0 "register_operand" "=r")
  2712.     (ashift:SI (match_operand:SI 1 "register_operand" "r")
  2713.            (match_operand:SI 2 "const_int_operand" "n")))]
  2714.   ""
  2715.   "zdep %1,%P2,%L2,%0"
  2716.   [(set_attr "type" "binary")
  2717.    (set_attr "length" "4")])
  2718.  
  2719. ; Match cases of op1 a CONST_INT here that zvdep_imm doesn't handle.
  2720. ; Doing it like this makes slightly better code since reload can
  2721. ; replace a register with a known value in range -16..15 with a
  2722. ; constant.  Ideally, we would like to merge zvdep32 and zvdep_imm,
  2723. ; but since we have no more CONST_OK... characters, that is not
  2724. ; possible.
  2725. (define_insn "zvdep32"
  2726.   [(set (match_operand:SI 0 "register_operand" "=r,r")
  2727.     (ashift:SI (match_operand:SI 1 "arith5_operand" "r,L")
  2728.            (minus:SI (const_int 31)
  2729.                  (match_operand:SI 2 "register_operand" "q,q"))))]
  2730.   ""
  2731.   "@
  2732.    zvdep %1,32,%0
  2733.    zvdepi %1,32,%0")
  2734.  
  2735. (define_insn "zvdep_imm"
  2736.   [(set (match_operand:SI 0 "register_operand" "=r")
  2737.     (ashift:SI (match_operand:SI 1 "lhs_lshift_cint_operand" "")
  2738.            (minus:SI (const_int 31)
  2739.                  (match_operand:SI 2 "register_operand" "q"))))]
  2740.   ""
  2741.   "*
  2742. {
  2743.   int x = INTVAL (operands[1]);
  2744.   operands[2] = GEN_INT (4 + exact_log2 ((x >> 4) + 1));
  2745.   operands[1] = GEN_INT ((x & 0xf) - 0x10);
  2746.   return \"zvdepi %1,%2,%0\";
  2747. }")
  2748.  
  2749. (define_insn "vdepi_ior"
  2750.   [(set (match_operand:SI 0 "register_operand" "=r")
  2751.     (ior:SI (ashift:SI (match_operand:SI 1 "const_int_operand" "")
  2752.                (minus:SI (const_int 31)
  2753.                      (match_operand:SI 2 "register_operand" "q")))
  2754.         (match_operand:SI 3 "register_operand" "0")))]
  2755.   ; accept ...0001...1, can this be generalized?
  2756.   "exact_log2 (INTVAL (operands[1]) + 1) >= 0"
  2757.   "*
  2758. {
  2759.   int x = INTVAL (operands[1]);
  2760.   operands[2] = GEN_INT (exact_log2 (x + 1));
  2761.   return \"vdepi -1,%2,%0\";
  2762. }")
  2763.  
  2764. (define_insn "vdepi_and"
  2765.   [(set (match_operand:SI 0 "register_operand" "=r")
  2766.     (and:SI (rotate:SI (match_operand:SI 1 "const_int_operand" "")
  2767.                (minus:SI (const_int 31)
  2768.                      (match_operand:SI 2 "register_operand" "q")))
  2769.         (match_operand:SI 3 "register_operand" "0")))]
  2770.   ; this can be generalized...!
  2771.   "INTVAL (operands[1]) == -2"
  2772.   "*
  2773. {
  2774.   int x = INTVAL (operands[1]);
  2775.   operands[2] = GEN_INT (exact_log2 ((~x) + 1));
  2776.   return \"vdepi 0,%2,%0\";
  2777. }")
  2778.  
  2779. (define_expand "ashrsi3"
  2780.   [(set (match_operand:SI 0 "register_operand" "")
  2781.     (ashiftrt:SI (match_operand:SI 1 "register_operand" "")
  2782.              (match_operand:SI 2 "arith32_operand" "")))]
  2783.   ""
  2784.   "
  2785. {
  2786.   if (GET_CODE (operands[2]) != CONST_INT)
  2787.     {
  2788.       rtx temp = gen_reg_rtx (SImode);
  2789.       emit_insn (gen_subsi3 (temp, GEN_INT (31), operands[2]));
  2790.       emit_insn (gen_vextrs32 (operands[0], operands[1], temp));
  2791.       DONE;
  2792.     }
  2793. }")
  2794.  
  2795. (define_insn ""
  2796.   [(set (match_operand:SI 0 "register_operand" "=r")
  2797.     (ashiftrt:SI (match_operand:SI 1 "register_operand" "r")
  2798.              (match_operand:SI 2 "const_int_operand" "n")))]
  2799.   ""
  2800.   "extrs %1,%P2,%L2,%0"
  2801.   [(set_attr "type" "binary")
  2802.    (set_attr "length" "4")])
  2803.  
  2804. (define_insn "vextrs32"
  2805.   [(set (match_operand:SI 0 "register_operand" "=r")
  2806.     (ashiftrt:SI (match_operand:SI 1 "register_operand" "r")
  2807.              (minus:SI (const_int 31)
  2808.                    (match_operand:SI 2 "register_operand" "q"))))]
  2809.   ""
  2810.   "vextrs %1,32,%0")
  2811.  
  2812. (define_insn "lshrsi3"
  2813.   [(set (match_operand:SI 0 "register_operand" "=r,r")
  2814.     (lshiftrt:SI (match_operand:SI 1 "register_operand" "r,r")
  2815.              (match_operand:SI 2 "arith32_operand" "q,n")))]
  2816.   ""
  2817.   "@
  2818.    vshd 0,%1,%0
  2819.    extru %1,%P2,%L2,%0"
  2820.   [(set_attr "type" "binary")
  2821.    (set_attr "length" "4")])
  2822.  
  2823. (define_insn "rotrsi3"
  2824.   [(set (match_operand:SI 0 "register_operand" "=r,r")
  2825.     (rotatert:SI (match_operand:SI 1 "register_operand" "r,r")
  2826.              (match_operand:SI 2 "arith32_operand" "q,n")))]
  2827.   ""
  2828.   "*
  2829. {
  2830.   if (GET_CODE (operands[2]) == CONST_INT)
  2831.     {
  2832.       operands[2] = GEN_INT (INTVAL (operands[2]) & 31);
  2833.       return \"shd %1,%1,%2,%0\";
  2834.     }
  2835.   else
  2836.     return \"vshd %1,%1,%0\";
  2837. }"
  2838.   [(set_attr "type" "binary")
  2839.    (set_attr "length" "4")])
  2840.  
  2841. (define_insn "rotlsi3"
  2842.   [(set (match_operand:SI 0 "register_operand" "=r")
  2843.     (rotate:SI (match_operand:SI 1 "register_operand" "r")
  2844.            (match_operand:SI 2 "const_int_operand" "n")))]
  2845.   ""
  2846.   "*
  2847. {
  2848.   operands[2] = GEN_INT ((32 - INTVAL (operands[2])) & 31);
  2849.   return \"shd %1,%1,%2,%0\";
  2850. }"
  2851.   [(set_attr "type" "binary")
  2852.    (set_attr "length" "4")])
  2853.  
  2854. (define_insn ""
  2855.   [(set (match_operand:SI 0 "register_operand" "=r")
  2856.     (match_operator:SI 5 "plus_xor_ior_operator"
  2857.       [(ashift:SI (match_operand:SI 1 "register_operand" "r")
  2858.               (match_operand:SI 3 "const_int_operand" "n"))
  2859.        (lshiftrt:SI (match_operand:SI 2 "register_operand" "r")
  2860.             (match_operand:SI 4 "const_int_operand" "n"))]))]
  2861.   "INTVAL (operands[3]) + INTVAL (operands[4]) == 32"
  2862.   "shd %1,%2,%4,%0"
  2863.   [(set_attr "type" "binary")
  2864.    (set_attr "length" "4")])
  2865.  
  2866. (define_insn ""
  2867.   [(set (match_operand:SI 0 "register_operand" "=r")
  2868.     (match_operator:SI 5 "plus_xor_ior_operator"
  2869.       [(lshiftrt:SI (match_operand:SI 2 "register_operand" "r")
  2870.             (match_operand:SI 4 "const_int_operand" "n"))
  2871.        (ashift:SI (match_operand:SI 1 "register_operand" "r")
  2872.               (match_operand:SI 3 "const_int_operand" "n"))]))]
  2873.   "INTVAL (operands[3]) + INTVAL (operands[4]) == 32"
  2874.   "shd %1,%2,%4,%0"
  2875.   [(set_attr "type" "binary")
  2876.    (set_attr "length" "4")])
  2877.  
  2878. (define_insn ""
  2879.   [(set (match_operand:SI 0 "register_operand" "=r")
  2880.     (and:SI (ashift:SI (match_operand:SI 1 "register_operand" "r")
  2881.                (match_operand:SI 2 "const_int_operand" ""))
  2882.         (match_operand:SI 3 "const_int_operand" "")))]
  2883.   "exact_log2 (1 + (INTVAL (operands[3]) >> (INTVAL (operands[2]) & 31))) >= 0"
  2884.   "*
  2885. {
  2886.   int cnt = INTVAL (operands[2]) & 31;
  2887.   operands[3] = GEN_INT (exact_log2 (1 + (INTVAL (operands[3]) >> cnt)));
  2888.   operands[2] = GEN_INT (31 - cnt);
  2889.   return \"zdep %1,%2,%3,%0\";
  2890. }"
  2891.   [(set_attr "type" "binary")
  2892.    (set_attr "length" "4")])
  2893.  
  2894. ;; Unconditional and other jump instructions.
  2895.  
  2896. (define_insn "return"
  2897.   [(return)]
  2898.   "hppa_can_use_return_insn_p ()"
  2899.   "bv%* 0(%%r2)"
  2900.   [(set_attr "type" "branch")])
  2901.  
  2902. ;; Use a different pattern for functions which have non-trivial
  2903. ;; epilogues so as not to confuse jump and reorg.
  2904. (define_insn "return_internal"
  2905.   [(use (reg:SI 2))
  2906.    (return)]
  2907.   ""
  2908.   "bv%* 0(%%r2)"
  2909.   [(set_attr "type" "branch")])
  2910.  
  2911. (define_expand "prologue"
  2912.   [(const_int 0)]
  2913.   ""
  2914.   "hppa_expand_prologue ();DONE;")
  2915.  
  2916. (define_expand "epilogue"
  2917.   [(return)]
  2918.   ""
  2919.   "
  2920. {
  2921.   /* Try to use the trivial return first.  Else use the full
  2922.      epilogue.  */
  2923.   if (hppa_can_use_return_insn_p ())
  2924.    emit_jump_insn (gen_return ());
  2925.   else
  2926.     {
  2927.       hppa_expand_epilogue ();
  2928.       emit_jump_insn (gen_return_internal ());
  2929.     }
  2930.   DONE;
  2931. }")
  2932.  
  2933. ;; Special because we use the value placed in %r2 by the bl instruction
  2934. ;; from within its delay slot to set the value for the 2nd parameter to
  2935. ;; the call.
  2936. (define_insn "call_profiler"
  2937.   [(unspec_volatile [(const_int 0)] 0)
  2938.    (use (match_operand:SI 0 "const_int_operand" ""))]
  2939.   ""
  2940.   "bl _mcount,%%r2\;ldo %0(%%r2),%%r25"
  2941.   [(set_attr "length" "8")])
  2942.  
  2943. (define_insn "blockage"
  2944.   [(unspec_volatile [(const_int 2)] 0)]
  2945.   ""
  2946.   ""
  2947.   [(set_attr "length" "0")])
  2948.  
  2949. (define_insn "jump"
  2950.   [(set (pc) (label_ref (match_operand 0 "" "")))]
  2951.   ""
  2952.   "bl%* %l0,0"
  2953.   [(set_attr "type" "uncond_branch")
  2954.    (set (attr "length")
  2955.     (cond [(eq (symbol_ref "jump_in_call_delay (insn)") (const_int 0))
  2956.        (const_int 4)
  2957. ;; If the jump is in the delay slot of a call, then its length depends
  2958. ;; on whether or not we can add the proper offset to %r2 with an ldo
  2959. ;; instruction.
  2960.        (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
  2961.             (const_int 8188))
  2962.            (const_int 4)]
  2963.       (const_int 8)))])
  2964.  
  2965. ;; Subroutines of "casesi".
  2966. ;; operand 0 is index
  2967. ;; operand 1 is the minimum bound
  2968. ;; operand 2 is the maximum bound - minimum bound + 1
  2969. ;; operand 3 is CODE_LABEL for the table;
  2970. ;; operand 4 is the CODE_LABEL to go to if index out of range.
  2971.  
  2972. (define_expand "casesi"
  2973.   [(match_operand:SI 0 "general_operand" "")
  2974.    (match_operand:SI 1 "const_int_operand" "")
  2975.    (match_operand:SI 2 "const_int_operand" "")
  2976.    (match_operand 3 "" "")
  2977.    (match_operand 4 "" "")]
  2978.   ""
  2979.   "
  2980. {
  2981.   if (GET_CODE (operands[0]) != REG)
  2982.     operands[0] = force_reg (SImode, operands[0]);
  2983.  
  2984.   if (operands[1] != const0_rtx)
  2985.     {
  2986.       rtx reg = gen_reg_rtx (SImode);
  2987.  
  2988.       operands[1] = GEN_INT (-INTVAL (operands[1]));
  2989.       if (!INT_14_BITS (operands[1]))
  2990.     operands[1] = force_reg (SImode, operands[1]);
  2991.       emit_insn (gen_addsi3 (reg, operands[0], operands[1]));
  2992.  
  2993.       operands[0] = reg;
  2994.     }
  2995.  
  2996.   if (!INT_11_BITS (operands[2]))
  2997.     operands[2] = force_reg (SImode, operands[2]);
  2998.  
  2999.   emit_jump_insn (gen_casesi0 (operands[0], operands[2],
  3000.                    operands[3], operands[4]));
  3001.   DONE;
  3002. }")
  3003.  
  3004. (define_insn "casesi0"
  3005.   [(set (pc)
  3006.     (if_then_else (leu (match_operand:SI 0 "register_operand" "r")
  3007.                (match_operand:SI 1 "arith11_operand" "rI"))
  3008.               (plus:SI (mem:SI (plus:SI (pc) (match_dup 0)))
  3009.                    (label_ref (match_operand 2 "" "")))
  3010.               (pc)))
  3011.    (use (label_ref (match_operand 3 "" "")))]
  3012.   ""
  3013.   "*
  3014. {
  3015.   if (GET_CODE (operands[1]) == CONST_INT)
  3016.     {
  3017.       operands[1] = GEN_INT (~INTVAL (operands[1]));
  3018.       return \"addi,uv %1,%0,0\;blr,n %0,0\;b,n %l3\";
  3019.     }
  3020.   else
  3021.     {
  3022.       return \"sub,>> %0,%1,0\;blr,n %0,0\;b,n %l3\";
  3023.     }
  3024. }"
  3025.   [(set_attr "length" "12")])
  3026.  
  3027. ;; Need nops for the calls because execution is supposed to continue
  3028. ;; past; we don't want to nullify an instruction that we need.
  3029. ;;- jump to subroutine
  3030.  
  3031. (define_expand "call"
  3032.   [(parallel [(call (match_operand:SI 0 "" "")
  3033.             (match_operand 1 "" ""))
  3034.           (clobber (reg:SI 2))])]
  3035.   ""
  3036.   "
  3037. {
  3038.   rtx op;
  3039.  
  3040.   if (flag_pic)
  3041.     emit_insn (gen_rtx (USE, VOIDmode,
  3042.             gen_rtx (REG, Pmode, PIC_OFFSET_TABLE_REGNUM)));
  3043.  
  3044.   if (TARGET_LONG_CALLS)
  3045.     op = force_reg (SImode, XEXP (operands[0], 0));
  3046.   else
  3047.     op = XEXP (operands[0], 0);
  3048.  
  3049.   /* Use two different patterns for calls to explicitly named functions
  3050.      and calls through function pointers.  This is necessary as these two
  3051.      types of calls use different calling conventions, and CSE might try
  3052.      to change the named call into an indirect call in some cases (using
  3053.      two patterns keeps CSE from performing this optimization).  */
  3054.   if (GET_CODE (op) == SYMBOL_REF)
  3055.     emit_call_insn (gen_call_internal_symref (op, operands[1]));
  3056.   else
  3057.     emit_call_insn (gen_call_internal_reg (force_reg (SImode, op),
  3058.                        operands[1]));
  3059.  
  3060.   if (flag_pic)
  3061.     {
  3062.       if (!hppa_save_pic_table_rtx)
  3063.     hppa_save_pic_table_rtx = gen_reg_rtx (Pmode);
  3064.       emit_insn (gen_rtx (SET, VOIDmode,
  3065.               gen_rtx (REG, Pmode, PIC_OFFSET_TABLE_REGNUM),
  3066.               hppa_save_pic_table_rtx));
  3067.     }
  3068.   DONE;
  3069. }")
  3070.  
  3071. (define_insn "call_internal_symref"
  3072.   [(call (mem:SI (match_operand:SI 0 "call_operand_address" ""))
  3073.      (match_operand 1 "" "i"))
  3074.    (clobber (reg:SI 2))
  3075.    (use (const_int 0))]
  3076.   "! TARGET_LONG_CALLS"
  3077.   "*
  3078. {
  3079.   output_arg_descriptor (insn);
  3080.   return output_call (insn, operands[0], gen_rtx (REG, SImode, 2));
  3081. }"
  3082.   [(set_attr "type" "call")
  3083.    (set_attr "length" "4")])
  3084.  
  3085. (define_insn "call_internal_reg"
  3086.   [(call (mem:SI (match_operand:SI 0 "register_operand" "r"))
  3087.      (match_operand 1 "" "i"))
  3088.    (clobber (reg:SI 2))
  3089.    (use (const_int 1))]
  3090.   ""
  3091.   "*
  3092. {
  3093.   /* Yuk!  bl may not be able to reach $$dyncall.  */
  3094.   if (TARGET_LONG_CALLS)
  3095.     return \"copy %r0,%%r22\;ldil L%%$$dyncall,%%r31\;ldo R%%$$dyncall(%%r31),%%r31\;blr 0,%%r2\;bv,n 0(%%r31)\;nop\";
  3096.   else
  3097.     return \"copy %r0,%%r22\;.CALL\\tARGW0=GR\;bl $$dyncall,%%r31\;copy %%r31,%%r2\";
  3098. }"
  3099.   [(set_attr "type" "dyncall")
  3100.    (set (attr "length") (if_then_else (ne (symbol_ref "TARGET_LONG_CALLS")
  3101.                       (const_int 0))
  3102.                       (const_int 12)
  3103.                       (const_int 24)))])
  3104.  
  3105. (define_expand "call_value"
  3106.   [(parallel [(set (match_operand 0 "" "")
  3107.            (call (match_operand:SI 1 "" "")
  3108.              (match_operand 2 "" "")))
  3109.           (clobber (reg:SI 2))])]
  3110.   ;;- Don't use operand 1 for most machines.
  3111.   ""
  3112.   "
  3113. {
  3114.   rtx op;
  3115.  
  3116.   if (flag_pic)
  3117.     emit_insn (gen_rtx (USE, VOIDmode,
  3118.             gen_rtx (REG, Pmode, PIC_OFFSET_TABLE_REGNUM)));
  3119.  
  3120.   if (TARGET_LONG_CALLS)
  3121.     op = force_reg (SImode, XEXP (operands[1], 0));
  3122.   else
  3123.     op = XEXP (operands[1], 0);
  3124.  
  3125.   /* Use two different patterns for calls to explicitly named functions
  3126.      and calls through function pointers.  This is necessary as these two
  3127.      types of calls use different calling conventions, and CSE might try
  3128.      to change the named call into an indirect call in some cases (using
  3129.      two patterns keeps CSE from performing this optimization).  */
  3130.   if (GET_CODE (op) == SYMBOL_REF)
  3131.     emit_call_insn (gen_call_value_internal_symref (operands[0], op,
  3132.                             operands[2]));
  3133.   else
  3134.     emit_call_insn (gen_call_value_internal_reg (operands[0],
  3135.                          force_reg (SImode, op),
  3136.                          operands[2]));
  3137.  
  3138.   if (flag_pic)
  3139.     {
  3140.       if (!hppa_save_pic_table_rtx)
  3141.     hppa_save_pic_table_rtx = gen_reg_rtx (Pmode);
  3142.       emit_insn (gen_rtx (SET, VOIDmode,
  3143.               gen_rtx (REG, Pmode, PIC_OFFSET_TABLE_REGNUM),
  3144.               hppa_save_pic_table_rtx));
  3145.     }
  3146.   DONE;
  3147. }")
  3148.  
  3149. (define_insn "call_value_internal_symref"
  3150.   [(set (match_operand 0 "" "=rf")
  3151.     (call (mem:SI (match_operand:SI 1 "call_operand_address" ""))
  3152.           (match_operand 2 "" "i")))
  3153.    (clobber (reg:SI 2))
  3154.    (use (const_int 0))]
  3155.   ;;- Don't use operand 1 for most machines.
  3156.   "! TARGET_LONG_CALLS"
  3157.   "*
  3158. {
  3159.   output_arg_descriptor (insn);
  3160.   return output_call (insn, operands[1], gen_rtx (REG, SImode, 2));
  3161. }"
  3162.   [(set_attr "type" "call")
  3163.    (set_attr "length" "4")])
  3164.  
  3165. (define_insn "call_value_internal_reg"
  3166.   [(set (match_operand 0 "" "=rf")
  3167.     (call (mem:SI (match_operand:SI 1 "register_operand" "r"))
  3168.           (match_operand 2 "" "i")))
  3169.    (clobber (reg:SI 2))
  3170.    (use (const_int 1))]
  3171.   ;;- Don't use operand 1 for most machines.
  3172.   ""
  3173.   "*
  3174. {
  3175.   /* Yuk!  bl may not be able to reach $$dyncall.  */
  3176.   if (TARGET_LONG_CALLS)
  3177.     return \"copy %r1,%%r22\;ldil L%%$$dyncall,%%r31\;ldo R%%$$dyncall(%%r31),%%r31\;blr 0,%%r2\;bv,n 0(%%r31)\;nop\";
  3178.   else
  3179.     return \"copy %r1,%%r22\;.CALL\\tARGW0=GR\;bl $$dyncall,%%r31\;copy %%r31,%%r2\";
  3180. }"
  3181.   [(set_attr "type" "dyncall")
  3182.    (set (attr "length") (if_then_else (ne (symbol_ref "TARGET_LONG_CALLS")
  3183.                       (const_int 0))
  3184.                       (const_int 12)
  3185.                       (const_int 24)))])
  3186.  
  3187. ;; Call subroutine returning any type.
  3188.  
  3189. (define_expand "untyped_call"
  3190.   [(parallel [(call (match_operand 0 "" "")
  3191.             (const_int 0))
  3192.           (match_operand 1 "" "")
  3193.           (match_operand 2 "" "")])]
  3194.   ""
  3195.   "
  3196. {
  3197.   int i;
  3198.  
  3199.   emit_call_insn (gen_call (operands[0], const0_rtx));
  3200.  
  3201.   for (i = 0; i < XVECLEN (operands[2], 0); i++)
  3202.     {
  3203.       rtx set = XVECEXP (operands[2], 0, i);
  3204.       emit_move_insn (SET_DEST (set), SET_SRC (set));
  3205.     }
  3206.  
  3207.   /* The optimizer does not know that the call sets the function value
  3208.      registers we stored in the result block.  We avoid problems by
  3209.      claiming that all hard registers are used and clobbered at this
  3210.      point.  */
  3211.   emit_insn (gen_blockage ());
  3212.  
  3213.   DONE;
  3214. }")
  3215. (define_insn "nop"
  3216.   [(const_int 0)]
  3217.   ""
  3218.   "nop")
  3219.  
  3220. ;;; Hope this is only within a function...
  3221. (define_insn "indirect_jump"
  3222.   [(set (pc) (match_operand:SI 0 "register_operand" "r"))]
  3223.   ""
  3224.   "bv%* 0(%0)"
  3225.   [(set_attr "type" "branch")])
  3226.  
  3227. (define_insn "extzv"
  3228.   [(set (match_operand:SI 0 "register_operand" "=r")
  3229.     (zero_extract:SI (match_operand:SI 1 "register_operand" "r")
  3230.              (match_operand:SI 2 "uint5_operand" "")
  3231.              (match_operand:SI 3 "uint5_operand" "")))]
  3232.   ""
  3233.   "extru %1,%3+%2-1,%2,%0")
  3234.  
  3235. (define_insn ""
  3236.   [(set (match_operand:SI 0 "register_operand" "=r")
  3237.     (zero_extract:SI (match_operand:SI 1 "register_operand" "r")
  3238.              (const_int 1)
  3239.              (match_operand:SI 3 "register_operand" "q")))]
  3240.   ""
  3241.   "vextru %1,1,%0")
  3242.  
  3243. (define_insn "extv"
  3244.   [(set (match_operand:SI 0 "register_operand" "=r")
  3245.     (sign_extract:SI (match_operand:SI 1 "register_operand" "r")
  3246.              (match_operand:SI 2 "uint5_operand" "")
  3247.              (match_operand:SI 3 "uint5_operand" "")))]
  3248.   ""
  3249.   "extrs %1,%3+%2-1,%2,%0")
  3250.  
  3251. (define_insn ""
  3252.   [(set (match_operand:SI 0 "register_operand" "=r")
  3253.     (sign_extract:SI (match_operand:SI 1 "register_operand" "r")
  3254.              (const_int 1)
  3255.              (match_operand:SI 3 "register_operand" "q")))]
  3256.   ""
  3257.   "vextrs %1,1,%0")
  3258.  
  3259. (define_insn "insv"
  3260.   [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+r,r")
  3261.              (match_operand:SI 1 "uint5_operand" "")
  3262.              (match_operand:SI 2 "uint5_operand" ""))
  3263.     (match_operand:SI 3 "arith5_operand" "r,L"))]
  3264.   ""
  3265.   "@
  3266.    dep %3,%2+%1-1,%1,%0
  3267.    depi %3,%2+%1-1,%1,%0")
  3268.  
  3269. ;; Optimize insertion of const_int values of type 1...1xxxx.
  3270. (define_insn ""
  3271.   [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+r")
  3272.              (match_operand:SI 1 "uint5_operand" "")
  3273.              (match_operand:SI 2 "uint5_operand" ""))
  3274.     (match_operand:SI 3 "const_int_operand" ""))]
  3275.   "(INTVAL (operands[3]) & 0x10) != 0 &&
  3276.    (~INTVAL (operands[3]) & (1L << INTVAL (operands[1])) - 1 & ~0xf) == 0"
  3277.   "*
  3278. {
  3279.   operands[3] = GEN_INT ((INTVAL (operands[3]) & 0xf) - 0x10);
  3280.   return \"depi %3,%2+%1-1,%1,%0\";
  3281. }")
  3282.  
  3283. ;; This insn is used for some loop tests, typically loops reversed when
  3284. ;; strength reduction is used.  It is actually created when the instruction
  3285. ;; combination phase combines the special loop test.  Since this insn
  3286. ;; is both a jump insn and has an output, it must deal with it's own
  3287. ;; reloads, hence the `m' constraints.  The `!' constraints direct reload
  3288. ;; to not choose the register alternatives in the event a reload is needed.
  3289. (define_insn "decrement_and_branch_until_zero"
  3290.   [(set (pc)
  3291.     (if_then_else
  3292.       (match_operator 2 "comparison_operator"
  3293.        [(plus:SI (match_operand:SI 0 "register_operand" "+!r,!*f,!*m")
  3294.              (match_operand:SI 1 "int5_operand" "L,L,L"))
  3295.         (const_int 0)])
  3296.       (label_ref (match_operand 3 "" ""))
  3297.       (pc)))
  3298.    (set (match_dup 0)
  3299.     (plus:SI (match_dup 0) (match_dup 1)))
  3300.    (clobber (match_scratch:SI 4 "=X,r,r"))]
  3301.   ""
  3302.   "* return output_dbra (operands, insn, which_alternative); "
  3303. ;; Do not expect to understand this the first time through.
  3304. [(set_attr "type" "cbranch,multi,multi")
  3305.  (set (attr "length")
  3306.       (if_then_else (eq_attr "alternative" "0")
  3307. ;; Loop counter in register case
  3308. ;; Short branch has length of 4
  3309. ;; Long branch has length of 8
  3310.     (if_then_else (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
  3311.               (const_int 8188))
  3312.            (const_int 4)
  3313.        (const_int 8))
  3314.  
  3315. ;; Loop counter in FP reg case.
  3316. ;; Extra goo to deal with additional reload insns.
  3317.     (if_then_else (eq_attr "alternative" "1")
  3318.       (if_then_else (lt (match_dup 3) (pc))
  3319.         (if_then_else
  3320.           (lt (abs (minus (match_dup 3) (plus (pc) (const_int 24))))
  3321.           (const_int 8188))
  3322.           (const_int 24)
  3323.           (const_int 28))
  3324.         (if_then_else
  3325.           (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
  3326.           (const_int 8188))
  3327.           (const_int 24)
  3328.           (const_int 28)))
  3329. ;; Loop counter in memory case.
  3330. ;; Extra goo to deal with additional reload insns.
  3331.     (if_then_else (lt (match_dup 3) (pc))
  3332.       (if_then_else
  3333.         (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
  3334.         (const_int 8188))
  3335.         (const_int 12)
  3336.         (const_int 16))
  3337.       (if_then_else
  3338.         (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
  3339.         (const_int 8188))
  3340.         (const_int 12)
  3341.         (const_int 16))))))])
  3342.  
  3343. ;; Simply another variant of the dbra pattern.  More restrictive
  3344. ;; in testing the comparison operator as it must worry about overflow
  3345. ;; problems.
  3346. (define_insn ""
  3347.   [(set (pc)
  3348.     (if_then_else
  3349.       (match_operator 2 "eq_neq_comparison_operator"
  3350.        [(match_operand:SI 0 "register_operand" "+!r,!*f,!*m")
  3351.         (match_operand:SI 5 "const_int_operand" "")])
  3352.       (label_ref (match_operand 3 "" ""))
  3353.       (pc)))
  3354.    (set (match_dup 0)
  3355.     (plus:SI (match_dup 0) (match_operand:SI 1 "int5_operand" "L,L,L")))
  3356.    (clobber (match_scratch:SI 4 "=X,r,r"))]
  3357.   "INTVAL (operands[5]) == - INTVAL (operands[1])"
  3358. "* return output_dbra (operands, insn, which_alternative);"
  3359. ;; Do not expect to understand this the first time through.
  3360. [(set_attr "type" "cbranch,multi,multi")
  3361.  (set (attr "length")
  3362.       (if_then_else (eq_attr "alternative" "0")
  3363. ;; Loop counter in register case
  3364. ;; Short branch has length of 4
  3365. ;; Long branch has length of 8
  3366.     (if_then_else (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
  3367.               (const_int 8188))
  3368.            (const_int 4)
  3369.        (const_int 8))
  3370.  
  3371. ;; Loop counter in FP reg case.
  3372. ;; Extra goo to deal with additional reload insns.
  3373.     (if_then_else (eq_attr "alternative" "1")
  3374.       (if_then_else (lt (match_dup 3) (pc))
  3375.         (if_then_else
  3376.           (lt (abs (minus (match_dup 3) (plus (pc) (const_int 24))))
  3377.           (const_int 8188))
  3378.           (const_int 24)
  3379.           (const_int 28))
  3380.         (if_then_else
  3381.           (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
  3382.           (const_int 8188))
  3383.           (const_int 24)
  3384.           (const_int 28)))
  3385. ;; Loop counter in memory case.
  3386. ;; Extra goo to deal with additional reload insns.
  3387.     (if_then_else (lt (match_dup 3) (pc))
  3388.       (if_then_else
  3389.         (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
  3390.         (const_int 8188))
  3391.         (const_int 12)
  3392.         (const_int 16))
  3393.       (if_then_else
  3394.         (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
  3395.         (const_int 8188))
  3396.         (const_int 12)
  3397.         (const_int 16))))))])
  3398.  
  3399. (define_insn ""
  3400.   [(set (pc)
  3401.     (if_then_else
  3402.       (match_operator 2 "movb_comparison_operator"
  3403.        [(match_operand:SI 1 "register_operand" "r,r,r") (const_int 0)])
  3404.       (label_ref (match_operand 3 "" ""))
  3405.       (pc)))
  3406.    (set (match_operand:SI 0 "register_operand" "=!r,!*f,!*m")
  3407.     (match_dup 1))]
  3408.   ""
  3409. "* return output_movb (operands, insn, which_alternative, 0); "
  3410. ;; Do not expect to understand this the first time through.
  3411. [(set_attr "type" "cbranch,multi,multi")
  3412.  (set (attr "length")
  3413.       (if_then_else (eq_attr "alternative" "0")
  3414. ;; Loop counter in register case
  3415. ;; Short branch has length of 4
  3416. ;; Long branch has length of 8
  3417.     (if_then_else (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
  3418.               (const_int 8188))
  3419.            (const_int 4)
  3420.        (const_int 8))
  3421.  
  3422. ;; Loop counter in FP reg case.
  3423. ;; Extra goo to deal with additional reload insns.
  3424.     (if_then_else (eq_attr "alternative" "1")
  3425.       (if_then_else (lt (match_dup 3) (pc))
  3426.         (if_then_else
  3427.           (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
  3428.           (const_int 8188))
  3429.           (const_int 12)
  3430.           (const_int 16))
  3431.         (if_then_else
  3432.           (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
  3433.           (const_int 8188))
  3434.           (const_int 12)
  3435.           (const_int 16)))
  3436. ;; Loop counter in memory case.
  3437. ;; Extra goo to deal with additional reload insns.
  3438.     (if_then_else
  3439.       (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
  3440.           (const_int 8188))
  3441.       (const_int 8)
  3442.       (const_int 12)))))])
  3443.  
  3444. ;; Handle negated branch.
  3445. (define_insn ""
  3446.   [(set (pc)
  3447.     (if_then_else
  3448.       (match_operator 2 "movb_comparison_operator"
  3449.        [(match_operand:SI 1 "register_operand" "r,r,r") (const_int 0)])
  3450.       (pc)
  3451.       (label_ref (match_operand 3 "" ""))))
  3452.    (set (match_operand:SI 0 "register_operand" "=!r,!*f,!*m")
  3453.     (match_dup 1))]
  3454.   ""
  3455. "* return output_movb (operands, insn, which_alternative, 1); "
  3456. ;; Do not expect to understand this the first time through.
  3457. [(set_attr "type" "cbranch,multi,multi")
  3458.  (set (attr "length")
  3459.       (if_then_else (eq_attr "alternative" "0")
  3460. ;; Loop counter in register case
  3461. ;; Short branch has length of 4
  3462. ;; Long branch has length of 8
  3463.     (if_then_else (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
  3464.               (const_int 8188))
  3465.            (const_int 4)
  3466.        (const_int 8))
  3467.  
  3468. ;; Loop counter in FP reg case.
  3469. ;; Extra goo to deal with additional reload insns.
  3470.     (if_then_else (eq_attr "alternative" "1")
  3471.       (if_then_else (lt (match_dup 3) (pc))
  3472.         (if_then_else
  3473.           (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
  3474.           (const_int 8188))
  3475.           (const_int 12)
  3476.           (const_int 16))
  3477.         (if_then_else
  3478.           (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
  3479.           (const_int 8188))
  3480.           (const_int 12)
  3481.           (const_int 16)))
  3482. ;; Loop counter in memory case.
  3483. ;; Extra goo to deal with additional reload insns.
  3484.     (if_then_else
  3485.       (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
  3486.           (const_int 8188))
  3487.       (const_int 8)
  3488.       (const_int 12)))))])
  3489.  
  3490. ;; The next four peepholes take advantage of the new 5 operand
  3491. ;; fmpy{add,sub} instructions available on 1.1 CPUS.  Basically
  3492. ;; fmpyadd performs a multiply and add/sub of independent operands
  3493. ;; at the same time.  Because the operands must be independent
  3494. ;; combine will not try to combine such insns...  Thus we have
  3495. ;; to use a peephole.
  3496. (define_peephole
  3497.   [(set (match_operand 0 "register_operand" "=f")
  3498.     (mult (match_operand 1 "register_operand" "f")
  3499.           (match_operand 2 "register_operand" "f")))
  3500.    (set (match_operand 3 "register_operand" "+f")
  3501.     (plus (match_operand 4 "register_operand" "f")
  3502.           (match_operand 5 "register_operand" "f")))]
  3503.   "TARGET_SNAKE && fmpyaddoperands (operands)"
  3504.   "*
  3505. {
  3506.   if (GET_MODE (operands[0]) == DFmode)
  3507.     {
  3508.       if (rtx_equal_p (operands[5], operands[3]))
  3509.     return \"fmpyadd,dbl %1,%2,%0,%4,%3\";
  3510.       else
  3511.     return \"fmpyadd,dbl %1,%2,%0,%5,%3\";
  3512.     }
  3513.   else
  3514.     {
  3515.       if (rtx_equal_p (operands[5], operands[3]))
  3516.     return \"fmpyadd,sgl %1,%2,%0,%4,%3\";
  3517.       else
  3518.     return \"fmpyadd,sgl %1,%2,%0,%5,%3\";
  3519.     }
  3520. }")
  3521.  
  3522. (define_peephole
  3523.   [(set (match_operand 3 "register_operand" "+f")
  3524.     (plus (match_operand 4 "register_operand" "f")
  3525.           (match_operand 5 "register_operand" "f")))
  3526.    (set (match_operand 0 "register_operand" "=f")
  3527.     (mult (match_operand 1 "register_operand" "f")
  3528.           (match_operand 2 "register_operand" "f")))]
  3529.   "TARGET_SNAKE && fmpyaddoperands (operands)"
  3530.   "*
  3531. {
  3532.   if (GET_MODE (operands[0]) == DFmode)
  3533.     {
  3534.       if (rtx_equal_p (operands[3], operands[5]))
  3535.     return \"fmpyadd,dbl %1,%2,%0,%4,%3\";
  3536.       else
  3537.     return \"fmpyadd,dbl %1,%2,%0,%5,%3\";
  3538.     }
  3539.   else
  3540.     {
  3541.       if (rtx_equal_p (operands[3], operands[5]))
  3542.     return \"fmpyadd,sgl %1,%2,%0,%4,%3\";
  3543.       else
  3544.     return \"fmpyadd,sgl %1,%2,%0,%5,%3\";
  3545.     }
  3546. }")
  3547.  
  3548. ;; Note fsub subtracts the second operand from the first while fmpysub
  3549. ;; does the opposite for the subtraction operands!
  3550. (define_peephole
  3551.   [(set (match_operand 0 "register_operand" "=f")
  3552.     (mult (match_operand 1 "register_operand" "f")
  3553.           (match_operand 2 "register_operand" "f")))
  3554.    (set (match_operand 3 "register_operand" "+f")
  3555.     (minus (match_operand 4 "register_operand" "f")
  3556.            (match_operand 5 "register_operand" "f")))]
  3557.   "TARGET_SNAKE && fmpysuboperands (operands)"
  3558.   "*
  3559. {
  3560.   if (GET_MODE (operands[0]) == DFmode)
  3561.     return \"fmpysub,dbl %1,%2,%0,%5,%3\";
  3562.   else
  3563.     return \"fmpysub,sgl %1,%2,%0,%5,%3\";
  3564. }")
  3565.  
  3566. (define_peephole
  3567.   [(set (match_operand 3 "register_operand" "+f")
  3568.     (minus (match_operand 4 "register_operand" "f")
  3569.            (match_operand 5 "register_operand" "f")))
  3570.    (set (match_operand 0 "register_operand" "=f")
  3571.     (mult (match_operand 1 "register_operand" "f")
  3572.           (match_operand 2 "register_operand" "f")))]
  3573.   "TARGET_SNAKE && fmpysuboperands (operands)"
  3574.   "*
  3575. {
  3576.   if (GET_MODE (operands[0]) == DFmode)
  3577.     return \"fmpysub,dbl %1,%2,%0,%5,%3\";
  3578.   else
  3579.     return \"fmpysub,sgl %1,%2,%0,%5,%3\";
  3580. }")
  3581.  
  3582. ;; Flush the I and D cache line found at the address in operand 0.
  3583. ;; This is used by the trampoline code for nested functions.
  3584. ;; So long as the trampoline itself is less than 32 bytes this
  3585. ;; is sufficient.
  3586.  
  3587. (define_insn "dcacheflush"
  3588.   [(unspec_volatile [(const_int 1)] 0)
  3589.    (use (mem:SI (match_operand:SI 0 "register_operand" "r")))
  3590.    (use (mem:SI (match_operand:SI 1 "register_operand" "r")))]
  3591.   ""
  3592.   "fdc 0(0,%0)\;fdc 0(0,%1)\;sync"
  3593.   [(set_attr "length" "12")])
  3594.  
  3595. (define_insn "icacheflush"
  3596.   [(unspec_volatile [(const_int 2)] 0)
  3597.    (use (mem:SI (match_operand:SI 0 "register_operand" "r")))
  3598.    (use (mem:SI (match_operand:SI 1 "register_operand" "r")))
  3599.    (use (match_operand:SI 2 "register_operand" "r"))
  3600.    (clobber (match_operand:SI 3 "register_operand" "=&r"))
  3601.    (clobber (match_operand:SI 4 "register_operand" "=&r"))]
  3602.   ""
  3603.   "mfsp %%sr0,%4\;ldsid (0,%2),%3\;mtsp %3,%%sr0\;fic 0(%%sr0,%0)\;fic 0(%%sr0,%1)\;sync\;mtsp %4,%%sr0\;nop\;nop\;nop\;nop\;nop\;nop"
  3604.   [(set_attr "length" "52")])
  3605.