]> git.ipfire.org Git - thirdparty/valgrind.git/commit
Fix operand / result types of Iop_DivU128[E], Iop_ModU128 and their signed counterparts
authorFlorian Krohm <flo2030@eich-krohm.de>
Wed, 9 Jul 2025 20:15:46 +0000 (20:15 +0000)
committerFlorian Krohm <flo2030@eich-krohm.de>
Wed, 9 Jul 2025 20:15:46 +0000 (20:15 +0000)
commit644d68e9501dd5679194dd5c8e0d3ce24764a1d8
tree4e8f58b949f02680f0b8949f39ae91cd910da5de
parenta9203727b159879ce17b1290bfe8cee97730c6ac
Fix operand / result types of Iop_DivU128[E], Iop_ModU128 and their signed counterparts

In libvex_ir.h these IROps are described to operate on Ity_I128 operands and produce a like typed result. This contradicts the specification in ir_defs.c
(function typeOfprimop) which claims Ity_V128 for operands and result.

Above IROps are used exclusively by ppc for the following opcodes:
Iop_DivU128  --> vdivuq  Vector Divide Unsigned Quadword
Iop_DivS128  --> vdivsq  Vector Divide Signed Quadword
Iop_DivU128E --> vdiveuq Vector Divide Extended Unsigned Quadword
Iop_DivS128E --> vdivesq Vector Divide Extended Signed Quadword
Iop_ModU128  --> vmoduq  Vector Modulo Unsigned Quadword
Iop_ModS128  --> vmodsq  Vector Modulo Signed Quadword

Reading the ISA document, it is clear, that those opcodes perform an
integer division / modulo operation. Technically, they work on vector
registers, presumably because vector registers are the only resource
wide enough to store a quadword. Perhaps that is where the confusion
comes from.
So Ity_I128 it is.
VEX/priv/ir_defs.c