Commit 2b8d7e9d authored by Aurelien Jarno's avatar Aurelien Jarno
Browse files

target-i386: SSE4.2: fix pcmpXstrm instructions



pcmpXstrm instructions returns their result in the XMM0 register and
not in the first operand.

Reviewed-by: default avatarRichard Henderson <rth@twiddle.net>
Signed-off-by: default avatarAurelien Jarno <aurelien@aurel32.net>
parent 93e3c0ae
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -2116,16 +2116,16 @@ void glue(helper_pcmpestrm, SUFFIX)(CPUX86State *env, Reg *d, Reg *s,
    if ((ctrl >> 6) & 1) {
        if (ctrl & 1) {
            for (i = 0; i < 8; i++, res >>= 1) {
                d->W(i) = (res & 1) ? ~0 : 0;
                env->xmm_regs[0].W(i) = (res & 1) ? ~0 : 0;
            }
        } else {
            for (i = 0; i < 16; i++, res >>= 1) {
                d->B(i) = (res & 1) ? ~0 : 0;
                env->xmm_regs[0].B(i) = (res & 1) ? ~0 : 0;
            }
        }
    } else {
        d->Q(1) = 0;
        d->Q(0) = res;
        env->xmm_regs[0].Q(1) = 0;
        env->xmm_regs[0].Q(0) = res;
    }
}

@@ -2154,16 +2154,16 @@ void glue(helper_pcmpistrm, SUFFIX)(CPUX86State *env, Reg *d, Reg *s,
    if ((ctrl >> 6) & 1) {
        if (ctrl & 1) {
            for (i = 0; i < 8; i++, res >>= 1) {
                d->W(i) = (res & 1) ? ~0 : 0;
                env->xmm_regs[0].W(i) = (res & 1) ? ~0 : 0;
            }
        } else {
            for (i = 0; i < 16; i++, res >>= 1) {
                d->B(i) = (res & 1) ? ~0 : 0;
                env->xmm_regs[0].B(i) = (res & 1) ? ~0 : 0;
            }
        }
    } else {
        d->Q(1) = 0;
        d->Q(0) = res;
        env->xmm_regs[0].Q(1) = 0;
        env->xmm_regs[0].Q(0) = res;
    }
}