comparison gcc/config/s390/subst.md @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 ;;- Machine description for GNU compiler -- S/390 / zSeries version. 1 ;;- Machine description for GNU compiler -- S/390 / zSeries version.
2 ;; Subst patterns. 2 ;; Subst patterns.
3 ;; Copyright (C) 2016-2018 Free Software Foundation, Inc. 3 ;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
4 ;; Contributed by Andreas Krebbel (Andreas.Krebbel@de.ibm.com) 4 ;; Contributed by Andreas Krebbel (Andreas.Krebbel@de.ibm.com)
5 5
6 ;; This file is part of GCC. 6 ;; This file is part of GCC.
7 7
8 ;; GCC is free software; you can redistribute it and/or modify it under 8 ;; GCC is free software; you can redistribute it and/or modify it under
19 ;; along with GCC; see the file COPYING3. If not see 19 ;; along with GCC; see the file COPYING3. If not see
20 ;; <http://www.gnu.org/licenses/>. 20 ;; <http://www.gnu.org/licenses/>.
21 21
22 (define_code_iterator SUBST [rotate ashift lshiftrt ashiftrt]) 22 (define_code_iterator SUBST [rotate ashift lshiftrt ashiftrt])
23 (define_mode_iterator DSI_VI [SI DI V2QI V4QI V8QI V16QI V2HI V4HI V8HI V2SI V4SI V2DI]) 23 (define_mode_iterator DSI_VI [SI DI V2QI V4QI V8QI V16QI V2HI V4HI V8HI V2SI V4SI V2DI])
24
25 ; This expands an register/immediate operand to a register+immediate
26 ; operand to draw advantage of the address style operand format
27 ; providing a addition for free.
28 (define_subst "addr_style_op_subst"
29 [(set (match_operand:DSI_VI 0 "" "")
30 (SUBST:DSI_VI (match_operand:DSI_VI 1 "" "")
31 (match_operand:SI 2 "" "")))]
32 ""
33 [(set (match_dup 0)
34 (SUBST:DSI_VI (match_dup 1)
35 (plus:SI (match_operand:SI 2 "register_operand" "a")
36 (match_operand 3 "const_int_operand" "n"))))])
37
38 ; Use this in the insn name.
39 (define_subst_attr "addr_style_op" "addr_style_op_subst" "" "_plus")
40
41 ; In the subst pattern the additional const int operand will be used
42 ; as displacement. In the normal version %Y is able to print the
43 ; operand either as displacement or as base register.
44 (define_subst_attr "addr_style_op_ops" "addr_style_op_subst" "%Y2" "%Y3(%2)")
45
46
47 ; This substitution adds an explicit AND operation to the second
48 ; operand. This way previous operations on the now masked out bits
49 ; might get optimized away.
50 (define_subst "masked_op_subst"
51 [(set (match_operand:DSI 0 "" "")
52 (SUBST:DSI (match_operand:DSI 1 "" "")
53 (match_operand:SI 2 "" "")))]
54 ""
55 [(set (match_dup 0)
56 (SUBST:DSI (match_dup 1)
57 (and:SI (match_dup 2)
58 (match_operand:SI 3 "const_int_6bitset_operand" "jm6"))))])
59
60 ; Use this in the insn name.
61 (define_subst_attr "masked_op" "masked_op_subst" "" "_and")
62
63
64
65 ; This is like the addr_style_op substitution above but with a CC clobber.
66 (define_subst "addr_style_op_cc_subst"
67 [(set (match_operand:DSI 0 "" "")
68 (ashiftrt:DSI (match_operand:DSI 1 "" "")
69 (match_operand:SI 2 "" "")))
70 (clobber (reg:CC CC_REGNUM))]
71 "REG_P (operands[2])"
72 [(set (match_dup 0)
73 (ashiftrt:DSI (match_dup 1)
74 (plus:SI (match_dup 2)
75 (match_operand 3 "const_int_operand" "n"))))
76 (clobber (reg:CC CC_REGNUM))])
77
78 (define_subst_attr "addr_style_op_cc" "addr_style_op_cc_subst" "" "_plus")
79 (define_subst_attr "addr_style_op_cc_ops" "addr_style_op_cc_subst" "%Y2" "%Y3(%2)")
80
81
82 ; This is like the masked_op substitution but with a CC clobber.
83 (define_subst "masked_op_cc_subst"
84 [(set (match_operand:DSI 0 "" "")
85 (ashiftrt:DSI (match_operand:DSI 1 "" "")
86 (match_operand:SI 2 "" "")))
87 (clobber (reg:CC CC_REGNUM))]
88 ""
89 [(set (match_dup 0)
90 (ashiftrt:DSI (match_dup 1)
91 (and:SI (match_dup 2)
92 (match_operand:SI 3 "const_int_6bitset_operand" ""))))
93 (clobber (reg:CC CC_REGNUM))])
94 (define_subst_attr "masked_op_cc" "masked_op_cc_subst" "" "_and")
95
96 24
97 ; This adds an explicit CC reg set to an operation while keeping the 25 ; This adds an explicit CC reg set to an operation while keeping the
98 ; set for the operation result as well. 26 ; set for the operation result as well.
99 (define_subst "setcc_subst" 27 (define_subst "setcc_subst"
100 [(set (match_operand:DSI 0 "" "") 28 [(set (match_operand:DSI 0 "" "")