operands.isa revision 6383
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
596383Sgblack@eecs.umich.edu    'LO0':  ('IntReg', 'uw','INTREG_LO', 'IsInteger', 6),
606383Sgblack@eecs.umich.edu    'HI0':  ('IntReg', 'uw','INTREG_HI', 'IsInteger', 7),
612616SN/A
624661Sksewell@umich.edu    #Bitfield-dependent HI/LO Register Access
636383Sgblack@eecs.umich.edu    'LO_RD_SEL': ('IntReg','uw','INTREG_DSP_LO0 + ACDST*3', None, 6),
646383Sgblack@eecs.umich.edu    'HI_RD_SEL': ('IntReg','uw','INTREG_DSP_HI0 + ACDST*3', None, 7),
656383Sgblack@eecs.umich.edu    'LO_RS_SEL': ('IntReg','uw','INTREG_DSP_LO0 + ACSRC*3', None, 6),
666383Sgblack@eecs.umich.edu    'HI_RS_SEL': ('IntReg','uw','INTREG_DSP_HI0 + ACSRC*3', None, 7),
674661Sksewell@umich.edu
684661Sksewell@umich.edu    #DSP Special Purpose Integer Operands
696383Sgblack@eecs.umich.edu    'DSPControl': ('IntReg', 'uw', 'INTREG_DSP_CONTROL', None, 8),
706383Sgblack@eecs.umich.edu    'DSPLo0': ('IntReg', 'uw', 'INTREG_LO', None, 1),
716383Sgblack@eecs.umich.edu    'DSPHi0': ('IntReg', 'uw', 'INTREG_HI', None, 1),
726383Sgblack@eecs.umich.edu    'DSPACX0': ('IntReg', 'uw', 'INTREG_DSP_ACX0', None, 1),
736383Sgblack@eecs.umich.edu    'DSPLo1': ('IntReg', 'uw', 'INTREG_DSP_LO1', None, 1),
746383Sgblack@eecs.umich.edu    'DSPHi1': ('IntReg', 'uw', 'INTREG_DSP_HI1', None, 1),
756383Sgblack@eecs.umich.edu    'DSPACX1': ('IntReg', 'uw', 'INTREG_DSP_ACX1', None, 1),
766383Sgblack@eecs.umich.edu    'DSPLo2': ('IntReg', 'uw', 'INTREG_DSP_LO2', None, 1),
776383Sgblack@eecs.umich.edu    'DSPHi2': ('IntReg', 'uw', 'INTREG_DSP_HI2', None, 1),
786383Sgblack@eecs.umich.edu    'DSPACX2': ('IntReg', 'uw', 'INTREG_DSP_ACX2', None, 1),
796383Sgblack@eecs.umich.edu    'DSPLo3': ('IntReg', 'uw', 'INTREG_DSP_LO3', None, 1),
806383Sgblack@eecs.umich.edu    'DSPHi3': ('IntReg', 'uw', 'INTREG_DSP_HI3', None, 1),
816383Sgblack@eecs.umich.edu    'DSPACX3': ('IntReg', 'uw', 'INTREG_DSP_ACX3', 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
906383Sgblack@eecs.umich.edu    'FIR':  ('FloatReg', 'uw', 'FLOATREG_FIR', 'IsFloating', 1),
916383Sgblack@eecs.umich.edu    'FCCR': ('FloatReg', 'uw', 'FLOATREG_FCCR', 'IsFloating', 2),
926383Sgblack@eecs.umich.edu    'FEXR': ('FloatReg', 'uw', 'FLOATREG_FEXR', 'IsFloating', 3),
936383Sgblack@eecs.umich.edu    'FENR': ('FloatReg', 'uw', 'FLOATREG_FENR', 'IsFloating', 3),
946383Sgblack@eecs.umich.edu    'FCSR': ('FloatReg', 'uw', 'FLOATREG_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
1076383Sgblack@eecs.umich.edu    'Status': ('ControlReg', 'uw', 'MISCREG_STATUS', None, 1),
1084661Sksewell@umich.edu
1095222Sksewell@umich.edu    #LL Flag
1106383Sgblack@eecs.umich.edu    'LLFlag': ('ControlReg', 'uw', 'MISCREG_LLFLAG', None, 1),
1115222Sksewell@umich.edu
1125222Sksewell@umich.edu    # Index Register
1136383Sgblack@eecs.umich.edu    'Index':('ControlReg','uw','MISCREG_INDEX',None,1),
1145222Sksewell@umich.edu
1155222Sksewell@umich.edu
1166338Sgblack@eecs.umich.edu    'CP0_RD_SEL': ('ControlReg', 'uw', '(RD << 3 | SEL)', None, 1),
1174661Sksewell@umich.edu
1184661Sksewell@umich.edu    #MT Control Regs
1196383Sgblack@eecs.umich.edu    'MVPConf0': ('ControlReg', 'uw', 'MISCREG_MVP_CONF0', None, 1),
1206383Sgblack@eecs.umich.edu    'MVPControl': ('ControlReg', 'uw', 'MISCREG_MVP_CONTROL', None, 1),
1216383Sgblack@eecs.umich.edu    'TCBind': ('ControlReg', 'uw', 'MISCREG_TC_BIND', None, 1),
1226383Sgblack@eecs.umich.edu    'TCStatus': ('ControlReg', 'uw', 'MISCREG_TC_STATUS', None, 1),
1236383Sgblack@eecs.umich.edu    'TCRestart': ('ControlReg', 'uw', 'MISCREG_TC_RESTART', None, 1),
1246383Sgblack@eecs.umich.edu    'VPEConf0': ('ControlReg', 'uw', 'MISCREG_VPE_CONF0', None, 1),
1256383Sgblack@eecs.umich.edu    'VPEControl': ('ControlReg', 'uw', 'MISCREG_VPE_CONTROL', None, 1),
1266383Sgblack@eecs.umich.edu    'YQMask': ('ControlReg', 'uw', 'MISCREG_YQMASK', None, 1),
1274661Sksewell@umich.edu
1285222Sksewell@umich.edu    #CP0 Control Regs
1296383Sgblack@eecs.umich.edu    'EntryHi': ('ControlReg','uw', 'MISCREG_ENTRYHI',None,1),
1306383Sgblack@eecs.umich.edu    'EntryLo0': ('ControlReg','uw', 'MISCREG_ENTRYLO0',None,1),
1316383Sgblack@eecs.umich.edu    'EntryLo1': ('ControlReg','uw', 'MISCREG_ENTRYLO1',None,1),
1326383Sgblack@eecs.umich.edu    'PageMask': ('ControlReg','uw', 'MISCREG_PAGEMASK',None,1),
1336383Sgblack@eecs.umich.edu    'Random': ('ControlReg','uw', 'MISCREG_CP0_RANDOM',None,1),
1346383Sgblack@eecs.umich.edu    'ErrorEPC': ('ControlReg','uw', 'MISCREG_ERROR_EPC',None,1),
1356383Sgblack@eecs.umich.edu    'EPC': ('ControlReg','uw', 'MISCREG_EPC',None,1),
1366383Sgblack@eecs.umich.edu    'DEPC': ('ControlReg','uw', 'MISCREG_DEPC',None,1),
1376383Sgblack@eecs.umich.edu    'IntCtl': ('ControlReg','uw', 'MISCREG_INTCTL',None,1),
1386383Sgblack@eecs.umich.edu    'SRSCtl': ('ControlReg','uw', 'MISCREG_SRSCTL',None,1),
1396383Sgblack@eecs.umich.edu    'Config': ('ControlReg','uw', 'MISCREG_CONFIG',None,1),
1406383Sgblack@eecs.umich.edu    'Config3': ('ControlReg','uw', 'MISCREG_CONFIG3',None,1),
1416383Sgblack@eecs.umich.edu    'Config1': ('ControlReg','uw', 'MISCREG_CONFIG1',None,1),
1426383Sgblack@eecs.umich.edu    'Config2': ('ControlReg','uw', 'MISCREG_CONFIG2',None,1),
1436383Sgblack@eecs.umich.edu    'PageGrain': ('ControlReg','uw', 'MISCREG_PAGEGRAIN',None,1),
1446383Sgblack@eecs.umich.edu    'Debug': ('ControlReg','uw', 'MISCREG_DEBUG',None,1),
1456383Sgblack@eecs.umich.edu    'Cause': ('ControlReg','uw', 'MISCREG_CAUSE',None,1),
1464661Sksewell@umich.edu
1472616SN/A    #Memory Operand
1482495SN/A    'Mem': ('Mem', 'uw', None, ('IsMemRef', 'IsLoad', 'IsStore'), 4),
1492041SN/A
1502616SN/A    #Program Counter Operands
1514661Sksewell@umich.edu    'NPC': ('NPC', 'uw', None, 'IsControl', 4),
1524661Sksewell@umich.edu    'NNPC':('NNPC', 'uw', None, 'IsControl', 4)
1532023SN/A}};
154