xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/config/m32c/minmax.md (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
136ac495dSmrg;; Machine Descriptions for R8C/M16C/M32C
2*8feb0f0bSmrg;; Copyright (C) 2005-2020 Free Software Foundation, Inc.
336ac495dSmrg;; Contributed by Red Hat.
436ac495dSmrg;;
536ac495dSmrg;; This file is part of GCC.
636ac495dSmrg;;
736ac495dSmrg;; GCC is free software; you can redistribute it and/or modify it
836ac495dSmrg;; under the terms of the GNU General Public License as published
936ac495dSmrg;; by the Free Software Foundation; either version 3, or (at your
1036ac495dSmrg;; option) any later version.
1136ac495dSmrg;;
1236ac495dSmrg;; GCC is distributed in the hope that it will be useful, but WITHOUT
1336ac495dSmrg;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
1436ac495dSmrg;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
1536ac495dSmrg;; License for more details.
1636ac495dSmrg;;
1736ac495dSmrg;; You should have received a copy of the GNU General Public License
1836ac495dSmrg;; along with GCC; see the file COPYING3.  If not see
1936ac495dSmrg;; <http://www.gnu.org/licenses/>.
2036ac495dSmrg
2136ac495dSmrg;; min, max
2236ac495dSmrg
2336ac495dSmrg(define_insn "sminqi3"
2436ac495dSmrg  [(set (match_operand:QI 0 "mra_operand" "=RhlSd,RhlSd,??Rmm,??Rmm,Raa,Raa")
2536ac495dSmrg	(smin:QI (match_operand:QI 1 "mra_operand" "%0,0,0,0,0,0")
2636ac495dSmrg		 (match_operand:QI 2 "mrai_operand" "iRhlSdRaa,?Rmm,iRhlSdRaa,?Rmm,iRhlSd,?Rmm")))]
2736ac495dSmrg  "TARGET_A24"
2836ac495dSmrg  "min.b\t%2,%0"
2936ac495dSmrg  [(set_attr "flags" "n")]
3036ac495dSmrg  )
3136ac495dSmrg
3236ac495dSmrg(define_insn "sminhi3"
3336ac495dSmrg  [(set (match_operand:HI 0 "mra_operand" "=RhiSd,RhiSd,??Rmm,??Rmm")
3436ac495dSmrg	(smin:HI (match_operand:HI 1 "mra_operand" "%0,0,0,0")
3536ac495dSmrg		 (match_operand:HI 2 "mrai_operand" "iRhiSd,?Rmm,iRhiSd,?Rmm")))]
3636ac495dSmrg  "TARGET_A24"
3736ac495dSmrg  "min.w\t%2,%0"
3836ac495dSmrg  [(set_attr "flags" "n")]
3936ac495dSmrg  )
4036ac495dSmrg
4136ac495dSmrg(define_insn "smaxqi3"
4236ac495dSmrg  [(set (match_operand:QI 0 "mra_operand" "=RhlSd,RhlSd,??Rmm,??Rmm,Raa,Raa")
4336ac495dSmrg	(smax:QI (match_operand:QI 1 "mra_operand" "%0,0,0,0,0,0")
4436ac495dSmrg		 (match_operand:QI 2 "mrai_operand" "iRhlSdRaa,?Rmm,iRhlSdRaa,?Rmm,iRhlSd,?Rmm")))]
4536ac495dSmrg  "TARGET_A24"
4636ac495dSmrg  "max.b\t%2,%0"
4736ac495dSmrg  [(set_attr "flags" "n")]
4836ac495dSmrg  )
4936ac495dSmrg
5036ac495dSmrg(define_insn "smaxhi3"
5136ac495dSmrg  [(set (match_operand:HI 0 "mra_operand" "=RhiSd,RhiSd,??Rmm,??Rmm")
5236ac495dSmrg	(smax:HI (match_operand:HI 1 "mra_operand" "%0,0,0,0")
5336ac495dSmrg		 (match_operand:HI 2 "mrai_operand" "iRhiSd,?Rmm,iRhiSd,?Rmm")))]
5436ac495dSmrg  "TARGET_A24"
5536ac495dSmrg  "max.w\t%2,%0"
5636ac495dSmrg  [(set_attr "flags" "n")]
5736ac495dSmrg  )
58