sve.decode 4.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# AArch64 SVE instruction descriptions
#
#  Copyright (c) 2017 Linaro, Ltd
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, see <http://www.gnu.org/licenses/>.

#
# This file is processed by scripts/decodetree.py
#

22 23 24 25 26
###########################################################################
# Named fields.  These are primarily for disjoint fields.

%imm9_16_10     16:s6 10:3

27 28 29 30 31
###########################################################################
# Named attribute sets.  These are used to make nice(er) names
# when creating helpers common to those for the individual
# instruction patterns.

32
&rr_esz         rd rn esz
33
&rri            rd rn imm
34
&rrr_esz        rd rn rm esz
35
&rprr_s         rd pg rn rm s
36 37 38 39 40

###########################################################################
# Named instruction formats.  These are generally used to
# reduce the amount of duplication between instruction patterns.

41 42 43 44 45 46
# Two operand with unused vector element size
@pd_pn_e0       ........ ........ ....... rn:4 . rd:4           &rr_esz esz=0

# Two operand
@pd_pn          ........ esz:2 .. .... ....... rn:4 . rd:4      &rr_esz

47 48 49
# Three operand with unused vector element size
@rd_rn_rm_e0    ........ ... rm:5 ... ... rn:5 rd:5             &rrr_esz esz=0

50 51 52
# Three predicate operand, with governing predicate, flag setting
@pd_pg_pn_pm_s  ........ . s:1 .. rm:4 .. pg:4 . rn:4 . rd:4    &rprr_s

53 54 55 56 57 58
# Basic Load/Store with 9-bit immediate offset
@pd_rn_i9       ........ ........ ...... rn:5 . rd:4    \
                &rri imm=%imm9_16_10
@rd_rn_i9       ........ ........ ...... rn:5 rd:5      \
                &rri imm=%imm9_16_10

59 60 61 62 63 64 65 66 67 68
###########################################################################
# Instruction patterns.  Grouped according to the SVE encodingindex.xhtml.

### SVE Logical - Unpredicated Group

# SVE bitwise logical operations (unpredicated)
AND_zzz         00000100 00 1 ..... 001 100 ..... .....         @rd_rn_rm_e0
ORR_zzz         00000100 01 1 ..... 001 100 ..... .....         @rd_rn_rm_e0
EOR_zzz         00000100 10 1 ..... 001 100 ..... .....         @rd_rn_rm_e0
BIC_zzz         00000100 11 1 ..... 001 100 ..... .....         @rd_rn_rm_e0
69

70 71 72 73 74 75 76 77 78 79 80 81
### SVE Predicate Logical Operations Group

# SVE predicate logical operations
AND_pppp        00100101 0. 00 .... 01 .... 0 .... 0 ....       @pd_pg_pn_pm_s
BIC_pppp        00100101 0. 00 .... 01 .... 0 .... 1 ....       @pd_pg_pn_pm_s
EOR_pppp        00100101 0. 00 .... 01 .... 1 .... 0 ....       @pd_pg_pn_pm_s
SEL_pppp        00100101 0. 00 .... 01 .... 1 .... 1 ....       @pd_pg_pn_pm_s
ORR_pppp        00100101 1. 00 .... 01 .... 0 .... 0 ....       @pd_pg_pn_pm_s
ORN_pppp        00100101 1. 00 .... 01 .... 0 .... 1 ....       @pd_pg_pn_pm_s
NOR_pppp        00100101 1. 00 .... 01 .... 1 .... 0 ....       @pd_pg_pn_pm_s
NAND_pppp       00100101 1. 00 .... 01 .... 1 .... 1 ....       @pd_pg_pn_pm_s

82 83 84 85 86
### SVE Predicate Misc Group

# SVE predicate test
PTEST           00100101 01 010000 11 pg:4 0 rn:4 0 0000

87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
# SVE predicate initialize
PTRUE           00100101 esz:2 01100 s:1 111000 pat:5 0 rd:4

# SVE initialize FFR
SETFFR          00100101 0010 1100 1001 0000 0000 0000

# SVE zero predicate register
PFALSE          00100101 0001 1000 1110 0100 0000 rd:4

# SVE predicate read from FFR (predicated)
RDFFR_p         00100101 0 s:1 0110001111000 pg:4 0 rd:4

# SVE predicate read from FFR (unpredicated)
RDFFR           00100101 0001 1001 1111 0000 0000 rd:4

# SVE FFR write from predicate (WRFFR)
WRFFR           00100101 0010 1000 1001 000 rn:4 00000

# SVE predicate first active
PFIRST          00100101 01 011 000 11000 00 .... 0 ....        @pd_pn_e0

# SVE predicate next active
PNEXT           00100101 .. 011 001 11000 10 .... 0 ....        @pd_pn

111 112 113 114 115 116 117
### SVE Memory - 32-bit Gather and Unsized Contiguous Group

# SVE load predicate register
LDR_pri         10000101 10 ...... 000 ... ..... 0 ....         @pd_rn_i9

# SVE load vector register
LDR_zri         10000101 10 ...... 010 ... ..... .....          @rd_rn_i9