Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(524)

Side by Side Diff: pydir/gen_arm32_reg_tables.py

Issue 1592663004: Subzero. ARM32. Fixes vpush/vpop bug. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Makefile.standalone ('k') | src/IceRegistersARM32.def » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import os 1 import os
2 import sys 2 import sys
3 3
4 class RegAliases(object): 4 class RegAliases(object):
5 def __init__(self, AliasesStr): 5 def __init__(self, AliasesStr):
6 self.Aliases = list(Alias.strip() for Alias in AliasesStr.split(',')) 6 self.Aliases = list(Alias.strip() for Alias in AliasesStr.split(','))
7 7
8 def __str__(self): 8 def __str__(self):
9 return 'REGLIST{AliasCount}(RegARM32, {Aliases})'.format( 9 return 'REGLIST{AliasCount}(RegARM32, {Aliases})'.format(
10 AliasCount=len(self.Aliases), Aliases=', '.join(self.Aliases)) 10 AliasCount=len(self.Aliases), Aliases=', '.join(self.Aliases))
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 Reg( 'q8', 8, IsScratch=1, IsVec128=1, Aliases= 'q8, d16, d17'), 187 Reg( 'q8', 8, IsScratch=1, IsVec128=1, Aliases= 'q8, d16, d17'),
188 Reg( 'q9', 9, IsScratch=1, IsVec128=1, Aliases= 'q9, d18, d19'), 188 Reg( 'q9', 9, IsScratch=1, IsVec128=1, Aliases= 'q9, d18, d19'),
189 Reg('q10', 10, IsScratch=1, IsVec128=1, Aliases='q10, d20, d21'), 189 Reg('q10', 10, IsScratch=1, IsVec128=1, Aliases='q10, d20, d21'),
190 Reg('q11', 11, IsScratch=1, IsVec128=1, Aliases='q11, d22, d23'), 190 Reg('q11', 11, IsScratch=1, IsVec128=1, Aliases='q11, d22, d23'),
191 Reg('q12', 12, IsScratch=1, IsVec128=1, Aliases='q12, d24, d25'), 191 Reg('q12', 12, IsScratch=1, IsVec128=1, Aliases='q12, d24, d25'),
192 Reg('q13', 13, IsScratch=1, IsVec128=1, Aliases='q13, d26, d27'), 192 Reg('q13', 13, IsScratch=1, IsVec128=1, Aliases='q13, d26, d27'),
193 Reg('q14', 14, IsScratch=1, IsVec128=1, Aliases='q14, d28, d29'), 193 Reg('q14', 14, IsScratch=1, IsVec128=1, Aliases='q14, d28, d29'),
194 Reg('q15', 15, IsScratch=1, IsVec128=1, Aliases='q15, d30, d31'), 194 Reg('q15', 15, IsScratch=1, IsVec128=1, Aliases='q15, d30, d31'),
195 ] 195 ]
196 196
197 def _reverse(x): 197 # TODO(jpp): Fix the pop emission, then emit FP64/Vec128 reverted.
198 return sorted(x, key=lambda x: x.Encode, reverse=True) 198 RegClasses = [('GPR', GPRs), ('I64PAIR', I64Pairs), ('FP32', FP32),
199 199 ('FP64', FP64), ('VEC128', Vec128)]
200 RegClasses = [('GPR', GPRs), ('I64PAIR', I64Pairs), ('FP32', FP32),
201 ('FP64', _reverse(FP64)), ('VEC128', _reverse(Vec128))]
202 200
203 AllRegs = {} 201 AllRegs = {}
204 for _, RegClass in RegClasses: 202 for _, RegClass in RegClasses:
205 for Reg in RegClass: 203 for Reg in RegClass:
206 assert Reg.Name not in AllRegs 204 assert Reg.Name not in AllRegs
207 AllRegs[Reg.Name] = Reg 205 AllRegs[Reg.Name] = Reg
208 206
209 for _, RegClass in RegClasses: 207 for _, RegClass in RegClasses:
210 for Reg in RegClass: 208 for Reg in RegClass:
211 for Alias in AllRegs[Reg.Name].Features.Aliases().Aliases: 209 for Alias in AllRegs[Reg.Name].Features.Aliases().Aliases:
212 assert AllRegs[Alias].IsAnAliasOf(Reg), '%s VS %s' % (Reg, AllRegs[Alias]) 210 assert AllRegs[Alias].IsAnAliasOf(Reg), '%s VS %s' % (Reg, AllRegs[Alias])
213 assert (AllRegs[Alias].Features.LivesInGPR() == 211 assert (AllRegs[Alias].Features.LivesInGPR() ==
214 Reg.Features.LivesInGPR()), '%s VS %s' % (Reg, AllRegs[Alias]) 212 Reg.Features.LivesInGPR()), '%s VS %s' % (Reg, AllRegs[Alias])
215 assert (AllRegs[Alias].Features.LivesInVFP() == 213 assert (AllRegs[Alias].Features.LivesInVFP() ==
216 Reg.Features.LivesInVFP()), '%s VS %s' % (Reg, AllRegs[Alias]) 214 Reg.Features.LivesInVFP()), '%s VS %s' % (Reg, AllRegs[Alias])
217 215
218 print ("// This file was auto generated by the {script} script.\n" 216 print ("// This file was auto generated by the {script} script.\n"
219 "// Do not modify it: modify the script instead.\n" 217 "// Do not modify it: modify the script instead.\n"
220 "\n" 218 "\n"
221 "#ifndef SUBZERO_SRC_ICEREGISTERSARM32_DEF\n" 219 "#ifndef SUBZERO_SRC_ICEREGISTERSARM32_DEF\n"
222 "#define SUBZERO_SRC_ICEREGISTERSARM32_DEF\n".format(script=os.path.basen ame(sys.argv[0]))) 220 "#define SUBZERO_SRC_ICEREGISTERSARM32_DEF\n".format(script=os.path.basen ame(sys.argv[0])))
223 221
224 for Name, RegClass in RegClasses: 222 for Name, RegClass in RegClasses:
225 print '\n//{xmacro}'.format(xmacro=Reg.DefiningXMacro()) 223 print '\n//{xmacro}'.format(xmacro=Reg.DefiningXMacro())
226 print "#define REGARM32_%s_TABLE" % Name, 224 print "#define REGARM32_%s_TABLE" % Name,
227 for Reg in RegClass: 225 for Reg in RegClass:
228 print '\\\n X({Reg})'.format(Reg=Reg), 226 print '\\\n X({Reg})'.format(Reg=Reg),
229 print '\n' 227 print '\n'
230 print "#endif // SUBZERO_SRC_ICEREGISTERSARM32_DEF", 228 print "#endif // SUBZERO_SRC_ICEREGISTERSARM32_DEF",
OLDNEW
« no previous file with comments | « Makefile.standalone ('k') | src/IceRegistersARM32.def » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698