}
// 2nd (right) operand
+
+ /* If the operand is an immediate value, there are no v-bits to set. */
+ if (op->shift_amount_is_immediate) return;
+
num_input_bits = bitsof_irtype(opnds[1].type);
for (i = 0; i < num_input_bits; ++i) {
that propagates to the output. Do this for all bits in each
operand. */
for (i = 0; i < 2; ++i) {
+
+ /* If this is a shift op that requires an immediate shift amount,
+ do not iterate the v-bits of the 2nd operand */
+ if (i == 1 && op->shift_amount_is_immediate) break;
+
num_input_bits = bitsof_irtype(opnds[i].type);
opnds[0].vbits = defined_vbits(bitsof_irtype(opnds[0].type));
opnds[1].vbits = defined_vbits(bitsof_irtype(opnds[1].type));
won't crash. */
memset(&opnds[1].value, 0xff, sizeof opnds[1].value);
+ /* For immediate shift amounts choose a value of '1'. That should
+ not cause a problem. */
+ if (op->shift_amount_is_immediate)
+ opnds[1].value.u8 = 1;
+
for (bitpos = 0; bitpos < num_input_bits; ++bitpos) {
opnds[i].vbits = onehot_vbits(bitpos, bitsof_irtype(opnds[i].type));
/* The opcodes appear in the same order here as in libvex_ir.h
That is not necessary but helpful when supporting a new architecture.
*/
-static const irop_t irops[] = {
+static irop_t irops[] = {
{ DEFOP(Iop_Add8, UNDEF_LEFT), .s390x = 1, .amd64 = 1, .x86 = 1, .arm = 0, .ppc64 = 1, .ppc32 = 1, .mips32 = 0 },
{ DEFOP(Iop_Add16, UNDEF_LEFT), .s390x = 1, .amd64 = 1, .x86 = 1, .arm = 0, .ppc64 = 1, .ppc32 = 1, .mips32 = 0 },
{ DEFOP(Iop_Add32, UNDEF_LEFT), .s390x = 1, .amd64 = 1, .x86 = 1, .arm = 1, .ppc64 = 1, .ppc32 = 1, .mips32 = 1 },
{ DEFOP(Iop_SubD128, UNDEF_ALL), .s390x = 0, .ppc64 = 1, .ppc32 = 1 },
{ DEFOP(Iop_MulD128, UNDEF_ALL), .s390x = 0, .ppc64 = 1, .ppc32 = 1 },
{ DEFOP(Iop_DivD128, UNDEF_ALL), .s390x = 0, .ppc64 = 1, .ppc32 = 1 },
- { DEFOP(Iop_ShlD64, UNDEF_SHL), .s390x = 0, .ppc64 = 0, .ppc32 = 0 }, // BZ #305948
- { DEFOP(Iop_ShrD64, UNDEF_SHR), .s390x = 0, .ppc64 = 0, .ppc32 = 0 }, // BZ #305948
- { DEFOP(Iop_ShlD128, UNDEF_SHL), .s390x = 0, .ppc64 = 0, .ppc32 = 0 }, // BZ #305948
- { DEFOP(Iop_ShrD128, UNDEF_SHR), .s390x = 0, .ppc64 = 0, .ppc32 = 0 }, // BZ #305948
+ { DEFOP(Iop_ShlD64, UNDEF_ALL), .s390x = 0, .ppc64 = 1, .ppc32 = 1 },
+ { DEFOP(Iop_ShrD64, UNDEF_ALL), .s390x = 0, .ppc64 = 1, .ppc32 = 1 },
+ { DEFOP(Iop_ShlD128, UNDEF_ALL), .s390x = 0, .ppc64 = 1, .ppc32 = 1 },
+ { DEFOP(Iop_ShrD128, UNDEF_ALL), .s390x = 0, .ppc64 = 1, .ppc32 = 1 },
{ DEFOP(Iop_D32toD64, UNDEF_ALL), .s390x = 0, .ppc64 = 1, .ppc32 = 1 },
{ DEFOP(Iop_D64toD128, UNDEF_ALL), .s390x = 0, .ppc64 = 1, .ppc32 = 1 },
{ DEFOP(Iop_I64StoD128, UNDEF_ALL), .s390x = 0, .ppc64 = 1, .ppc32 = 1 },
/* Return a descriptor for OP, iff it exists and it is implemented
for the current architecture. */
-const irop_t *
+irop_t *
get_irop(IROp op)
{
unsigned i;
for (i = 0; i < sizeof irops / sizeof *irops; ++i) {
- const irop_t *p = irops + i;
+ irop_t *p = irops + i;
if (p->op == op) {
#ifdef __s390x__
#define S390X_FEATURES "../../../tests/s390x_features"