2021-06-14 17:09:20 +02:00
|
|
|
# M-profile MVE instruction descriptions
|
|
|
|
#
|
|
|
|
# Copyright (c) 2021 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.1 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
|
|
|
|
#
|
2021-06-17 14:15:45 +02:00
|
|
|
|
|
|
|
%qd 22:1 13:3
|
2021-06-17 14:15:47 +02:00
|
|
|
%qm 5:1 1:3
|
2021-06-17 14:15:54 +02:00
|
|
|
%qn 7:1 17:3
|
2021-06-17 14:15:45 +02:00
|
|
|
|
2021-06-17 14:16:13 +02:00
|
|
|
# VQDMULL has size in bit 28: 0 for 16 bit, 1 for 32 bit
|
|
|
|
%size_28 28:1 !function=plus_1
|
|
|
|
|
2021-06-28 15:58:23 +02:00
|
|
|
# 1imm format immediate
|
|
|
|
%imm_28_16_0 28:1 16:3 0:4
|
|
|
|
|
2021-06-17 14:15:46 +02:00
|
|
|
&vldr_vstr rn qd imm p a w size l u
|
2021-06-17 14:15:47 +02:00
|
|
|
&1op qd qm size
|
2021-06-17 14:15:55 +02:00
|
|
|
&2op qd qm qn size
|
2021-06-17 14:16:06 +02:00
|
|
|
&2scalar qd qn rm size
|
2021-06-28 15:58:23 +02:00
|
|
|
&1imm qd imm cmode op
|
2021-06-28 15:58:24 +02:00
|
|
|
&2shift qd qm shift size
|
2021-08-13 18:11:50 +02:00
|
|
|
&vidup qd rn size imm
|
|
|
|
&viwdup qd rn rm size imm
|
2021-08-13 18:11:51 +02:00
|
|
|
&vcmp qm qn size mask
|
2021-08-13 18:11:51 +02:00
|
|
|
&vcmp_scalar qn rm size mask
|
2021-06-17 14:15:45 +02:00
|
|
|
|
2021-06-17 14:15:46 +02:00
|
|
|
@vldr_vstr ....... . . . . l:1 rn:4 ... ...... imm:7 &vldr_vstr qd=%qd u=0
|
|
|
|
# Note that both Rn and Qd are 3 bits only (no D bit)
|
|
|
|
@vldst_wn ... u:1 ... . . . . l:1 . rn:3 qd:3 . ... .. imm:7 &vldr_vstr
|
2021-06-17 14:15:45 +02:00
|
|
|
|
2021-06-17 14:15:47 +02:00
|
|
|
@1op .... .... .... size:2 .. .... .... .... .... &1op qd=%qd qm=%qm
|
2021-06-17 14:15:50 +02:00
|
|
|
@1op_nosz .... .... .... .... .... .... .... .... &1op qd=%qd qm=%qm size=0
|
2021-06-17 14:15:56 +02:00
|
|
|
@2op .... .... .. size:2 .... .... .... .... .... &2op qd=%qd qm=%qm qn=%qn
|
2021-06-17 14:15:55 +02:00
|
|
|
@2op_nosz .... .... .... .... .... .... .... .... &2op qd=%qd qm=%qm qn=%qn size=0
|
2021-06-17 14:16:22 +02:00
|
|
|
@2op_sz28 .... .... .... .... .... .... .... .... &2op qd=%qd qm=%qm qn=%qn \
|
|
|
|
size=%size_28
|
2021-06-28 15:58:23 +02:00
|
|
|
@1imm .... .... .... .... .... cmode:4 .. op:1 . .... &1imm qd=%qd imm=%imm_28_16_0
|
2021-06-17 14:15:47 +02:00
|
|
|
|
2021-06-17 14:16:16 +02:00
|
|
|
# The _rev suffix indicates that Vn and Vm are reversed. This is
|
|
|
|
# the case for shifts. In the Arm ARM these insns are documented
|
|
|
|
# with the Vm and Vn fields in their usual places, but in the
|
|
|
|
# assembly the operands are listed "backwards", ie in the order
|
|
|
|
# Qd, Qm, Qn where other insns use Qd, Qn, Qm. For QEMU we choose
|
|
|
|
# to consider Vm and Vn as being in different fields in the insn.
|
|
|
|
# This gives us consistency with A64 and Neon.
|
|
|
|
@2op_rev .... .... .. size:2 .... .... .... .... .... &2op qd=%qd qm=%qn qn=%qm
|
|
|
|
|
2021-06-17 14:16:06 +02:00
|
|
|
@2scalar .... .... .. size:2 .... .... .... .... rm:4 &2scalar qd=%qd qn=%qn
|
2021-06-17 14:16:13 +02:00
|
|
|
@2scalar_nosz .... .... .... .... .... .... .... rm:4 &2scalar qd=%qd qn=%qn
|
2021-06-17 14:16:06 +02:00
|
|
|
|
2021-06-28 15:58:24 +02:00
|
|
|
@2_shl_b .... .... .. 001 shift:3 .... .... .... .... &2shift qd=%qd qm=%qm size=0
|
|
|
|
@2_shl_h .... .... .. 01 shift:4 .... .... .... .... &2shift qd=%qd qm=%qm size=1
|
|
|
|
@2_shl_w .... .... .. 1 shift:5 .... .... .... .... &2shift qd=%qd qm=%qm size=2
|
|
|
|
|
2021-06-28 15:58:26 +02:00
|
|
|
@2_shll_b .... .... ... 01 shift:3 .... .... .... .... &2shift qd=%qd qm=%qm size=0
|
|
|
|
@2_shll_h .... .... ... 1 shift:4 .... .... .... .... &2shift qd=%qd qm=%qm size=1
|
|
|
|
# VSHLL encoding T2 where shift == esize
|
|
|
|
@2_shll_esize_b .... .... .... 00 .. .... .... .... .... &2shift \
|
|
|
|
qd=%qd qm=%qm size=0 shift=8
|
|
|
|
@2_shll_esize_h .... .... .... 01 .. .... .... .... .... &2shift \
|
|
|
|
qd=%qd qm=%qm size=1 shift=16
|
|
|
|
|
2021-06-28 15:58:25 +02:00
|
|
|
# Right shifts are encoded as N - shift, where N is the element size in bits.
|
|
|
|
%rshift_i5 16:5 !function=rsub_32
|
|
|
|
%rshift_i4 16:4 !function=rsub_16
|
|
|
|
%rshift_i3 16:3 !function=rsub_8
|
|
|
|
|
|
|
|
@2_shr_b .... .... .. 001 ... .... .... .... .... &2shift qd=%qd qm=%qm \
|
|
|
|
size=0 shift=%rshift_i3
|
|
|
|
@2_shr_h .... .... .. 01 .... .... .... .... .... &2shift qd=%qd qm=%qm \
|
|
|
|
size=1 shift=%rshift_i4
|
|
|
|
@2_shr_w .... .... .. 1 ..... .... .... .... .... &2shift qd=%qd qm=%qm \
|
|
|
|
size=2 shift=%rshift_i5
|
|
|
|
|
2021-08-13 18:11:51 +02:00
|
|
|
# Vector comparison; 4-bit Qm but 3-bit Qn
|
|
|
|
%mask_22_13 22:1 13:3
|
|
|
|
@vcmp .... .... .. size:2 qn:3 . .... .... .... .... &vcmp qm=%qm mask=%mask_22_13
|
2021-08-13 18:11:51 +02:00
|
|
|
@vcmp_scalar .... .... .. size:2 qn:3 . .... .... .... rm:4 &vcmp_scalar \
|
|
|
|
mask=%mask_22_13
|
2021-08-13 18:11:51 +02:00
|
|
|
|
2021-06-17 14:15:45 +02:00
|
|
|
# Vector loads and stores
|
|
|
|
|
2021-06-17 14:15:46 +02:00
|
|
|
# Widening loads and narrowing stores:
|
|
|
|
# for these P=0 W=0 is 'related encoding'; sz=11 is 'related encoding'
|
|
|
|
# This means we need to expand out to multiple patterns for P, W, SZ.
|
|
|
|
# For stores the U bit must be 0 but we catch that in the trans_ function.
|
|
|
|
# The naming scheme here is "VLDSTB_H == in-memory byte load/store to/from
|
|
|
|
# signed halfword element in register", etc.
|
|
|
|
VLDSTB_H 111 . 110 0 a:1 0 1 . 0 ... ... 0 111 01 ....... @vldst_wn \
|
|
|
|
p=0 w=1 size=1
|
|
|
|
VLDSTB_H 111 . 110 1 a:1 0 w:1 . 0 ... ... 0 111 01 ....... @vldst_wn \
|
|
|
|
p=1 size=1
|
|
|
|
VLDSTB_W 111 . 110 0 a:1 0 1 . 0 ... ... 0 111 10 ....... @vldst_wn \
|
|
|
|
p=0 w=1 size=2
|
|
|
|
VLDSTB_W 111 . 110 1 a:1 0 w:1 . 0 ... ... 0 111 10 ....... @vldst_wn \
|
|
|
|
p=1 size=2
|
|
|
|
VLDSTH_W 111 . 110 0 a:1 0 1 . 1 ... ... 0 111 10 ....... @vldst_wn \
|
|
|
|
p=0 w=1 size=2
|
|
|
|
VLDSTH_W 111 . 110 1 a:1 0 w:1 . 1 ... ... 0 111 10 ....... @vldst_wn \
|
|
|
|
p=1 size=2
|
|
|
|
|
2021-06-17 14:15:45 +02:00
|
|
|
# Non-widening loads/stores (P=0 W=0 is 'related encoding')
|
|
|
|
VLDR_VSTR 1110110 0 a:1 . 1 . .... ... 111100 ....... @vldr_vstr \
|
|
|
|
size=0 p=0 w=1
|
|
|
|
VLDR_VSTR 1110110 0 a:1 . 1 . .... ... 111101 ....... @vldr_vstr \
|
|
|
|
size=1 p=0 w=1
|
|
|
|
VLDR_VSTR 1110110 0 a:1 . 1 . .... ... 111110 ....... @vldr_vstr \
|
|
|
|
size=2 p=0 w=1
|
|
|
|
VLDR_VSTR 1110110 1 a:1 . w:1 . .... ... 111100 ....... @vldr_vstr \
|
|
|
|
size=0 p=1
|
|
|
|
VLDR_VSTR 1110110 1 a:1 . w:1 . .... ... 111101 ....... @vldr_vstr \
|
|
|
|
size=1 p=1
|
|
|
|
VLDR_VSTR 1110110 1 a:1 . w:1 . .... ... 111110 ....... @vldr_vstr \
|
|
|
|
size=2 p=1
|
2021-06-17 14:15:47 +02:00
|
|
|
|
2021-06-17 14:15:55 +02:00
|
|
|
# Vector 2-op
|
|
|
|
VAND 1110 1111 0 . 00 ... 0 ... 0 0001 . 1 . 1 ... 0 @2op_nosz
|
|
|
|
VBIC 1110 1111 0 . 01 ... 0 ... 0 0001 . 1 . 1 ... 0 @2op_nosz
|
|
|
|
VORR 1110 1111 0 . 10 ... 0 ... 0 0001 . 1 . 1 ... 0 @2op_nosz
|
|
|
|
VORN 1110 1111 0 . 11 ... 0 ... 0 0001 . 1 . 1 ... 0 @2op_nosz
|
|
|
|
VEOR 1111 1111 0 . 00 ... 0 ... 0 0001 . 1 . 1 ... 0 @2op_nosz
|
|
|
|
|
2021-06-17 14:15:56 +02:00
|
|
|
VADD 1110 1111 0 . .. ... 0 ... 0 1000 . 1 . 0 ... 0 @2op
|
|
|
|
VSUB 1111 1111 0 . .. ... 0 ... 0 1000 . 1 . 0 ... 0 @2op
|
|
|
|
VMUL 1110 1111 0 . .. ... 0 ... 0 1001 . 1 . 1 ... 0 @2op
|
|
|
|
|
2021-06-28 15:58:26 +02:00
|
|
|
# The VSHLL T2 encoding is not a @2op pattern, but is here because it
|
|
|
|
# overlaps what would be size=0b11 VMULH/VRMULH
|
|
|
|
{
|
|
|
|
VSHLL_BS 111 0 1110 0 . 11 .. 01 ... 0 1110 0 0 . 0 ... 1 @2_shll_esize_b
|
|
|
|
VSHLL_BS 111 0 1110 0 . 11 .. 01 ... 0 1110 0 0 . 0 ... 1 @2_shll_esize_h
|
|
|
|
|
|
|
|
VMULH_S 111 0 1110 0 . .. ...1 ... 0 1110 . 0 . 0 ... 1 @2op
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
VSHLL_BU 111 1 1110 0 . 11 .. 01 ... 0 1110 0 0 . 0 ... 1 @2_shll_esize_b
|
|
|
|
VSHLL_BU 111 1 1110 0 . 11 .. 01 ... 0 1110 0 0 . 0 ... 1 @2_shll_esize_h
|
2021-06-17 14:15:57 +02:00
|
|
|
|
2021-06-28 15:58:26 +02:00
|
|
|
VMULH_U 111 1 1110 0 . .. ...1 ... 0 1110 . 0 . 0 ... 1 @2op
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
VSHLL_TS 111 0 1110 0 . 11 .. 01 ... 1 1110 0 0 . 0 ... 1 @2_shll_esize_b
|
|
|
|
VSHLL_TS 111 0 1110 0 . 11 .. 01 ... 1 1110 0 0 . 0 ... 1 @2_shll_esize_h
|
|
|
|
|
|
|
|
VRMULH_S 111 0 1110 0 . .. ...1 ... 1 1110 . 0 . 0 ... 1 @2op
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
VSHLL_TU 111 1 1110 0 . 11 .. 01 ... 1 1110 0 0 . 0 ... 1 @2_shll_esize_b
|
|
|
|
VSHLL_TU 111 1 1110 0 . 11 .. 01 ... 1 1110 0 0 . 0 ... 1 @2_shll_esize_h
|
|
|
|
|
|
|
|
VRMULH_U 111 1 1110 0 . .. ...1 ... 1 1110 . 0 . 0 ... 1 @2op
|
|
|
|
}
|
2021-06-17 14:15:58 +02:00
|
|
|
|
2021-06-17 14:15:59 +02:00
|
|
|
VMAX_S 111 0 1111 0 . .. ... 0 ... 0 0110 . 1 . 0 ... 0 @2op
|
|
|
|
VMAX_U 111 1 1111 0 . .. ... 0 ... 0 0110 . 1 . 0 ... 0 @2op
|
|
|
|
VMIN_S 111 0 1111 0 . .. ... 0 ... 0 0110 . 1 . 1 ... 0 @2op
|
|
|
|
VMIN_U 111 1 1111 0 . .. ... 0 ... 0 0110 . 1 . 1 ... 0 @2op
|
|
|
|
|
2021-06-17 14:16:00 +02:00
|
|
|
VABD_S 111 0 1111 0 . .. ... 0 ... 0 0111 . 1 . 0 ... 0 @2op
|
|
|
|
VABD_U 111 1 1111 0 . .. ... 0 ... 0 0111 . 1 . 0 ... 0 @2op
|
|
|
|
|
2021-06-17 14:16:01 +02:00
|
|
|
VHADD_S 111 0 1111 0 . .. ... 0 ... 0 0000 . 1 . 0 ... 0 @2op
|
|
|
|
VHADD_U 111 1 1111 0 . .. ... 0 ... 0 0000 . 1 . 0 ... 0 @2op
|
|
|
|
VHSUB_S 111 0 1111 0 . .. ... 0 ... 0 0010 . 1 . 0 ... 0 @2op
|
|
|
|
VHSUB_U 111 1 1111 0 . .. ... 0 ... 0 0010 . 1 . 0 ... 0 @2op
|
|
|
|
|
2021-08-13 18:11:50 +02:00
|
|
|
{
|
|
|
|
VMULLP_B 111 . 1110 0 . 11 ... 1 ... 0 1110 . 0 . 0 ... 0 @2op_sz28
|
|
|
|
VMULL_BS 111 0 1110 0 . .. ... 1 ... 0 1110 . 0 . 0 ... 0 @2op
|
|
|
|
VMULL_BU 111 1 1110 0 . .. ... 1 ... 0 1110 . 0 . 0 ... 0 @2op
|
|
|
|
}
|
|
|
|
{
|
|
|
|
VMULLP_T 111 . 1110 0 . 11 ... 1 ... 1 1110 . 0 . 0 ... 0 @2op_sz28
|
|
|
|
VMULL_TS 111 0 1110 0 . .. ... 1 ... 1 1110 . 0 . 0 ... 0 @2op
|
|
|
|
VMULL_TU 111 1 1110 0 . .. ... 1 ... 1 1110 . 0 . 0 ... 0 @2op
|
|
|
|
}
|
2021-06-17 14:16:02 +02:00
|
|
|
|
2021-06-17 14:16:14 +02:00
|
|
|
VQDMULH 1110 1111 0 . .. ... 0 ... 0 1011 . 1 . 0 ... 0 @2op
|
|
|
|
VQRDMULH 1111 1111 0 . .. ... 0 ... 0 1011 . 1 . 0 ... 0 @2op
|
|
|
|
|
2021-06-17 14:16:15 +02:00
|
|
|
VQADD_S 111 0 1111 0 . .. ... 0 ... 0 0000 . 1 . 1 ... 0 @2op
|
|
|
|
VQADD_U 111 1 1111 0 . .. ... 0 ... 0 0000 . 1 . 1 ... 0 @2op
|
|
|
|
VQSUB_S 111 0 1111 0 . .. ... 0 ... 0 0010 . 1 . 1 ... 0 @2op
|
|
|
|
VQSUB_U 111 1 1111 0 . .. ... 0 ... 0 0010 . 1 . 1 ... 0 @2op
|
|
|
|
|
2021-06-17 14:16:18 +02:00
|
|
|
VSHL_S 111 0 1111 0 . .. ... 0 ... 0 0100 . 1 . 0 ... 0 @2op_rev
|
|
|
|
VSHL_U 111 1 1111 0 . .. ... 0 ... 0 0100 . 1 . 0 ... 0 @2op_rev
|
|
|
|
|
2021-06-17 14:16:19 +02:00
|
|
|
VRSHL_S 111 0 1111 0 . .. ... 0 ... 0 0101 . 1 . 0 ... 0 @2op_rev
|
|
|
|
VRSHL_U 111 1 1111 0 . .. ... 0 ... 0 0101 . 1 . 0 ... 0 @2op_rev
|
|
|
|
|
2021-06-17 14:16:16 +02:00
|
|
|
VQSHL_S 111 0 1111 0 . .. ... 0 ... 0 0100 . 1 . 1 ... 0 @2op_rev
|
|
|
|
VQSHL_U 111 1 1111 0 . .. ... 0 ... 0 0100 . 1 . 1 ... 0 @2op_rev
|
|
|
|
|
2021-06-17 14:16:17 +02:00
|
|
|
VQRSHL_S 111 0 1111 0 . .. ... 0 ... 0 0101 . 1 . 1 ... 0 @2op_rev
|
|
|
|
VQRSHL_U 111 1 1111 0 . .. ... 0 ... 0 0101 . 1 . 1 ... 0 @2op_rev
|
|
|
|
|
2021-06-17 14:16:20 +02:00
|
|
|
VQDMLADH 1110 1110 0 . .. ... 0 ... 0 1110 . 0 . 0 ... 0 @2op
|
|
|
|
VQDMLADHX 1110 1110 0 . .. ... 0 ... 1 1110 . 0 . 0 ... 0 @2op
|
|
|
|
VQRDMLADH 1110 1110 0 . .. ... 0 ... 0 1110 . 0 . 0 ... 1 @2op
|
|
|
|
VQRDMLADHX 1110 1110 0 . .. ... 0 ... 1 1110 . 0 . 0 ... 1 @2op
|
|
|
|
|
2021-06-17 14:16:21 +02:00
|
|
|
VQDMLSDH 1111 1110 0 . .. ... 0 ... 0 1110 . 0 . 0 ... 0 @2op
|
|
|
|
VQDMLSDHX 1111 1110 0 . .. ... 0 ... 1 1110 . 0 . 0 ... 0 @2op
|
|
|
|
VQRDMLSDH 1111 1110 0 . .. ... 0 ... 0 1110 . 0 . 0 ... 1 @2op
|
|
|
|
VQRDMLSDHX 1111 1110 0 . .. ... 0 ... 1 1110 . 0 . 0 ... 1 @2op
|
|
|
|
|
2021-06-17 14:16:22 +02:00
|
|
|
VQDMULLB 111 . 1110 0 . 11 ... 0 ... 0 1111 . 0 . 0 ... 1 @2op_sz28
|
|
|
|
VQDMULLT 111 . 1110 0 . 11 ... 0 ... 1 1111 . 0 . 0 ... 1 @2op_sz28
|
|
|
|
|
2021-06-17 14:16:23 +02:00
|
|
|
VRHADD_S 111 0 1111 0 . .. ... 0 ... 0 0001 . 1 . 0 ... 0 @2op
|
|
|
|
VRHADD_U 111 1 1111 0 . .. ... 0 ... 0 0001 . 1 . 0 ... 0 @2op
|
|
|
|
|
2021-06-17 14:16:26 +02:00
|
|
|
{
|
|
|
|
VADC 1110 1110 0 . 11 ... 0 ... 0 1111 . 0 . 0 ... 0 @2op_nosz
|
|
|
|
VADCI 1110 1110 0 . 11 ... 0 ... 1 1111 . 0 . 0 ... 0 @2op_nosz
|
|
|
|
VHCADD90 1110 1110 0 . .. ... 0 ... 0 1111 . 0 . 0 ... 0 @2op
|
|
|
|
VHCADD270 1110 1110 0 . .. ... 0 ... 1 1111 . 0 . 0 ... 0 @2op
|
|
|
|
}
|
2021-06-17 14:16:25 +02:00
|
|
|
|
|
|
|
{
|
|
|
|
VSBC 1111 1110 0 . 11 ... 0 ... 0 1111 . 0 . 0 ... 0 @2op_nosz
|
|
|
|
VSBCI 1111 1110 0 . 11 ... 0 ... 1 1111 . 0 . 0 ... 0 @2op_nosz
|
|
|
|
VCADD90 1111 1110 0 . .. ... 0 ... 0 1111 . 0 . 0 ... 0 @2op
|
|
|
|
VCADD270 1111 1110 0 . .. ... 0 ... 1 1111 . 0 . 0 ... 0 @2op
|
|
|
|
}
|
2021-06-17 14:16:24 +02:00
|
|
|
|
2021-06-17 14:15:47 +02:00
|
|
|
# Vector miscellaneous
|
|
|
|
|
2021-06-17 14:15:48 +02:00
|
|
|
VCLS 1111 1111 1 . 11 .. 00 ... 0 0100 01 . 0 ... 0 @1op
|
2021-06-17 14:15:47 +02:00
|
|
|
VCLZ 1111 1111 1 . 11 .. 00 ... 0 0100 11 . 0 ... 0 @1op
|
2021-06-17 14:15:49 +02:00
|
|
|
|
|
|
|
VREV16 1111 1111 1 . 11 .. 00 ... 0 0001 01 . 0 ... 0 @1op
|
|
|
|
VREV32 1111 1111 1 . 11 .. 00 ... 0 0000 11 . 0 ... 0 @1op
|
|
|
|
VREV64 1111 1111 1 . 11 .. 00 ... 0 0000 01 . 0 ... 0 @1op
|
2021-06-17 14:15:50 +02:00
|
|
|
|
|
|
|
VMVN 1111 1111 1 . 11 00 00 ... 0 0101 11 . 0 ... 0 @1op_nosz
|
2021-06-17 14:15:51 +02:00
|
|
|
|
|
|
|
VABS 1111 1111 1 . 11 .. 01 ... 0 0011 01 . 0 ... 0 @1op
|
|
|
|
VABS_fp 1111 1111 1 . 11 .. 01 ... 0 0111 01 . 0 ... 0 @1op
|
2021-06-17 14:15:52 +02:00
|
|
|
VNEG 1111 1111 1 . 11 .. 01 ... 0 0011 11 . 0 ... 0 @1op
|
|
|
|
VNEG_fp 1111 1111 1 . 11 .. 01 ... 0 0111 11 . 0 ... 0 @1op
|
2021-06-17 14:15:54 +02:00
|
|
|
|
|
|
|
&vdup qd rt size
|
|
|
|
# Qd is in the fields usually named Qn
|
|
|
|
@vdup .... .... . . .. ... . rt:4 .... . . . . .... qd=%qn &vdup
|
|
|
|
|
|
|
|
# B and E bits encode size, which we decode here to the usual size values
|
|
|
|
VDUP 1110 1110 1 1 10 ... 0 .... 1011 . 0 0 1 0000 @vdup size=0
|
|
|
|
VDUP 1110 1110 1 0 10 ... 0 .... 1011 . 0 1 1 0000 @vdup size=1
|
|
|
|
VDUP 1110 1110 1 0 10 ... 0 .... 1011 . 0 0 1 0000 @vdup size=2
|
2021-06-17 14:16:03 +02:00
|
|
|
|
2021-08-13 18:11:50 +02:00
|
|
|
# Incrementing and decrementing dup
|
|
|
|
|
|
|
|
# VIDUP, VDDUP format immediate: 1 << (immh:imml)
|
|
|
|
%imm_vidup 7:1 0:1 !function=vidup_imm
|
|
|
|
|
|
|
|
# VIDUP, VDDUP registers: Rm bits [3:1] from insn, bit 0 is 1;
|
|
|
|
# Rn bits [3:1] from insn, bit 0 is 0
|
|
|
|
%vidup_rm 1:3 !function=times_2_plus_1
|
|
|
|
%vidup_rn 17:3 !function=times_2
|
|
|
|
|
|
|
|
@vidup .... .... . . size:2 .... .... .... .... .... \
|
|
|
|
qd=%qd imm=%imm_vidup rn=%vidup_rn &vidup
|
|
|
|
@viwdup .... .... . . size:2 .... .... .... .... .... \
|
|
|
|
qd=%qd imm=%imm_vidup rm=%vidup_rm rn=%vidup_rn &viwdup
|
|
|
|
{
|
|
|
|
VIDUP 1110 1110 0 . .. ... 1 ... 0 1111 . 110 111 . @vidup
|
|
|
|
VIWDUP 1110 1110 0 . .. ... 1 ... 0 1111 . 110 ... . @viwdup
|
|
|
|
}
|
|
|
|
{
|
|
|
|
VDDUP 1110 1110 0 . .. ... 1 ... 1 1111 . 110 111 . @vidup
|
|
|
|
VDWDUP 1110 1110 0 . .. ... 1 ... 1 1111 . 110 ... . @viwdup
|
|
|
|
}
|
|
|
|
|
2021-06-17 14:16:03 +02:00
|
|
|
# multiply-add long dual accumulate
|
|
|
|
# rdahi: bits [3:1] from insn, bit 0 is 1
|
|
|
|
# rdalo: bits [3:1] from insn, bit 0 is 0
|
|
|
|
%rdahi 20:3 !function=times_2_plus_1
|
|
|
|
%rdalo 13:3 !function=times_2
|
|
|
|
# size bit is 0 for 16 bit, 1 for 32 bit
|
|
|
|
%size_16 16:1 !function=plus_1
|
|
|
|
|
|
|
|
&vmlaldav rdahi rdalo size qn qm x a
|
|
|
|
|
|
|
|
@vmlaldav .... .... . ... ... . ... . .... .... qm:3 . \
|
|
|
|
qn=%qn rdahi=%rdahi rdalo=%rdalo size=%size_16 &vmlaldav
|
2021-06-17 14:16:05 +02:00
|
|
|
@vmlaldav_nosz .... .... . ... ... . ... . .... .... qm:3 . \
|
|
|
|
qn=%qn rdahi=%rdahi rdalo=%rdalo size=0 &vmlaldav
|
2021-06-17 14:16:03 +02:00
|
|
|
VMLALDAV_S 1110 1110 1 ... ... . ... x:1 1110 . 0 a:1 0 ... 0 @vmlaldav
|
|
|
|
VMLALDAV_U 1111 1110 1 ... ... . ... x:1 1110 . 0 a:1 0 ... 0 @vmlaldav
|
2021-06-17 14:16:04 +02:00
|
|
|
|
|
|
|
VMLSLDAV 1110 1110 1 ... ... . ... x:1 1110 . 0 a:1 0 ... 1 @vmlaldav
|
2021-06-17 14:16:05 +02:00
|
|
|
|
|
|
|
VRMLALDAVH_S 1110 1110 1 ... ... 0 ... x:1 1111 . 0 a:1 0 ... 0 @vmlaldav_nosz
|
|
|
|
VRMLALDAVH_U 1111 1110 1 ... ... 0 ... x:1 1111 . 0 a:1 0 ... 0 @vmlaldav_nosz
|
|
|
|
|
|
|
|
VRMLSLDAVH 1111 1110 1 ... ... 0 ... x:1 1110 . 0 a:1 0 ... 1 @vmlaldav_nosz
|
2021-06-17 14:16:06 +02:00
|
|
|
|
|
|
|
# Scalar operations
|
|
|
|
|
|
|
|
VADD_scalar 1110 1110 0 . .. ... 1 ... 0 1111 . 100 .... @2scalar
|
2021-06-17 14:16:07 +02:00
|
|
|
VSUB_scalar 1110 1110 0 . .. ... 1 ... 1 1111 . 100 .... @2scalar
|
|
|
|
VMUL_scalar 1110 1110 0 . .. ... 1 ... 1 1110 . 110 .... @2scalar
|
2021-06-17 14:16:08 +02:00
|
|
|
VHADD_S_scalar 1110 1110 0 . .. ... 0 ... 0 1111 . 100 .... @2scalar
|
|
|
|
VHADD_U_scalar 1111 1110 0 . .. ... 0 ... 0 1111 . 100 .... @2scalar
|
|
|
|
VHSUB_S_scalar 1110 1110 0 . .. ... 0 ... 1 1111 . 100 .... @2scalar
|
|
|
|
VHSUB_U_scalar 1111 1110 0 . .. ... 0 ... 1 1111 . 100 .... @2scalar
|
2021-06-17 14:16:11 +02:00
|
|
|
|
2021-06-17 14:16:13 +02:00
|
|
|
{
|
|
|
|
VQADD_S_scalar 1110 1110 0 . .. ... 0 ... 0 1111 . 110 .... @2scalar
|
|
|
|
VQADD_U_scalar 1111 1110 0 . .. ... 0 ... 0 1111 . 110 .... @2scalar
|
|
|
|
VQDMULLB_scalar 111 . 1110 0 . 11 ... 0 ... 0 1111 . 110 .... @2scalar_nosz \
|
|
|
|
size=%size_28
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
VQSUB_S_scalar 1110 1110 0 . .. ... 0 ... 1 1111 . 110 .... @2scalar
|
|
|
|
VQSUB_U_scalar 1111 1110 0 . .. ... 0 ... 1 1111 . 110 .... @2scalar
|
|
|
|
VQDMULLT_scalar 111 . 1110 0 . 11 ... 0 ... 1 1111 . 110 .... @2scalar_nosz \
|
|
|
|
size=%size_28
|
|
|
|
}
|
|
|
|
|
2021-06-17 14:16:09 +02:00
|
|
|
VBRSR 1111 1110 0 . .. ... 1 ... 1 1110 . 110 .... @2scalar
|
2021-06-17 14:16:10 +02:00
|
|
|
|
2021-06-17 14:16:12 +02:00
|
|
|
VQDMULH_scalar 1110 1110 0 . .. ... 1 ... 0 1110 . 110 .... @2scalar
|
|
|
|
VQRDMULH_scalar 1111 1110 0 . .. ... 1 ... 0 1110 . 110 .... @2scalar
|
|
|
|
|
2021-08-13 18:11:52 +02:00
|
|
|
# The U bit (28) is don't-care because it does not affect the result
|
|
|
|
VMLAS 111- 1110 0 . .. ... 1 ... 1 1110 . 100 .... @2scalar
|
|
|
|
|
2021-06-17 14:16:27 +02:00
|
|
|
# Vector add across vector
|
2021-06-28 15:58:31 +02:00
|
|
|
{
|
|
|
|
VADDV 111 u:1 1110 1111 size:2 01 ... 0 1111 0 0 a:1 0 qm:3 0 rda=%rdalo
|
|
|
|
VADDLV 111 u:1 1110 1 ... 1001 ... 0 1111 00 a:1 0 qm:3 0 \
|
|
|
|
rdahi=%rdahi rdalo=%rdalo
|
|
|
|
}
|
2021-06-17 14:16:13 +02:00
|
|
|
|
2021-06-28 15:58:23 +02:00
|
|
|
# Logical immediate operations (1 reg and modified-immediate)
|
|
|
|
|
|
|
|
# The cmode/op bits here decode VORR/VBIC/VMOV/VMVN, but
|
|
|
|
# not in a way we can conveniently represent in decodetree without
|
|
|
|
# a lot of repetition:
|
|
|
|
# VORR: op=0, (cmode & 1) && cmode < 12
|
|
|
|
# VBIC: op=1, (cmode & 1) && cmode < 12
|
|
|
|
# VMOV: everything else
|
|
|
|
# So we have a single decode line and check the cmode/op in the
|
|
|
|
# trans function.
|
|
|
|
Vimm_1r 111 . 1111 1 . 00 0 ... ... 0 .... 0 1 . 1 .... @1imm
|
2021-06-28 15:58:24 +02:00
|
|
|
|
|
|
|
# Shifts by immediate
|
|
|
|
|
|
|
|
VSHLI 111 0 1111 1 . ... ... ... 0 0101 0 1 . 1 ... 0 @2_shl_b
|
|
|
|
VSHLI 111 0 1111 1 . ... ... ... 0 0101 0 1 . 1 ... 0 @2_shl_h
|
|
|
|
VSHLI 111 0 1111 1 . ... ... ... 0 0101 0 1 . 1 ... 0 @2_shl_w
|
|
|
|
|
|
|
|
VQSHLI_S 111 0 1111 1 . ... ... ... 0 0111 0 1 . 1 ... 0 @2_shl_b
|
|
|
|
VQSHLI_S 111 0 1111 1 . ... ... ... 0 0111 0 1 . 1 ... 0 @2_shl_h
|
|
|
|
VQSHLI_S 111 0 1111 1 . ... ... ... 0 0111 0 1 . 1 ... 0 @2_shl_w
|
|
|
|
|
|
|
|
VQSHLI_U 111 1 1111 1 . ... ... ... 0 0111 0 1 . 1 ... 0 @2_shl_b
|
|
|
|
VQSHLI_U 111 1 1111 1 . ... ... ... 0 0111 0 1 . 1 ... 0 @2_shl_h
|
|
|
|
VQSHLI_U 111 1 1111 1 . ... ... ... 0 0111 0 1 . 1 ... 0 @2_shl_w
|
|
|
|
|
|
|
|
VQSHLUI 111 1 1111 1 . ... ... ... 0 0110 0 1 . 1 ... 0 @2_shl_b
|
|
|
|
VQSHLUI 111 1 1111 1 . ... ... ... 0 0110 0 1 . 1 ... 0 @2_shl_h
|
|
|
|
VQSHLUI 111 1 1111 1 . ... ... ... 0 0110 0 1 . 1 ... 0 @2_shl_w
|
2021-06-28 15:58:25 +02:00
|
|
|
|
|
|
|
VSHRI_S 111 0 1111 1 . ... ... ... 0 0000 0 1 . 1 ... 0 @2_shr_b
|
|
|
|
VSHRI_S 111 0 1111 1 . ... ... ... 0 0000 0 1 . 1 ... 0 @2_shr_h
|
|
|
|
VSHRI_S 111 0 1111 1 . ... ... ... 0 0000 0 1 . 1 ... 0 @2_shr_w
|
|
|
|
|
|
|
|
VSHRI_U 111 1 1111 1 . ... ... ... 0 0000 0 1 . 1 ... 0 @2_shr_b
|
|
|
|
VSHRI_U 111 1 1111 1 . ... ... ... 0 0000 0 1 . 1 ... 0 @2_shr_h
|
|
|
|
VSHRI_U 111 1 1111 1 . ... ... ... 0 0000 0 1 . 1 ... 0 @2_shr_w
|
|
|
|
|
|
|
|
VRSHRI_S 111 0 1111 1 . ... ... ... 0 0010 0 1 . 1 ... 0 @2_shr_b
|
|
|
|
VRSHRI_S 111 0 1111 1 . ... ... ... 0 0010 0 1 . 1 ... 0 @2_shr_h
|
|
|
|
VRSHRI_S 111 0 1111 1 . ... ... ... 0 0010 0 1 . 1 ... 0 @2_shr_w
|
|
|
|
|
|
|
|
VRSHRI_U 111 1 1111 1 . ... ... ... 0 0010 0 1 . 1 ... 0 @2_shr_b
|
|
|
|
VRSHRI_U 111 1 1111 1 . ... ... ... 0 0010 0 1 . 1 ... 0 @2_shr_h
|
|
|
|
VRSHRI_U 111 1 1111 1 . ... ... ... 0 0010 0 1 . 1 ... 0 @2_shr_w
|
2021-06-28 15:58:26 +02:00
|
|
|
|
|
|
|
# VSHLL T1 encoding; the T2 VSHLL encoding is elsewhere in this file
|
2021-08-13 18:11:46 +02:00
|
|
|
# Note that VMOVL is encoded as "VSHLL with a zero shift count"; we
|
|
|
|
# implement it that way rather than special-casing it in the decode.
|
2021-06-28 15:58:26 +02:00
|
|
|
VSHLL_BS 111 0 1110 1 . 1 .. ... ... 0 1111 0 1 . 0 ... 0 @2_shll_b
|
|
|
|
VSHLL_BS 111 0 1110 1 . 1 .. ... ... 0 1111 0 1 . 0 ... 0 @2_shll_h
|
|
|
|
|
|
|
|
VSHLL_BU 111 1 1110 1 . 1 .. ... ... 0 1111 0 1 . 0 ... 0 @2_shll_b
|
|
|
|
VSHLL_BU 111 1 1110 1 . 1 .. ... ... 0 1111 0 1 . 0 ... 0 @2_shll_h
|
|
|
|
|
|
|
|
VSHLL_TS 111 0 1110 1 . 1 .. ... ... 1 1111 0 1 . 0 ... 0 @2_shll_b
|
|
|
|
VSHLL_TS 111 0 1110 1 . 1 .. ... ... 1 1111 0 1 . 0 ... 0 @2_shll_h
|
|
|
|
|
|
|
|
VSHLL_TU 111 1 1110 1 . 1 .. ... ... 1 1111 0 1 . 0 ... 0 @2_shll_b
|
|
|
|
VSHLL_TU 111 1 1110 1 . 1 .. ... ... 1 1111 0 1 . 0 ... 0 @2_shll_h
|
2021-06-28 15:58:27 +02:00
|
|
|
|
|
|
|
# Shift-and-insert
|
|
|
|
VSRI 111 1 1111 1 . ... ... ... 0 0100 0 1 . 1 ... 0 @2_shr_b
|
|
|
|
VSRI 111 1 1111 1 . ... ... ... 0 0100 0 1 . 1 ... 0 @2_shr_h
|
|
|
|
VSRI 111 1 1111 1 . ... ... ... 0 0100 0 1 . 1 ... 0 @2_shr_w
|
|
|
|
|
|
|
|
VSLI 111 1 1111 1 . ... ... ... 0 0101 0 1 . 1 ... 0 @2_shl_b
|
|
|
|
VSLI 111 1 1111 1 . ... ... ... 0 0101 0 1 . 1 ... 0 @2_shl_h
|
|
|
|
VSLI 111 1 1111 1 . ... ... ... 0 0101 0 1 . 1 ... 0 @2_shl_w
|
2021-06-28 15:58:28 +02:00
|
|
|
|
|
|
|
# Narrowing shifts (which only support b and h sizes)
|
|
|
|
VSHRNB 111 0 1110 1 . ... ... ... 0 1111 1 1 . 0 ... 1 @2_shr_b
|
|
|
|
VSHRNB 111 0 1110 1 . ... ... ... 0 1111 1 1 . 0 ... 1 @2_shr_h
|
|
|
|
VSHRNT 111 0 1110 1 . ... ... ... 1 1111 1 1 . 0 ... 1 @2_shr_b
|
|
|
|
VSHRNT 111 0 1110 1 . ... ... ... 1 1111 1 1 . 0 ... 1 @2_shr_h
|
|
|
|
|
|
|
|
VRSHRNB 111 1 1110 1 . ... ... ... 0 1111 1 1 . 0 ... 1 @2_shr_b
|
|
|
|
VRSHRNB 111 1 1110 1 . ... ... ... 0 1111 1 1 . 0 ... 1 @2_shr_h
|
|
|
|
VRSHRNT 111 1 1110 1 . ... ... ... 1 1111 1 1 . 0 ... 1 @2_shr_b
|
|
|
|
VRSHRNT 111 1 1110 1 . ... ... ... 1 1111 1 1 . 0 ... 1 @2_shr_h
|
2021-06-28 15:58:29 +02:00
|
|
|
|
|
|
|
VQSHRNB_S 111 0 1110 1 . ... ... ... 0 1111 0 1 . 0 ... 0 @2_shr_b
|
|
|
|
VQSHRNB_S 111 0 1110 1 . ... ... ... 0 1111 0 1 . 0 ... 0 @2_shr_h
|
|
|
|
VQSHRNT_S 111 0 1110 1 . ... ... ... 1 1111 0 1 . 0 ... 0 @2_shr_b
|
|
|
|
VQSHRNT_S 111 0 1110 1 . ... ... ... 1 1111 0 1 . 0 ... 0 @2_shr_h
|
|
|
|
VQSHRNB_U 111 1 1110 1 . ... ... ... 0 1111 0 1 . 0 ... 0 @2_shr_b
|
|
|
|
VQSHRNB_U 111 1 1110 1 . ... ... ... 0 1111 0 1 . 0 ... 0 @2_shr_h
|
|
|
|
VQSHRNT_U 111 1 1110 1 . ... ... ... 1 1111 0 1 . 0 ... 0 @2_shr_b
|
|
|
|
VQSHRNT_U 111 1 1110 1 . ... ... ... 1 1111 0 1 . 0 ... 0 @2_shr_h
|
|
|
|
|
|
|
|
VQSHRUNB 111 0 1110 1 . ... ... ... 0 1111 1 1 . 0 ... 0 @2_shr_b
|
|
|
|
VQSHRUNB 111 0 1110 1 . ... ... ... 0 1111 1 1 . 0 ... 0 @2_shr_h
|
|
|
|
VQSHRUNT 111 0 1110 1 . ... ... ... 1 1111 1 1 . 0 ... 0 @2_shr_b
|
|
|
|
VQSHRUNT 111 0 1110 1 . ... ... ... 1 1111 1 1 . 0 ... 0 @2_shr_h
|
|
|
|
|
|
|
|
VQRSHRNB_S 111 0 1110 1 . ... ... ... 0 1111 0 1 . 0 ... 1 @2_shr_b
|
|
|
|
VQRSHRNB_S 111 0 1110 1 . ... ... ... 0 1111 0 1 . 0 ... 1 @2_shr_h
|
|
|
|
VQRSHRNT_S 111 0 1110 1 . ... ... ... 1 1111 0 1 . 0 ... 1 @2_shr_b
|
|
|
|
VQRSHRNT_S 111 0 1110 1 . ... ... ... 1 1111 0 1 . 0 ... 1 @2_shr_h
|
|
|
|
VQRSHRNB_U 111 1 1110 1 . ... ... ... 0 1111 0 1 . 0 ... 1 @2_shr_b
|
|
|
|
VQRSHRNB_U 111 1 1110 1 . ... ... ... 0 1111 0 1 . 0 ... 1 @2_shr_h
|
|
|
|
VQRSHRNT_U 111 1 1110 1 . ... ... ... 1 1111 0 1 . 0 ... 1 @2_shr_b
|
|
|
|
VQRSHRNT_U 111 1 1110 1 . ... ... ... 1 1111 0 1 . 0 ... 1 @2_shr_h
|
|
|
|
|
|
|
|
VQRSHRUNB 111 1 1110 1 . ... ... ... 0 1111 1 1 . 0 ... 0 @2_shr_b
|
|
|
|
VQRSHRUNB 111 1 1110 1 . ... ... ... 0 1111 1 1 . 0 ... 0 @2_shr_h
|
|
|
|
VQRSHRUNT 111 1 1110 1 . ... ... ... 1 1111 1 1 . 0 ... 0 @2_shr_b
|
|
|
|
VQRSHRUNT 111 1 1110 1 . ... ... ... 1 1111 1 1 . 0 ... 0 @2_shr_h
|
2021-06-28 15:58:30 +02:00
|
|
|
|
|
|
|
VSHLC 111 0 1110 1 . 1 imm:5 ... 0 1111 1100 rdm:4 qd=%qd
|
2021-08-13 18:11:51 +02:00
|
|
|
|
|
|
|
# Comparisons. We expand out the conditions which are split across
|
|
|
|
# encodings T1, T2, T3 and the fc bits. These include VPT, which is
|
|
|
|
# effectively "VCMP then VPST". A plain "VCMP" has a mask field of zero.
|
|
|
|
VCMPEQ 1111 1110 0 . .. ... 1 ... 0 1111 0 0 . 0 ... 0 @vcmp
|
|
|
|
VCMPNE 1111 1110 0 . .. ... 1 ... 0 1111 1 0 . 0 ... 0 @vcmp
|
2021-08-13 18:11:51 +02:00
|
|
|
{
|
|
|
|
VPSEL 1111 1110 0 . 11 ... 1 ... 0 1111 . 0 . 0 ... 1 @2op_nosz
|
|
|
|
VCMPCS 1111 1110 0 . .. ... 1 ... 0 1111 0 0 . 0 ... 1 @vcmp
|
|
|
|
VCMPHI 1111 1110 0 . .. ... 1 ... 0 1111 1 0 . 0 ... 1 @vcmp
|
|
|
|
}
|
2021-08-13 18:11:51 +02:00
|
|
|
VCMPGE 1111 1110 0 . .. ... 1 ... 1 1111 0 0 . 0 ... 0 @vcmp
|
|
|
|
VCMPLT 1111 1110 0 . .. ... 1 ... 1 1111 1 0 . 0 ... 0 @vcmp
|
|
|
|
VCMPGT 1111 1110 0 . .. ... 1 ... 1 1111 0 0 . 0 ... 1 @vcmp
|
|
|
|
VCMPLE 1111 1110 0 . .. ... 1 ... 1 1111 1 0 . 0 ... 1 @vcmp
|
2021-08-13 18:11:51 +02:00
|
|
|
|
|
|
|
{
|
|
|
|
VPST 1111 1110 0 . 11 000 1 ... 0 1111 0100 1101 mask=%mask_22_13
|
|
|
|
VCMPEQ_scalar 1111 1110 0 . .. ... 1 ... 0 1111 0 1 0 0 .... @vcmp_scalar
|
|
|
|
}
|
|
|
|
VCMPNE_scalar 1111 1110 0 . .. ... 1 ... 0 1111 1 1 0 0 .... @vcmp_scalar
|
|
|
|
VCMPCS_scalar 1111 1110 0 . .. ... 1 ... 0 1111 0 1 1 0 .... @vcmp_scalar
|
|
|
|
VCMPHI_scalar 1111 1110 0 . .. ... 1 ... 0 1111 1 1 1 0 .... @vcmp_scalar
|
|
|
|
VCMPGE_scalar 1111 1110 0 . .. ... 1 ... 1 1111 0 1 0 0 .... @vcmp_scalar
|
|
|
|
VCMPLT_scalar 1111 1110 0 . .. ... 1 ... 1 1111 1 1 0 0 .... @vcmp_scalar
|
|
|
|
VCMPGT_scalar 1111 1110 0 . .. ... 1 ... 1 1111 0 1 1 0 .... @vcmp_scalar
|
|
|
|
VCMPLE_scalar 1111 1110 0 . .. ... 1 ... 1 1111 1 1 1 0 .... @vcmp_scalar
|