comparison gentests.py @ 2596:01cd8aa40573

populate registers at full size in test generator to expose masking bugs
author Michael Pavone <pavone@retrodev.com>
date Sun, 09 Feb 2025 22:08:47 -0800
parents 6c475ddefd6f
children
comparison
equal deleted inserted replaced
2595:eb4b37c14c93 2596:01cd8aa40573
92 return self.kind + str(self.num) 92 return self.kind + str(self.num)
93 return self.kind 93 return self.kind
94 94
95 def write_init(self, outfile, size, already): 95 def write_init(self, outfile, size, already):
96 if not str(self) in already and not self.kind in ('ccr', 'sr'): 96 if not str(self) in already and not self.kind in ('ccr', 'sr'):
97 if self.kind in ('d', 'a'):
98 #populate all register bits during init to catch masking bugs
99 size = 'l'
97 minv,maxv = get_size_range(size) 100 minv,maxv = get_size_range(size)
98 val = randint(minv,maxv) 101 val = randint(minv,maxv)
99 already[str(self)] = val 102 already[str(self)] = val
100 outfile.write('\tmove.'+size+' #'+str(val)+', ' + str(self) + '\n') 103 outfile.write('\tmove.'+size+' #'+str(val)+', ' + str(self) + '\n')
101 104