16691Stjones1@inf.ed.ac.uk// -*- mode:c++ -*-
26691Stjones1@inf.ed.ac.uk
36691Stjones1@inf.ed.ac.uk// Copyright (c) 2009 The University of Edinburgh
46691Stjones1@inf.ed.ac.uk// All rights reserved.
56691Stjones1@inf.ed.ac.uk//
66691Stjones1@inf.ed.ac.uk// Redistribution and use in source and binary forms, with or without
76691Stjones1@inf.ed.ac.uk// modification, are permitted provided that the following conditions are
86691Stjones1@inf.ed.ac.uk// met: redistributions of source code must retain the above copyright
96691Stjones1@inf.ed.ac.uk// notice, this list of conditions and the following disclaimer;
106691Stjones1@inf.ed.ac.uk// redistributions in binary form must reproduce the above copyright
116691Stjones1@inf.ed.ac.uk// notice, this list of conditions and the following disclaimer in the
126691Stjones1@inf.ed.ac.uk// documentation and/or other materials provided with the distribution;
136691Stjones1@inf.ed.ac.uk// neither the name of the copyright holders nor the names of its
146691Stjones1@inf.ed.ac.uk// contributors may be used to endorse or promote products derived from
156691Stjones1@inf.ed.ac.uk// this software without specific prior written permission.
166691Stjones1@inf.ed.ac.uk//
176691Stjones1@inf.ed.ac.uk// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
186691Stjones1@inf.ed.ac.uk// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
196691Stjones1@inf.ed.ac.uk// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
206691Stjones1@inf.ed.ac.uk// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
216691Stjones1@inf.ed.ac.uk// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
226691Stjones1@inf.ed.ac.uk// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
236691Stjones1@inf.ed.ac.uk// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
246691Stjones1@inf.ed.ac.uk// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
256691Stjones1@inf.ed.ac.uk// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
266691Stjones1@inf.ed.ac.uk// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
276691Stjones1@inf.ed.ac.uk// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
286691Stjones1@inf.ed.ac.uk//
296691Stjones1@inf.ed.ac.uk// Authors: Timothy M. Jones
306691Stjones1@inf.ed.ac.uk
316691Stjones1@inf.ed.ac.ukdef operand_types {{
328449Sgblack@eecs.umich.edu    'sb' : 'int8_t',
338449Sgblack@eecs.umich.edu    'ub' : 'uint8_t',
348449Sgblack@eecs.umich.edu    'sh' : 'int16_t',
358449Sgblack@eecs.umich.edu    'uh' : 'uint16_t',
368449Sgblack@eecs.umich.edu    'sw' : 'int32_t',
378449Sgblack@eecs.umich.edu    'uw' : 'uint32_t',
3813800Ssandipan@linux.ibm.com    'sd' : 'int64_t',
3913800Ssandipan@linux.ibm.com    'ud' : 'uint64_t',
408449Sgblack@eecs.umich.edu    'sf' : 'float',
418449Sgblack@eecs.umich.edu    'df' : 'double'
426691Stjones1@inf.ed.ac.uk}};
436691Stjones1@inf.ed.ac.uk
446691Stjones1@inf.ed.ac.ukdef operands {{
456691Stjones1@inf.ed.ac.uk    # General Purpose Integer Reg Operands
466691Stjones1@inf.ed.ac.uk    'Ra': ('IntReg', 'uw', 'RA', 'IsInteger', 1),
476691Stjones1@inf.ed.ac.uk    'Rb': ('IntReg', 'uw', 'RB', 'IsInteger', 2),
486691Stjones1@inf.ed.ac.uk    'Rs': ('IntReg', 'uw', 'RS', 'IsInteger', 3),
496691Stjones1@inf.ed.ac.uk    'Rt': ('IntReg', 'uw', 'RT', 'IsInteger', 4),
506691Stjones1@inf.ed.ac.uk
516691Stjones1@inf.ed.ac.uk    # General Purpose Floating Point Reg Operands
526691Stjones1@inf.ed.ac.uk    'Fa': ('FloatReg', 'df', 'FRA', 'IsFloating', 1),
536691Stjones1@inf.ed.ac.uk    'Fb': ('FloatReg', 'df', 'FRB', 'IsFloating', 2),
546691Stjones1@inf.ed.ac.uk    'Fc': ('FloatReg', 'df', 'FRC', 'IsFloating', 3),
556691Stjones1@inf.ed.ac.uk    'Fs': ('FloatReg', 'df', 'FRS', 'IsFloating', 4),
566691Stjones1@inf.ed.ac.uk    'Ft': ('FloatReg', 'df', 'FRT', 'IsFloating', 5),
576691Stjones1@inf.ed.ac.uk
586691Stjones1@inf.ed.ac.uk    # Memory Operand
596691Stjones1@inf.ed.ac.uk    'Mem': ('Mem', 'uw', None, ('IsMemRef', 'IsLoad', 'IsStore'), 8),
606691Stjones1@inf.ed.ac.uk
616691Stjones1@inf.ed.ac.uk    # Program counter and next
6213801Ssandipan@linux.ibm.com    'CIA': ('PCState', 'uw', 'pc', (None, None, 'IsControl'), 9),
6313801Ssandipan@linux.ibm.com    'NIA': ('PCState', 'uw', 'npc', (None, None, 'IsControl'), 9),
646691Stjones1@inf.ed.ac.uk
656691Stjones1@inf.ed.ac.uk    # Control registers
666691Stjones1@inf.ed.ac.uk    'CR': ('IntReg', 'uw', 'INTREG_CR', 'IsInteger', 9),
676691Stjones1@inf.ed.ac.uk    'LR': ('IntReg', 'uw', 'INTREG_LR', 'IsInteger', 9),
686691Stjones1@inf.ed.ac.uk    'CTR': ('IntReg', 'uw', 'INTREG_CTR', 'IsInteger', 9),
696691Stjones1@inf.ed.ac.uk    'XER': ('IntReg', 'uw', 'INTREG_XER', 'IsInteger', 9),
706691Stjones1@inf.ed.ac.uk
716691Stjones1@inf.ed.ac.uk    # Setting as IntReg so things are stored as an integer, not double
726691Stjones1@inf.ed.ac.uk    'FPSCR': ('IntReg', 'uw', 'INTREG_FPSCR', 'IsFloating', 9),
736691Stjones1@inf.ed.ac.uk
746691Stjones1@inf.ed.ac.uk    # Registers for linked loads and stores
756691Stjones1@inf.ed.ac.uk    'Rsv': ('IntReg', 'uw', 'INTREG_RSV', 'IsInteger', 9),
766691Stjones1@inf.ed.ac.uk    'RsvLen': ('IntReg', 'uw', 'INTREG_RSV_LEN', 'IsInteger', 9),
776691Stjones1@inf.ed.ac.uk    'RsvAddr': ('IntReg', 'uw', 'INTREG_RSV_ADDR', 'IsInteger', 9),
786691Stjones1@inf.ed.ac.uk
796691Stjones1@inf.ed.ac.uk    # Hack for non-full-system syscall emulation
806691Stjones1@inf.ed.ac.uk    'R0':  ('IntReg', 'uw', '0', None, 1),
816691Stjones1@inf.ed.ac.uk}};
82