]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/s390/subst.md
S/390: Get rid of Y constraint in left and logical right
[thirdparty/gcc.git] / gcc / config / s390 / subst.md
CommitLineData
191eb16d
AK
1;;- Machine description for GNU compiler -- S/390 / zSeries version.
2;; Subst patterns.
3;; Copyright (C) 2016 Free Software Foundation, Inc.
4;; Contributed by Andreas Krebbel (Andreas.Krebbel@de.ibm.com)
5
6;; This file is part of GCC.
7
8;; GCC is free software; you can redistribute it and/or modify it under
9;; the terms of the GNU General Public License as published by the Free
10;; Software Foundation; either version 3, or (at your option) any later
11;; version.
12
13;; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14;; WARRANTY; without even the implied warranty of MERCHANTABILITY or
15;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16;; for more details.
17
18;; You should have received a copy of the GNU General Public License
19;; along with GCC; see the file COPYING3. If not see
20;; <http://www.gnu.org/licenses/>.
21
adf22b3f 22(define_code_iterator SUBST [rotate ashift lshiftrt])
191eb16d
AK
23
24; This expands an register/immediate operand to a register+immediate
25; operand to draw advantage of the address style operand format
26; providing a addition for free.
27(define_subst "addr_style_op_subst"
28 [(set (match_operand:DSI 0 "" "")
29 (SUBST:DSI (match_operand:DSI 1 "" "")
30 (match_operand:SI 2 "" "")))]
31 ""
32 [(set (match_dup 0)
33 (SUBST:DSI (match_dup 1)
34 (plus:SI (match_operand:SI 2 "register_operand" "a")
35 (match_operand 3 "const_int_operand" "n"))))])
36
37; Use this in the insn name.
38(define_subst_attr "addr_style_op" "addr_style_op_subst" "" "_plus")
39
40; In the subst pattern the additional const int operand will be used
41; as displacement. In the normal version %Y is able to print the
42; operand either as displacement or as base register.
43(define_subst_attr "addr_style_op_ops" "addr_style_op_subst" "%Y2" "%Y3(%2)")
44
45
46; This substitution adds an explicit AND operation to the second
47; operand. This way previous operations on the now masked out bits
48; might get optimized away.
49(define_subst "masked_op_subst"
50 [(set (match_operand:DSI 0 "" "")
51 (SUBST:DSI (match_operand:DSI 1 "" "")
52 (match_operand:SI 2 "" "")))]
53 ""
54 [(set (match_dup 0)
55 (SUBST:DSI (match_dup 1)
56 (and:SI (match_dup 2)
57 (match_operand:SI 3 "const_int_6bitset_operand" "jm6"))))])
58
59; Use this in the insn name.
60(define_subst_attr "masked_op" "masked_op_subst" "" "_and")
61