isa_parser.py (2665:a124942bacb8) | isa_parser.py (2686:f0d591379ac3) |
---|---|
1# Copyright (c) 2003-2005 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 11 unchanged lines hidden (view full) --- 20# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26# 27# Authors: Steve Reinhardt | 1# Copyright (c) 2003-2005 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 11 unchanged lines hidden (view full) --- 20# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26# 27# Authors: Steve Reinhardt |
28# Korey Sewell |
|
28 29import os 30import sys 31import re 32import string 33import traceback 34# get type names 35from types import * --- 1140 unchanged lines hidden (view full) --- 1176 return c 1177 1178 def makeRead(self): 1179 if (self.ctype == 'float' or self.ctype == 'double'): 1180 error(0, 'Attempt to read integer register as FP') 1181 if (self.size == self.dflt_size): 1182 return '%s = xc->readIntReg(this, %d);\n' % \ 1183 (self.base_name, self.src_reg_idx) | 29 30import os 31import sys 32import re 33import string 34import traceback 35# get type names 36from types import * --- 1140 unchanged lines hidden (view full) --- 1177 return c 1178 1179 def makeRead(self): 1180 if (self.ctype == 'float' or self.ctype == 'double'): 1181 error(0, 'Attempt to read integer register as FP') 1182 if (self.size == self.dflt_size): 1183 return '%s = xc->readIntReg(this, %d);\n' % \ 1184 (self.base_name, self.src_reg_idx) |
1185 elif (self.size > self.dflt_size): 1186 int_reg_val = 'xc->readIntReg(this, %d)' % (self.src_reg_idx) 1187 if (self.is_signed): 1188 int_reg_val = 'sext<%d>(%s)' % (self.dflt_size, int_reg_val) 1189 return '%s = %s;\n' % (self.base_name, int_reg_val) |
|
1184 else: 1185 return '%s = bits(xc->readIntReg(this, %d), %d, 0);\n' % \ 1186 (self.base_name, self.src_reg_idx, self.size-1) 1187 1188 def makeWrite(self): 1189 if (self.ctype == 'float' or self.ctype == 'double'): 1190 error(0, 'Attempt to write integer register as FP') 1191 if (self.size != self.dflt_size and self.is_signed): --- 621 unchanged lines hidden --- | 1190 else: 1191 return '%s = bits(xc->readIntReg(this, %d), %d, 0);\n' % \ 1192 (self.base_name, self.src_reg_idx, self.size-1) 1193 1194 def makeWrite(self): 1195 if (self.ctype == 'float' or self.ctype == 'double'): 1196 error(0, 'Attempt to write integer register as FP') 1197 if (self.size != self.dflt_size and self.is_signed): --- 621 unchanged lines hidden --- |