X-Git-Url: https://git.libre-soc.org/?p=soc.git;a=blobdiff_plain;f=src%2Fsoc%2Fdecoder%2Fisa%2Fcaller.py;h=299b74c0e136a65a0f1a68955e6ccda786e2cf99;hp=36921d5f70519859c5a28cc6e0d6117107911b90;hb=7bcc2eb604806b9b69993974cb0b5519136a7d01;hpb=6e3c0a3f8bebb432e702b8e4d2627a3503d6b179 diff --git a/src/soc/decoder/isa/caller.py b/src/soc/decoder/isa/caller.py index 36921d5f..299b74c0 100644 --- a/src/soc/decoder/isa/caller.py +++ b/src/soc/decoder/isa/caller.py @@ -273,16 +273,17 @@ class ISACaller: imm = yield self.dec2.e.imm_data.data inputs.append(SelectableInt(imm, 64)) assert len(outputs) >= 1 - output = outputs[0] - input_sgn = [exts(x.value, x.bits) < 0 for x in inputs] - output_sgn = exts(output.value, output.bits) < 0 - ov = 1 if input_sgn[0] == input_sgn[1] and \ - output_sgn != input_sgn[0] else 0 - - self.spr['XER'][XER_bits['OV']] = ov - so = self.spr['XER'][XER_bits['SO']] - so = so | ov - self.spr['XER'][XER_bits['SO']] = so + if len(inputs) >= 2: + output = outputs[0] + input_sgn = [exts(x.value, x.bits) < 0 for x in inputs] + output_sgn = exts(output.value, output.bits) < 0 + ov = 1 if input_sgn[0] == input_sgn[1] and \ + output_sgn != input_sgn[0] else 0 + + self.spr['XER'][XER_bits['OV']] = ov + so = self.spr['XER'][XER_bits['SO']] + so = so | ov + self.spr['XER'][XER_bits['SO']] = so