insn.spec.compare: ignore upper 32-bits when pfv.gpr_width=32.

main
Jean-François Nguyen 2 years ago
parent 28becc090c
commit 1d8916f2df

@ -23,8 +23,8 @@ class CompareSpec(InsnSpec, Elaboratable):
self.pfv.xer.r_mask.so.eq(1), self.pfv.xer.r_mask.so.eq(1),
] ]


src_a = Signal(64) src_a = Signal(self.pfv.gpr_width)
src_b = Signal(64) src_b = Signal(self.pfv.gpr_width)
result = Record([ result = Record([
("so", 1), ("so", 1),
("eq_", 1), ("eq_", 1),
@ -120,7 +120,7 @@ class CompareSpec(InsnSpec, Elaboratable):


elif isinstance(self.insn, CMPEQB): elif isinstance(self.insn, CMPEQB):
_match = 0 _match = 0
for i in range(64//8): for i in range(self.pfv.gpr_width//8):
_match |= (src_a == src_b.word_select(i, width=8)) _match |= (src_a == src_b.word_select(i, width=8))


m.d.comb += result.eq(Cat(Const(0, 2), _match, Const(0, 1))) m.d.comb += result.eq(Cat(Const(0, 2), _match, Const(0, 1)))

Loading…
Cancel
Save