HPI.py revision 12149
112149Sashkan.tousimojarad@arm.com# Copyright (c) 2014-2017 ARM Limited
212149Sashkan.tousimojarad@arm.com# All rights reserved.
312149Sashkan.tousimojarad@arm.com#
412149Sashkan.tousimojarad@arm.com# The license below extends only to copyright in the software and shall
512149Sashkan.tousimojarad@arm.com# not be construed as granting a license to any other intellectual
612149Sashkan.tousimojarad@arm.com# property including but not limited to intellectual property relating
712149Sashkan.tousimojarad@arm.com# to a hardware implementation of the functionality of the software
812149Sashkan.tousimojarad@arm.com# licensed hereunder.  You may use the software subject to the license
912149Sashkan.tousimojarad@arm.com# terms below provided that you ensure that this notice is replicated
1012149Sashkan.tousimojarad@arm.com# unmodified and in its entirety in all distributions of the software,
1112149Sashkan.tousimojarad@arm.com# modified or unmodified, in source code or in binary form.
1212149Sashkan.tousimojarad@arm.com#
1312149Sashkan.tousimojarad@arm.com# Redistribution and use in source and binary forms, with or without
1412149Sashkan.tousimojarad@arm.com# modification, are permitted provided that the following conditions are
1512149Sashkan.tousimojarad@arm.com# met: redistributions of source code must retain the above copyright
1612149Sashkan.tousimojarad@arm.com# notice, this list of conditions and the following disclaimer;
1712149Sashkan.tousimojarad@arm.com# redistributions in binary form must reproduce the above copyright
1812149Sashkan.tousimojarad@arm.com# notice, this list of conditions and the following disclaimer in the
1912149Sashkan.tousimojarad@arm.com# documentation and/or other materials provided with the distribution;
2012149Sashkan.tousimojarad@arm.com# neither the name of the copyright holders nor the names of its
2112149Sashkan.tousimojarad@arm.com# contributors may be used to endorse or promote products derived from
2212149Sashkan.tousimojarad@arm.com# this software without specific prior written permission.
2312149Sashkan.tousimojarad@arm.com#
2412149Sashkan.tousimojarad@arm.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2512149Sashkan.tousimojarad@arm.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2612149Sashkan.tousimojarad@arm.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2712149Sashkan.tousimojarad@arm.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2812149Sashkan.tousimojarad@arm.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2912149Sashkan.tousimojarad@arm.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3012149Sashkan.tousimojarad@arm.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3112149Sashkan.tousimojarad@arm.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3212149Sashkan.tousimojarad@arm.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3312149Sashkan.tousimojarad@arm.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3412149Sashkan.tousimojarad@arm.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3512149Sashkan.tousimojarad@arm.com#
3612149Sashkan.tousimojarad@arm.com# Authors: Andrew Bardsley
3712149Sashkan.tousimojarad@arm.com#
3812149Sashkan.tousimojarad@arm.com
3912149Sashkan.tousimojarad@arm.com"""The High-Performance In-order (HPI) CPU timing model is tuned to be
4012149Sashkan.tousimojarad@arm.comrepresentative of a modern in-order ARMv8-A implementation. The HPI
4112149Sashkan.tousimojarad@arm.comcore and its supporting simulation scripts, namely starter_se.py and
4212149Sashkan.tousimojarad@arm.comstarter_fs.py (under /configs/example/arm/) are part of the ARM
4312149Sashkan.tousimojarad@arm.comResearch Starter Kit on System Modeling. More information can be found
4412149Sashkan.tousimojarad@arm.comat: http://www.arm.com/ResearchEnablement/SystemModeling
4512149Sashkan.tousimojarad@arm.com
4612149Sashkan.tousimojarad@arm.com"""
4712149Sashkan.tousimojarad@arm.com
4812149Sashkan.tousimojarad@arm.comfrom m5.objects import *
4912149Sashkan.tousimojarad@arm.com
5012149Sashkan.tousimojarad@arm.com# Simple function to allow a string of [01x_] to be converted into a
5112149Sashkan.tousimojarad@arm.com# mask and value for use with MinorFUTiming
5212149Sashkan.tousimojarad@arm.comdef make_implicant(implicant_string):
5312149Sashkan.tousimojarad@arm.com    ret_mask = 0
5412149Sashkan.tousimojarad@arm.com    ret_match = 0
5512149Sashkan.tousimojarad@arm.com
5612149Sashkan.tousimojarad@arm.com    shift = False
5712149Sashkan.tousimojarad@arm.com    for char in implicant_string:
5812149Sashkan.tousimojarad@arm.com        char = char.lower()
5912149Sashkan.tousimojarad@arm.com        if shift:
6012149Sashkan.tousimojarad@arm.com            ret_mask <<= 1
6112149Sashkan.tousimojarad@arm.com            ret_match <<= 1
6212149Sashkan.tousimojarad@arm.com
6312149Sashkan.tousimojarad@arm.com        shift = True
6412149Sashkan.tousimojarad@arm.com        if char == '_':
6512149Sashkan.tousimojarad@arm.com            shift = False
6612149Sashkan.tousimojarad@arm.com        elif char == '0':
6712149Sashkan.tousimojarad@arm.com            ret_mask |= 1
6812149Sashkan.tousimojarad@arm.com        elif char == '1':
6912149Sashkan.tousimojarad@arm.com            ret_mask |= 1
7012149Sashkan.tousimojarad@arm.com            ret_match |= 1
7112149Sashkan.tousimojarad@arm.com        elif char == 'x':
7212149Sashkan.tousimojarad@arm.com            pass
7312149Sashkan.tousimojarad@arm.com        else:
7412149Sashkan.tousimojarad@arm.com            print "Can't parse implicant character", char
7512149Sashkan.tousimojarad@arm.com
7612149Sashkan.tousimojarad@arm.com    return (ret_mask, ret_match)
7712149Sashkan.tousimojarad@arm.com
7812149Sashkan.tousimojarad@arm.com#                          ,----- 36 thumb
7912149Sashkan.tousimojarad@arm.com#                          | ,--- 35 bigThumb
8012149Sashkan.tousimojarad@arm.com#                          | |,-- 34 aarch64
8112149Sashkan.tousimojarad@arm.coma64_inst = make_implicant('0_01xx__xxxx_xxxx_xxxx_xxxx__xxxx_xxxx_xxxx_xxxx')
8212149Sashkan.tousimojarad@arm.coma32_inst = make_implicant('0_00xx__xxxx_xxxx_xxxx_xxxx__xxxx_xxxx_xxxx_xxxx')
8312149Sashkan.tousimojarad@arm.comt32_inst = make_implicant('1_10xx__xxxx_xxxx_xxxx_xxxx__xxxx_xxxx_xxxx_xxxx')
8412149Sashkan.tousimojarad@arm.comt16_inst = make_implicant('1_00xx__xxxx_xxxx_xxxx_xxxx__xxxx_xxxx_xxxx_xxxx')
8512149Sashkan.tousimojarad@arm.comany_inst = make_implicant('x_xxxx__xxxx_xxxx_xxxx_xxxx__xxxx_xxxx_xxxx_xxxx')
8612149Sashkan.tousimojarad@arm.com#                          | ||
8712149Sashkan.tousimojarad@arm.comany_a64_inst = \
8812149Sashkan.tousimojarad@arm.com           make_implicant('x_x1xx__xxxx_xxxx_xxxx_xxxx__xxxx_xxxx_xxxx_xxxx')
8912149Sashkan.tousimojarad@arm.comany_non_a64_inst = \
9012149Sashkan.tousimojarad@arm.com           make_implicant('x_x0xx__xxxx_xxxx_xxxx_xxxx__xxxx_xxxx_xxxx_xxxx')
9112149Sashkan.tousimojarad@arm.com
9212149Sashkan.tousimojarad@arm.comdef encode_opcode(pattern):
9312149Sashkan.tousimojarad@arm.com    def encode(opcode_string):
9412149Sashkan.tousimojarad@arm.com        a64_mask, a64_match = pattern
9512149Sashkan.tousimojarad@arm.com        mask, match = make_implicant(opcode_string)
9612149Sashkan.tousimojarad@arm.com        return (a64_mask | mask), (a64_match | match)
9712149Sashkan.tousimojarad@arm.com    return encode
9812149Sashkan.tousimojarad@arm.com
9912149Sashkan.tousimojarad@arm.coma64_opcode = encode_opcode(a64_inst)
10012149Sashkan.tousimojarad@arm.coma32_opcode = encode_opcode(a32_inst)
10112149Sashkan.tousimojarad@arm.comt32_opcode = encode_opcode(t32_inst)
10212149Sashkan.tousimojarad@arm.comt16_opcode = encode_opcode(t16_inst)
10312149Sashkan.tousimojarad@arm.com
10412149Sashkan.tousimojarad@arm.com# These definitions (in some form) should probably be part of TimingExpr
10512149Sashkan.tousimojarad@arm.com
10612149Sashkan.tousimojarad@arm.comdef literal(value):
10712149Sashkan.tousimojarad@arm.com    def body(env):
10812149Sashkan.tousimojarad@arm.com        ret = TimingExprLiteral()
10912149Sashkan.tousimojarad@arm.com        ret.value = value
11012149Sashkan.tousimojarad@arm.com        return ret
11112149Sashkan.tousimojarad@arm.com    return body
11212149Sashkan.tousimojarad@arm.com
11312149Sashkan.tousimojarad@arm.comdef bin(op, left, right):
11412149Sashkan.tousimojarad@arm.com    def body(env):
11512149Sashkan.tousimojarad@arm.com        ret = TimingExprBin()
11612149Sashkan.tousimojarad@arm.com        ret.op = 'timingExpr' + op
11712149Sashkan.tousimojarad@arm.com        ret.left = left(env)
11812149Sashkan.tousimojarad@arm.com        ret.right = right(env)
11912149Sashkan.tousimojarad@arm.com        return ret
12012149Sashkan.tousimojarad@arm.com    return body
12112149Sashkan.tousimojarad@arm.com
12212149Sashkan.tousimojarad@arm.comdef un(op, arg):
12312149Sashkan.tousimojarad@arm.com    def body(env):
12412149Sashkan.tousimojarad@arm.com        ret = TimingExprUn()
12512149Sashkan.tousimojarad@arm.com        ret.op = 'timingExpr' + op
12612149Sashkan.tousimojarad@arm.com        ret.arg = arg(env)
12712149Sashkan.tousimojarad@arm.com        return ret
12812149Sashkan.tousimojarad@arm.com    return body
12912149Sashkan.tousimojarad@arm.com
13012149Sashkan.tousimojarad@arm.comdef ref(name):
13112149Sashkan.tousimojarad@arm.com    def body(env):
13212149Sashkan.tousimojarad@arm.com        if name in env:
13312149Sashkan.tousimojarad@arm.com            ret = TimingExprRef()
13412149Sashkan.tousimojarad@arm.com            ret.index = env[name]
13512149Sashkan.tousimojarad@arm.com        else:
13612149Sashkan.tousimojarad@arm.com            print "Invalid expression name", name
13712149Sashkan.tousimojarad@arm.com            ret = TimingExprNull()
13812149Sashkan.tousimojarad@arm.com        return ret
13912149Sashkan.tousimojarad@arm.com    return body
14012149Sashkan.tousimojarad@arm.com
14112149Sashkan.tousimojarad@arm.comdef if_expr(cond, true_expr, false_expr):
14212149Sashkan.tousimojarad@arm.com    def body(env):
14312149Sashkan.tousimojarad@arm.com        ret = TimingExprIf()
14412149Sashkan.tousimojarad@arm.com        ret.cond = cond(env)
14512149Sashkan.tousimojarad@arm.com        ret.trueExpr = true_expr(env)
14612149Sashkan.tousimojarad@arm.com        ret.falseExpr = false_expr(env)
14712149Sashkan.tousimojarad@arm.com        return ret
14812149Sashkan.tousimojarad@arm.com    return body
14912149Sashkan.tousimojarad@arm.com
15012149Sashkan.tousimojarad@arm.comdef src(index):
15112149Sashkan.tousimojarad@arm.com    def body(env):
15212149Sashkan.tousimojarad@arm.com        ret = TimingExprSrcReg()
15312149Sashkan.tousimojarad@arm.com        ret.index = index
15412149Sashkan.tousimojarad@arm.com        return ret
15512149Sashkan.tousimojarad@arm.com    return body
15612149Sashkan.tousimojarad@arm.com
15712149Sashkan.tousimojarad@arm.comdef int_reg(reg):
15812149Sashkan.tousimojarad@arm.com    def body(env):
15912149Sashkan.tousimojarad@arm.com        ret = TimingExprReadIntReg()
16012149Sashkan.tousimojarad@arm.com        ret.reg = reg(env)
16112149Sashkan.tousimojarad@arm.com        return ret
16212149Sashkan.tousimojarad@arm.com    return body
16312149Sashkan.tousimojarad@arm.com
16412149Sashkan.tousimojarad@arm.comdef let(bindings, expr):
16512149Sashkan.tousimojarad@arm.com    def body(env):
16612149Sashkan.tousimojarad@arm.com        ret = TimingExprLet()
16712149Sashkan.tousimojarad@arm.com        let_bindings = []
16812149Sashkan.tousimojarad@arm.com        new_env = {}
16912149Sashkan.tousimojarad@arm.com        i = 0
17012149Sashkan.tousimojarad@arm.com
17112149Sashkan.tousimojarad@arm.com        # Make the sub-expression as null to start with
17212149Sashkan.tousimojarad@arm.com        for name, binding in bindings:
17312149Sashkan.tousimojarad@arm.com            new_env[name] = i
17412149Sashkan.tousimojarad@arm.com            i += 1
17512149Sashkan.tousimojarad@arm.com
17612149Sashkan.tousimojarad@arm.com        defns = []
17712149Sashkan.tousimojarad@arm.com        # Then apply them to the produced new env
17812149Sashkan.tousimojarad@arm.com        for i in xrange(0, len(bindings)):
17912149Sashkan.tousimojarad@arm.com            name, binding_expr = bindings[i]
18012149Sashkan.tousimojarad@arm.com            defns.append(binding_expr(new_env))
18112149Sashkan.tousimojarad@arm.com
18212149Sashkan.tousimojarad@arm.com        ret.defns = defns
18312149Sashkan.tousimojarad@arm.com        ret.expr = expr(new_env)
18412149Sashkan.tousimojarad@arm.com
18512149Sashkan.tousimojarad@arm.com        return ret
18612149Sashkan.tousimojarad@arm.com    return body
18712149Sashkan.tousimojarad@arm.com
18812149Sashkan.tousimojarad@arm.comdef expr_top(expr):
18912149Sashkan.tousimojarad@arm.com    return expr([])
19012149Sashkan.tousimojarad@arm.com
19112149Sashkan.tousimojarad@arm.comclass HPI_DefaultInt(MinorFUTiming):
19212149Sashkan.tousimojarad@arm.com    description = 'HPI_DefaultInt'
19312149Sashkan.tousimojarad@arm.com    mask, match = any_non_a64_inst
19412149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [3, 3, 2, 2, 2, 1, 0]
19512149Sashkan.tousimojarad@arm.com
19612149Sashkan.tousimojarad@arm.comclass HPI_DefaultA64Int(MinorFUTiming):
19712149Sashkan.tousimojarad@arm.com    description = 'HPI_DefaultA64Int'
19812149Sashkan.tousimojarad@arm.com    mask, match = any_a64_inst
19912149Sashkan.tousimojarad@arm.com    # r, l, (c)
20012149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [2, 2, 2, 0]
20112149Sashkan.tousimojarad@arm.com
20212149Sashkan.tousimojarad@arm.comclass HPI_DefaultMul(MinorFUTiming):
20312149Sashkan.tousimojarad@arm.com    description = 'HPI_DefaultMul'
20412149Sashkan.tousimojarad@arm.com    mask, match = any_non_a64_inst
20512149Sashkan.tousimojarad@arm.com    # f, f, f, r, l, a?
20612149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0, 0]
20712149Sashkan.tousimojarad@arm.com
20812149Sashkan.tousimojarad@arm.comclass HPI_DefaultA64Mul(MinorFUTiming):
20912149Sashkan.tousimojarad@arm.com    description = 'HPI_DefaultA64Mul'
21012149Sashkan.tousimojarad@arm.com    mask, match = any_a64_inst
21112149Sashkan.tousimojarad@arm.com    # a (zr for mul), l, r
21212149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0]
21312149Sashkan.tousimojarad@arm.com    # extraCommitLat = 1
21412149Sashkan.tousimojarad@arm.com
21512149Sashkan.tousimojarad@arm.comclass HPI_DefaultVfp(MinorFUTiming):
21612149Sashkan.tousimojarad@arm.com    description = 'HPI_DefaultVfp'
21712149Sashkan.tousimojarad@arm.com    mask, match = any_non_a64_inst
21812149Sashkan.tousimojarad@arm.com    # cpsr, z, z, z, cpacr, fpexc, l_lo, r_lo, l_hi, r_hi (from vadd2h)
21912149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [5, 5, 5, 5, 5, 5,  2, 2, 2, 2, 2, 2, 2, 2, 0]
22012149Sashkan.tousimojarad@arm.com
22112149Sashkan.tousimojarad@arm.comclass HPI_DefaultA64Vfp(MinorFUTiming):
22212149Sashkan.tousimojarad@arm.com    description = 'HPI_DefaultA64Vfp'
22312149Sashkan.tousimojarad@arm.com    mask, match = any_a64_inst
22412149Sashkan.tousimojarad@arm.com    # cpsr, cpacr_el1, fpscr_exc, ...
22512149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [5, 5, 5, 2]
22612149Sashkan.tousimojarad@arm.com
22712149Sashkan.tousimojarad@arm.comclass HPI_FMADD_A64(MinorFUTiming):
22812149Sashkan.tousimojarad@arm.com    description = 'HPI_FMADD_A64'
22912149Sashkan.tousimojarad@arm.com    mask, match = a64_opcode('0001_1111_0x0x_xxxx__0xxx_xxxx_xxxx_xxxx')
23012149Sashkan.tousimojarad@arm.com    #                                    t
23112149Sashkan.tousimojarad@arm.com    # cpsr, cpacr_el1, fpscr_exc, 1, 1, 2, 2, 3, 3, fpscr_exc, d, d, d, d
23212149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [5, 5, 5,  0, 0,  0, 0,  1, 1,  0,  0, 0, 0, 0]
23312149Sashkan.tousimojarad@arm.com
23412149Sashkan.tousimojarad@arm.comclass HPI_FMSUB_D_A64(MinorFUTiming):
23512149Sashkan.tousimojarad@arm.com    description = 'HPI_FMSUB_D_A64'
23612149Sashkan.tousimojarad@arm.com    mask, match = a64_opcode('0001_1111_0x0x_xxxx__1xxx_xxxx_xxxx_xxxx')
23712149Sashkan.tousimojarad@arm.com    #                                    t
23812149Sashkan.tousimojarad@arm.com    # cpsr, cpacr_el1, fpscr_exc, 1, 1, 2, 2, 3, 3, fpscr_exc, d, d, d, d
23912149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [5, 5, 5,  0, 0,  0, 0,  1, 1,  0,  0, 0, 0, 0]
24012149Sashkan.tousimojarad@arm.com
24112149Sashkan.tousimojarad@arm.comclass HPI_FMOV_A64(MinorFUTiming):
24212149Sashkan.tousimojarad@arm.com    description = 'HPI_FMOV_A64'
24312149Sashkan.tousimojarad@arm.com    mask, match = a64_opcode('0001_1110_0x10_0000__0100_00xx_xxxx_xxxx')
24412149Sashkan.tousimojarad@arm.com    # cpsr, cpacr_el1, fpscr_exc, 1, 1, 2, 2, 3, 3, fpscr_exc, d, d, d, d
24512149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [5, 5, 5, 0]
24612149Sashkan.tousimojarad@arm.com
24712149Sashkan.tousimojarad@arm.comclass HPI_ADD_SUB_vector_scalar_A64(MinorFUTiming):
24812149Sashkan.tousimojarad@arm.com    description = 'HPI_ADD_SUB_vector_scalar_A64'
24912149Sashkan.tousimojarad@arm.com    mask, match = a64_opcode('01x1_1110_xx1x_xxxx__1000_01xx_xxxx_xxxx')
25012149Sashkan.tousimojarad@arm.com    # cpsr, z, z, z, cpacr, fpexc, l0, r0, l1, r1, l2, r2, l3, r3 (for vadd2h)
25112149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [5, 5, 5, 4]
25212149Sashkan.tousimojarad@arm.com
25312149Sashkan.tousimojarad@arm.com
25412149Sashkan.tousimojarad@arm.comclass HPI_ADD_SUB_vector_vector_A64(MinorFUTiming):
25512149Sashkan.tousimojarad@arm.com    description = 'HPI_ADD_SUB_vector_vector_A64'
25612149Sashkan.tousimojarad@arm.com    mask, match = a64_opcode('0xx0_1110_xx1x_xxxx__1000_01xx_xxxx_xxxx')
25712149Sashkan.tousimojarad@arm.com    # cpsr, z, z, z, cpacr, fpexc, l0, r0, l1, r1, l2, r2, l3, r3 (for vadd2h)
25812149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [5, 5, 5, 4]
25912149Sashkan.tousimojarad@arm.com
26012149Sashkan.tousimojarad@arm.comclass HPI_FDIV_scalar_32_A64(MinorFUTiming):
26112149Sashkan.tousimojarad@arm.com    description = 'HPI_FDIV_scalar_32_A64'
26212149Sashkan.tousimojarad@arm.com    mask, match = a64_opcode('0001_1110_001x_xxxx__0001_10xx_xxxx_xxxx')
26312149Sashkan.tousimojarad@arm.com    extraCommitLat = 6
26412149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 20,  4]
26512149Sashkan.tousimojarad@arm.com
26612149Sashkan.tousimojarad@arm.comclass HPI_FDIV_scalar_64_A64(MinorFUTiming):
26712149Sashkan.tousimojarad@arm.com    description = 'HPI_FDIV_scalar_64_A64'
26812149Sashkan.tousimojarad@arm.com    mask, match = a64_opcode('0001_1110_011x_xxxx__0001_10xx_xxxx_xxxx')
26912149Sashkan.tousimojarad@arm.com    extraCommitLat = 15
27012149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 20,  4]
27112149Sashkan.tousimojarad@arm.com
27212149Sashkan.tousimojarad@arm.com# CINC CINV CSEL CSET CSETM CSINC CSINC CSINV CSINV CSNEG
27312149Sashkan.tousimojarad@arm.comclass HPI_Cxxx_A64(MinorFUTiming):
27412149Sashkan.tousimojarad@arm.com    description = 'HPI_Cxxx_A64'
27512149Sashkan.tousimojarad@arm.com    mask, match = a64_opcode('xx01_1010_100x_xxxx_xxxx__0xxx_xxxx_xxxx')
27612149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [3, 3, 3, 2, 2]
27712149Sashkan.tousimojarad@arm.com
27812149Sashkan.tousimojarad@arm.comclass HPI_DefaultMem(MinorFUTiming):
27912149Sashkan.tousimojarad@arm.com    description = 'HPI_DefaultMem'
28012149Sashkan.tousimojarad@arm.com    mask, match = any_non_a64_inst
28112149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [1, 1, 1, 1, 1, 2]
28212149Sashkan.tousimojarad@arm.com    # Assume that LDR/STR take 2 cycles for resolving dependencies
28312149Sashkan.tousimojarad@arm.com    # (1 + 1 of the FU)
28412149Sashkan.tousimojarad@arm.com    extraAssumedLat = 2
28512149Sashkan.tousimojarad@arm.com
28612149Sashkan.tousimojarad@arm.comclass HPI_DefaultMem64(MinorFUTiming):
28712149Sashkan.tousimojarad@arm.com    description = 'HPI_DefaultMem64'
28812149Sashkan.tousimojarad@arm.com    mask, match = any_a64_inst
28912149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [2]
29012149Sashkan.tousimojarad@arm.com    # Assume that LDR/STR take 2 cycles for resolving dependencies
29112149Sashkan.tousimojarad@arm.com    # (1 + 1 of the FU)
29212149Sashkan.tousimojarad@arm.com    extraAssumedLat = 3
29312149Sashkan.tousimojarad@arm.com
29412149Sashkan.tousimojarad@arm.comclass HPI_DataProcessingMovShiftr(MinorFUTiming):
29512149Sashkan.tousimojarad@arm.com    description = 'HPI_DataProcessingMovShiftr'
29612149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0001_101x_xxxx__xxxx_xxxx_xxx1_xxxx')
29712149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [3, 3, 2, 2, 2, 1, 0]
29812149Sashkan.tousimojarad@arm.com
29912149Sashkan.tousimojarad@arm.comclass HPI_DataProcessingMayShift(MinorFUTiming):
30012149Sashkan.tousimojarad@arm.com    description = 'HPI_DataProcessingMayShift'
30112149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_000x_xxxx_xxxx__xxxx_xxxx_xxxx_xxxx')
30212149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [3, 3, 2, 2, 1, 1, 0]
30312149Sashkan.tousimojarad@arm.com
30412149Sashkan.tousimojarad@arm.comclass HPI_DataProcessingNoShift(MinorFUTiming):
30512149Sashkan.tousimojarad@arm.com    description = 'HPI_DataProcessingNoShift'
30612149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_000x_xxxx_xxxx__xxxx_0000_0xx0_xxxx')
30712149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [3, 3, 2, 2, 2, 1, 0]
30812149Sashkan.tousimojarad@arm.com
30912149Sashkan.tousimojarad@arm.comclass HPI_DataProcessingAllowShifti(MinorFUTiming):
31012149Sashkan.tousimojarad@arm.com    description = 'HPI_DataProcessingAllowShifti'
31112149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_000x_xxxx_xxxx__xxxx_xxxx_xxx0_xxxx')
31212149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [3, 3, 2, 2, 1, 1, 0]
31312149Sashkan.tousimojarad@arm.com
31412149Sashkan.tousimojarad@arm.comclass HPI_DataProcessingSuppressShift(MinorFUTiming):
31512149Sashkan.tousimojarad@arm.com    description = 'HPI_DataProcessingSuppressShift'
31612149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_000x_xxxx_xxxx__xxxx_xxxx_xxxx_xxxx')
31712149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = []
31812149Sashkan.tousimojarad@arm.com    suppress = True
31912149Sashkan.tousimojarad@arm.com
32012149Sashkan.tousimojarad@arm.comclass HPI_DataProcessingSuppressBranch(MinorFUTiming):
32112149Sashkan.tousimojarad@arm.com    description = 'HPI_DataProcessingSuppressBranch'
32212149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_1010_xxxx_xxxx__xxxx_xxxx_xxxx_xxxx')
32312149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = []
32412149Sashkan.tousimojarad@arm.com    suppress = True
32512149Sashkan.tousimojarad@arm.com
32612149Sashkan.tousimojarad@arm.comclass HPI_BFI_T1(MinorFUTiming):
32712149Sashkan.tousimojarad@arm.com    description = 'HPI_BFI_T1'
32812149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_0x11_0110_xxxx__0xxx_xxxx_xxxx_xxxx')
32912149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 1, 1, 0]
33012149Sashkan.tousimojarad@arm.com
33112149Sashkan.tousimojarad@arm.comclass HPI_BFI_A1(MinorFUTiming):
33212149Sashkan.tousimojarad@arm.com    description = 'HPI_BFI_A1'
33312149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0111_110x_xxxx__xxxx_xxxx_x001_xxxx')
33412149Sashkan.tousimojarad@arm.com    # f, f, f, dest, src
33512149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 1, 1, 0]
33612149Sashkan.tousimojarad@arm.com
33712149Sashkan.tousimojarad@arm.comclass HPI_CLZ_T1(MinorFUTiming):
33812149Sashkan.tousimojarad@arm.com    description = 'HPI_CLZ_T1'
33912149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1010_1011_xxxx__1111_xxxx_1000_xxxx')
34012149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [3, 3, 2, 2, 2, 1, 0]
34112149Sashkan.tousimojarad@arm.com
34212149Sashkan.tousimojarad@arm.comclass HPI_CLZ_A1(MinorFUTiming):
34312149Sashkan.tousimojarad@arm.com    description = 'HPI_CLZ_A1'
34412149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0001_0110_xxxx__xxxx_xxxx_0001_xxxx')
34512149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [3, 3, 2, 2, 2, 1, 0]
34612149Sashkan.tousimojarad@arm.com
34712149Sashkan.tousimojarad@arm.comclass HPI_CMN_immediate_A1(MinorFUTiming):
34812149Sashkan.tousimojarad@arm.com    description = 'HPI_CMN_immediate_A1'
34912149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0011_0111_xxxx__xxxx_xxxx_xxxx_xxxx')
35012149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [3, 3, 3, 2, 2, 3, 3, 3, 0]
35112149Sashkan.tousimojarad@arm.com
35212149Sashkan.tousimojarad@arm.comclass HPI_CMN_register_A1(MinorFUTiming):
35312149Sashkan.tousimojarad@arm.com    description = 'HPI_CMN_register_A1'
35412149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0001_0111_xxxx__xxxx_xxxx_xxx0_xxxx')
35512149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [3, 3, 3, 2, 2, 3, 3, 3, 0]
35612149Sashkan.tousimojarad@arm.com
35712149Sashkan.tousimojarad@arm.comclass HPI_CMP_immediate_A1(MinorFUTiming):
35812149Sashkan.tousimojarad@arm.com    description = 'HPI_CMP_immediate_A1'
35912149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0011_0101_xxxx__xxxx_xxxx_xxxx_xxxx')
36012149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [3, 3, 3, 2, 2, 3, 3, 3, 0]
36112149Sashkan.tousimojarad@arm.com
36212149Sashkan.tousimojarad@arm.comclass HPI_CMP_register_A1(MinorFUTiming):
36312149Sashkan.tousimojarad@arm.com    description = 'HPI_CMP_register_A1'
36412149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0001_0101_xxxx__xxxx_xxxx_xxx0_xxxx')
36512149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [3, 3, 3, 2, 2, 3, 3, 3, 0]
36612149Sashkan.tousimojarad@arm.com
36712149Sashkan.tousimojarad@arm.comclass HPI_MLA_T1(MinorFUTiming):
36812149Sashkan.tousimojarad@arm.com    description = 'HPI_MLA_T1'
36912149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1011_0000_xxxx__xxxx_xxxx_0000_xxxx')
37012149Sashkan.tousimojarad@arm.com    # z, z, z, a, l?, r?
37112149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 2, 0]
37212149Sashkan.tousimojarad@arm.com
37312149Sashkan.tousimojarad@arm.comclass HPI_MLA_A1(MinorFUTiming):
37412149Sashkan.tousimojarad@arm.com    description = 'HPI_MLA_A1'
37512149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0000_001x_xxxx__xxxx_xxxx_1001_xxxx')
37612149Sashkan.tousimojarad@arm.com    # z, z, z, a, l?, r?
37712149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 2, 0]
37812149Sashkan.tousimojarad@arm.com
37912149Sashkan.tousimojarad@arm.comclass HPI_MADD_A64(MinorFUTiming):
38012149Sashkan.tousimojarad@arm.com    description = 'HPI_MADD_A64'
38112149Sashkan.tousimojarad@arm.com    mask, match = a64_opcode('x001_1011_000x_xxxx__0xxx_xxxx_xxxx_xxxx')
38212149Sashkan.tousimojarad@arm.com    # a, l?, r?
38312149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [1, 1, 1, 0]
38412149Sashkan.tousimojarad@arm.com    extraCommitLat = 1
38512149Sashkan.tousimojarad@arm.com
38612149Sashkan.tousimojarad@arm.comclass HPI_MLS_T1(MinorFUTiming):
38712149Sashkan.tousimojarad@arm.com    description = 'HPI_MLS_T1'
38812149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1011_0000_xxxx__xxxx_xxxx_0001_xxxx')
38912149Sashkan.tousimojarad@arm.com    # z, z, z, l?, a, r?
39012149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 2, 0, 0, 0]
39112149Sashkan.tousimojarad@arm.com
39212149Sashkan.tousimojarad@arm.comclass HPI_MLS_A1(MinorFUTiming):
39312149Sashkan.tousimojarad@arm.com    description = 'HPI_MLS_A1'
39412149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0000_0110_xxxx__xxxx_xxxx_1001_xxxx')
39512149Sashkan.tousimojarad@arm.com    # z, z, z, l?, a, r?
39612149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 2, 0, 0, 0]
39712149Sashkan.tousimojarad@arm.com
39812149Sashkan.tousimojarad@arm.comclass HPI_MOVT_A1(MinorFUTiming):
39912149Sashkan.tousimojarad@arm.com    description = 'HPI_MOVT_A1'
40012149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('xxxx_0010_0100_xxxx__xxxx_xxxx_xxxx_xxxx')
40112149Sashkan.tousimojarad@arm.com
40212149Sashkan.tousimojarad@arm.comclass HPI_MUL_T1(MinorFUTiming):
40312149Sashkan.tousimojarad@arm.com    description = 'HPI_MUL_T1'
40412149Sashkan.tousimojarad@arm.com    mask, match = t16_opcode('0100_0011_01xx_xxxx')
40512149Sashkan.tousimojarad@arm.comclass HPI_MUL_T2(MinorFUTiming):
40612149Sashkan.tousimojarad@arm.com    description = 'HPI_MUL_T2'
40712149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1011_0000_xxxx_1111_xxxx_0000_xxxx')
40812149Sashkan.tousimojarad@arm.com
40912149Sashkan.tousimojarad@arm.comclass HPI_PKH_T1(MinorFUTiming):
41012149Sashkan.tousimojarad@arm.com    description = 'HPI_PKH_T1'
41112149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1110_1010_110x_xxxx__xxxx_xxxx_xxxx_xxxx')
41212149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 2, 1, 0]
41312149Sashkan.tousimojarad@arm.com
41412149Sashkan.tousimojarad@arm.comclass HPI_PKH_A1(MinorFUTiming):
41512149Sashkan.tousimojarad@arm.com    description = 'HPI_PKH_A1'
41612149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0110_1000_xxxx__xxxx_xxxx_xx01_xxxx')
41712149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 2, 1, 0]
41812149Sashkan.tousimojarad@arm.com
41912149Sashkan.tousimojarad@arm.comclass HPI_QADD_QSUB_T1(MinorFUTiming):
42012149Sashkan.tousimojarad@arm.com    description = 'HPI_QADD_QSUB_T1'
42112149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1010_1000_xxxx__1111_xxxx_10x0_xxxx')
42212149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 1, 1, 0]
42312149Sashkan.tousimojarad@arm.com
42412149Sashkan.tousimojarad@arm.comclass HPI_QADD_QSUB_A1(MinorFUTiming):
42512149Sashkan.tousimojarad@arm.com    description = 'HPI_QADD_QSUB_A1'
42612149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0001_00x0_xxxx__xxxx_xxxx_0101_xxxx')
42712149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 1, 1, 0]
42812149Sashkan.tousimojarad@arm.com
42912149Sashkan.tousimojarad@arm.com# T1 QADD16 QADD8 QSUB16 QSUB8 UQADD16 UQADD8 UQSUB16 UQSUB8
43012149Sashkan.tousimojarad@arm.comclass HPI_QADD_ETC_T1(MinorFUTiming):
43112149Sashkan.tousimojarad@arm.com    description = 'HPI_QADD_ETC_T1'
43212149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1010_1x0x_xxxx__1111_xxxx_0x01_xxxx')
43312149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 1, 1, 0]
43412149Sashkan.tousimojarad@arm.com
43512149Sashkan.tousimojarad@arm.com# A1 QADD16 QADD8 QSAX QSUB16 QSUB8 UQADD16 UQADD8 UQASX UQSAX UQSUB16 UQSUB8
43612149Sashkan.tousimojarad@arm.comclass HPI_QADD_ETC_A1(MinorFUTiming):
43712149Sashkan.tousimojarad@arm.com    description = 'HPI_QADD_ETC_A1'
43812149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0110_0x10_xxxx__xxxx_xxxx_xxx1_xxxx')
43912149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 1, 1, 0]
44012149Sashkan.tousimojarad@arm.com
44112149Sashkan.tousimojarad@arm.comclass HPI_QASX_QSAX_UQASX_UQSAX_T1(MinorFUTiming):
44212149Sashkan.tousimojarad@arm.com    description = 'HPI_QASX_QSAX_UQASX_UQSAX_T1'
44312149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1010_1x10_xxxx__1111_xxxx_0x01_xxxx')
44412149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 1, 1, 0]
44512149Sashkan.tousimojarad@arm.com
44612149Sashkan.tousimojarad@arm.comclass HPI_QDADD_QDSUB_T1(MinorFUTiming):
44712149Sashkan.tousimojarad@arm.com    description = 'HPI_QDADD_QDSUB_T1'
44812149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1010_1000_xxxx__1111_xxxx_10x1_xxxx')
44912149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 1, 0]
45012149Sashkan.tousimojarad@arm.com
45112149Sashkan.tousimojarad@arm.comclass HPI_QDADD_QDSUB_A1(MinorFUTiming):
45212149Sashkan.tousimojarad@arm.com    description = 'HPI_QDADD_QSUB_A1'
45312149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0001_01x0_xxxx__xxxx_xxxx_0101_xxxx')
45412149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 1, 0]
45512149Sashkan.tousimojarad@arm.com
45612149Sashkan.tousimojarad@arm.comclass HPI_RBIT_A1(MinorFUTiming):
45712149Sashkan.tousimojarad@arm.com    description = 'HPI_RBIT_A1'
45812149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0110_1111_xxxx__xxxx_xxxx_0011_xxxx')
45912149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 1, 0]
46012149Sashkan.tousimojarad@arm.com
46112149Sashkan.tousimojarad@arm.comclass HPI_REV_REV16_A1(MinorFUTiming):
46212149Sashkan.tousimojarad@arm.com    description = 'HPI_REV_REV16_A1'
46312149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0110_1011_xxxx__xxxx_xxxx_x011_xxxx')
46412149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 1, 0]
46512149Sashkan.tousimojarad@arm.com
46612149Sashkan.tousimojarad@arm.comclass HPI_REVSH_A1(MinorFUTiming):
46712149Sashkan.tousimojarad@arm.com    description = 'HPI_REVSH_A1'
46812149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0110_1111_xxxx__xxxx_xxxx_1011_xxxx')
46912149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 1, 0]
47012149Sashkan.tousimojarad@arm.com
47112149Sashkan.tousimojarad@arm.comclass HPI_ADD_ETC_A1(MinorFUTiming):
47212149Sashkan.tousimojarad@arm.com    description = 'HPI_ADD_ETC_A1'
47312149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0110_0xx1_xxxx__xxxx_xxxx_x001_xxxx')
47412149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 2, 2, 0]
47512149Sashkan.tousimojarad@arm.com
47612149Sashkan.tousimojarad@arm.comclass HPI_ADD_ETC_T1(MinorFUTiming):
47712149Sashkan.tousimojarad@arm.com    description = 'HPI_ADD_ETC_A1'
47812149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1010_100x_xxxx__1111_xxxx_0xx0_xxxx')
47912149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 2, 2, 0]
48012149Sashkan.tousimojarad@arm.com
48112149Sashkan.tousimojarad@arm.comclass HPI_SASX_SHASX_UASX_UHASX_A1(MinorFUTiming):
48212149Sashkan.tousimojarad@arm.com    description = 'HPI_SASX_SHASX_UASX_UHASX_A1'
48312149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0110_0xx1_xxxx__xxxx_xxxx_0011_xxxx')
48412149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [3, 3, 2, 2, 2, 1, 0]
48512149Sashkan.tousimojarad@arm.com
48612149Sashkan.tousimojarad@arm.comclass HPI_SBFX_UBFX_A1(MinorFUTiming):
48712149Sashkan.tousimojarad@arm.com    description = 'HPI_SBFX_UBFX_A1'
48812149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0111_1x1x_xxxx__xxxx_xxxx_x101_xxxx')
48912149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 1, 0]
49012149Sashkan.tousimojarad@arm.com
49112149Sashkan.tousimojarad@arm.com### SDIV
49212149Sashkan.tousimojarad@arm.com
49312149Sashkan.tousimojarad@arm.comsdiv_lat_expr = expr_top(let([
49412149Sashkan.tousimojarad@arm.com    ('left', un('SignExtend32To64', int_reg(src(4)))),
49512149Sashkan.tousimojarad@arm.com    ('right', un('SignExtend32To64', int_reg(src(3)))),
49612149Sashkan.tousimojarad@arm.com    ('either_signed', bin('Or',
49712149Sashkan.tousimojarad@arm.com        bin('SLessThan', ref('left'), literal(0)),
49812149Sashkan.tousimojarad@arm.com        bin('SLessThan', ref('right'), literal(0)))),
49912149Sashkan.tousimojarad@arm.com    ('left_size', un('SizeInBits', un('Abs', ref('left')))),
50012149Sashkan.tousimojarad@arm.com    ('signed_adjust', if_expr(ref('either_signed'), literal(1), literal(0))),
50112149Sashkan.tousimojarad@arm.com    ('right_size', un('SizeInBits',
50212149Sashkan.tousimojarad@arm.com        bin('UDiv', un('Abs', ref('right')),
50312149Sashkan.tousimojarad@arm.com            if_expr(ref('either_signed'), literal(4), literal(2))))),
50412149Sashkan.tousimojarad@arm.com    ('left_minus_right', if_expr(
50512149Sashkan.tousimojarad@arm.com        bin('SLessThan', ref('left_size'), ref('right_size')),
50612149Sashkan.tousimojarad@arm.com        literal(0),
50712149Sashkan.tousimojarad@arm.com        bin('Sub', ref('left_size'), ref('right_size'))))
50812149Sashkan.tousimojarad@arm.com    ],
50912149Sashkan.tousimojarad@arm.com    bin('Add',
51012149Sashkan.tousimojarad@arm.com        ref('signed_adjust'),
51112149Sashkan.tousimojarad@arm.com        if_expr(bin('Equal', ref('right'), literal(0)),
51212149Sashkan.tousimojarad@arm.com            literal(0),
51312149Sashkan.tousimojarad@arm.com            bin('UDiv', ref('left_minus_right'), literal(4))))
51412149Sashkan.tousimojarad@arm.com    ))
51512149Sashkan.tousimojarad@arm.com
51612149Sashkan.tousimojarad@arm.comsdiv_lat_expr64 = expr_top(let([
51712149Sashkan.tousimojarad@arm.com    ('left', un('SignExtend32To64', int_reg(src(0)))),
51812149Sashkan.tousimojarad@arm.com    ('right', un('SignExtend32To64', int_reg(src(1)))),
51912149Sashkan.tousimojarad@arm.com    ('either_signed', bin('Or',
52012149Sashkan.tousimojarad@arm.com        bin('SLessThan', ref('left'), literal(0)),
52112149Sashkan.tousimojarad@arm.com        bin('SLessThan', ref('right'), literal(0)))),
52212149Sashkan.tousimojarad@arm.com    ('left_size', un('SizeInBits', un('Abs', ref('left')))),
52312149Sashkan.tousimojarad@arm.com    ('signed_adjust', if_expr(ref('either_signed'), literal(1), literal(0))),
52412149Sashkan.tousimojarad@arm.com    ('right_size', un('SizeInBits',
52512149Sashkan.tousimojarad@arm.com        bin('UDiv', un('Abs', ref('right')),
52612149Sashkan.tousimojarad@arm.com            if_expr(ref('either_signed'), literal(4), literal(2))))),
52712149Sashkan.tousimojarad@arm.com    ('left_minus_right', if_expr(
52812149Sashkan.tousimojarad@arm.com        bin('SLessThan', ref('left_size'), ref('right_size')),
52912149Sashkan.tousimojarad@arm.com        literal(0),
53012149Sashkan.tousimojarad@arm.com        bin('Sub', ref('left_size'), ref('right_size'))))
53112149Sashkan.tousimojarad@arm.com    ],
53212149Sashkan.tousimojarad@arm.com    bin('Add',
53312149Sashkan.tousimojarad@arm.com        ref('signed_adjust'),
53412149Sashkan.tousimojarad@arm.com        if_expr(bin('Equal', ref('right'), literal(0)),
53512149Sashkan.tousimojarad@arm.com            literal(0),
53612149Sashkan.tousimojarad@arm.com            bin('UDiv', ref('left_minus_right'), literal(4))))
53712149Sashkan.tousimojarad@arm.com    ))
53812149Sashkan.tousimojarad@arm.com
53912149Sashkan.tousimojarad@arm.comclass HPI_SDIV_A1(MinorFUTiming):
54012149Sashkan.tousimojarad@arm.com    description = 'HPI_SDIV_A1'
54112149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0111_0001_xxxx__xxxx_xxxx_0001_xxxx')
54212149Sashkan.tousimojarad@arm.com    extraCommitLat = 0
54312149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = []
54412149Sashkan.tousimojarad@arm.com    extraCommitLatExpr = sdiv_lat_expr
54512149Sashkan.tousimojarad@arm.com
54612149Sashkan.tousimojarad@arm.comclass HPI_SDIV_A64(MinorFUTiming):
54712149Sashkan.tousimojarad@arm.com    description = 'HPI_SDIV_A64'
54812149Sashkan.tousimojarad@arm.com    mask, match = a64_opcode('x001_1010_110x_xxxx__0000_11xx_xxxx_xxxx')
54912149Sashkan.tousimojarad@arm.com    extraCommitLat = 0
55012149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = []
55112149Sashkan.tousimojarad@arm.com    extraCommitLatExpr = sdiv_lat_expr64
55212149Sashkan.tousimojarad@arm.com
55312149Sashkan.tousimojarad@arm.com### SEL
55412149Sashkan.tousimojarad@arm.com
55512149Sashkan.tousimojarad@arm.comclass HPI_SEL_A1(MinorFUTiming):
55612149Sashkan.tousimojarad@arm.com    description = 'HPI_SEL_A1'
55712149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0110_1000_xxxx__xxxx_xxxx_1011_xxxx')
55812149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 2, 2, 0]
55912149Sashkan.tousimojarad@arm.com
56012149Sashkan.tousimojarad@arm.comclass HPI_SEL_A1_Suppress(MinorFUTiming):
56112149Sashkan.tousimojarad@arm.com    description = 'HPI_SEL_A1_Suppress'
56212149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0110_1000_xxxx__xxxx_xxxx_1011_xxxx')
56312149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = []
56412149Sashkan.tousimojarad@arm.com    suppress = True
56512149Sashkan.tousimojarad@arm.com
56612149Sashkan.tousimojarad@arm.comclass HPI_SHSAX_SSAX_UHSAX_USAX_A1(MinorFUTiming):
56712149Sashkan.tousimojarad@arm.com    description = 'HPI_SHSAX_SSAX_UHSAX_USAX_A1'
56812149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0110_0xx1_xxxx__xxxx_xxxx_0101_xxxx')
56912149Sashkan.tousimojarad@arm.com    # As Default
57012149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [3, 3, 2, 2, 2, 1, 0]
57112149Sashkan.tousimojarad@arm.com
57212149Sashkan.tousimojarad@arm.comclass HPI_USUB_ETC_A1(MinorFUTiming):
57312149Sashkan.tousimojarad@arm.com    description = 'HPI_USUB_ETC_A1'
57412149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0110_0xx1_xxxx__xxxx_xxxx_x111_xxxx')
57512149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 2, 2, 0]
57612149Sashkan.tousimojarad@arm.com
57712149Sashkan.tousimojarad@arm.comclass HPI_SMLABB_T1(MinorFUTiming):
57812149Sashkan.tousimojarad@arm.com    description = 'HPI_SMLABB_T1'
57912149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1011_0001_xxxx__xxxx_xxxx_00xx_xxxx')
58012149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 2, 0]
58112149Sashkan.tousimojarad@arm.com
58212149Sashkan.tousimojarad@arm.comclass HPI_SMLABB_A1(MinorFUTiming):
58312149Sashkan.tousimojarad@arm.com    description = 'HPI_SMLABB_A1'
58412149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0001_0000_xxxx__xxxx_xxxx_1xx0_xxxx')
58512149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 2, 0]
58612149Sashkan.tousimojarad@arm.com
58712149Sashkan.tousimojarad@arm.comclass HPI_SMLAD_T1(MinorFUTiming):
58812149Sashkan.tousimojarad@arm.com    description = 'HPI_SMLAD_T1'
58912149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1011_0010_xxxx__xxxx_xxxx_000x_xxxx')
59012149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 2, 0]
59112149Sashkan.tousimojarad@arm.com
59212149Sashkan.tousimojarad@arm.comclass HPI_SMLAD_A1(MinorFUTiming):
59312149Sashkan.tousimojarad@arm.com    description = 'HPI_SMLAD_A1'
59412149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0111_0000_xxxx__xxxx_xxxx_00x1_xxxx')
59512149Sashkan.tousimojarad@arm.com    # z, z, z, l, r, a
59612149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 2, 0]
59712149Sashkan.tousimojarad@arm.com
59812149Sashkan.tousimojarad@arm.comclass HPI_SMLAL_T1(MinorFUTiming):
59912149Sashkan.tousimojarad@arm.com    description = 'HPI_SMLAL_T1'
60012149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1011_1100_xxxx__xxxx_xxxx_0000_xxxx')
60112149Sashkan.tousimojarad@arm.comclass HPI_SMLAL_A1(MinorFUTiming):
60212149Sashkan.tousimojarad@arm.com    description = 'HPI_SMLAL_A1'
60312149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0000_111x_xxxx__xxxx_xxxx_1001_xxxx')
60412149Sashkan.tousimojarad@arm.com
60512149Sashkan.tousimojarad@arm.comclass HPI_SMLALBB_T1(MinorFUTiming):
60612149Sashkan.tousimojarad@arm.com    description = 'HPI_SMLALBB_T1'
60712149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1011_1100_xxxx__xxxx_xxxx_10xx_xxxx')
60812149Sashkan.tousimojarad@arm.comclass HPI_SMLALBB_A1(MinorFUTiming):
60912149Sashkan.tousimojarad@arm.com    description = 'HPI_SMLALBB_A1'
61012149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0001_0100_xxxx__xxxx_xxxx_1xx0_xxxx')
61112149Sashkan.tousimojarad@arm.com
61212149Sashkan.tousimojarad@arm.comclass HPI_SMLALD_T1(MinorFUTiming):
61312149Sashkan.tousimojarad@arm.com    description = 'HPI_SMLALD_T1'
61412149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1011_1100_xxxx__xxxx_xxxx_110x_xxxx')
61512149Sashkan.tousimojarad@arm.comclass HPI_SMLALD_A1(MinorFUTiming):
61612149Sashkan.tousimojarad@arm.com    description = 'HPI_SMLALD_A1'
61712149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0111_0100_xxxx__xxxx_xxxx_00x1_xxxx')
61812149Sashkan.tousimojarad@arm.com
61912149Sashkan.tousimojarad@arm.comclass HPI_SMLAWB_T1(MinorFUTiming):
62012149Sashkan.tousimojarad@arm.com    description = 'HPI_SMLAWB_T1'
62112149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1011_0011_xxxx__xxxx_xxxx_000x_xxxx')
62212149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 2, 0]
62312149Sashkan.tousimojarad@arm.com
62412149Sashkan.tousimojarad@arm.comclass HPI_SMLAWB_A1(MinorFUTiming):
62512149Sashkan.tousimojarad@arm.com    description = 'HPI_SMLAWB_A1'
62612149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0001_0010_xxxx__xxxx_xxxx_1x00_xxxx')
62712149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 2, 0]
62812149Sashkan.tousimojarad@arm.com
62912149Sashkan.tousimojarad@arm.comclass HPI_SMLSD_A1(MinorFUTiming):
63012149Sashkan.tousimojarad@arm.com    description = 'HPI_SMLSD_A1'
63112149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0111_0000_xxxx__xxxx_xxxx_01x1_xxxx')
63212149Sashkan.tousimojarad@arm.com
63312149Sashkan.tousimojarad@arm.comclass HPI_SMLSLD_T1(MinorFUTiming):
63412149Sashkan.tousimojarad@arm.com    description = 'HPI_SMLSLD_T1'
63512149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1011_1101_xxxx__xxxx_xxxx_110x_xxxx')
63612149Sashkan.tousimojarad@arm.comclass HPI_SMLSLD_A1(MinorFUTiming):
63712149Sashkan.tousimojarad@arm.com    description = 'HPI_SMLSLD_A1'
63812149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0111_0100_xxxx__xxxx_xxxx_01x1_xxxx')
63912149Sashkan.tousimojarad@arm.com
64012149Sashkan.tousimojarad@arm.comclass HPI_SMMLA_T1(MinorFUTiming):
64112149Sashkan.tousimojarad@arm.com    description = 'HPI_SMMLA_T1'
64212149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1011_0101_xxxx__xxxx_xxxx_000x_xxxx')
64312149Sashkan.tousimojarad@arm.com    #                                              ^^^^ != 1111
64412149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 2, 0, 0, 0]
64512149Sashkan.tousimojarad@arm.com
64612149Sashkan.tousimojarad@arm.comclass HPI_SMMLA_A1(MinorFUTiming):
64712149Sashkan.tousimojarad@arm.com    description = 'HPI_SMMLA_A1'
64812149Sashkan.tousimojarad@arm.com    # Note that this must be after the encoding for SMMUL
64912149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0111_0101_xxxx__xxxx_xxxx_00x1_xxxx')
65012149Sashkan.tousimojarad@arm.com    #                                              ^^^^ != 1111
65112149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 2, 0, 0, 0]
65212149Sashkan.tousimojarad@arm.com
65312149Sashkan.tousimojarad@arm.comclass HPI_SMMLS_T1(MinorFUTiming):
65412149Sashkan.tousimojarad@arm.com    description = 'HPI_SMMLS_T1'
65512149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1011_0110_xxxx__xxxx_xxxx_000x_xxxx')
65612149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 2, 0, 0, 0]
65712149Sashkan.tousimojarad@arm.com
65812149Sashkan.tousimojarad@arm.comclass HPI_SMMLS_A1(MinorFUTiming):
65912149Sashkan.tousimojarad@arm.com    description = 'HPI_SMMLS_A1'
66012149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0111_0101_xxxx__xxxx_xxxx_11x1_xxxx')
66112149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 2, 0, 0, 0]
66212149Sashkan.tousimojarad@arm.com
66312149Sashkan.tousimojarad@arm.comclass HPI_SMMUL_T1(MinorFUTiming):
66412149Sashkan.tousimojarad@arm.com    description = 'HPI_SMMUL_T1'
66512149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1011_0101_xxxx__1111_xxxx_000x_xxxx')
66612149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0]
66712149Sashkan.tousimojarad@arm.com
66812149Sashkan.tousimojarad@arm.comclass HPI_SMMUL_A1(MinorFUTiming):
66912149Sashkan.tousimojarad@arm.com    description = 'HPI_SMMUL_A1'
67012149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0111_0101_xxxx__1111_xxxx_00x1_xxxx')
67112149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0]
67212149Sashkan.tousimojarad@arm.com
67312149Sashkan.tousimojarad@arm.comclass HPI_SMUAD_T1(MinorFUTiming):
67412149Sashkan.tousimojarad@arm.com    description = 'HPI_SMUAD_T1'
67512149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1011_0010_xxxx__1111_xxxx_000x_xxxx')
67612149Sashkan.tousimojarad@arm.comclass HPI_SMUAD_A1(MinorFUTiming):
67712149Sashkan.tousimojarad@arm.com    description = 'HPI_SMUAD_A1'
67812149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0111_0000_xxxx__1111_xxxx_00x1_xxxx')
67912149Sashkan.tousimojarad@arm.com
68012149Sashkan.tousimojarad@arm.comclass HPI_SMULBB_T1(MinorFUTiming):
68112149Sashkan.tousimojarad@arm.com    description = 'HPI_SMULBB_T1'
68212149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1011_0001_xxxx__1111_xxxx_00xx_xxxx')
68312149Sashkan.tousimojarad@arm.comclass HPI_SMULBB_A1(MinorFUTiming):
68412149Sashkan.tousimojarad@arm.com    description = 'HPI_SMULBB_A1'
68512149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0001_0110_xxxx__xxxx_xxxx_1xx0_xxxx')
68612149Sashkan.tousimojarad@arm.com
68712149Sashkan.tousimojarad@arm.comclass HPI_SMULL_T1(MinorFUTiming):
68812149Sashkan.tousimojarad@arm.com    description = 'HPI_SMULL_T1'
68912149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1011_1000_xxxx__xxxx_xxxx_0000_xxxx')
69012149Sashkan.tousimojarad@arm.comclass HPI_SMULL_A1(MinorFUTiming):
69112149Sashkan.tousimojarad@arm.com    description = 'HPI_SMULL_A1'
69212149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0000_110x_xxxx__xxxx_xxxx_1001_xxxx')
69312149Sashkan.tousimojarad@arm.com
69412149Sashkan.tousimojarad@arm.comclass HPI_SMULWB_T1(MinorFUTiming):
69512149Sashkan.tousimojarad@arm.com    description = 'HPI_SMULWB_T1'
69612149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1011_0011_xxxx__1111_xxxx_000x_xxxx')
69712149Sashkan.tousimojarad@arm.comclass HPI_SMULWB_A1(MinorFUTiming):
69812149Sashkan.tousimojarad@arm.com    description = 'HPI_SMULWB_A1'
69912149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0001_0010_xxxx__xxxx_xxxx_1x10_xxxx')
70012149Sashkan.tousimojarad@arm.com
70112149Sashkan.tousimojarad@arm.comclass HPI_SMUSD_T1(MinorFUTiming):
70212149Sashkan.tousimojarad@arm.com    description = 'HPI_SMUSD_T1'
70312149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1011_0100_xxxx__1111_xxxx_000x_xxxx')
70412149Sashkan.tousimojarad@arm.comclass HPI_SMUSD_A1(MinorFUTiming):
70512149Sashkan.tousimojarad@arm.com    description = 'HPI_SMUSD_A1'
70612149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0111_0000_xxxx__1111_xxxx_01x1_xxxx')
70712149Sashkan.tousimojarad@arm.com
70812149Sashkan.tousimojarad@arm.comclass HPI_SSAT_USAT_no_shift_A1(MinorFUTiming):
70912149Sashkan.tousimojarad@arm.com    description = 'HPI_SSAT_USAT_no_shift_A1'
71012149Sashkan.tousimojarad@arm.com    # Order *before* shift
71112149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0110_1x1x_xxxx__xxxx_0000_0001_xxxx')
71212149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 2, 0]
71312149Sashkan.tousimojarad@arm.com
71412149Sashkan.tousimojarad@arm.comclass HPI_SSAT_USAT_shift_A1(MinorFUTiming):
71512149Sashkan.tousimojarad@arm.com    description = 'HPI_SSAT_USAT_shift_A1'
71612149Sashkan.tousimojarad@arm.com    # Order after shift
71712149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0110_1x1x_xxxx__xxxx_xxxx_xx01_xxxx')
71812149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 1, 0]
71912149Sashkan.tousimojarad@arm.com
72012149Sashkan.tousimojarad@arm.comclass HPI_SSAT16_USAT16_A1(MinorFUTiming):
72112149Sashkan.tousimojarad@arm.com    description = 'HPI_SSAT16_USAT16_A1'
72212149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0110_1x10_xxxx__xxxx_xxxx_0011_xxxx')
72312149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 2, 0]
72412149Sashkan.tousimojarad@arm.com
72512149Sashkan.tousimojarad@arm.comclass HPI_SXTAB_T1(MinorFUTiming):
72612149Sashkan.tousimojarad@arm.com    description = 'HPI_SXTAB_T1'
72712149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1010_0100_xxxx__1111_xxxx_1xxx_xxxx')
72812149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 1, 2, 0]
72912149Sashkan.tousimojarad@arm.com
73012149Sashkan.tousimojarad@arm.comclass HPI_SXTAB_SXTAB16_SXTAH_UXTAB_UXTAB16_UXTAH_A1(MinorFUTiming):
73112149Sashkan.tousimojarad@arm.com    description = 'HPI_SXTAB_SXTAB16_SXTAH_UXTAB_UXTAB16_UXTAH_A1'
73212149Sashkan.tousimojarad@arm.com    # Place AFTER HPI_SXTB_SXTB16_SXTH_UXTB_UXTB16_UXTH_A1
73312149Sashkan.tousimojarad@arm.com    # e6[9d][^f]0070 are undefined
73412149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0110_1xxx_xxxx__xxxx_xxxx_0111_xxxx')
73512149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 1, 2, 0]
73612149Sashkan.tousimojarad@arm.com
73712149Sashkan.tousimojarad@arm.comclass HPI_SXTAB16_T1(MinorFUTiming):
73812149Sashkan.tousimojarad@arm.com    description = 'HPI_SXTAB16_T1'
73912149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1010_0010_xxxx__1111_xxxx_1xxx_xxxx')
74012149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 1, 2, 0]
74112149Sashkan.tousimojarad@arm.com
74212149Sashkan.tousimojarad@arm.comclass HPI_SXTAH_T1(MinorFUTiming):
74312149Sashkan.tousimojarad@arm.com    description = 'HPI_SXTAH_T1'
74412149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1010_0000_xxxx__1111_xxxx_1xxx_xxxx')
74512149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 1, 2, 0]
74612149Sashkan.tousimojarad@arm.com
74712149Sashkan.tousimojarad@arm.comclass HPI_SXTB_T1(MinorFUTiming):
74812149Sashkan.tousimojarad@arm.com    description = 'HPI_SXTB_T1'
74912149Sashkan.tousimojarad@arm.com    mask, match = t16_opcode('1011_0010_01xx_xxxx')
75012149Sashkan.tousimojarad@arm.comclass HPI_SXTB_T2(MinorFUTiming):
75112149Sashkan.tousimojarad@arm.com    description = 'HPI_SXTB_T2'
75212149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1010_0100_1111__1111_xxxx_1xxx_xxxx')
75312149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 1, 2, 0]
75412149Sashkan.tousimojarad@arm.com
75512149Sashkan.tousimojarad@arm.comclass HPI_SXTB_SXTB16_SXTH_UXTB_UXTB16_UXTH_A1(MinorFUTiming):
75612149Sashkan.tousimojarad@arm.com    description = 'HPI_SXTB_SXTB16_SXTH_UXTB_UXTB16_UXTH_A1'
75712149Sashkan.tousimojarad@arm.com    # e6[9d]f0070 are undefined
75812149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0110_1xxx_1111__xxxx_xxxx_0111_xxxx')
75912149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 2, 0]
76012149Sashkan.tousimojarad@arm.com
76112149Sashkan.tousimojarad@arm.comclass HPI_SXTB16_T1(MinorFUTiming):
76212149Sashkan.tousimojarad@arm.com    description = 'HPI_SXTB16_T1'
76312149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1010_0010_1111__1111_xxxx_1xxx_xxxx')
76412149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 1, 2, 0]
76512149Sashkan.tousimojarad@arm.com
76612149Sashkan.tousimojarad@arm.comclass HPI_SXTH_T1(MinorFUTiming):
76712149Sashkan.tousimojarad@arm.com    description = 'HPI_SXTH_T1'
76812149Sashkan.tousimojarad@arm.com    mask, match = t16_opcode('1011_0010_00xx_xxxx')
76912149Sashkan.tousimojarad@arm.comclass HPI_SXTH_T2(MinorFUTiming):
77012149Sashkan.tousimojarad@arm.com    description = 'HPI_SXTH_T2'
77112149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1010_0000_1111__1111_xxxx_1xxx_xxxx')
77212149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 1, 2, 0]
77312149Sashkan.tousimojarad@arm.com
77412149Sashkan.tousimojarad@arm.comclass HPI_UDIV_T1(MinorFUTiming):
77512149Sashkan.tousimojarad@arm.com    description = 'HPI_UDIV_T1'
77612149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1011_1011_xxxx__xxxx_xxxx_1111_xxxx')
77712149Sashkan.tousimojarad@arm.com
77812149Sashkan.tousimojarad@arm.comudiv_lat_expr = expr_top(let([
77912149Sashkan.tousimojarad@arm.com    ('left', int_reg(src(4))),
78012149Sashkan.tousimojarad@arm.com    ('right', int_reg(src(3))),
78112149Sashkan.tousimojarad@arm.com    ('left_size', un('SizeInBits', ref('left'))),
78212149Sashkan.tousimojarad@arm.com    ('right_size', un('SizeInBits',
78312149Sashkan.tousimojarad@arm.com        bin('UDiv', ref('right'), literal(2)))),
78412149Sashkan.tousimojarad@arm.com    ('left_minus_right', if_expr(
78512149Sashkan.tousimojarad@arm.com        bin('SLessThan', ref('left_size'), ref('right_size')),
78612149Sashkan.tousimojarad@arm.com        literal(0),
78712149Sashkan.tousimojarad@arm.com        bin('Sub', ref('left_size'), ref('right_size'))))
78812149Sashkan.tousimojarad@arm.com    ],
78912149Sashkan.tousimojarad@arm.com    if_expr(bin('Equal', ref('right'), literal(0)),
79012149Sashkan.tousimojarad@arm.com        literal(0),
79112149Sashkan.tousimojarad@arm.com        bin('UDiv', ref('left_minus_right'), literal(4)))
79212149Sashkan.tousimojarad@arm.com    ))
79312149Sashkan.tousimojarad@arm.com
79412149Sashkan.tousimojarad@arm.comclass HPI_UDIV_A1(MinorFUTiming):
79512149Sashkan.tousimojarad@arm.com    description = 'HPI_UDIV_A1'
79612149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0111_0011_xxxx__xxxx_xxxx_0001_xxxx')
79712149Sashkan.tousimojarad@arm.com    extraCommitLat = 0
79812149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = []
79912149Sashkan.tousimojarad@arm.com    extraCommitLatExpr = udiv_lat_expr
80012149Sashkan.tousimojarad@arm.com
80112149Sashkan.tousimojarad@arm.comclass HPI_UMAAL_T1(MinorFUTiming):
80212149Sashkan.tousimojarad@arm.com    description = 'HPI_UMAAL_T1'
80312149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1011_1110_xxxx__xxxx_xxxx_0110_xxxx')
80412149Sashkan.tousimojarad@arm.com    # z, z, z, dlo, dhi, l, r
80512149Sashkan.tousimojarad@arm.com    extraCommitLat = 1
80612149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0, 0, 0]
80712149Sashkan.tousimojarad@arm.com
80812149Sashkan.tousimojarad@arm.comclass HPI_UMAAL_A1(MinorFUTiming):
80912149Sashkan.tousimojarad@arm.com    description = 'HPI_UMAAL_A1'
81012149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0000_0100_xxxx__xxxx_xxxx_1001_xxxx')
81112149Sashkan.tousimojarad@arm.com    # z, z, z, dlo, dhi, l, r
81212149Sashkan.tousimojarad@arm.com    extraCommitLat = 1
81312149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0, 0, 0]
81412149Sashkan.tousimojarad@arm.com
81512149Sashkan.tousimojarad@arm.comclass HPI_UMLAL_T1(MinorFUTiming):
81612149Sashkan.tousimojarad@arm.com    description = 'HPI_UMLAL_T1'
81712149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1011_1110_xxxx__xxxx_xxxx_0000_xxxx')
81812149Sashkan.tousimojarad@arm.com
81912149Sashkan.tousimojarad@arm.comclass HPI_UMLAL_A1(MinorFUTiming):
82012149Sashkan.tousimojarad@arm.com    description = 'HPI_UMLAL_A1'
82112149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('xxxx_0000_101x_xxxx__xxxx_xxxx_1001_xxxx')
82212149Sashkan.tousimojarad@arm.com
82312149Sashkan.tousimojarad@arm.comclass HPI_UMULL_T1(MinorFUTiming):
82412149Sashkan.tousimojarad@arm.com    description = 'HPI_UMULL_T1'
82512149Sashkan.tousimojarad@arm.com    mask, match = t32_opcode('1111_1011_1010_xxxx__xxxx_xxxx_0000_xxxx')
82612149Sashkan.tousimojarad@arm.com
82712149Sashkan.tousimojarad@arm.comclass HPI_UMULL_A1(MinorFUTiming):
82812149Sashkan.tousimojarad@arm.com    description = 'HPI_UMULL_A1'
82912149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0000_100x_xxxx__xxxx_xxxx_1001_xxxx')
83012149Sashkan.tousimojarad@arm.com
83112149Sashkan.tousimojarad@arm.comclass HPI_USAD8_USADA8_A1(MinorFUTiming):
83212149Sashkan.tousimojarad@arm.com    description = 'HPI_USAD8_USADA8_A1'
83312149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0111_1000_xxxx__xxxx_xxxx_0001_xxxx')
83412149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 2, 0]
83512149Sashkan.tousimojarad@arm.com
83612149Sashkan.tousimojarad@arm.comclass HPI_USAD8_USADA8_A1_Suppress(MinorFUTiming):
83712149Sashkan.tousimojarad@arm.com    description = 'HPI_USAD8_USADA8_A1_Suppress'
83812149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_0111_1000_xxxx__xxxx_xxxx_0001_xxxx')
83912149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = []
84012149Sashkan.tousimojarad@arm.com    suppress = True
84112149Sashkan.tousimojarad@arm.com
84212149Sashkan.tousimojarad@arm.comclass HPI_VMOV_immediate_A1(MinorFUTiming):
84312149Sashkan.tousimojarad@arm.com    description = 'HPI_VMOV_register_A1'
84412149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0010_0x10_xxxx_xxxx_0001_xxx1_xxxx')
84512149Sashkan.tousimojarad@arm.com    # cpsr, z, z, z, hcptr, nsacr, cpacr, fpexc, scr
84612149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [5, 5, 5, 5, 5, 5, 5, 5, 5, 0]
84712149Sashkan.tousimojarad@arm.com
84812149Sashkan.tousimojarad@arm.comclass HPI_VMRS_A1(MinorFUTiming):
84912149Sashkan.tousimojarad@arm.com    description = 'HPI_VMRS_A1'
85012149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_1110_1111_0001_xxxx_1010_xxx1_xxxx')
85112149Sashkan.tousimojarad@arm.com    # cpsr,z,z,z,hcptr,nsacr,cpacr,scr,r42
85212149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [5, 5, 5, 5, 5, 5, 5, 5, 5, 0]
85312149Sashkan.tousimojarad@arm.com
85412149Sashkan.tousimojarad@arm.comclass HPI_VMOV_register_A2(MinorFUTiming):
85512149Sashkan.tousimojarad@arm.com    description = 'HPI_VMOV_register_A2'
85612149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_1110_1x11_0000_xxxx_101x_01x0_xxxx')
85712149Sashkan.tousimojarad@arm.com    # cpsr, z, r39, z, hcptr, nsacr, cpacr, fpexc, scr, f4, f5, f0, f1
85812149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = \
85912149Sashkan.tousimojarad@arm.com        [5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 0]
86012149Sashkan.tousimojarad@arm.com
86112149Sashkan.tousimojarad@arm.com# VADD.I16 D/VADD.F32 D/VADD.I8 D/VADD.I32 D
86212149Sashkan.tousimojarad@arm.comclass HPI_VADD2H_A32(MinorFUTiming):
86312149Sashkan.tousimojarad@arm.com    description = 'Vadd2hALU'
86412149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0010_0xxx_xxxx__xxxx_1000_xxx0_xxxx')
86512149Sashkan.tousimojarad@arm.com    # cpsr, z, z, z, cpacr, fpexc, l0, r0, l1, r1, l2, r2, l3, r3 (for vadd2h)
86612149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  4, 4, 4, 4, 4, 4, 4, 4, 0]
86712149Sashkan.tousimojarad@arm.com
86812149Sashkan.tousimojarad@arm.com# VAQQHN.I16 Q/VAQQHN.I32 Q/VAQQHN.I64 Q
86912149Sashkan.tousimojarad@arm.comclass HPI_VADDHN_A32(MinorFUTiming):
87012149Sashkan.tousimojarad@arm.com    description = 'VaddhnALU'
87112149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0010_1xxx_xxxx__xxxx_0100_x0x0_xxxx')
87212149Sashkan.tousimojarad@arm.com    # cpsr, z, z, z, cpacr, fpexc, l0, l1, l2, l3, r0, r1, r2, r3
87312149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  3, 3, 3, 3, 3, 3, 3, 3, 0]
87412149Sashkan.tousimojarad@arm.com
87512149Sashkan.tousimojarad@arm.comclass HPI_VADDL_A32(MinorFUTiming):
87612149Sashkan.tousimojarad@arm.com    description = 'VaddlALU'
87712149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_001x_1xxx_xxxx__xxxx_0000_x0x0_xxxx')
87812149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  3, 3, 3, 3, 3, 3, 3, 3, 0]
87912149Sashkan.tousimojarad@arm.com
88012149Sashkan.tousimojarad@arm.comclass HPI_VADDW_A32(MinorFUTiming):
88112149Sashkan.tousimojarad@arm.com    description = 'HPI_VADDW_A32'
88212149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_001x_1xxx_xxxx__xxxx_0001_x0x0_xxxx')
88312149Sashkan.tousimojarad@arm.com    # cpsr, z, z, z, cpacr, fpexc, l0, l1, l2, l3, r0, r1
88412149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  4, 4, 4, 4, 3, 3, 0]
88512149Sashkan.tousimojarad@arm.com
88612149Sashkan.tousimojarad@arm.com# VHADD/VHSUB S8,S16,S32,U8,U16,U32 Q and D
88712149Sashkan.tousimojarad@arm.comclass HPI_VHADD_A32(MinorFUTiming):
88812149Sashkan.tousimojarad@arm.com    description = 'HPI_VHADD_A32'
88912149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_001x_0xxx_xxxx__xxxx_00x0_xxx0_xxxx')
89012149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  4, 4, 4, 4, 4, 4, 4, 4, 0]
89112149Sashkan.tousimojarad@arm.com
89212149Sashkan.tousimojarad@arm.comclass HPI_VPADAL_A32(MinorFUTiming):
89312149Sashkan.tousimojarad@arm.com    description = 'VpadalALU'
89412149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0011_1x11_xx00__xxxx_0110_xxx0_xxxx')
89512149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  2, 2, 2, 2, 2, 2, 2, 2, 0]
89612149Sashkan.tousimojarad@arm.com
89712149Sashkan.tousimojarad@arm.com# VPADDH.I16
89812149Sashkan.tousimojarad@arm.comclass HPI_VPADDH_A32(MinorFUTiming):
89912149Sashkan.tousimojarad@arm.com    description = 'VpaddhALU'
90012149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0010_0xxx_xxxx__xxxx_1011_xxx1_xxxx')
90112149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  3, 3, 3, 3, 3, 3, 3, 3, 0]
90212149Sashkan.tousimojarad@arm.com
90312149Sashkan.tousimojarad@arm.com# VPADDH.F32
90412149Sashkan.tousimojarad@arm.comclass HPI_VPADDS_A32(MinorFUTiming):
90512149Sashkan.tousimojarad@arm.com    description = 'VpaddsALU'
90612149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0011_0x0x_xxxx__xxxx_1101_xxx0_xxxx')
90712149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  2, 2, 2, 2, 2, 2, 2, 2, 0]
90812149Sashkan.tousimojarad@arm.com
90912149Sashkan.tousimojarad@arm.com# VPADDL.S16
91012149Sashkan.tousimojarad@arm.comclass HPI_VPADDL_A32(MinorFUTiming):
91112149Sashkan.tousimojarad@arm.com    description = 'VpaddlALU'
91212149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0011_1x11_xx00__xxxx_0010_xxx0_xxxx')
91312149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  3, 3, 3, 3, 3, 3, 3, 3, 0]
91412149Sashkan.tousimojarad@arm.com
91512149Sashkan.tousimojarad@arm.com# VRADDHN.I16
91612149Sashkan.tousimojarad@arm.comclass HPI_VRADDHN_A32(MinorFUTiming):
91712149Sashkan.tousimojarad@arm.com    description = 'HPI_VRADDHN_A32'
91812149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0011_1xxx_xxxx__xxxx_0100_x0x0_xxxx')
91912149Sashkan.tousimojarad@arm.com    # cpsr, z, z, z, cpacr, fpexc, l0, l1, l2, l3, r0, r1, r2, r3
92012149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  4, 4, 4, 4, 4, 4, 4, 4, 0]
92112149Sashkan.tousimojarad@arm.com
92212149Sashkan.tousimojarad@arm.comclass HPI_VRHADD_A32(MinorFUTiming):
92312149Sashkan.tousimojarad@arm.com    description = 'VrhaddALU'
92412149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_001x_0xxx_xxxx__xxxx_0001_xxx0_xxxx')
92512149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  4, 4, 4, 4, 4, 4, 4, 4, 0]
92612149Sashkan.tousimojarad@arm.com
92712149Sashkan.tousimojarad@arm.comclass HPI_VQADD_A32(MinorFUTiming):
92812149Sashkan.tousimojarad@arm.com    description = 'VqaddALU'
92912149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_001x_0xxx_xxxx__xxxx_0000_xxx1_xxxx')
93012149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  3, 3, 3, 3, 3, 3, 3, 3, 0]
93112149Sashkan.tousimojarad@arm.com
93212149Sashkan.tousimojarad@arm.comclass HPI_VANDQ_A32(MinorFUTiming):
93312149Sashkan.tousimojarad@arm.com    description = 'VandqALU'
93412149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0010_0x00_xxxx__xxxx_0001_xxx1_xxxx')
93512149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  5, 5, 5, 5, 5, 5, 5, 5, 0]
93612149Sashkan.tousimojarad@arm.com
93712149Sashkan.tousimojarad@arm.com# VMUL (integer)
93812149Sashkan.tousimojarad@arm.comclass HPI_VMULI_A32(MinorFUTiming):
93912149Sashkan.tousimojarad@arm.com    description = 'VmuliALU'
94012149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_001x_0xxx_xxxx__xxxx_1001_xxx1_xxxx')
94112149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  2, 2, 2, 2, 2, 2, 2, 2, 0]
94212149Sashkan.tousimojarad@arm.com
94312149Sashkan.tousimojarad@arm.com# VBIC (reg)
94412149Sashkan.tousimojarad@arm.comclass HPI_VBIC_A32(MinorFUTiming):
94512149Sashkan.tousimojarad@arm.com    description = 'VbicALU'
94612149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0010_0x01_xxxx__xxxx_0001_xxx1_xxxx')
94712149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  5, 5, 5, 5, 5, 5, 5, 5, 0]
94812149Sashkan.tousimojarad@arm.com
94912149Sashkan.tousimojarad@arm.com# VBIF VBIT VBSL
95012149Sashkan.tousimojarad@arm.comclass HPI_VBIF_ETC_A32(MinorFUTiming):
95112149Sashkan.tousimojarad@arm.com    description = 'VbifALU'
95212149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0011_0xxx_xxxx__xxxx_0001_xxx1_xxxx')
95312149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = \
95412149Sashkan.tousimojarad@arm.com        [0, 0, 0, 0, 0, 0,  5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0]
95512149Sashkan.tousimojarad@arm.com
95612149Sashkan.tousimojarad@arm.comclass HPI_VACGE_A32(MinorFUTiming):
95712149Sashkan.tousimojarad@arm.com    description = 'VacgeALU'
95812149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0011_0xxx_xxxx__xxxx_1110_xxx1_xxxx')
95912149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  4, 4, 4, 4, 4, 4, 4, 4, 4, 0]
96012149Sashkan.tousimojarad@arm.com
96112149Sashkan.tousimojarad@arm.com# VCEQ.F32
96212149Sashkan.tousimojarad@arm.comclass HPI_VCEQ_A32(MinorFUTiming):
96312149Sashkan.tousimojarad@arm.com    description = 'VceqALU'
96412149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0010_0x0x_xxxx__xxxx_1110_xxx0_xxxx')
96512149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  4, 4, 4, 4, 4, 4, 4, 4, 4, 0]
96612149Sashkan.tousimojarad@arm.com
96712149Sashkan.tousimojarad@arm.com# VCEQ.[IS]... register
96812149Sashkan.tousimojarad@arm.comclass HPI_VCEQI_A32(MinorFUTiming):
96912149Sashkan.tousimojarad@arm.com    description = 'VceqiALU'
97012149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0011_0xxx_xxxx__xxxx_1000_xxx1_xxxx')
97112149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  4, 4, 4, 4, 4, 4, 4, 4, 4, 0]
97212149Sashkan.tousimojarad@arm.com
97312149Sashkan.tousimojarad@arm.com# VCEQ.[IS]... immediate
97412149Sashkan.tousimojarad@arm.comclass HPI_VCEQII_A32(MinorFUTiming):
97512149Sashkan.tousimojarad@arm.com    description = 'HPI_VCEQII_A32'
97612149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0011_1x11_xx01__xxxx_0x01_0xx0_xxxx')
97712149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  4, 4, 4, 4, 4, 4, 4, 4, 4, 0]
97812149Sashkan.tousimojarad@arm.com
97912149Sashkan.tousimojarad@arm.comclass HPI_VTST_A32(MinorFUTiming):
98012149Sashkan.tousimojarad@arm.com    description = 'HPI_VTST_A32'
98112149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0010_0xxx_xxxx__xxxx_1000_xxx1_xxxx')
98212149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  3, 3, 3, 3, 3, 3, 3, 3, 3, 0]
98312149Sashkan.tousimojarad@arm.com
98412149Sashkan.tousimojarad@arm.comclass HPI_VCLZ_A32(MinorFUTiming):
98512149Sashkan.tousimojarad@arm.com    description = 'HPI_VCLZ_A32'
98612149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0011_1x11_xx00__xxxx_0100_1xx0_xxxx')
98712149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  4, 4, 4, 4, 4, 4, 4, 4, 4, 0]
98812149Sashkan.tousimojarad@arm.com
98912149Sashkan.tousimojarad@arm.comclass HPI_VCNT_A32(MinorFUTiming):
99012149Sashkan.tousimojarad@arm.com    description = 'HPI_VCNT_A32'
99112149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0011_1x11_xx00__xxxx_0101_0xx0_xxxx')
99212149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  4, 4, 4, 4, 4, 4, 4, 4, 4, 0]
99312149Sashkan.tousimojarad@arm.com
99412149Sashkan.tousimojarad@arm.comclass HPI_VEXT_A32(MinorFUTiming):
99512149Sashkan.tousimojarad@arm.com    description = 'HPI_VCNT_A32'
99612149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0010_1x11_xxxx__xxxx_xxxx_xxx0_xxxx')
99712149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  4, 4, 4, 4, 4, 4, 4, 4, 4, 0]
99812149Sashkan.tousimojarad@arm.com
99912149Sashkan.tousimojarad@arm.com# VMAX VMIN integer
100012149Sashkan.tousimojarad@arm.comclass HPI_VMAXI_A32(MinorFUTiming):
100112149Sashkan.tousimojarad@arm.com    description = 'HPI_VMAXI_A32'
100212149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_001x_0xxx_xxxx__xxxx_0110_xxxx_xxxx')
100312149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  4, 4, 4, 4, 4, 4, 4, 4, 4, 0]
100412149Sashkan.tousimojarad@arm.com
100512149Sashkan.tousimojarad@arm.com# VMAX VMIN float
100612149Sashkan.tousimojarad@arm.comclass HPI_VMAXS_A32(MinorFUTiming):
100712149Sashkan.tousimojarad@arm.com    description = 'HPI_VMAXS_A32'
100812149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0010_0xxx_xxxx__xxxx_1111_xxx0_xxxx')
100912149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  2, 2, 2, 2, 2, 2, 2, 2, 2, 0]
101012149Sashkan.tousimojarad@arm.com
101112149Sashkan.tousimojarad@arm.com# VNEG integer
101212149Sashkan.tousimojarad@arm.comclass HPI_VNEGI_A32(MinorFUTiming):
101312149Sashkan.tousimojarad@arm.com    description = 'HPI_VNEGI_A32'
101412149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0011_1x11_xx01__xxxx_0x11_1xx0_xxxx')
101512149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  4, 4, 4, 4, 4, 4, 4, 4, 4, 0]
101612149Sashkan.tousimojarad@arm.com
101712149Sashkan.tousimojarad@arm.com# VNEG float
101812149Sashkan.tousimojarad@arm.comclass HPI_VNEGF_A32(MinorFUTiming):
101912149Sashkan.tousimojarad@arm.com    description = 'HPI_VNEGF_A32'
102012149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_1110_1x11_0001__xxxx_101x_01x0_xxxx')
102112149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  2, 2, 2, 2, 2, 2, 2, 2, 2, 0]
102212149Sashkan.tousimojarad@arm.com
102312149Sashkan.tousimojarad@arm.com# VREV16 VREV32 VREV64
102412149Sashkan.tousimojarad@arm.comclass HPI_VREVN_A32(MinorFUTiming):
102512149Sashkan.tousimojarad@arm.com    description = 'HPI_VREVN_A32'
102612149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0011_1x11_xx00__xxxx_000x_xxx0_xxxx')
102712149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  4, 4, 4, 4, 4, 4, 4, 4, 4, 0]
102812149Sashkan.tousimojarad@arm.com
102912149Sashkan.tousimojarad@arm.comclass HPI_VQNEG_A32(MinorFUTiming):
103012149Sashkan.tousimojarad@arm.com    description = 'HPI_VQNEG_A32'
103112149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0011_1x11_xx00__xxxx_0111_1xx0_xxxx')
103212149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  3, 3, 3, 3, 3, 3, 3, 3, 3, 0]
103312149Sashkan.tousimojarad@arm.com
103412149Sashkan.tousimojarad@arm.comclass HPI_VSWP_A32(MinorFUTiming):
103512149Sashkan.tousimojarad@arm.com    description = 'HPI_VSWP_A32'
103612149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0011_1x11_xx10__xxxx_0000_0xx0_xxxx')
103712149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  4, 4, 4, 4, 4, 4, 4, 4, 0]
103812149Sashkan.tousimojarad@arm.com
103912149Sashkan.tousimojarad@arm.comclass HPI_VTRN_A32(MinorFUTiming):
104012149Sashkan.tousimojarad@arm.com    description = 'HPI_VTRN_A32'
104112149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0011_1x11_xx10__xxxx_0000_1xx0_xxxx')
104212149Sashkan.tousimojarad@arm.com    # cpsr, z, z, z, cpact, fpexc, o0, d0, o1, d1, o2, d2, o3, d3
104312149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  2, 2, 2, 2, 2, 2, 2, 2, 0]
104412149Sashkan.tousimojarad@arm.com
104512149Sashkan.tousimojarad@arm.com# VQMOVN VQMOVUN
104612149Sashkan.tousimojarad@arm.comclass HPI_VQMOVN_A32(MinorFUTiming):
104712149Sashkan.tousimojarad@arm.com    description = 'HPI_VQMOVN_A32'
104812149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0011_1x11_xx10__xxxx_0010_xxx0_xxxx')
104912149Sashkan.tousimojarad@arm.com    # cpsr, z, z, z, cpact, fpexc, o[0], o[1], o[2], o[3], fpscr
105012149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  2, 2, 2, 2,  2, 0]
105112149Sashkan.tousimojarad@arm.com
105212149Sashkan.tousimojarad@arm.com# VUZP double word
105312149Sashkan.tousimojarad@arm.comclass HPI_VUZP_A32(MinorFUTiming):
105412149Sashkan.tousimojarad@arm.com    description = 'HPI_VUZP_A32'
105512149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0011_1x11_xx10__xxxx_0001_00x0_xxxx')
105612149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  3, 3, 3, 3, 3, 3, 3, 3, 0]
105712149Sashkan.tousimojarad@arm.com
105812149Sashkan.tousimojarad@arm.com# VDIV.F32
105912149Sashkan.tousimojarad@arm.comclass HPI_VDIV32_A32(MinorFUTiming):
106012149Sashkan.tousimojarad@arm.com    description = 'HPI_VDIV32_A32'
106112149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_1110_1x00_xxxx__xxxx_1010_x0x0_xxxx')
106212149Sashkan.tousimojarad@arm.com    # cpsr, z, z, z, cpact, fpexc, fpscr_exc, l, r
106312149Sashkan.tousimojarad@arm.com    extraCommitLat = 9
106412149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0, 20,  4, 4, 0]
106512149Sashkan.tousimojarad@arm.com
106612149Sashkan.tousimojarad@arm.com# VDIV.F64
106712149Sashkan.tousimojarad@arm.comclass HPI_VDIV64_A32(MinorFUTiming):
106812149Sashkan.tousimojarad@arm.com    description = 'HPI_VDIV64_A32'
106912149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_1110_1x00_xxxx__xxxx_1011_x0x0_xxxx')
107012149Sashkan.tousimojarad@arm.com    # cpsr, z, z, z, cpact, fpexc, fpscr_exc, l, r
107112149Sashkan.tousimojarad@arm.com    extraCommitLat = 18
107212149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0, 20,  4, 4, 0]
107312149Sashkan.tousimojarad@arm.com
107412149Sashkan.tousimojarad@arm.comclass HPI_VZIP_A32(MinorFUTiming):
107512149Sashkan.tousimojarad@arm.com    description = 'HPI_VZIP_A32'
107612149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0011_1x11_xx10__xxxx_0001_1xx0_xxxx')
107712149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  4, 4, 4, 4, 4, 4, 4, 4, 0]
107812149Sashkan.tousimojarad@arm.com
107912149Sashkan.tousimojarad@arm.com# VPMAX integer
108012149Sashkan.tousimojarad@arm.comclass HPI_VPMAX_A32(MinorFUTiming):
108112149Sashkan.tousimojarad@arm.com    description = 'HPI_VPMAX_A32'
108212149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_001x_0xxx_xxxx__xxxx_1010_xxxx_xxxx')
108312149Sashkan.tousimojarad@arm.com    # cpsr, z, z, z, cpact, fpexc, l0, r0, l1, r1, fpscr
108412149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  4, 4, 4, 4,  4, 0]
108512149Sashkan.tousimojarad@arm.com
108612149Sashkan.tousimojarad@arm.com# VPMAX float
108712149Sashkan.tousimojarad@arm.comclass HPI_VPMAXF_A32(MinorFUTiming):
108812149Sashkan.tousimojarad@arm.com    description = 'HPI_VPMAXF_A32'
108912149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0011_0xxx_xxxx__xxxx_1111_xxx0_xxxx')
109012149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  2, 2, 2, 2, 0]
109112149Sashkan.tousimojarad@arm.com
109212149Sashkan.tousimojarad@arm.comclass HPI_VMOVN_A32(MinorFUTiming):
109312149Sashkan.tousimojarad@arm.com    description = 'HPI_VMOVN_A32'
109412149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_0011_1x11_xx10__xxxx_0010_00x0_xxxx')
109512149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  4, 4, 4, 4, 0]
109612149Sashkan.tousimojarad@arm.com
109712149Sashkan.tousimojarad@arm.comclass HPI_VMOVL_A32(MinorFUTiming):
109812149Sashkan.tousimojarad@arm.com    description = 'HPI_VMOVL_A32'
109912149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('1111_001x_1xxx_x000__xxxx_1010_00x1_xxxx')
110012149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = [0, 0, 0, 0, 0, 0,  4, 4, 4, 4, 0]
110112149Sashkan.tousimojarad@arm.com
110212149Sashkan.tousimojarad@arm.com# VSQRT.F64
110312149Sashkan.tousimojarad@arm.comclass HPI_VSQRT64_A32(MinorFUTiming):
110412149Sashkan.tousimojarad@arm.com    description = 'HPI_VSQRT64_A32'
110512149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_1110_1x11_0001__xxxx_1011_11x0_xxxx')
110612149Sashkan.tousimojarad@arm.com    extraCommitLat = 18
110712149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = []
110812149Sashkan.tousimojarad@arm.com
110912149Sashkan.tousimojarad@arm.com# VSQRT.F32
111012149Sashkan.tousimojarad@arm.comclass HPI_VSQRT32_A32(MinorFUTiming):
111112149Sashkan.tousimojarad@arm.com    description = 'HPI_VSQRT32_A32'
111212149Sashkan.tousimojarad@arm.com    mask, match = a32_opcode('xxxx_1110_1x11_0001__xxxx_1010_11x0_xxxx')
111312149Sashkan.tousimojarad@arm.com    extraCommitLat = 9
111412149Sashkan.tousimojarad@arm.com    srcRegsRelativeLats = []
111512149Sashkan.tousimojarad@arm.com
111612149Sashkan.tousimojarad@arm.comclass HPI_FloatSimdFU(MinorFU):
111712149Sashkan.tousimojarad@arm.com    opClasses = minorMakeOpClassSet([
111812149Sashkan.tousimojarad@arm.com        'FloatAdd', 'FloatCmp', 'FloatCvt', 'FloatMult', 'FloatDiv',
111912149Sashkan.tousimojarad@arm.com        'FloatSqrt', 'FloatMisc', 'FloatMultAcc',
112012149Sashkan.tousimojarad@arm.com        'SimdAdd', 'SimdAddAcc', 'SimdAlu', 'SimdCmp', 'SimdCvt',
112112149Sashkan.tousimojarad@arm.com        'SimdMisc', 'SimdMult', 'SimdMultAcc', 'SimdShift', 'SimdShiftAcc',
112212149Sashkan.tousimojarad@arm.com        'SimdSqrt', 'SimdFloatAdd', 'SimdFloatAlu', 'SimdFloatCmp',
112312149Sashkan.tousimojarad@arm.com        'SimdFloatCvt', 'SimdFloatDiv', 'SimdFloatMisc', 'SimdFloatMult',
112412149Sashkan.tousimojarad@arm.com        'SimdFloatMultAcc', 'SimdFloatSqrt'])
112512149Sashkan.tousimojarad@arm.com
112612149Sashkan.tousimojarad@arm.com    timings = [
112712149Sashkan.tousimojarad@arm.com        # VUZP and VZIP must be before VADDW/L
112812149Sashkan.tousimojarad@arm.com        HPI_VUZP_A32(), HPI_VZIP_A32(),
112912149Sashkan.tousimojarad@arm.com        HPI_VADD2H_A32(), HPI_VADDHN_A32(),
113012149Sashkan.tousimojarad@arm.com        HPI_VADDL_A32(), HPI_VADDW_A32(),
113112149Sashkan.tousimojarad@arm.com        HPI_VHADD_A32(), HPI_VPADAL_A32(),
113212149Sashkan.tousimojarad@arm.com        HPI_VPADDH_A32(), HPI_VPADDS_A32(),
113312149Sashkan.tousimojarad@arm.com        HPI_VPADDL_A32(), HPI_VRADDHN_A32(),
113412149Sashkan.tousimojarad@arm.com        HPI_VRHADD_A32(), HPI_VQADD_A32(),
113512149Sashkan.tousimojarad@arm.com        HPI_VANDQ_A32(), HPI_VBIC_A32(),
113612149Sashkan.tousimojarad@arm.com        HPI_VBIF_ETC_A32(), HPI_VACGE_A32(),
113712149Sashkan.tousimojarad@arm.com        HPI_VCEQ_A32(), HPI_VCEQI_A32(),
113812149Sashkan.tousimojarad@arm.com        HPI_VCEQII_A32(), HPI_VTST_A32(),
113912149Sashkan.tousimojarad@arm.com        HPI_VCLZ_A32(), HPI_VCNT_A32(),
114012149Sashkan.tousimojarad@arm.com        HPI_VEXT_A32(), HPI_VMAXI_A32(),
114112149Sashkan.tousimojarad@arm.com        HPI_VMAXS_A32(), HPI_VNEGI_A32(),
114212149Sashkan.tousimojarad@arm.com        HPI_VNEGF_A32(), HPI_VREVN_A32(),
114312149Sashkan.tousimojarad@arm.com        HPI_VQNEG_A32(), HPI_VSWP_A32(),
114412149Sashkan.tousimojarad@arm.com        HPI_VTRN_A32(), HPI_VPMAX_A32(),
114512149Sashkan.tousimojarad@arm.com        HPI_VPMAXF_A32(), HPI_VMOVN_A32(),
114612149Sashkan.tousimojarad@arm.com        HPI_VMRS_A1(),
114712149Sashkan.tousimojarad@arm.com        HPI_VMOV_immediate_A1(),
114812149Sashkan.tousimojarad@arm.com        HPI_VMOV_register_A2(),
114912149Sashkan.tousimojarad@arm.com        HPI_VQMOVN_A32(), HPI_VMOVL_A32(),
115012149Sashkan.tousimojarad@arm.com        HPI_VDIV32_A32(), HPI_VDIV64_A32(),
115112149Sashkan.tousimojarad@arm.com        HPI_VSQRT32_A32(), HPI_VSQRT64_A32(),
115212149Sashkan.tousimojarad@arm.com        HPI_VMULI_A32(),
115312149Sashkan.tousimojarad@arm.com        # Add before here
115412149Sashkan.tousimojarad@arm.com        HPI_FMADD_A64(),
115512149Sashkan.tousimojarad@arm.com        HPI_FMSUB_D_A64(),
115612149Sashkan.tousimojarad@arm.com        HPI_FMOV_A64(),
115712149Sashkan.tousimojarad@arm.com        HPI_ADD_SUB_vector_scalar_A64(),
115812149Sashkan.tousimojarad@arm.com        HPI_ADD_SUB_vector_vector_A64(),
115912149Sashkan.tousimojarad@arm.com        HPI_FDIV_scalar_32_A64(), HPI_FDIV_scalar_64_A64(),
116012149Sashkan.tousimojarad@arm.com        HPI_DefaultA64Vfp(),
116112149Sashkan.tousimojarad@arm.com        HPI_DefaultVfp()]
116212149Sashkan.tousimojarad@arm.com
116312149Sashkan.tousimojarad@arm.com    opLat = 6
116412149Sashkan.tousimojarad@arm.com
116512149Sashkan.tousimojarad@arm.comclass HPI_IntFU(MinorFU):
116612149Sashkan.tousimojarad@arm.com    opClasses = minorMakeOpClassSet(['IntAlu'])
116712149Sashkan.tousimojarad@arm.com    # IMPORTANT! Keep the order below, add new entries *at the head*
116812149Sashkan.tousimojarad@arm.com    timings = [
116912149Sashkan.tousimojarad@arm.com        HPI_SSAT_USAT_no_shift_A1(),
117012149Sashkan.tousimojarad@arm.com        HPI_SSAT_USAT_shift_A1(),
117112149Sashkan.tousimojarad@arm.com        HPI_SSAT16_USAT16_A1(),
117212149Sashkan.tousimojarad@arm.com        HPI_QADD_QSUB_A1(),
117312149Sashkan.tousimojarad@arm.com        HPI_QADD_QSUB_T1(),
117412149Sashkan.tousimojarad@arm.com        HPI_QADD_ETC_A1(),
117512149Sashkan.tousimojarad@arm.com        HPI_QASX_QSAX_UQASX_UQSAX_T1(),
117612149Sashkan.tousimojarad@arm.com        HPI_QADD_ETC_T1(),
117712149Sashkan.tousimojarad@arm.com        HPI_USUB_ETC_A1(),
117812149Sashkan.tousimojarad@arm.com        HPI_ADD_ETC_A1(),
117912149Sashkan.tousimojarad@arm.com        HPI_ADD_ETC_T1(),
118012149Sashkan.tousimojarad@arm.com        HPI_QDADD_QDSUB_A1(),
118112149Sashkan.tousimojarad@arm.com        HPI_QDADD_QDSUB_T1(),
118212149Sashkan.tousimojarad@arm.com        HPI_SASX_SHASX_UASX_UHASX_A1(),
118312149Sashkan.tousimojarad@arm.com        HPI_SHSAX_SSAX_UHSAX_USAX_A1(),
118412149Sashkan.tousimojarad@arm.com        HPI_SXTB_SXTB16_SXTH_UXTB_UXTB16_UXTH_A1(),
118512149Sashkan.tousimojarad@arm.com
118612149Sashkan.tousimojarad@arm.com        # Must be after HPI_SXTB_SXTB16_SXTH_UXTB_UXTB16_UXTH_A1
118712149Sashkan.tousimojarad@arm.com        HPI_SXTAB_SXTAB16_SXTAH_UXTAB_UXTAB16_UXTAH_A1(),
118812149Sashkan.tousimojarad@arm.com
118912149Sashkan.tousimojarad@arm.com        HPI_SXTAB_T1(),
119012149Sashkan.tousimojarad@arm.com        HPI_SXTAB16_T1(),
119112149Sashkan.tousimojarad@arm.com        HPI_SXTAH_T1(),
119212149Sashkan.tousimojarad@arm.com        HPI_SXTB_T2(),
119312149Sashkan.tousimojarad@arm.com        HPI_SXTB16_T1(),
119412149Sashkan.tousimojarad@arm.com        HPI_SXTH_T2(),
119512149Sashkan.tousimojarad@arm.com
119612149Sashkan.tousimojarad@arm.com        HPI_PKH_A1(),
119712149Sashkan.tousimojarad@arm.com        HPI_PKH_T1(),
119812149Sashkan.tousimojarad@arm.com        HPI_SBFX_UBFX_A1(),
119912149Sashkan.tousimojarad@arm.com        HPI_SEL_A1(),
120012149Sashkan.tousimojarad@arm.com        HPI_RBIT_A1(),
120112149Sashkan.tousimojarad@arm.com        HPI_REV_REV16_A1(),
120212149Sashkan.tousimojarad@arm.com        HPI_REVSH_A1(),
120312149Sashkan.tousimojarad@arm.com        HPI_USAD8_USADA8_A1(),
120412149Sashkan.tousimojarad@arm.com        HPI_BFI_A1(),
120512149Sashkan.tousimojarad@arm.com        HPI_BFI_T1(),
120612149Sashkan.tousimojarad@arm.com
120712149Sashkan.tousimojarad@arm.com        HPI_CMN_register_A1(),
120812149Sashkan.tousimojarad@arm.com        HPI_CMN_immediate_A1(),
120912149Sashkan.tousimojarad@arm.com        HPI_CMP_register_A1(),
121012149Sashkan.tousimojarad@arm.com        HPI_CMP_immediate_A1(),
121112149Sashkan.tousimojarad@arm.com
121212149Sashkan.tousimojarad@arm.com        HPI_DataProcessingNoShift(),
121312149Sashkan.tousimojarad@arm.com        HPI_DataProcessingMovShiftr(),
121412149Sashkan.tousimojarad@arm.com        HPI_DataProcessingMayShift(),
121512149Sashkan.tousimojarad@arm.com
121612149Sashkan.tousimojarad@arm.com        HPI_Cxxx_A64(),
121712149Sashkan.tousimojarad@arm.com
121812149Sashkan.tousimojarad@arm.com        HPI_DefaultA64Int(),
121912149Sashkan.tousimojarad@arm.com        HPI_DefaultInt()]
122012149Sashkan.tousimojarad@arm.com    opLat = 3
122112149Sashkan.tousimojarad@arm.com
122212149Sashkan.tousimojarad@arm.comclass HPI_Int2FU(MinorFU):
122312149Sashkan.tousimojarad@arm.com    opClasses = minorMakeOpClassSet(['IntAlu'])
122412149Sashkan.tousimojarad@arm.com    # IMPORTANT! Keep the order below, add new entries *at the head*
122512149Sashkan.tousimojarad@arm.com    timings = [
122612149Sashkan.tousimojarad@arm.com        HPI_SSAT_USAT_no_shift_A1(),
122712149Sashkan.tousimojarad@arm.com        HPI_SSAT_USAT_shift_A1(),
122812149Sashkan.tousimojarad@arm.com        HPI_SSAT16_USAT16_A1(),
122912149Sashkan.tousimojarad@arm.com        HPI_QADD_QSUB_A1(),
123012149Sashkan.tousimojarad@arm.com        HPI_QADD_QSUB_T1(),
123112149Sashkan.tousimojarad@arm.com        HPI_QADD_ETC_A1(),
123212149Sashkan.tousimojarad@arm.com        HPI_QASX_QSAX_UQASX_UQSAX_T1(),
123312149Sashkan.tousimojarad@arm.com        HPI_QADD_ETC_T1(),
123412149Sashkan.tousimojarad@arm.com        HPI_USUB_ETC_A1(),
123512149Sashkan.tousimojarad@arm.com        HPI_ADD_ETC_A1(),
123612149Sashkan.tousimojarad@arm.com        HPI_ADD_ETC_T1(),
123712149Sashkan.tousimojarad@arm.com        HPI_QDADD_QDSUB_A1(),
123812149Sashkan.tousimojarad@arm.com        HPI_QDADD_QDSUB_T1(),
123912149Sashkan.tousimojarad@arm.com        HPI_SASX_SHASX_UASX_UHASX_A1(),
124012149Sashkan.tousimojarad@arm.com        HPI_SHSAX_SSAX_UHSAX_USAX_A1(),
124112149Sashkan.tousimojarad@arm.com        HPI_SXTB_SXTB16_SXTH_UXTB_UXTB16_UXTH_A1(),
124212149Sashkan.tousimojarad@arm.com
124312149Sashkan.tousimojarad@arm.com        # Must be after HPI_SXTB_SXTB16_SXTH_UXTB_UXTB16_UXTH_A1
124412149Sashkan.tousimojarad@arm.com        HPI_SXTAB_SXTAB16_SXTAH_UXTAB_UXTAB16_UXTAH_A1(),
124512149Sashkan.tousimojarad@arm.com
124612149Sashkan.tousimojarad@arm.com        HPI_SXTAB_T1(),
124712149Sashkan.tousimojarad@arm.com        HPI_SXTAB16_T1(),
124812149Sashkan.tousimojarad@arm.com        HPI_SXTAH_T1(),
124912149Sashkan.tousimojarad@arm.com        HPI_SXTB_T2(),
125012149Sashkan.tousimojarad@arm.com        HPI_SXTB16_T1(),
125112149Sashkan.tousimojarad@arm.com        HPI_SXTH_T2(),
125212149Sashkan.tousimojarad@arm.com
125312149Sashkan.tousimojarad@arm.com        HPI_PKH_A1(),
125412149Sashkan.tousimojarad@arm.com        HPI_PKH_T1(),
125512149Sashkan.tousimojarad@arm.com        HPI_SBFX_UBFX_A1(),
125612149Sashkan.tousimojarad@arm.com        HPI_SEL_A1_Suppress(),
125712149Sashkan.tousimojarad@arm.com        HPI_RBIT_A1(),
125812149Sashkan.tousimojarad@arm.com        HPI_REV_REV16_A1(),
125912149Sashkan.tousimojarad@arm.com        HPI_REVSH_A1(),
126012149Sashkan.tousimojarad@arm.com        HPI_USAD8_USADA8_A1_Suppress(),
126112149Sashkan.tousimojarad@arm.com        HPI_BFI_A1(),
126212149Sashkan.tousimojarad@arm.com        HPI_BFI_T1(),
126312149Sashkan.tousimojarad@arm.com
126412149Sashkan.tousimojarad@arm.com        HPI_CMN_register_A1(), # Need to check for shift
126512149Sashkan.tousimojarad@arm.com        HPI_CMN_immediate_A1(),
126612149Sashkan.tousimojarad@arm.com        HPI_CMP_register_A1(), # Need to check for shift
126712149Sashkan.tousimojarad@arm.com        HPI_CMP_immediate_A1(),
126812149Sashkan.tousimojarad@arm.com
126912149Sashkan.tousimojarad@arm.com        HPI_DataProcessingNoShift(),
127012149Sashkan.tousimojarad@arm.com        HPI_DataProcessingAllowShifti(),
127112149Sashkan.tousimojarad@arm.com        # HPI_DataProcessingAllowMovShiftr(),
127212149Sashkan.tousimojarad@arm.com
127312149Sashkan.tousimojarad@arm.com        # Data processing ops that match SuppressShift but are *not*
127412149Sashkan.tousimojarad@arm.com        # to be suppressed here
127512149Sashkan.tousimojarad@arm.com        HPI_CLZ_A1(),
127612149Sashkan.tousimojarad@arm.com        HPI_CLZ_T1(),
127712149Sashkan.tousimojarad@arm.com        HPI_DataProcessingSuppressShift(),
127812149Sashkan.tousimojarad@arm.com        # Can you dual issue a branch?
127912149Sashkan.tousimojarad@arm.com        # HPI_DataProcessingSuppressBranch(),
128012149Sashkan.tousimojarad@arm.com        HPI_Cxxx_A64(),
128112149Sashkan.tousimojarad@arm.com
128212149Sashkan.tousimojarad@arm.com        HPI_DefaultA64Int(),
128312149Sashkan.tousimojarad@arm.com        HPI_DefaultInt()]
128412149Sashkan.tousimojarad@arm.com    opLat = 3
128512149Sashkan.tousimojarad@arm.com
128612149Sashkan.tousimojarad@arm.comclass HPI_IntMulFU(MinorFU):
128712149Sashkan.tousimojarad@arm.com    opClasses = minorMakeOpClassSet(['IntMult'])
128812149Sashkan.tousimojarad@arm.com    timings = [
128912149Sashkan.tousimojarad@arm.com        HPI_MLA_A1(), HPI_MLA_T1(),
129012149Sashkan.tousimojarad@arm.com        HPI_MLS_A1(), HPI_MLS_T1(),
129112149Sashkan.tousimojarad@arm.com        HPI_SMLABB_A1(), HPI_SMLABB_T1(),
129212149Sashkan.tousimojarad@arm.com        HPI_SMLAWB_A1(), HPI_SMLAWB_T1(),
129312149Sashkan.tousimojarad@arm.com        HPI_SMLAD_A1(), HPI_SMLAD_T1(),
129412149Sashkan.tousimojarad@arm.com        HPI_SMMUL_A1(), HPI_SMMUL_T1(),
129512149Sashkan.tousimojarad@arm.com        # SMMUL_A1 must be before SMMLA_A1
129612149Sashkan.tousimojarad@arm.com        HPI_SMMLA_A1(), HPI_SMMLA_T1(),
129712149Sashkan.tousimojarad@arm.com        HPI_SMMLS_A1(), HPI_SMMLS_T1(),
129812149Sashkan.tousimojarad@arm.com        HPI_UMAAL_A1(), HPI_UMAAL_T1(),
129912149Sashkan.tousimojarad@arm.com
130012149Sashkan.tousimojarad@arm.com        HPI_MADD_A64(),
130112149Sashkan.tousimojarad@arm.com        HPI_DefaultA64Mul(),
130212149Sashkan.tousimojarad@arm.com        HPI_DefaultMul()]
130312149Sashkan.tousimojarad@arm.com    opLat = 3
130412149Sashkan.tousimojarad@arm.com    cantForwardFromFUIndices = [0, 1, 5] # Int1, Int2, Mem
130512149Sashkan.tousimojarad@arm.com
130612149Sashkan.tousimojarad@arm.comclass HPI_IntDivFU(MinorFU):
130712149Sashkan.tousimojarad@arm.com    opClasses = minorMakeOpClassSet(['IntDiv'])
130812149Sashkan.tousimojarad@arm.com    timings = [HPI_SDIV_A1(), HPI_UDIV_A1(),
130912149Sashkan.tousimojarad@arm.com        HPI_SDIV_A64()]
131012149Sashkan.tousimojarad@arm.com    issueLat = 3
131112149Sashkan.tousimojarad@arm.com    opLat = 3
131212149Sashkan.tousimojarad@arm.com
131312149Sashkan.tousimojarad@arm.comclass HPI_MemFU(MinorFU):
131412149Sashkan.tousimojarad@arm.com    opClasses = minorMakeOpClassSet(['MemRead', 'MemWrite', 'FloatMemRead',
131512149Sashkan.tousimojarad@arm.com                                     'FloatMemWrite'])
131612149Sashkan.tousimojarad@arm.com    timings = [HPI_DefaultMem(), HPI_DefaultMem64()]
131712149Sashkan.tousimojarad@arm.com    opLat = 1
131812149Sashkan.tousimojarad@arm.com    cantForwardFromFUIndices = [5] # Mem (this FU)
131912149Sashkan.tousimojarad@arm.com
132012149Sashkan.tousimojarad@arm.comclass HPI_MiscFU(MinorFU):
132112149Sashkan.tousimojarad@arm.com    opClasses = minorMakeOpClassSet(['IprAccess', 'InstPrefetch'])
132212149Sashkan.tousimojarad@arm.com    opLat = 1
132312149Sashkan.tousimojarad@arm.com
132412149Sashkan.tousimojarad@arm.comclass HPI_FUPool(MinorFUPool):
132512149Sashkan.tousimojarad@arm.com    funcUnits = [HPI_IntFU(), # 0
132612149Sashkan.tousimojarad@arm.com        HPI_Int2FU(), # 1
132712149Sashkan.tousimojarad@arm.com        HPI_IntMulFU(), # 2
132812149Sashkan.tousimojarad@arm.com        HPI_IntDivFU(), # 3
132912149Sashkan.tousimojarad@arm.com        HPI_FloatSimdFU(), # 4
133012149Sashkan.tousimojarad@arm.com        HPI_MemFU(), # 5
133112149Sashkan.tousimojarad@arm.com        HPI_MiscFU() # 6
133212149Sashkan.tousimojarad@arm.com        ]
133312149Sashkan.tousimojarad@arm.com
133412149Sashkan.tousimojarad@arm.comclass HPI_DTB(ArmTLB):
133512149Sashkan.tousimojarad@arm.com    size = 256
133612149Sashkan.tousimojarad@arm.com
133712149Sashkan.tousimojarad@arm.comclass HPI_ITB(ArmTLB):
133812149Sashkan.tousimojarad@arm.com    size = 256
133912149Sashkan.tousimojarad@arm.com
134012149Sashkan.tousimojarad@arm.comclass HPI_WalkCache(Cache):
134112149Sashkan.tousimojarad@arm.com    data_latency = 4
134212149Sashkan.tousimojarad@arm.com    tag_latency = 4
134312149Sashkan.tousimojarad@arm.com    response_latency = 4
134412149Sashkan.tousimojarad@arm.com    mshrs = 6
134512149Sashkan.tousimojarad@arm.com    tgts_per_mshr = 8
134612149Sashkan.tousimojarad@arm.com    size = '1kB'
134712149Sashkan.tousimojarad@arm.com    assoc = 8
134812149Sashkan.tousimojarad@arm.com    write_buffers = 16
134912149Sashkan.tousimojarad@arm.com
135012149Sashkan.tousimojarad@arm.comclass HPI_BP(TournamentBP):
135112149Sashkan.tousimojarad@arm.com    localPredictorSize = 64
135212149Sashkan.tousimojarad@arm.com    localCtrBits = 2
135312149Sashkan.tousimojarad@arm.com    localHistoryTableSize = 64
135412149Sashkan.tousimojarad@arm.com    globalPredictorSize = 1024
135512149Sashkan.tousimojarad@arm.com    globalCtrBits = 2
135612149Sashkan.tousimojarad@arm.com    choicePredictorSize = 1024
135712149Sashkan.tousimojarad@arm.com    choiceCtrBits = 2
135812149Sashkan.tousimojarad@arm.com    BTBEntries = 128
135912149Sashkan.tousimojarad@arm.com    BTBTagSize = 18
136012149Sashkan.tousimojarad@arm.com    RASSize = 8
136112149Sashkan.tousimojarad@arm.com    instShiftAmt = 2
136212149Sashkan.tousimojarad@arm.com
136312149Sashkan.tousimojarad@arm.comclass HPI_ICache(Cache):
136412149Sashkan.tousimojarad@arm.com    data_latency = 1
136512149Sashkan.tousimojarad@arm.com    tag_latency = 1
136612149Sashkan.tousimojarad@arm.com    response_latency = 1
136712149Sashkan.tousimojarad@arm.com    mshrs = 2
136812149Sashkan.tousimojarad@arm.com    tgts_per_mshr = 8
136912149Sashkan.tousimojarad@arm.com    size = '32kB'
137012149Sashkan.tousimojarad@arm.com    assoc = 2
137112149Sashkan.tousimojarad@arm.com    # No prefetcher, this is handled by the core
137212149Sashkan.tousimojarad@arm.com
137312149Sashkan.tousimojarad@arm.comclass HPI_DCache(Cache):
137412149Sashkan.tousimojarad@arm.com    data_latency = 1
137512149Sashkan.tousimojarad@arm.com    tag_latency = 1
137612149Sashkan.tousimojarad@arm.com    response_latency = 1
137712149Sashkan.tousimojarad@arm.com    mshrs = 4
137812149Sashkan.tousimojarad@arm.com    tgts_per_mshr = 8
137912149Sashkan.tousimojarad@arm.com    size = '32kB'
138012149Sashkan.tousimojarad@arm.com    assoc = 4
138112149Sashkan.tousimojarad@arm.com    write_buffers = 4
138212149Sashkan.tousimojarad@arm.com    prefetcher = StridePrefetcher(
138312149Sashkan.tousimojarad@arm.com        queue_size=4,
138412149Sashkan.tousimojarad@arm.com        degree=4)
138512149Sashkan.tousimojarad@arm.com
138612149Sashkan.tousimojarad@arm.comclass HPI_L2(Cache):
138712149Sashkan.tousimojarad@arm.com    data_latency = 13
138812149Sashkan.tousimojarad@arm.com    tag_latency = 13
138912149Sashkan.tousimojarad@arm.com    response_latency = 5
139012149Sashkan.tousimojarad@arm.com    mshrs = 4
139112149Sashkan.tousimojarad@arm.com    tgts_per_mshr = 8
139212149Sashkan.tousimojarad@arm.com    size = '1024kB'
139312149Sashkan.tousimojarad@arm.com    assoc = 16
139412149Sashkan.tousimojarad@arm.com    write_buffers = 16
139512149Sashkan.tousimojarad@arm.com    # prefetcher FIXME
139612149Sashkan.tousimojarad@arm.com
139712149Sashkan.tousimojarad@arm.comclass HPI(MinorCPU):
139812149Sashkan.tousimojarad@arm.com    # Inherit the doc string from the module to avoid repeating it
139912149Sashkan.tousimojarad@arm.com    # here.
140012149Sashkan.tousimojarad@arm.com    __doc__ = __doc__
140112149Sashkan.tousimojarad@arm.com
140212149Sashkan.tousimojarad@arm.com    fetch1LineSnapWidth = 0
140312149Sashkan.tousimojarad@arm.com    fetch1LineWidth = 0
140412149Sashkan.tousimojarad@arm.com    fetch1FetchLimit = 1
140512149Sashkan.tousimojarad@arm.com    fetch1ToFetch2ForwardDelay = 1
140612149Sashkan.tousimojarad@arm.com    fetch1ToFetch2BackwardDelay = 1
140712149Sashkan.tousimojarad@arm.com
140812149Sashkan.tousimojarad@arm.com    fetch2InputBufferSize = 2
140912149Sashkan.tousimojarad@arm.com    fetch2ToDecodeForwardDelay = 1
141012149Sashkan.tousimojarad@arm.com    fetch2CycleInput = True
141112149Sashkan.tousimojarad@arm.com
141212149Sashkan.tousimojarad@arm.com    decodeInputBufferSize = 3
141312149Sashkan.tousimojarad@arm.com    decodeToExecuteForwardDelay = 1
141412149Sashkan.tousimojarad@arm.com    decodeInputWidth = 2
141512149Sashkan.tousimojarad@arm.com    decodeCycleInput = True
141612149Sashkan.tousimojarad@arm.com
141712149Sashkan.tousimojarad@arm.com    executeInputWidth = 2
141812149Sashkan.tousimojarad@arm.com    executeCycleInput = True
141912149Sashkan.tousimojarad@arm.com    executeIssueLimit = 2
142012149Sashkan.tousimojarad@arm.com
142112149Sashkan.tousimojarad@arm.com    # Only allow one ld/st to be issued but the second ld/st FU allows
142212149Sashkan.tousimojarad@arm.com    # back-to-back loads
142312149Sashkan.tousimojarad@arm.com    executeMemoryIssueLimit = 1
142412149Sashkan.tousimojarad@arm.com
142512149Sashkan.tousimojarad@arm.com    executeCommitLimit = 2
142612149Sashkan.tousimojarad@arm.com    executeMemoryCommitLimit = 1
142712149Sashkan.tousimojarad@arm.com    executeInputBufferSize = 7
142812149Sashkan.tousimojarad@arm.com
142912149Sashkan.tousimojarad@arm.com    executeMaxAccessesInMemory = 2
143012149Sashkan.tousimojarad@arm.com
143112149Sashkan.tousimojarad@arm.com    executeLSQMaxStoreBufferStoresPerCycle = 2
143212149Sashkan.tousimojarad@arm.com    executeLSQRequestsQueueSize = 1
143312149Sashkan.tousimojarad@arm.com    executeLSQTransfersQueueSize = 2
143412149Sashkan.tousimojarad@arm.com    executeLSQStoreBufferSize = 5
143512149Sashkan.tousimojarad@arm.com    executeBranchDelay = 1
143612149Sashkan.tousimojarad@arm.com    executeFuncUnits = HPI_FUPool()
143712149Sashkan.tousimojarad@arm.com    executeSetTraceTimeOnCommit = True
143812149Sashkan.tousimojarad@arm.com    executeSetTraceTimeOnIssue = False
143912149Sashkan.tousimojarad@arm.com
144012149Sashkan.tousimojarad@arm.com    executeAllowEarlyMemoryIssue = True
144112149Sashkan.tousimojarad@arm.com
144212149Sashkan.tousimojarad@arm.com    enableIdling = True
144312149Sashkan.tousimojarad@arm.com
144412149Sashkan.tousimojarad@arm.com    branchPred = HPI_BP(numThreads = Parent.numThreads)
144512149Sashkan.tousimojarad@arm.com
144612149Sashkan.tousimojarad@arm.com    itb = HPI_ITB()
144712149Sashkan.tousimojarad@arm.com    dtb = HPI_DTB()
144812149Sashkan.tousimojarad@arm.com
144912149Sashkan.tousimojarad@arm.com__all__ = [
145012149Sashkan.tousimojarad@arm.com    "HPI_BP",
145112149Sashkan.tousimojarad@arm.com    "HPI_ITB", "HPI_DTB", "HPI_WalkCache",
145212149Sashkan.tousimojarad@arm.com    "HPI_ICache", "HPI_DCache", "HPI_L2",
145312149Sashkan.tousimojarad@arm.com    "HPI",
145412149Sashkan.tousimojarad@arm.com]
1455