annotate gcc/config/rs6000/crypto.md @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ;; Cryptographic instructions added in ISA 2.07
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
2 ;; Copyright (C) 2012-2018 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3 ;; Contributed by Michael Meissner (meissner@linux.vnet.ibm.com)
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 ;; This file is part of GCC.
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 ;; GCC is free software; you can redistribute it and/or modify it
kono
parents:
diff changeset
8 ;; under the terms of the GNU General Public License as published
kono
parents:
diff changeset
9 ;; by the Free Software Foundation; either version 3, or (at your
kono
parents:
diff changeset
10 ;; option) any later version.
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 ;; GCC is distributed in the hope that it will be useful, but WITHOUT
kono
parents:
diff changeset
13 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
kono
parents:
diff changeset
14 ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
kono
parents:
diff changeset
15 ;; License for more details.
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 ;; You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
18 ;; along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
19 ;; <http://www.gnu.org/licenses/>.
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 ;; NOTE: Although this file contains all the instructions from
kono
parents:
diff changeset
22 ;; section 5.11 of ISA 2.07, only those in sections 5.11.1 and
kono
parents:
diff changeset
23 ;; 5.11.2 are in Category:Vector.Crypto. Those are the only
kono
parents:
diff changeset
24 ;; ones controlled by -m[no-]crypto.
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 ;; FIXME: The builtin names for the instructions in this file
kono
parents:
diff changeset
27 ;; are likely to be deprecated in favor of other names to be
kono
parents:
diff changeset
28 ;; agreed upon with the XL compilers and LLVM.
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 (define_c_enum "unspec"
kono
parents:
diff changeset
31 [UNSPEC_VCIPHER
kono
parents:
diff changeset
32 UNSPEC_VNCIPHER
kono
parents:
diff changeset
33 UNSPEC_VCIPHERLAST
kono
parents:
diff changeset
34 UNSPEC_VNCIPHERLAST
kono
parents:
diff changeset
35 UNSPEC_VSBOX
kono
parents:
diff changeset
36 UNSPEC_VSHASIGMA
kono
parents:
diff changeset
37 UNSPEC_VPERMXOR
kono
parents:
diff changeset
38 UNSPEC_VPMSUM])
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 ;; Iterator for VPMSUM/VPERMXOR
kono
parents:
diff changeset
41 (define_mode_iterator CR_mode [V16QI V8HI V4SI V2DI])
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 (define_mode_attr CR_char [(V16QI "b")
kono
parents:
diff changeset
44 (V8HI "h")
kono
parents:
diff changeset
45 (V4SI "w")
kono
parents:
diff changeset
46 (V2DI "d")])
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 ;; Iterator for VSHASIGMAD/VSHASIGMAW
kono
parents:
diff changeset
49 (define_mode_iterator CR_hash [V4SI V2DI])
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 ;; Iterator for the other crypto functions
kono
parents:
diff changeset
52 (define_int_iterator CR_code [UNSPEC_VCIPHER
kono
parents:
diff changeset
53 UNSPEC_VNCIPHER
kono
parents:
diff changeset
54 UNSPEC_VCIPHERLAST
kono
parents:
diff changeset
55 UNSPEC_VNCIPHERLAST])
kono
parents:
diff changeset
56
kono
parents:
diff changeset
57 (define_int_attr CR_insn [(UNSPEC_VCIPHER "vcipher")
kono
parents:
diff changeset
58 (UNSPEC_VNCIPHER "vncipher")
kono
parents:
diff changeset
59 (UNSPEC_VCIPHERLAST "vcipherlast")
kono
parents:
diff changeset
60 (UNSPEC_VNCIPHERLAST "vncipherlast")])
kono
parents:
diff changeset
61
kono
parents:
diff changeset
62 ;; 2 operand crypto instructions
kono
parents:
diff changeset
63 (define_insn "crypto_<CR_insn>"
kono
parents:
diff changeset
64 [(set (match_operand:V2DI 0 "register_operand" "=v")
kono
parents:
diff changeset
65 (unspec:V2DI [(match_operand:V2DI 1 "register_operand" "v")
kono
parents:
diff changeset
66 (match_operand:V2DI 2 "register_operand" "v")]
kono
parents:
diff changeset
67 CR_code))]
kono
parents:
diff changeset
68 "TARGET_CRYPTO"
kono
parents:
diff changeset
69 "<CR_insn> %0,%1,%2"
kono
parents:
diff changeset
70 [(set_attr "type" "crypto")])
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72 (define_insn "crypto_vpmsum<CR_char>"
kono
parents:
diff changeset
73 [(set (match_operand:CR_mode 0 "register_operand" "=v")
kono
parents:
diff changeset
74 (unspec:CR_mode [(match_operand:CR_mode 1 "register_operand" "v")
kono
parents:
diff changeset
75 (match_operand:CR_mode 2 "register_operand" "v")]
kono
parents:
diff changeset
76 UNSPEC_VPMSUM))]
kono
parents:
diff changeset
77 "TARGET_P8_VECTOR"
kono
parents:
diff changeset
78 "vpmsum<CR_char> %0,%1,%2"
kono
parents:
diff changeset
79 [(set_attr "type" "crypto")])
kono
parents:
diff changeset
80
kono
parents:
diff changeset
81 ;; 3 operand crypto instructions
kono
parents:
diff changeset
82 (define_insn "crypto_vpermxor_<mode>"
kono
parents:
diff changeset
83 [(set (match_operand:CR_mode 0 "register_operand" "=v")
kono
parents:
diff changeset
84 (unspec:CR_mode [(match_operand:CR_mode 1 "register_operand" "v")
kono
parents:
diff changeset
85 (match_operand:CR_mode 2 "register_operand" "v")
kono
parents:
diff changeset
86 (match_operand:CR_mode 3 "register_operand" "v")]
kono
parents:
diff changeset
87 UNSPEC_VPERMXOR))]
kono
parents:
diff changeset
88 "TARGET_P8_VECTOR"
kono
parents:
diff changeset
89 "vpermxor %0,%1,%2,%3"
kono
parents:
diff changeset
90 [(set_attr "type" "vecperm")])
kono
parents:
diff changeset
91
kono
parents:
diff changeset
92 ;; 1 operand crypto instruction
kono
parents:
diff changeset
93 (define_insn "crypto_vsbox"
kono
parents:
diff changeset
94 [(set (match_operand:V2DI 0 "register_operand" "=v")
kono
parents:
diff changeset
95 (unspec:V2DI [(match_operand:V2DI 1 "register_operand" "v")]
kono
parents:
diff changeset
96 UNSPEC_VSBOX))]
kono
parents:
diff changeset
97 "TARGET_CRYPTO"
kono
parents:
diff changeset
98 "vsbox %0,%1"
kono
parents:
diff changeset
99 [(set_attr "type" "crypto")])
kono
parents:
diff changeset
100
kono
parents:
diff changeset
101 ;; Hash crypto instructions
kono
parents:
diff changeset
102 (define_insn "crypto_vshasigma<CR_char>"
kono
parents:
diff changeset
103 [(set (match_operand:CR_hash 0 "register_operand" "=v")
kono
parents:
diff changeset
104 (unspec:CR_hash [(match_operand:CR_hash 1 "register_operand" "v")
kono
parents:
diff changeset
105 (match_operand:SI 2 "const_0_to_1_operand" "n")
kono
parents:
diff changeset
106 (match_operand:SI 3 "const_0_to_15_operand" "n")]
kono
parents:
diff changeset
107 UNSPEC_VSHASIGMA))]
kono
parents:
diff changeset
108 "TARGET_CRYPTO"
kono
parents:
diff changeset
109 "vshasigma<CR_char> %0,%1,%2,%3"
kono
parents:
diff changeset
110 [(set_attr "type" "vecsimple")])