operands.isa revision 5254
12686Sksewell@umich.edu// -*- mode:c++ -*-
22686Sksewell@umich.edu
35254Sksewell@umich.edu// Copyright (c) 2007 MIPS Technologies, Inc.
45254Sksewell@umich.edu// All rights reserved.
55254Sksewell@umich.edu//
65254Sksewell@umich.edu// Redistribution and use in source and binary forms, with or without
75254Sksewell@umich.edu// modification, are permitted provided that the following conditions are
85254Sksewell@umich.edu// met: redistributions of source code must retain the above copyright
95254Sksewell@umich.edu// notice, this list of conditions and the following disclaimer;
105254Sksewell@umich.edu// redistributions in binary form must reproduce the above copyright
115254Sksewell@umich.edu// notice, this list of conditions and the following disclaimer in the
125254Sksewell@umich.edu// documentation and/or other materials provided with the distribution;
135254Sksewell@umich.edu// neither the name of the copyright holders nor the names of its
145254Sksewell@umich.edu// contributors may be used to endorse or promote products derived from
155254Sksewell@umich.edu// this software without specific prior written permission.
165254Sksewell@umich.edu//
175254Sksewell@umich.edu// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
185254Sksewell@umich.edu// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
195254Sksewell@umich.edu// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
205254Sksewell@umich.edu// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
215254Sksewell@umich.edu// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
225254Sksewell@umich.edu// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
235254Sksewell@umich.edu// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
245254Sksewell@umich.edu// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
255254Sksewell@umich.edu// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
265254Sksewell@umich.edu// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
275254Sksewell@umich.edu// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
285254Sksewell@umich.edu//
295254Sksewell@umich.edu// Authors: Korey Sewell
305254Sksewell@umich.edu//          Jaidev Patwardhan
312706Sksewell@umich.edu
322023SN/Adef operand_types {{
332023SN/A    'sb' : ('signed int', 8),
342023SN/A    'ub' : ('unsigned int', 8),
352124SN/A    'sh' : ('signed int', 16),
362124SN/A    'uh' : ('unsigned int', 16),
372023SN/A    'sw' : ('signed int', 32),
382023SN/A    'uw' : ('unsigned int', 32),
392084SN/A    'sd' : ('signed int', 64),
402084SN/A    'ud' : ('unsigned int', 64),
412023SN/A    'sf' : ('float', 32),
422023SN/A    'df' : ('float', 64),
432023SN/A}};
442023SN/A
452023SN/Adef operands {{
462616SN/A    #General Purpose Integer Reg Operands
472077SN/A    'Rd': ('IntReg', 'uw', 'RD', 'IsInteger', 1),
482077SN/A    'Rs': ('IntReg', 'uw', 'RS', 'IsInteger', 2),
492077SN/A    'Rt': ('IntReg', 'uw', 'RT', 'IsInteger', 3),
502616SN/A
514661Sksewell@umich.edu    #Immediate Value operand
524661Sksewell@umich.edu    'IntImm': ('IntReg', 'uw', 'INTIMM', 'IsInteger', 3),
534661Sksewell@umich.edu
542616SN/A    #Operands used for Link or Syscall Insts
552616SN/A    'R31': ('IntReg', 'uw','31','IsInteger', 4),
562562SN/A    'R2':  ('IntReg', 'uw','2', 'IsInteger', 5),
572041SN/A
582616SN/A    #Special Integer Reg operands
594661Sksewell@umich.edu    'LO0':  ('IntReg', 'uw','MipsISA::LO', 'IsInteger', 6),
604661Sksewell@umich.edu    'HI0':  ('IntReg', 'uw','MipsISA::HI', 'IsInteger', 7),
612616SN/A
624661Sksewell@umich.edu    #Bitfield-dependent HI/LO Register Access
634661Sksewell@umich.edu    'LO_RD_SEL': ('IntReg','uw','MipsISA::DSPLo0 + ACDST*3', None, 6),
644661Sksewell@umich.edu    'HI_RD_SEL': ('IntReg','uw','MipsISA::DSPHi0 + ACDST*3', None, 7),
654661Sksewell@umich.edu    'LO_RS_SEL': ('IntReg','uw','MipsISA::DSPLo0 + ACSRC*3', None, 6),
664661Sksewell@umich.edu    'HI_RS_SEL': ('IntReg','uw','MipsISA::DSPHi0 + ACSRC*3', None, 7),
674661Sksewell@umich.edu
684661Sksewell@umich.edu    #DSP Special Purpose Integer Operands
694661Sksewell@umich.edu    'DSPControl': ('IntReg', 'uw', 'MipsISA::DSPControl', None, 8),
704661Sksewell@umich.edu    'DSPLo0': ('IntReg', 'uw', 'MipsISA::LO', None, 1),
714661Sksewell@umich.edu    'DSPHi0': ('IntReg', 'uw', 'MipsISA::HI', None, 1),
724661Sksewell@umich.edu    'DSPACX0': ('IntReg', 'uw', 'MipsISA::DSPACX0', None, 1),
734661Sksewell@umich.edu    'DSPLo1': ('IntReg', 'uw', 'MipsISA::DSPLo1', None, 1),
744661Sksewell@umich.edu    'DSPHi1': ('IntReg', 'uw', 'MipsISA::DSPHi1', None, 1),
754661Sksewell@umich.edu    'DSPACX1': ('IntReg', 'uw', 'MipsISA::DSPACX1', None, 1),
764661Sksewell@umich.edu    'DSPLo2': ('IntReg', 'uw', 'MipsISA::DSPLo2', None, 1),
774661Sksewell@umich.edu    'DSPHi2': ('IntReg', 'uw', 'MipsISA::DSPHi2', None, 1),
784661Sksewell@umich.edu    'DSPACX2': ('IntReg', 'uw', 'MipsISA::DSPACX2', None, 1),
794661Sksewell@umich.edu    'DSPLo3': ('IntReg', 'uw', 'MipsISA::DSPLo3', None, 1),
804661Sksewell@umich.edu    'DSPHi3': ('IntReg', 'uw', 'MipsISA::DSPHi3', None, 1),
814661Sksewell@umich.edu    'DSPACX3': ('IntReg', 'uw', 'MipsISA::DSPACX3', None, 1),
822041SN/A
832616SN/A    #Floating Point Reg Operands
842077SN/A    'Fd': ('FloatReg', 'sf', 'FD', 'IsFloating', 1),
852077SN/A    'Fs': ('FloatReg', 'sf', 'FS', 'IsFloating', 2),
862077SN/A    'Ft': ('FloatReg', 'sf', 'FT', 'IsFloating', 3),
872239SN/A    'Fr': ('FloatReg', 'sf', 'FR', 'IsFloating', 3),
882041SN/A
894661Sksewell@umich.edu    #Special Purpose Floating Point Control Reg Operands
902754Sksewell@umich.edu    'FIR':  ('FloatReg', 'uw', 'MipsISA::FIR', 'IsFloating', 1),
912754Sksewell@umich.edu    'FCCR': ('FloatReg', 'uw', 'MipsISA::FCCR', 'IsFloating', 2),
922754Sksewell@umich.edu    'FEXR': ('FloatReg', 'uw', 'MipsISA::FEXR', 'IsFloating', 3),
932754Sksewell@umich.edu    'FENR': ('FloatReg', 'uw', 'MipsISA::FENR', 'IsFloating', 3),
942754Sksewell@umich.edu    'FCSR': ('FloatReg', 'uw', 'MipsISA::FCSR', 'IsFloating', 3),
952616SN/A
964661Sksewell@umich.edu    #Operands For Paired Singles FP Operations
972607SN/A    'Fd1': ('FloatReg', 'sf', 'FD', 'IsFloating', 4),
982607SN/A    'Fd2': ('FloatReg', 'sf', 'FD+1', 'IsFloating', 4),
992607SN/A    'Fs1': ('FloatReg', 'sf', 'FS', 'IsFloating', 5),
1002607SN/A    'Fs2': ('FloatReg', 'sf', 'FS+1', 'IsFloating', 5),
1012607SN/A    'Ft1': ('FloatReg', 'sf', 'FT', 'IsFloating', 6),
1022607SN/A    'Ft2': ('FloatReg', 'sf', 'FT+1', 'IsFloating', 6),
1032607SN/A    'Fr1': ('FloatReg', 'sf', 'FR', 'IsFloating', 7),
1042607SN/A    'Fr2': ('FloatReg', 'sf', 'FR+1', 'IsFloating', 7),
1052607SN/A
1064661Sksewell@umich.edu    #Status Control Reg
1074661Sksewell@umich.edu    'Status': ('ControlReg', 'uw', 'MipsISA::Status', None, 1),
1084661Sksewell@umich.edu
1095222Sksewell@umich.edu    #LL Flag
1105222Sksewell@umich.edu    'LLFlag': ('ControlReg', 'uw', 'MipsISA::LLFlag', None, 1),
1115222Sksewell@umich.edu
1125222Sksewell@umich.edu    # Index Register
1135222Sksewell@umich.edu    'Index':('ControlReg','uw','MipsISA::Index',None,1),
1145222Sksewell@umich.edu
1155222Sksewell@umich.edu
1164661Sksewell@umich.edu    #Special cases for when a Control Register Access is dependent on
1174661Sksewell@umich.edu    #a combination of bitfield indices (handles MTCO & MFCO)
1185222Sksewell@umich.edu    # Fixed to allow CP0 Register Offset
1195222Sksewell@umich.edu    'CP0_RD_SEL': ('IControlReg', 'uw', '(RD << 3 | SEL) + Ctrl_Base_DepTag', None, 1),
1204661Sksewell@umich.edu
1214661Sksewell@umich.edu    #MT Control Regs
1224661Sksewell@umich.edu    'MVPConf0': ('ControlReg', 'uw', 'MipsISA::MVPConf0', None, 1),
1234661Sksewell@umich.edu    'MVPControl': ('ControlReg', 'uw', 'MipsISA::MVPControl', None, 1),
1244661Sksewell@umich.edu    'TCBind': ('ControlReg', 'uw', 'MipsISA::TCBind', None, 1),
1254661Sksewell@umich.edu    'TCStatus': ('ControlReg', 'uw', 'MipsISA::TCStatus', None, 1),
1264661Sksewell@umich.edu    'TCRestart': ('ControlReg', 'uw', 'MipsISA::TCRestart', None, 1),
1274661Sksewell@umich.edu    'VPEConf0': ('ControlReg', 'uw', 'MipsISA::VPEConf0', None, 1),
1284661Sksewell@umich.edu    'VPEControl': ('ControlReg', 'uw', 'MipsISA::VPEControl', None, 1),
1294661Sksewell@umich.edu    'YQMask': ('ControlReg', 'uw', 'MipsISA::YQMask', None, 1),
1304661Sksewell@umich.edu
1315222Sksewell@umich.edu    #CP0 Control Regs
1325222Sksewell@umich.edu    'EntryHi': ('ControlReg','uw', 'MipsISA::EntryHi',None,1),
1335222Sksewell@umich.edu    'EntryLo0': ('ControlReg','uw', 'MipsISA::EntryLo0',None,1),
1345222Sksewell@umich.edu    'EntryLo1': ('ControlReg','uw', 'MipsISA::EntryLo1',None,1),
1355222Sksewell@umich.edu    'PageMask': ('ControlReg','uw', 'MipsISA::PageMask',None,1),
1365222Sksewell@umich.edu    'Random': ('ControlReg','uw', 'MipsISA::CP0_Random',None,1),
1375222Sksewell@umich.edu    'ErrorEPC': ('ControlReg','uw', 'MipsISA::ErrorEPC',None,1),
1385222Sksewell@umich.edu    'EPC': ('ControlReg','uw', 'MipsISA::EPC',None,1),
1395222Sksewell@umich.edu    'DEPC': ('ControlReg','uw', 'MipsISA::DEPC',None,1),
1405222Sksewell@umich.edu    'SRSCtl': ('ControlReg','uw', 'MipsISA::SRSCtl',None,1),
1415222Sksewell@umich.edu    'Config': ('ControlReg','uw', 'MipsISA::Config',None,1),
1425222Sksewell@umich.edu    'Config3': ('ControlReg','uw', 'MipsISA::Config3',None,1),
1435222Sksewell@umich.edu    'Config1': ('ControlReg','uw', 'MipsISA::Config1',None,1),
1445222Sksewell@umich.edu    'Config2': ('ControlReg','uw', 'MipsISA::Config2',None,1),
1455222Sksewell@umich.edu    'PageGrain': ('ControlReg','uw', 'MipsISA::PageGrain',None,1),
1465222Sksewell@umich.edu
1475222Sksewell@umich.edu
1484661Sksewell@umich.edu    # named bitfields of Control Regs
1494661Sksewell@umich.edu    'Status_IE': ('ControlBitfield', 'uw', 'MipsISA::Status', None, 1),
1504661Sksewell@umich.edu    'Status_ERL': ('ControlBitfield', 'uw', 'MipsISA::Status', None, 1),
1514661Sksewell@umich.edu    'Status_EXL': ('ControlBitfield', 'uw', 'MipsISA::Status', None, 1),
1525222Sksewell@umich.edu    'Status_BEV': ('ControlBitfield', 'uw', 'MipsISA::Status', None, 1),
1534661Sksewell@umich.edu    'Status_CU3': ('ControlBitfield', 'uw', 'MipsISA::Status', None, 1),
1544661Sksewell@umich.edu    'Status_CU2': ('ControlBitfield', 'uw', 'MipsISA::Status', None, 1),
1554661Sksewell@umich.edu    'Status_CU1': ('ControlBitfield', 'uw', 'MipsISA::Status', None, 1),
1564661Sksewell@umich.edu    'Status_CU0': ('ControlBitfield', 'uw', 'MipsISA::Status', None, 1),
1574661Sksewell@umich.edu    'SRSCtl_HSS': ('ControlBitfield', 'uw', 'MipsISA::SRSCtl', None, 4),
1584661Sksewell@umich.edu    'SRSCtl_PSS': ('ControlBitfield', 'uw', 'MipsISA::SRSCtl', None, 4),
1594661Sksewell@umich.edu    'SRSCtl_CSS': ('ControlBitfield', 'uw', 'MipsISA::SRSCtl', None, 4),
1604661Sksewell@umich.edu    'Config_AR': ('ControlBitfield', 'uw', 'MipsISA::Config', None, 3),
1615222Sksewell@umich.edu    'Config_MT': ('ControlBitfield', 'uw', 'MipsISA::Config', None, 1),
1625222Sksewell@umich.edu    'Config1_CA': ('ControlBitfield', 'uw', 'MipsISA::Config1', None, 1),
1635222Sksewell@umich.edu    'Config3_SP': ('ControlBitfield', 'uw', 'MipsISA::Config3', None, 1),
1645222Sksewell@umich.edu    'PageGrain_ESP': ('ControlBitfield', 'uw', 'MipsISA::PageGrain', None, 1),
1655222Sksewell@umich.edu    'Cause_EXCCODE': ('ControlBitfield', 'uw', 'MipsISA::Cause', None, 4),
1665222Sksewell@umich.edu    'Cause_TI': ('ControlBitfield', 'uw', 'MipsISA::Cause', None, 4),
1675222Sksewell@umich.edu    'IntCtl_IPTI': ('ControlBitfield', 'uw', 'MipsISA::IntCtl', None, 4),
1685222Sksewell@umich.edu    'EntryHi_ASID': ('ControlBitfield', 'uw', 'MipsISA::EntryHi', None, 1),
1695222Sksewell@umich.edu    'EntryLo0_PFN': ('ControlBitfield', 'uw', 'MipsISA::EntryLo0', None, 1),
1705222Sksewell@umich.edu    'EntryLo0_C': ('ControlBitfield', 'uw', 'MipsISA::EntryLo0', None, 3),
1715222Sksewell@umich.edu    'EntryLo0_D': ('ControlBitfield', 'uw', 'MipsISA::EntryLo0', None, 1),
1725222Sksewell@umich.edu    'EntryLo0_V': ('ControlBitfield', 'uw', 'MipsISA::EntryLo0', None, 1),
1735222Sksewell@umich.edu    'EntryLo0_G': ('ControlBitfield', 'uw', 'MipsISA::EntryLo0', None, 1),
1745222Sksewell@umich.edu    'EntryLo1_PFN': ('ControlBitfield', 'uw', 'MipsISA::EntryLo1', None, 1),
1755222Sksewell@umich.edu    'EntryLo1_C': ('ControlBitfield', 'uw', 'MipsISA::EntryLo1', None, 3),
1765222Sksewell@umich.edu    'EntryLo1_D': ('ControlBitfield', 'uw', 'MipsISA::EntryLo1', None, 1),
1775222Sksewell@umich.edu    'EntryLo1_V': ('ControlBitfield', 'uw', 'MipsISA::EntryLo1', None, 1),
1785222Sksewell@umich.edu    'EntryLo1_G': ('ControlBitfield', 'uw', 'MipsISA::EntryLo1', None, 1),
1794661Sksewell@umich.edu
1804661Sksewell@umich.edu    # named bitfields of Debug Regs
1814661Sksewell@umich.edu    'Debug_DM': ('ControlBitfield', 'uw', 'MipsISA::Debug', None, 1),
1824661Sksewell@umich.edu    'Debug_IEXI': ('ControlBitfield', 'uw', 'MipsISA::Debug', None, 1),
1834661Sksewell@umich.edu
1842616SN/A    #Memory Operand
1852495SN/A    'Mem': ('Mem', 'uw', None, ('IsMemRef', 'IsLoad', 'IsStore'), 4),
1862041SN/A
1872616SN/A    #Program Counter Operands
1884661Sksewell@umich.edu    'NPC': ('NPC', 'uw', None, 'IsControl', 4),
1894661Sksewell@umich.edu    'NNPC':('NNPC', 'uw', None, 'IsControl', 4)
1902023SN/A}};
191