From nobody Mon Nov 10 20:55:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559300024; cv=none; d=zoho.com; s=zohoarc; b=UFept2QeYIc7EY7GJrdTg/73M3CUzxJ7Dws7KXFNzHOIr2XgCkheIicqbJWd6m/SQLiJSqPbxPWFZY2AxZMG03TNShZItVpPjF7xop//WSMZwD1vkj1CyOLUVbQ54iTRGfh7/El81ij9j5WVUINMwBLuNWzPbPGcNfBCRLxJaa0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559300024; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=pXchYGOv6Ja+GYfXP9iUr/HqJhVtE1zVG72NN+VZKa4=; b=kGzI1omFRQwzoTyfvrKVsPtYShbNReq3XPlwTwj0+xyOaxk9u6E5G5kZhJdaUZpdHKfO/ztiXEMGfOIIigRpnl8/OVUUciLp6lLI1xM4ksFYejXWZO4ayIxndixEA6iH1f+DxOxVGELlljrIH2AJbUCDGmGABpvRSYngqBE/gb0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559300024852132.49611105540066; Fri, 31 May 2019 03:53:44 -0700 (PDT) Received: from localhost ([127.0.0.1]:40910 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWfAK-0005Fz-7T for importer@patchew.org; Fri, 31 May 2019 06:53:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55963) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf1m-0006mS-9p for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf1j-0001IK-Tw for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42658) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf1h-00016y-09 for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:47 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 83BCB30821B2; Fri, 31 May 2019 10:44:38 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 224C0473DB; Fri, 31 May 2019 10:44:36 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:10 +0200 Message-Id: <20190531104432.29379-2-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 31 May 2019 10:44:38 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 01/23] s390x: Use uint64_t for vector registers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Richard Henderson , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" CPU_DoubleU is primarily used to reinterpret between integer and floats. We don't really need this functionality. So let's just keep it simple and use an uint64_t. Reviewed-by: Richard Henderson Signed-off-by: David Hildenbrand --- linux-user/s390x/signal.c | 4 +- target/s390x/arch_dump.c | 8 +-- target/s390x/cpu.h | 4 +- target/s390x/excp_helper.c | 6 +- target/s390x/gdbstub.c | 16 ++--- target/s390x/helper.c | 10 +-- target/s390x/kvm.c | 16 ++--- target/s390x/machine.c | 128 ++++++++++++++++++------------------- target/s390x/translate.c | 2 +- 9 files changed, 97 insertions(+), 97 deletions(-) diff --git a/linux-user/s390x/signal.c b/linux-user/s390x/signal.c index 3d3cb67bbe..ecfa2a14a9 100644 --- a/linux-user/s390x/signal.c +++ b/linux-user/s390x/signal.c @@ -123,7 +123,7 @@ static void save_sigregs(CPUS390XState *env, target_sig= regs *sregs) */ //save_fp_regs(¤t->thread.fp_regs); FIXME for (i =3D 0; i < 16; i++) { - __put_user(get_freg(env, i)->ll, &sregs->fpregs.fprs[i]); + __put_user(*get_freg(env, i), &sregs->fpregs.fprs[i]); } } =20 @@ -254,7 +254,7 @@ restore_sigregs(CPUS390XState *env, target_sigregs *sc) __get_user(env->aregs[i], &sc->regs.acrs[i]); } for (i =3D 0; i < 16; i++) { - __get_user(get_freg(env, i)->ll, &sc->fpregs.fprs[i]); + __get_user(*get_freg(env, i), &sc->fpregs.fprs[i]); } =20 return err; diff --git a/target/s390x/arch_dump.c b/target/s390x/arch_dump.c index c9ef0a6e60..50fa0ae4b6 100644 --- a/target/s390x/arch_dump.c +++ b/target/s390x/arch_dump.c @@ -104,7 +104,7 @@ static void s390x_write_elf64_fpregset(Note *note, S390= CPU *cpu, int id) note->hdr.n_type =3D cpu_to_be32(NT_FPREGSET); note->contents.fpregset.fpc =3D cpu_to_be32(cpu->env.fpc); for (i =3D 0; i <=3D 15; i++) { - note->contents.fpregset.fprs[i] =3D cpu_to_be64(get_freg(cs, i)->l= l); + note->contents.fpregset.fprs[i] =3D cpu_to_be64(*get_freg(cs, i)); } } =20 @@ -114,7 +114,7 @@ static void s390x_write_elf64_vregslo(Note *note, S390C= PU *cpu, int id) =20 note->hdr.n_type =3D cpu_to_be32(NT_S390_VXRS_LOW); for (i =3D 0; i <=3D 15; i++) { - note->contents.vregslo.vregs[i] =3D cpu_to_be64(cpu->env.vregs[i][= 1].ll); + note->contents.vregslo.vregs[i] =3D cpu_to_be64(cpu->env.vregs[i][= 1]); } } =20 @@ -127,8 +127,8 @@ static void s390x_write_elf64_vregshi(Note *note, S390C= PU *cpu, int id) =20 note->hdr.n_type =3D cpu_to_be32(NT_S390_VXRS_HIGH); for (i =3D 0; i <=3D 15; i++) { - temp_vregshi->vregs[i][0] =3D cpu_to_be64(cpu->env.vregs[i + 16][0= ].ll); - temp_vregshi->vregs[i][1] =3D cpu_to_be64(cpu->env.vregs[i + 16][1= ].ll); + temp_vregshi->vregs[i][0] =3D cpu_to_be64(cpu->env.vregs[i + 16][0= ]); + temp_vregshi->vregs[i][1] =3D cpu_to_be64(cpu->env.vregs[i + 16][1= ]); } } =20 diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 1bed12b6c3..317a1377e6 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -66,7 +66,7 @@ struct CPUS390XState { * The floating point registers are part of the vector registers. * vregs[0][0] -> vregs[15][0] are 16 floating point registers */ - CPU_DoubleU vregs[32][2] QEMU_ALIGNED(16); /* vector registers */ + uint64_t vregs[32][2] QEMU_ALIGNED(16); /* vector registers */ uint32_t aregs[16]; /* access registers */ uint8_t riccb[64]; /* runtime instrumentation control */ uint64_t gscb[4]; /* guarded storage control */ @@ -153,7 +153,7 @@ struct CPUS390XState { =20 }; =20 -static inline CPU_DoubleU *get_freg(CPUS390XState *cs, int nr) +static inline uint64_t *get_freg(CPUS390XState *cs, int nr) { return &cs->vregs[nr][0]; } diff --git a/target/s390x/excp_helper.c b/target/s390x/excp_helper.c index 3a467b72c5..85223d00c0 100644 --- a/target/s390x/excp_helper.c +++ b/target/s390x/excp_helper.c @@ -390,8 +390,8 @@ static int mchk_store_vregs(CPUS390XState *env, uint64_= t mcesao) } =20 for (i =3D 0; i < 32; i++) { - sa->vregs[i][0] =3D cpu_to_be64(env->vregs[i][0].ll); - sa->vregs[i][1] =3D cpu_to_be64(env->vregs[i][1].ll); + sa->vregs[i][0] =3D cpu_to_be64(env->vregs[i][0]); + sa->vregs[i][1] =3D cpu_to_be64(env->vregs[i][1]); } =20 cpu_physical_memory_unmap(sa, len, 1, len); @@ -429,7 +429,7 @@ static void do_mchk_interrupt(CPUS390XState *env) lowcore->ar_access_id =3D 1; =20 for (i =3D 0; i < 16; i++) { - lowcore->floating_pt_save_area[i] =3D cpu_to_be64(get_freg(env, i)= ->ll); + lowcore->floating_pt_save_area[i] =3D cpu_to_be64(*get_freg(env, i= )); lowcore->gpregs_save_area[i] =3D cpu_to_be64(env->regs[i]); lowcore->access_regs_save_area[i] =3D cpu_to_be32(env->aregs[i]); lowcore->cregs_save_area[i] =3D cpu_to_be64(env->cregs[i]); diff --git a/target/s390x/gdbstub.c b/target/s390x/gdbstub.c index df147596ce..9cfd8fe3e0 100644 --- a/target/s390x/gdbstub.c +++ b/target/s390x/gdbstub.c @@ -116,7 +116,7 @@ static int cpu_read_fp_reg(CPUS390XState *env, uint8_t = *mem_buf, int n) case S390_FPC_REGNUM: return gdb_get_reg32(mem_buf, env->fpc); case S390_F0_REGNUM ... S390_F15_REGNUM: - return gdb_get_reg64(mem_buf, get_freg(env, n - S390_F0_REGNUM)->l= l); + return gdb_get_reg64(mem_buf, *get_freg(env, n - S390_F0_REGNUM)); default: return 0; } @@ -129,7 +129,7 @@ static int cpu_write_fp_reg(CPUS390XState *env, uint8_t= *mem_buf, int n) env->fpc =3D ldl_p(mem_buf); return 4; case S390_F0_REGNUM ... S390_F15_REGNUM: - get_freg(env, n - S390_F0_REGNUM)->ll =3D ldtul_p(mem_buf); + *get_freg(env, n - S390_F0_REGNUM) =3D ldtul_p(mem_buf); return 8; default: return 0; @@ -150,11 +150,11 @@ static int cpu_read_vreg(CPUS390XState *env, uint8_t = *mem_buf, int n) =20 switch (n) { case S390_V0L_REGNUM ... S390_V15L_REGNUM: - ret =3D gdb_get_reg64(mem_buf, env->vregs[n][1].ll); + ret =3D gdb_get_reg64(mem_buf, env->vregs[n][1]); break; case S390_V16_REGNUM ... S390_V31_REGNUM: - ret =3D gdb_get_reg64(mem_buf, env->vregs[n][0].ll); - ret +=3D gdb_get_reg64(mem_buf + 8, env->vregs[n][1].ll); + ret =3D gdb_get_reg64(mem_buf, env->vregs[n][0]); + ret +=3D gdb_get_reg64(mem_buf + 8, env->vregs[n][1]); break; default: ret =3D 0; @@ -167,11 +167,11 @@ static int cpu_write_vreg(CPUS390XState *env, uint8_t= *mem_buf, int n) { switch (n) { case S390_V0L_REGNUM ... S390_V15L_REGNUM: - env->vregs[n][1].ll =3D ldtul_p(mem_buf + 8); + env->vregs[n][1] =3D ldtul_p(mem_buf + 8); return 8; case S390_V16_REGNUM ... S390_V31_REGNUM: - env->vregs[n][0].ll =3D ldtul_p(mem_buf); - env->vregs[n][1].ll =3D ldtul_p(mem_buf + 8); + env->vregs[n][0] =3D ldtul_p(mem_buf); + env->vregs[n][1] =3D ldtul_p(mem_buf + 8); return 16; default: return 0; diff --git a/target/s390x/helper.c b/target/s390x/helper.c index 3c8f0a7615..a69e5abf5f 100644 --- a/target/s390x/helper.c +++ b/target/s390x/helper.c @@ -249,7 +249,7 @@ int s390_store_status(S390CPU *cpu, hwaddr addr, bool s= tore_arch) cpu_physical_memory_write(offsetof(LowCore, ar_access_id), &ar_id,= 1); } for (i =3D 0; i < 16; ++i) { - sa->fprs[i] =3D cpu_to_be64(get_freg(&cpu->env, i)->ll); + sa->fprs[i] =3D cpu_to_be64(*get_freg(&cpu->env, i)); } for (i =3D 0; i < 16; ++i) { sa->grs[i] =3D cpu_to_be64(cpu->env.regs[i]); @@ -299,8 +299,8 @@ int s390_store_adtl_status(S390CPU *cpu, hwaddr addr, h= waddr len) =20 if (s390_has_feat(S390_FEAT_VECTOR)) { for (i =3D 0; i < 32; i++) { - sa->vregs[i][0] =3D cpu_to_be64(cpu->env.vregs[i][0].ll); - sa->vregs[i][1] =3D cpu_to_be64(cpu->env.vregs[i][1].ll); + sa->vregs[i][0] =3D cpu_to_be64(cpu->env.vregs[i][0]); + sa->vregs[i][1] =3D cpu_to_be64(cpu->env.vregs[i][1]); } } if (s390_has_feat(S390_FEAT_GUARDED_STORAGE) && len >=3D ADTL_GS_MIN_S= IZE) { @@ -341,13 +341,13 @@ void s390_cpu_dump_state(CPUState *cs, FILE *f, int f= lags) if (s390_has_feat(S390_FEAT_VECTOR)) { for (i =3D 0; i < 32; i++) { qemu_fprintf(f, "V%02d=3D%016" PRIx64 "%016" PRIx64 "%c", - i, env->vregs[i][0].ll, env->vregs[i][1].ll, + i, env->vregs[i][0], env->vregs[i][1], i % 2 ? '\n' : ' '); } } else { for (i =3D 0; i < 16; i++) { qemu_fprintf(f, "F%02d=3D%016" PRIx64 "%c", - i, get_freg(env, i)->ll, + i, *get_freg(env, i), (i % 4) =3D=3D 3 ? '\n' : ' '); } } diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index e5e2b691f2..f0649980c9 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -418,21 +418,21 @@ int kvm_arch_put_registers(CPUState *cs, int level) =20 if (can_sync_regs(cs, KVM_SYNC_VRS)) { for (i =3D 0; i < 32; i++) { - cs->kvm_run->s.regs.vrs[i][0] =3D env->vregs[i][0].ll; - cs->kvm_run->s.regs.vrs[i][1] =3D env->vregs[i][1].ll; + cs->kvm_run->s.regs.vrs[i][0] =3D env->vregs[i][0]; + cs->kvm_run->s.regs.vrs[i][1] =3D env->vregs[i][1]; } cs->kvm_run->s.regs.fpc =3D env->fpc; cs->kvm_run->kvm_dirty_regs |=3D KVM_SYNC_VRS; } else if (can_sync_regs(cs, KVM_SYNC_FPRS)) { for (i =3D 0; i < 16; i++) { - cs->kvm_run->s.regs.fprs[i] =3D get_freg(env, i)->ll; + cs->kvm_run->s.regs.fprs[i] =3D *get_freg(env, i); } cs->kvm_run->s.regs.fpc =3D env->fpc; cs->kvm_run->kvm_dirty_regs |=3D KVM_SYNC_FPRS; } else { /* Floating point */ for (i =3D 0; i < 16; i++) { - fpu.fprs[i] =3D get_freg(env, i)->ll; + fpu.fprs[i] =3D *get_freg(env, i); } fpu.fpc =3D env->fpc; =20 @@ -586,13 +586,13 @@ int kvm_arch_get_registers(CPUState *cs) /* Floating point and vector registers */ if (can_sync_regs(cs, KVM_SYNC_VRS)) { for (i =3D 0; i < 32; i++) { - env->vregs[i][0].ll =3D cs->kvm_run->s.regs.vrs[i][0]; - env->vregs[i][1].ll =3D cs->kvm_run->s.regs.vrs[i][1]; + env->vregs[i][0] =3D cs->kvm_run->s.regs.vrs[i][0]; + env->vregs[i][1] =3D cs->kvm_run->s.regs.vrs[i][1]; } env->fpc =3D cs->kvm_run->s.regs.fpc; } else if (can_sync_regs(cs, KVM_SYNC_FPRS)) { for (i =3D 0; i < 16; i++) { - get_freg(env, i)->ll =3D cs->kvm_run->s.regs.fprs[i]; + get_freg(env, i) =3D cs->kvm_run->s.regs.fprs[i]; } env->fpc =3D cs->kvm_run->s.regs.fpc; } else { @@ -601,7 +601,7 @@ int kvm_arch_get_registers(CPUState *cs) return r; } for (i =3D 0; i < 16; i++) { - get_freg(env, i)->ll =3D fpu.fprs[i]; + get_freg(env, i) =3D fpu.fprs[i]; } env->fpc =3D fpu.fpc; } diff --git a/target/s390x/machine.c b/target/s390x/machine.c index cb792aa103..e6851a57bc 100644 --- a/target/s390x/machine.c +++ b/target/s390x/machine.c @@ -66,22 +66,22 @@ static const VMStateDescription vmstate_fpu =3D { .minimum_version_id =3D 1, .needed =3D fpu_needed, .fields =3D (VMStateField[]) { - VMSTATE_UINT64(env.vregs[0][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[1][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[2][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[3][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[4][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[5][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[6][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[7][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[8][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[9][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[10][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[11][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[12][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[13][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[14][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[15][0].ll, S390CPU), + VMSTATE_UINT64(env.vregs[0][0], S390CPU), + VMSTATE_UINT64(env.vregs[1][0], S390CPU), + VMSTATE_UINT64(env.vregs[2][0], S390CPU), + VMSTATE_UINT64(env.vregs[3][0], S390CPU), + VMSTATE_UINT64(env.vregs[4][0], S390CPU), + VMSTATE_UINT64(env.vregs[5][0], S390CPU), + VMSTATE_UINT64(env.vregs[6][0], S390CPU), + VMSTATE_UINT64(env.vregs[7][0], S390CPU), + VMSTATE_UINT64(env.vregs[8][0], S390CPU), + VMSTATE_UINT64(env.vregs[9][0], S390CPU), + VMSTATE_UINT64(env.vregs[10][0], S390CPU), + VMSTATE_UINT64(env.vregs[11][0], S390CPU), + VMSTATE_UINT64(env.vregs[12][0], S390CPU), + VMSTATE_UINT64(env.vregs[13][0], S390CPU), + VMSTATE_UINT64(env.vregs[14][0], S390CPU), + VMSTATE_UINT64(env.vregs[15][0], S390CPU), VMSTATE_UINT32(env.fpc, S390CPU), VMSTATE_END_OF_LIST() } @@ -99,54 +99,54 @@ static const VMStateDescription vmstate_vregs =3D { .needed =3D vregs_needed, .fields =3D (VMStateField[]) { /* vregs[0][0] -> vregs[15][0] and fregs are overlays */ - VMSTATE_UINT64(env.vregs[16][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[17][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[18][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[19][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[20][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[21][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[22][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[23][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[24][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[25][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[26][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[27][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[28][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[29][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[30][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[31][0].ll, S390CPU), - VMSTATE_UINT64(env.vregs[0][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[1][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[2][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[3][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[4][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[5][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[6][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[7][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[8][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[9][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[10][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[11][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[12][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[13][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[14][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[15][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[16][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[17][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[18][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[19][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[20][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[21][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[22][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[23][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[24][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[25][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[26][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[27][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[28][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[29][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[30][1].ll, S390CPU), - VMSTATE_UINT64(env.vregs[31][1].ll, S390CPU), + VMSTATE_UINT64(env.vregs[16][0], S390CPU), + VMSTATE_UINT64(env.vregs[17][0], S390CPU), + VMSTATE_UINT64(env.vregs[18][0], S390CPU), + VMSTATE_UINT64(env.vregs[19][0], S390CPU), + VMSTATE_UINT64(env.vregs[20][0], S390CPU), + VMSTATE_UINT64(env.vregs[21][0], S390CPU), + VMSTATE_UINT64(env.vregs[22][0], S390CPU), + VMSTATE_UINT64(env.vregs[23][0], S390CPU), + VMSTATE_UINT64(env.vregs[24][0], S390CPU), + VMSTATE_UINT64(env.vregs[25][0], S390CPU), + VMSTATE_UINT64(env.vregs[26][0], S390CPU), + VMSTATE_UINT64(env.vregs[27][0], S390CPU), + VMSTATE_UINT64(env.vregs[28][0], S390CPU), + VMSTATE_UINT64(env.vregs[29][0], S390CPU), + VMSTATE_UINT64(env.vregs[30][0], S390CPU), + VMSTATE_UINT64(env.vregs[31][0], S390CPU), + VMSTATE_UINT64(env.vregs[0][1], S390CPU), + VMSTATE_UINT64(env.vregs[1][1], S390CPU), + VMSTATE_UINT64(env.vregs[2][1], S390CPU), + VMSTATE_UINT64(env.vregs[3][1], S390CPU), + VMSTATE_UINT64(env.vregs[4][1], S390CPU), + VMSTATE_UINT64(env.vregs[5][1], S390CPU), + VMSTATE_UINT64(env.vregs[6][1], S390CPU), + VMSTATE_UINT64(env.vregs[7][1], S390CPU), + VMSTATE_UINT64(env.vregs[8][1], S390CPU), + VMSTATE_UINT64(env.vregs[9][1], S390CPU), + VMSTATE_UINT64(env.vregs[10][1], S390CPU), + VMSTATE_UINT64(env.vregs[11][1], S390CPU), + VMSTATE_UINT64(env.vregs[12][1], S390CPU), + VMSTATE_UINT64(env.vregs[13][1], S390CPU), + VMSTATE_UINT64(env.vregs[14][1], S390CPU), + VMSTATE_UINT64(env.vregs[15][1], S390CPU), + VMSTATE_UINT64(env.vregs[16][1], S390CPU), + VMSTATE_UINT64(env.vregs[17][1], S390CPU), + VMSTATE_UINT64(env.vregs[18][1], S390CPU), + VMSTATE_UINT64(env.vregs[19][1], S390CPU), + VMSTATE_UINT64(env.vregs[20][1], S390CPU), + VMSTATE_UINT64(env.vregs[21][1], S390CPU), + VMSTATE_UINT64(env.vregs[22][1], S390CPU), + VMSTATE_UINT64(env.vregs[23][1], S390CPU), + VMSTATE_UINT64(env.vregs[24][1], S390CPU), + VMSTATE_UINT64(env.vregs[25][1], S390CPU), + VMSTATE_UINT64(env.vregs[26][1], S390CPU), + VMSTATE_UINT64(env.vregs[27][1], S390CPU), + VMSTATE_UINT64(env.vregs[28][1], S390CPU), + VMSTATE_UINT64(env.vregs[29][1], S390CPU), + VMSTATE_UINT64(env.vregs[30][1], S390CPU), + VMSTATE_UINT64(env.vregs[31][1], S390CPU), VMSTATE_END_OF_LIST() } }; diff --git a/target/s390x/translate.c b/target/s390x/translate.c index fa57b7550e..ac0d8b6410 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -149,7 +149,7 @@ void s390x_translate_init(void) static inline int vec_full_reg_offset(uint8_t reg) { g_assert(reg < 32); - return offsetof(CPUS390XState, vregs[reg][0].d); + return offsetof(CPUS390XState, vregs[reg][0]); } =20 static inline int vec_reg_offset(uint8_t reg, uint8_t enr, TCGMemOp es) --=20 2.20.1 From nobody Mon Nov 10 20:55:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559299649; cv=none; d=zoho.com; s=zohoarc; b=PkwpNylFXeYN1Az0Qe/XtmAz7N0CYN/jWFEJg11uZyfo5mjbKm7oPZXB0M1l1ILcOCBdXp5HF2g9y67pHaID4FS/GyoiG24SwMEXBjACfmpYW/9HrsbcR9jSzawzuuITzt7z/IPULkA9DiS9U77y8Q8uJNTBePW4jP+fX7Q0v+Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559299649; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=8N/7udU9wVdTd+OP1GBXuY2rQLWl1R1SlXITcOPky24=; b=YNJe0vrTJ9Zm6kcGYtAXFFnI5a+ef/ZT3sanQuaAnK1u8u4+JrqFmjWY6B5gISNkEkdMonCFM6t7cgV0j25ObuvFUw0Lcb/9MYbaO0yTYst2VSrSsoJNxn4IWfViANdilM/GYgARQImeDcA55mIGF7DXgD8PTgZGCtMTjBZIxWo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559299649316166.48881170099935; Fri, 31 May 2019 03:47:29 -0700 (PDT) Received: from localhost ([127.0.0.1]:40834 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf4E-0000H7-62 for importer@patchew.org; Fri, 31 May 2019 06:47:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf1n-0006pz-IF for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf1l-0001LO-TW for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56120) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf1k-0001AF-0e for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:49 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4264030BB37D; Fri, 31 May 2019 10:44:41 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id D0041271AE; Fri, 31 May 2019 10:44:38 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:11 +0200 Message-Id: <20190531104432.29379-3-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 31 May 2019 10:44:41 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 02/23] s390x/tcg: Introduce tcg_s390_vector_exception() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Handling is similar to data exceptions, however we can always store the VXC into the lowore and the FPC: z14 PoP, 6-20, "Vector-Exception Code" When a vector-processing exception causes a pro- gram interruption, a vector-exception code (VXC) is stored at location 147, and zeros are stored at loca- tions 144-146. The VXC is also placed in the DXC field of the floating-point-control (FPC) register if bit 45 of control register 0 is one. When bit 45 of control register 0 is zero and bit 46 of control register 0 is one, the DXC field of the FPC register and the con- tents of storage at location 147 are unpredictable. Signed-off-by: David Hildenbrand --- target/s390x/cpu.h | 1 + target/s390x/excp_helper.c | 15 +++++++++++++++ target/s390x/tcg_s390x.h | 2 ++ 3 files changed, 18 insertions(+) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 317a1377e6..4fc08a2c88 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -215,6 +215,7 @@ extern const struct VMStateDescription vmstate_s390_cpu; #define PGM_SPECIAL_OP 0x0013 #define PGM_OPERAND 0x0015 #define PGM_TRACE_TABLE 0x0016 +#define PGM_VECTOR_PROCESSING 0x001b #define PGM_SPACE_SWITCH 0x001c #define PGM_HFP_SQRT 0x001d #define PGM_PC_TRANS_SPEC 0x001f diff --git a/target/s390x/excp_helper.c b/target/s390x/excp_helper.c index 85223d00c0..f21bcf79ae 100644 --- a/target/s390x/excp_helper.c +++ b/target/s390x/excp_helper.c @@ -62,6 +62,21 @@ void QEMU_NORETURN tcg_s390_data_exception(CPUS390XState= *env, uint32_t dxc, tcg_s390_program_interrupt(env, PGM_DATA, ILEN_AUTO, ra); } =20 +void QEMU_NORETURN tcg_s390_vector_exception(CPUS390XState *env, uint32_t = vxc, + uintptr_t ra) +{ + g_assert(vxc <=3D 0xff); +#if !defined(CONFIG_USER_ONLY) + /* Always store the VXC into the lowcore, without AFP it is undefined = */ + stl_phys(CPU(s390_env_get_cpu(env))->as, + env->psa + offsetof(LowCore, data_exc_code), vxc); +#endif + + /* Always store the VXC into the FPC, without AFP it is undefined */ + env->fpc =3D deposit32(env->fpc, 8, 8, vxc); + tcg_s390_program_interrupt(env, PGM_VECTOR_PROCESSING, ILEN_AUTO, ra); +} + void HELPER(data_exception)(CPUS390XState *env, uint32_t dxc) { tcg_s390_data_exception(env, dxc, GETPC()); diff --git a/target/s390x/tcg_s390x.h b/target/s390x/tcg_s390x.h index ab2c4ba703..2813f9d48e 100644 --- a/target/s390x/tcg_s390x.h +++ b/target/s390x/tcg_s390x.h @@ -18,5 +18,7 @@ void QEMU_NORETURN tcg_s390_program_interrupt(CPUS390XSta= te *env, uint32_t code, int ilen, uintptr_t ra); void QEMU_NORETURN tcg_s390_data_exception(CPUS390XState *env, uint32_t dx= c, uintptr_t ra); +void QEMU_NORETURN tcg_s390_vector_exception(CPUS390XState *env, uint32_t = vxc, + uintptr_t ra); =20 #endif /* TCG_S390X_H */ --=20 2.20.1 From nobody Mon Nov 10 20:55:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559299859; cv=none; d=zoho.com; s=zohoarc; b=ll8woslDy0WMy8gnb94fLIqzb2V5AAaEvENVlmnyO2ZLhEkVQmXl2KwV65OAnQvx4xOh6TcvevFyFsid4GSVTgonXIje2nvC79yReDyKzUtloiAa0MXaPjHkoSNapo4gN6NOGCxP3tCrImfsgy2M0YA4PCxBBYcl3/I9Tw3R44U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559299859; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Z0kaI19pPUrtHN+gUj9nGQ/y6bfjLXm9Zu4RkYLMRvw=; b=jJnhakolbMrsotDjYdrEiNiP6PnCEACUXh9Aw1By2NCjxr9OeUADhgaIrd6o92kUfzgk05WkKy5MYOlrnWKsIy9u875OhO5R3AQ1GtsLvfo/Dr4shs3nae++8Ur/K3yjI5x2XJoDQl0Y/gwWYSmH14UvGH0fupau64XfLsRqnnc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559299859431794.8535376211325; Fri, 31 May 2019 03:50:59 -0700 (PDT) Received: from localhost ([127.0.0.1]:40852 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf76-0002UW-U2 for importer@patchew.org; Fri, 31 May 2019 06:50:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf1n-0006pJ-Dy for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf1m-0001Lk-3X for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43964) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf1l-0001CH-S3 for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:49 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9B7B2A4D21; Fri, 31 May 2019 10:44:42 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C75B271AE; Fri, 31 May 2019 10:44:41 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:12 +0200 Message-Id: <20190531104432.29379-4-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 31 May 2019 10:44:42 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 03/23] s390x/tcg: Export float_comp_to_cc() and float(32|64|128)_dcmask() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Vector floating-point instructions will require these functions, so allow to use them from other files. Signed-off-by: David Hildenbrand --- target/s390x/fpu_helper.c | 4 ++-- target/s390x/internal.h | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/target/s390x/fpu_helper.c b/target/s390x/fpu_helper.c index 1be68bafea..d2c17ed942 100644 --- a/target/s390x/fpu_helper.c +++ b/target/s390x/fpu_helper.c @@ -112,7 +112,7 @@ static void handle_exceptions(CPUS390XState *env, bool = XxC, uintptr_t retaddr) } } =20 -static inline int float_comp_to_cc(CPUS390XState *env, int float_compare) +int float_comp_to_cc(CPUS390XState *env, int float_compare) { S390CPU *cpu =3D s390_env_get_cpu(env); =20 @@ -746,7 +746,7 @@ static inline uint16_t dcmask(int bit, bool neg) } =20 #define DEF_FLOAT_DCMASK(_TYPE) \ -static uint16_t _TYPE##_dcmask(CPUS390XState *env, _TYPE f1) \ +uint16_t _TYPE##_dcmask(CPUS390XState *env, _TYPE f1) \ { \ const bool neg =3D _TYPE##_is_neg(f1); \ \ diff --git a/target/s390x/internal.h b/target/s390x/internal.h index 9893fc094b..c243fa725b 100644 --- a/target/s390x/internal.h +++ b/target/s390x/internal.h @@ -285,6 +285,10 @@ uint32_t set_cc_nz_f128(float128 v); uint8_t s390_softfloat_exc_to_ieee(unsigned int exc); int s390_swap_bfp_rounding_mode(CPUS390XState *env, int m3); void s390_restore_bfp_rounding_mode(CPUS390XState *env, int old_mode); +int float_comp_to_cc(CPUS390XState *env, int float_compare); +uint16_t float32_dcmask(CPUS390XState *env, float32 f1); +uint16_t float64_dcmask(CPUS390XState *env, float64 f1); +uint16_t float128_dcmask(CPUS390XState *env, float128 f1); =20 =20 /* gdbstub.c */ --=20 2.20.1 From nobody Mon Nov 10 20:55:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559300024; cv=none; d=zoho.com; s=zohoarc; b=DeQeuCZQniLUQ7xcWjUCFXm6y7+gO1Iz+P9LxooaB4ealeA69CRpOG+3EhkLKLjTuYQQXTbiFhdrEoYcxm3XjGyit9J/gpaj9Ze35gzIXPCQfZ4ckrhyjHWKD3mDt2ofU/G6OSuChTUE3QhzLlrcH61kIwevJT/hUXvNn6keIjg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559300024; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=fgY9lGe6ySEeUB7LMoSjVXQunyRCvdgteewmULPRTF8=; b=lVNuOeJPLNQMCU4FSSC1hO8swKI3a5w5P/i+bNYf79Y2jmEkMrX1SCUYeWO+rcTpETFjpOXVAaUG+po8etIU5xLPN5SmExr4syYSi3+kyZuZq8J7M6YBODdzteYhNC0aYkZRjeH8/OGS3J0eECmUdI8JDxBz8PWcmAdYjKhOmAs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559300024795486.9380201394737; Fri, 31 May 2019 03:53:44 -0700 (PDT) Received: from localhost ([127.0.0.1]:40908 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWfAH-0005Eg-MC for importer@patchew.org; Fri, 31 May 2019 06:53:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56030) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf1o-0006qJ-25 for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf1l-0001L6-Si for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56170) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf1j-0001Dg-UE for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:49 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F376B302451A; Fri, 31 May 2019 10:44:43 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id E7DCC473DB; Fri, 31 May 2019 10:44:42 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:13 +0200 Message-Id: <20190531104432.29379-5-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 31 May 2019 10:44:44 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 04/23] s390x/tcg: Implement VECTOR FP ADD X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" 1. We'll reuse op_vfa() for similar instructions later, prepare for that. 2. We'll reuse vop64_3() for other instructions later. 3. Take care of modifying the vector register only if no trap happened. - on traps, flags are not updated and no elements are modified - traps don't modify the fpc flags - without traps, all exceptions of all elements are merged 4. We'll reuse check_ieee_exc() later when we need the XxC flag. We have to check for exceptions after processing each element. Provide separate handlers for single/all element processing. We'll do the same for all applicable FP instructions. Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- target/s390x/Makefile.objs | 1 + target/s390x/helper.h | 4 ++ target/s390x/insn-data.def | 5 ++ target/s390x/translate_vx.inc.c | 29 ++++++++ target/s390x/vec_fpu_helper.c | 119 ++++++++++++++++++++++++++++++++ 5 files changed, 158 insertions(+) create mode 100644 target/s390x/vec_fpu_helper.c diff --git a/target/s390x/Makefile.objs b/target/s390x/Makefile.objs index ffdd484ef0..3e2745594a 100644 --- a/target/s390x/Makefile.objs +++ b/target/s390x/Makefile.objs @@ -2,6 +2,7 @@ obj-y +=3D cpu.o cpu_models.o cpu_features.o gdbstub.o inte= rrupt.o helper.o obj-$(CONFIG_TCG) +=3D translate.o cc_helper.o excp_helper.o fpu_helper.o obj-$(CONFIG_TCG) +=3D int_helper.o mem_helper.o misc_helper.o crypto_help= er.o obj-$(CONFIG_TCG) +=3D vec_helper.o vec_int_helper.o vec_string_helper.o +obj-$(CONFIG_TCG) +=3D vec_fpu_helper.o obj-$(CONFIG_SOFTMMU) +=3D machine.o ioinst.o arch_dump.o mmu_helper.o dia= g.o obj-$(CONFIG_SOFTMMU) +=3D sigp.o obj-$(CONFIG_KVM) +=3D kvm.o diff --git a/target/s390x/helper.h b/target/s390x/helper.h index 5db67779d3..21658a2771 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -249,6 +249,10 @@ DEF_HELPER_6(gvec_vstrc_cc_rt8, void, ptr, cptr, cptr,= cptr, env, i32) DEF_HELPER_6(gvec_vstrc_cc_rt16, void, ptr, cptr, cptr, cptr, env, i32) DEF_HELPER_6(gvec_vstrc_cc_rt32, void, ptr, cptr, cptr, cptr, env, i32) =20 +/* =3D=3D=3D Vector Floating-Point Instructions */ +DEF_HELPER_FLAGS_5(gvec_vfa64, TCG_CALL_NO_WG, void, ptr, cptr, cptr, env,= i32) +DEF_HELPER_FLAGS_5(gvec_vfa64s, TCG_CALL_NO_WG, void, ptr, cptr, cptr, env= , i32) + #ifndef CONFIG_USER_ONLY DEF_HELPER_3(servc, i32, env, i64, i64) DEF_HELPER_4(diag, void, env, i32, i32, i32) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index a2969fab58..79892f6042 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -1204,6 +1204,11 @@ /* VECTOR STRING RANGE COMPARE */ F(0xe78a, VSTRC, VRR_d, V, 0, 0, 0, 0, vstrc, 0, IF_VEC) =20 +/* =3D=3D=3D Vector Floating-Point Instructions */ + +/* VECTOR FP ADD */ + F(0xe7e3, VFA, VRR_c, V, 0, 0, 0, 0, vfa, 0, IF_VEC) + #ifndef CONFIG_USER_ONLY /* COMPARE AND SWAP AND PURGE */ E(0xb250, CSP, RRE, Z, r1_32u, ra2, r1_P, 0, csp, 0, MO_TEUL, = IF_PRIV) diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.in= c.c index f26ffa2895..44da9f2645 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -52,6 +52,11 @@ #define ES_64 MO_64 #define ES_128 4 =20 +/* Floating-Point Format */ +#define FPF_SHORT 2 +#define FPF_LONG 3 +#define FPF_EXT 4 + static inline bool valid_vec_element(uint8_t enr, TCGMemOp es) { return !(enr & ~(NUM_VEC_ELEMENTS(es) - 1)); @@ -2538,3 +2543,27 @@ static DisasJumpType op_vstrc(DisasContext *s, Disas= Ops *o) } return DISAS_NEXT; } + +static DisasJumpType op_vfa(DisasContext *s, DisasOps *o) +{ + const uint8_t fpf =3D get_field(s->fields, m4); + const uint8_t m5 =3D get_field(s->fields, m5); + const bool se =3D extract32(m5, 3, 1); + gen_helper_gvec_3_ptr *fn; + + if (fpf !=3D FPF_LONG || extract32(m5, 0, 3)) { + gen_program_exception(s, PGM_SPECIFICATION); + return DISAS_NORETURN; + } + + switch (s->fields->op2) { + case 0xe3: + fn =3D se ? gen_helper_gvec_vfa64s : gen_helper_gvec_vfa64; + break; + default: + g_assert_not_reached(); + } + gen_gvec_3_ptr(get_field(s->fields, v1), get_field(s->fields, v2), + get_field(s->fields, v3), cpu_env, 0, fn); + return DISAS_NEXT; +} diff --git a/target/s390x/vec_fpu_helper.c b/target/s390x/vec_fpu_helper.c new file mode 100644 index 0000000000..11dd20b837 --- /dev/null +++ b/target/s390x/vec_fpu_helper.c @@ -0,0 +1,119 @@ +/* + * QEMU TCG support -- s390x vector floating point instruction support + * + * Copyright (C) 2019 Red Hat Inc + * + * Authors: + * David Hildenbrand + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ +#include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" +#include "internal.h" +#include "vec.h" +#include "tcg_s390x.h" +#include "tcg/tcg-gvec-desc.h" +#include "exec/exec-all.h" +#include "exec/helper-proto.h" +#include "fpu/softfloat.h" + +#define VIC_INVALID 0x1 +#define VIC_DIVBYZERO 0x2 +#define VIC_OVERFLOW 0x3 +#define VIC_UNDERFLOW 0x4 +#define VIC_INEXACT 0x5 + +/* returns the VEX. If the VEX is 0, there is no trap */ +static uint8_t check_ieee_exc(CPUS390XState *env, uint8_t enr, bool XxC, + uint8_t *vec_exc) +{ + uint8_t vece_exc =3D 0, trap_exc; + unsigned qemu_exc; + + /* Retrieve and clear the softfloat exceptions */ + qemu_exc =3D env->fpu_status.float_exception_flags; + if (qemu_exc =3D=3D 0) { + return 0; + } + env->fpu_status.float_exception_flags =3D 0; + + vece_exc =3D s390_softfloat_exc_to_ieee(qemu_exc); + + /* Add them to the vector-wide s390x exception bits */ + *vec_exc |=3D vece_exc; + + /* Check for traps and construct the VXC */ + trap_exc =3D vece_exc & env->fpc >> 24; + if (trap_exc) { + if (trap_exc & S390_IEEE_MASK_INVALID) { + return enr << 4 | VIC_INVALID; + } else if (trap_exc & S390_IEEE_MASK_DIVBYZERO) { + return enr << 4 | VIC_DIVBYZERO; + } else if (trap_exc & S390_IEEE_MASK_OVERFLOW) { + return enr << 4 | VIC_OVERFLOW; + } else if (trap_exc & S390_IEEE_MASK_UNDERFLOW) { + return enr << 4 | VIC_UNDERFLOW; + } else if (!XxC) { + g_assert(trap_exc & S390_IEEE_MASK_INEXACT); + /* inexact has lowest priority on traps */ + return enr << 4 | VIC_INEXACT; + } + } + return 0; +} + +static void handle_ieee_exc(CPUS390XState *env, uint8_t vxc, uint8_t vec_e= xc, + uintptr_t retaddr) +{ + if (vxc) { + /* on traps, the fpc flags are not updated, instruction is suppres= sed */ + tcg_s390_vector_exception(env, vxc, retaddr); + } + if (vec_exc) { + /* indicate exceptions for all elements combined */ + env->fpc |=3D vec_exc << 16; + } +} + +typedef uint64_t (*vop64_3_fn)(uint64_t a, uint64_t b, float_status *s); +static void vop64_3(S390Vector *v1, const S390Vector *v2, const S390Vector= *v3, + CPUS390XState *env, bool s, vop64_3_fn fn, + uintptr_t retaddr) +{ + uint8_t vxc, vec_exc =3D 0; + S390Vector tmp =3D {}; + int i; + + for (i =3D 0; i < 2; i++) { + const uint64_t a =3D s390_vec_read_element64(v2, i); + const uint64_t b =3D s390_vec_read_element64(v3, i); + + s390_vec_write_element64(&tmp, i, fn(a, b, &env->fpu_status)); + vxc =3D check_ieee_exc(env, i, false, &vec_exc); + if (s || vxc) { + break; + } + } + handle_ieee_exc(env, vxc, vec_exc, retaddr); + *v1 =3D tmp; +} + +static uint64_t vfa64(uint64_t a, uint64_t b, float_status *s) +{ + return float64_val(float64_add(make_float64(a), make_float64(b), s)); +} + +void HELPER(gvec_vfa64)(void *v1, const void *v2, const void *v3, + CPUS390XState *env, uint32_t desc) +{ + vop64_3(v1, v2, v3, env, false, vfa64, GETPC()); +} + +void HELPER(gvec_vfa64s)(void *v1, const void *v2, const void *v3, + CPUS390XState *env, uint32_t desc) +{ + vop64_3(v1, v2, v3, env, true, vfa64, GETPC()); +} --=20 2.20.1 From nobody Mon Nov 10 20:55:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559299627; cv=none; d=zoho.com; s=zohoarc; b=VR4XPXhvg0Q/e0pY0YrIhQAj+ygep4OWUhlgMuevpKSJsQv/KakeFShXAzbRuKxDGwgJpA15wNEx4pqJG6GMbzKtWaIUWFlt1AM5bY6dDVhcK+j5hkjq7oBLMpLTst5lxI53jngpH+QbCuhwv+NoCBkvCFnsEwTRPHKTXl7H8t0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559299627; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=14n6NJD4pxRMap4hsLPZi0gRTly9IKDQR+QiT6KyOG4=; b=Tu8Ajz3JMnh5hN/vsbLf0GdwgSSX0s+Cz7AUlj3R+W1glIADFrgxl/br4Wz0Vp7EPDB3/ElCyUbpKGnfrY8qxbA8j92clbuAbRE61CePUkpbJ5JCV8htkojgT6H6LuFsxHfuApBRY1NLeuxw1oQyZpQ7hoOLCtcduxLuOQyANTA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559299627157617.794868390559; Fri, 31 May 2019 03:47:07 -0700 (PDT) Received: from localhost ([127.0.0.1]:40828 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf3s-0008GI-Gs for importer@patchew.org; Fri, 31 May 2019 06:47:00 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55985) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf1n-0006od-1r for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf1l-0001LC-TM for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42706) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf1j-0001Ft-Vc for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:49 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 57A8030821C0; Fri, 31 May 2019 10:44:45 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4BE32271AE; Fri, 31 May 2019 10:44:44 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:14 +0200 Message-Id: <20190531104432.29379-6-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 31 May 2019 10:44:45 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 05/23] s390x/tcg: Implement VECTOR FP COMPARE (AND SIGNAL) SCALAR X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" As far as I can see, there is only a tiny difference. Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- target/s390x/helper.h | 2 ++ target/s390x/insn-data.def | 4 ++++ target/s390x/translate_vx.inc.c | 21 +++++++++++++++++++++ target/s390x/vec_fpu_helper.c | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index 21658a2771..d34d6802a6 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -252,6 +252,8 @@ DEF_HELPER_6(gvec_vstrc_cc_rt32, void, ptr, cptr, cptr,= cptr, env, i32) /* =3D=3D=3D Vector Floating-Point Instructions */ DEF_HELPER_FLAGS_5(gvec_vfa64, TCG_CALL_NO_WG, void, ptr, cptr, cptr, env,= i32) DEF_HELPER_FLAGS_5(gvec_vfa64s, TCG_CALL_NO_WG, void, ptr, cptr, cptr, env= , i32) +DEF_HELPER_4(gvec_wfc64, void, cptr, cptr, env, i32) +DEF_HELPER_4(gvec_wfk64, void, cptr, cptr, env, i32) =20 #ifndef CONFIG_USER_ONLY DEF_HELPER_3(servc, i32, env, i64, i64) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index 79892f6042..c45e101b10 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -1208,6 +1208,10 @@ =20 /* VECTOR FP ADD */ F(0xe7e3, VFA, VRR_c, V, 0, 0, 0, 0, vfa, 0, IF_VEC) +/* VECTOR FP COMPARE SCALAR */ + F(0xe7cb, WFC, VRR_a, V, 0, 0, 0, 0, wfc, 0, IF_VEC) +/* VECTOR FP COMPARE AND SIGNAL SCALAR */ + F(0xe7ca, WFK, VRR_a, V, 0, 0, 0, 0, wfc, 0, IF_VEC) =20 #ifndef CONFIG_USER_ONLY /* COMPARE AND SWAP AND PURGE */ diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.in= c.c index 44da9f2645..283e8aa07a 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -2567,3 +2567,24 @@ static DisasJumpType op_vfa(DisasContext *s, DisasOp= s *o) get_field(s->fields, v3), cpu_env, 0, fn); return DISAS_NEXT; } + +static DisasJumpType op_wfc(DisasContext *s, DisasOps *o) +{ + const uint8_t fpf =3D get_field(s->fields, m3); + const uint8_t m4 =3D get_field(s->fields, m4); + + if (fpf !=3D FPF_LONG || m4) { + gen_program_exception(s, PGM_SPECIFICATION); + return DISAS_NORETURN; + } + + if (s->fields->op2 =3D=3D 0xcb) { + gen_gvec_2_ptr(get_field(s->fields, v1), get_field(s->fields, v2), + cpu_env, 0, gen_helper_gvec_wfc64); + } else { + gen_gvec_2_ptr(get_field(s->fields, v1), get_field(s->fields, v2), + cpu_env, 0, gen_helper_gvec_wfk64); + } + set_cc_static(s); + return DISAS_NEXT; +} diff --git a/target/s390x/vec_fpu_helper.c b/target/s390x/vec_fpu_helper.c index 11dd20b837..3c153d8426 100644 --- a/target/s390x/vec_fpu_helper.c +++ b/target/s390x/vec_fpu_helper.c @@ -117,3 +117,35 @@ void HELPER(gvec_vfa64s)(void *v1, const void *v2, con= st void *v3, { vop64_3(v1, v2, v3, env, true, vfa64, GETPC()); } + +static int wfc64(const S390Vector *v1, const S390Vector *v2, + CPUS390XState *env, bool signal, uintptr_t retaddr) +{ + /* only the zero-indexed elements are compared */ + const float64 a =3D make_float64(s390_vec_read_element64(v1, 0)); + const float64 b =3D make_float64(s390_vec_read_element64(v2, 0)); + uint8_t vxc, vec_exc =3D 0; + int cmp; + + if (signal) { + cmp =3D float64_compare(a, b, &env->fpu_status); + } else { + cmp =3D float64_compare_quiet(a, b, &env->fpu_status); + } + vxc =3D check_ieee_exc(env, 0, false, &vec_exc); + handle_ieee_exc(env, vxc, vec_exc, retaddr); + + return float_comp_to_cc(env, cmp); +} + +void HELPER(gvec_wfc64)(const void *v1, const void *v2, CPUS390XState *env, + uint32_t desc) +{ + env->cc_op =3D wfc64(v1, v2, env, false, GETPC()); +} + +void HELPER(gvec_wfk64)(const void *v1, const void *v2, CPUS390XState *env, + uint32_t desc) +{ + env->cc_op =3D wfc64(v1, v2, env, true, GETPC()); +} --=20 2.20.1 From nobody Mon Nov 10 20:55:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559299833; cv=none; d=zoho.com; s=zohoarc; b=P8gHZqGojWb/G4lT56HOfwgOv2Nmrb0Rs3PQ13ZtIWF6DkbfiX4KviQB08CpxZR3q3oY7Kfq7xWHniq1r1VpZ1bRb23RB+GC9z+oH0NzYfsh+KNpk4Lns+ZOhpKK4OYuHQjz6Ak2lHJd9LaDiILeORv9MMm0KCO0OgJMhaZa91E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559299833; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ke5sMbJikjh+zt6lznatfwn//+hGH3NxwCdg7L0JVVs=; b=DeXl5IS1fXUVZTODMyD3aZdadSU1pUXH8r8DH2wshPX9/6tjtCuyCfBt0WutPoaz6xy4woEOCYmjZKT7M9CS5TtFrZbIXeNUD/lytqyNTXQ754BlN6MutL5lrfmAmnDJGQoAELfcUgpCJO7vnubAMwVT40POa16udw8qrc8UVjo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559299833682760.3558853887523; Fri, 31 May 2019 03:50:33 -0700 (PDT) Received: from localhost ([127.0.0.1]:40856 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf78-0002W3-Io for importer@patchew.org; Fri, 31 May 2019 06:50:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf1n-0006qI-Sy for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf1l-0001LH-TC for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43042) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf1k-0001HG-0l for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:49 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B3DCE307D977; Fri, 31 May 2019 10:44:46 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4C8E271AE; Fri, 31 May 2019 10:44:45 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:15 +0200 Message-Id: <20190531104432.29379-7-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 31 May 2019 10:44:46 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 06/23] s390x/tcg: Implement VECTOR FP COMPARE (EQUAL|HIGH|HIGH OR EQUAL) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Provide for all three instructions all four combinations of cc bit and s bit. Signed-off-by: David Hildenbrand --- target/s390x/helper.h | 12 ++++ target/s390x/insn-data.def | 6 ++ target/s390x/translate_vx.inc.c | 51 +++++++++++++++ target/s390x/vec_fpu_helper.c | 107 ++++++++++++++++++++++++++++++++ 4 files changed, 176 insertions(+) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index d34d6802a6..33d3bacf74 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -254,6 +254,18 @@ DEF_HELPER_FLAGS_5(gvec_vfa64, TCG_CALL_NO_WG, void, p= tr, cptr, cptr, env, i32) DEF_HELPER_FLAGS_5(gvec_vfa64s, TCG_CALL_NO_WG, void, ptr, cptr, cptr, env= , i32) DEF_HELPER_4(gvec_wfc64, void, cptr, cptr, env, i32) DEF_HELPER_4(gvec_wfk64, void, cptr, cptr, env, i32) +DEF_HELPER_FLAGS_5(gvec_vfce64, TCG_CALL_NO_WG, void, ptr, cptr, cptr, env= , i32) +DEF_HELPER_FLAGS_5(gvec_vfce64s, TCG_CALL_NO_WG, void, ptr, cptr, cptr, en= v, i32) +DEF_HELPER_5(gvec_vfce64_cc, void, ptr, cptr, cptr, env, i32) +DEF_HELPER_5(gvec_vfce64s_cc, void, ptr, cptr, cptr, env, i32) +DEF_HELPER_FLAGS_5(gvec_vfch64, TCG_CALL_NO_WG, void, ptr, cptr, cptr, env= , i32) +DEF_HELPER_FLAGS_5(gvec_vfch64s, TCG_CALL_NO_WG, void, ptr, cptr, cptr, en= v, i32) +DEF_HELPER_5(gvec_vfch64_cc, void, ptr, cptr, cptr, env, i32) +DEF_HELPER_5(gvec_vfch64s_cc, void, ptr, cptr, cptr, env, i32) +DEF_HELPER_FLAGS_5(gvec_vfche64, TCG_CALL_NO_WG, void, ptr, cptr, cptr, en= v, i32) +DEF_HELPER_FLAGS_5(gvec_vfche64s, TCG_CALL_NO_WG, void, ptr, cptr, cptr, e= nv, i32) +DEF_HELPER_5(gvec_vfche64_cc, void, ptr, cptr, cptr, env, i32) +DEF_HELPER_5(gvec_vfche64s_cc, void, ptr, cptr, cptr, env, i32) =20 #ifndef CONFIG_USER_ONLY DEF_HELPER_3(servc, i32, env, i64, i64) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index c45e101b10..446552f251 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -1212,6 +1212,12 @@ F(0xe7cb, WFC, VRR_a, V, 0, 0, 0, 0, wfc, 0, IF_VEC) /* VECTOR FP COMPARE AND SIGNAL SCALAR */ F(0xe7ca, WFK, VRR_a, V, 0, 0, 0, 0, wfc, 0, IF_VEC) +/* VECTOR FP COMPARE EQUAL */ + F(0xe7e8, VFCE, VRR_c, V, 0, 0, 0, 0, vfc, 0, IF_VEC) +/* VECTOR FP COMPARE HIGH */ + F(0xe7eb, VFCH, VRR_c, V, 0, 0, 0, 0, vfc, 0, IF_VEC) +/* VECTOR FP COMPARE HIGH OR EQUAL */ + F(0xe7ea, VFCHE, VRR_c, V, 0, 0, 0, 0, vfc, 0, IF_VEC) =20 #ifndef CONFIG_USER_ONLY /* COMPARE AND SWAP AND PURGE */ diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.in= c.c index 283e8aa07a..5571a71e1a 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -2588,3 +2588,54 @@ static DisasJumpType op_wfc(DisasContext *s, DisasOp= s *o) set_cc_static(s); return DISAS_NEXT; } + +static DisasJumpType op_vfc(DisasContext *s, DisasOps *o) +{ + const uint8_t fpf =3D get_field(s->fields, m4); + const uint8_t m5 =3D get_field(s->fields, m5); + const uint8_t m6 =3D get_field(s->fields, m6); + const bool se =3D extract32(m5, 3, 1); + const bool cs =3D extract32(m6, 0, 1); + gen_helper_gvec_3_ptr *fn; + + if (fpf !=3D FPF_LONG || extract32(m5, 0, 3) || extract32(m6, 1, 3)) { + gen_program_exception(s, PGM_SPECIFICATION); + return DISAS_NORETURN; + } + + if (cs) { + switch (s->fields->op2) { + case 0xe8: + fn =3D se ? gen_helper_gvec_vfce64s_cc : gen_helper_gvec_vfce6= 4_cc; + break; + case 0xeb: + fn =3D se ? gen_helper_gvec_vfch64s_cc : gen_helper_gvec_vfch6= 4_cc; + break; + case 0xea: + fn =3D se ? gen_helper_gvec_vfche64s_cc : gen_helper_gvec_vfch= e64_cc; + break; + default: + g_assert_not_reached(); + } + } else { + switch (s->fields->op2) { + case 0xe8: + fn =3D se ? gen_helper_gvec_vfce64s : gen_helper_gvec_vfce64; + break; + case 0xeb: + fn =3D se ? gen_helper_gvec_vfch64s : gen_helper_gvec_vfch64; + break; + case 0xea: + fn =3D se ? gen_helper_gvec_vfche64s : gen_helper_gvec_vfche64; + break; + default: + g_assert_not_reached(); + } + } + gen_gvec_3_ptr(get_field(s->fields, v1), get_field(s->fields, v2), + get_field(s->fields, v3), cpu_env, 0, fn); + if (cs) { + set_cc_static(s); + } + return DISAS_NEXT; +} diff --git a/target/s390x/vec_fpu_helper.c b/target/s390x/vec_fpu_helper.c index 3c153d8426..1c4d4661ba 100644 --- a/target/s390x/vec_fpu_helper.c +++ b/target/s390x/vec_fpu_helper.c @@ -149,3 +149,110 @@ void HELPER(gvec_wfk64)(const void *v1, const void *v= 2, CPUS390XState *env, { env->cc_op =3D wfc64(v1, v2, env, true, GETPC()); } + +static int vfc64(S390Vector *v1, const S390Vector *v2, const S390Vector *v= 3, + CPUS390XState *env, bool s, bool test_equal, bool test_hi= gh, + uintptr_t retaddr) +{ + uint8_t vxc, vec_exc =3D 0; + S390Vector tmp =3D {}; + int match =3D 0; + int i; + + for (i =3D 0; i < 2; i++) { + const float64 a =3D make_float64(s390_vec_read_element64(v2, i)); + const float64 b =3D make_float64(s390_vec_read_element64(v3, i)); + const int cmp =3D float64_compare_quiet(a, b, &env->fpu_status); + + if ((cmp =3D=3D float_relation_equal && test_equal) || + (cmp =3D=3D float_relation_greater && test_high)) { + match++; + s390_vec_write_element64(&tmp, i, -1ull); + } + vxc =3D check_ieee_exc(env, i, false, &vec_exc); + if (s || vxc) { + break; + } + } + + handle_ieee_exc(env, vxc, vec_exc, retaddr); + *v1 =3D tmp; + if (match =3D=3D i + 1) { + return 0; + } else if (match) { + return 1; + } + return 3; +} + +void HELPER(gvec_vfce64)(void *v1, const void *v2, const void *v3, + CPUS390XState *env, uint32_t desc) +{ + vfc64(v1, v2, v3, env, false, true, false, GETPC()); +} + +void HELPER(gvec_vfce64s)(void *v1, const void *v2, const void *v3, + CPUS390XState *env, uint32_t desc) +{ + vfc64(v1, v2, v3, env, true, true, false, GETPC()); +} + +void HELPER(gvec_vfce64_cc)(void *v1, const void *v2, const void *v3, + CPUS390XState *env, uint32_t desc) +{ + env->cc_op =3D vfc64(v1, v2, v3, env, false, true, false, GETPC()); +} + +void HELPER(gvec_vfce64s_cc)(void *v1, const void *v2, const void *v3, + CPUS390XState *env, uint32_t desc) +{ + env->cc_op =3D vfc64(v1, v2, v3, env, true, true, false, GETPC()); +} + +void HELPER(gvec_vfch64)(void *v1, const void *v2, const void *v3, + CPUS390XState *env, uint32_t desc) +{ + vfc64(v1, v2, v3, env, false, false, true, GETPC()); +} + +void HELPER(gvec_vfch64s)(void *v1, const void *v2, const void *v3, + CPUS390XState *env, uint32_t desc) +{ + vfc64(v1, v2, v3, env, true, false, true, GETPC()); +} + +void HELPER(gvec_vfch64_cc)(void *v1, const void *v2, const void *v3, + CPUS390XState *env, uint32_t desc) +{ + env->cc_op =3D vfc64(v1, v2, v3, env, false, false, true, GETPC()); +} + +void HELPER(gvec_vfch64s_cc)(void *v1, const void *v2, const void *v3, + CPUS390XState *env, uint32_t desc) +{ + env->cc_op =3D vfc64(v1, v2, v3, env, true, false, true, GETPC()); +} + +void HELPER(gvec_vfche64)(void *v1, const void *v2, const void *v3, + CPUS390XState *env, uint32_t desc) +{ + vfc64(v1, v2, v3, env, false, true, true, GETPC()); +} + +void HELPER(gvec_vfche64s)(void *v1, const void *v2, const void *v3, + CPUS390XState *env, uint32_t desc) +{ + vfc64(v1, v2, v3, env, true, true, true, GETPC()); +} + +void HELPER(gvec_vfche64_cc)(void *v1, const void *v2, const void *v3, + CPUS390XState *env, uint32_t desc) +{ + env->cc_op =3D vfc64(v1, v2, v3, env, false, true, true, GETPC()); +} + +void HELPER(gvec_vfche64s_cc)(void *v1, const void *v2, const void *v3, + CPUS390XState *env, uint32_t desc) +{ + env->cc_op =3D vfc64(v1, v2, v3, env, true, true, true, GETPC()); +} --=20 2.20.1 From nobody Mon Nov 10 20:55:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559299845; cv=none; d=zoho.com; s=zohoarc; b=Nb/qmyNgRqXupkrF3CJvkdxqSKKwjsBa2OAKqVQGn9bVO9c2SMiZa8KNLospBQCocwM+v72jVn9+bdlU0GPIEVDR2Xg6EFqDrFsGtrDQo4NRtpC5u70x+bIgaU/3tN2NC/4rxiQnPQ8qO6IMtr0GopuwfWyWyds5NZGfxAU1duk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559299845; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=7S8w7ggZX1eJwLb9g00Jc7vOQpl21JecnAp0wI6n16o=; b=FZNCFRYSLeW76lgRicGTvgVT4vCPTkcIsnbYh1kpgNUSlY7Z4+Q7UXKZUegQvRs1zATeIEVAkJP65YL1diCL0GrqL66RXfdqqv5BFr2LUtkq65qb+SivL4vo0+NY3IyFyCqGgsgswdEkOqnGRJCwzIvSaeTIyHWgIDr2LKOnlSg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559299845652294.9266903788374; Fri, 31 May 2019 03:50:45 -0700 (PDT) Received: from localhost ([127.0.0.1]:40858 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf7P-0002iD-J7 for importer@patchew.org; Fri, 31 May 2019 06:50:39 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf1n-0006qC-Qb for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf1m-0001Lg-3f for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37718) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf1l-0001Ir-QJ for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:49 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 18E6A308339E; Fri, 31 May 2019 10:44:48 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0AA1B271AE; Fri, 31 May 2019 10:44:46 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:16 +0200 Message-Id: <20190531104432.29379-8-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 31 May 2019 10:44:48 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 07/23] s390x/tcg: Implement VECTOR FP CONVERT FROM FIXED 64-BIT X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" 1. We'll reuse op_vcdg() for similar instructions later, prepare for that. 2. We'll reuse vop64_2() later for other instructions. We have to mangle the erm (effective rounding mode) and the m4 into the simd_data(), and properly unmangle them again. Make sure to restore the erm before triggering an exception. Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- target/s390x/helper.h | 2 ++ target/s390x/insn-data.def | 2 ++ target/s390x/translate_vx.inc.c | 25 ++++++++++++++++++ target/s390x/vec_fpu_helper.c | 47 +++++++++++++++++++++++++++++++++ 4 files changed, 76 insertions(+) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index 33d3bacf74..a60f4c49fc 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -266,6 +266,8 @@ DEF_HELPER_FLAGS_5(gvec_vfche64, TCG_CALL_NO_WG, void, = ptr, cptr, cptr, env, i32 DEF_HELPER_FLAGS_5(gvec_vfche64s, TCG_CALL_NO_WG, void, ptr, cptr, cptr, e= nv, i32) DEF_HELPER_5(gvec_vfche64_cc, void, ptr, cptr, cptr, env, i32) DEF_HELPER_5(gvec_vfche64s_cc, void, ptr, cptr, cptr, env, i32) +DEF_HELPER_FLAGS_4(gvec_vcdg64, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) +DEF_HELPER_FLAGS_4(gvec_vcdg64s, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) =20 #ifndef CONFIG_USER_ONLY DEF_HELPER_3(servc, i32, env, i64, i64) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index 446552f251..d3386024c8 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -1218,6 +1218,8 @@ F(0xe7eb, VFCH, VRR_c, V, 0, 0, 0, 0, vfc, 0, IF_VEC) /* VECTOR FP COMPARE HIGH OR EQUAL */ F(0xe7ea, VFCHE, VRR_c, V, 0, 0, 0, 0, vfc, 0, IF_VEC) +/* VECTOR FP CONVERT FROM FIXED 64-BIT */ + F(0xe7c3, VCDG, VRR_a, V, 0, 0, 0, 0, vcdg, 0, IF_VEC) =20 #ifndef CONFIG_USER_ONLY /* COMPARE AND SWAP AND PURGE */ diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.in= c.c index 5571a71e1a..6741b707cc 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -2639,3 +2639,28 @@ static DisasJumpType op_vfc(DisasContext *s, DisasOp= s *o) } return DISAS_NEXT; } + +static DisasJumpType op_vcdg(DisasContext *s, DisasOps *o) +{ + const uint8_t fpf =3D get_field(s->fields, m3); + const uint8_t m4 =3D get_field(s->fields, m4); + const uint8_t erm =3D get_field(s->fields, m5); + const bool se =3D extract32(m4, 3, 1); + gen_helper_gvec_2_ptr *fn; + + if (fpf !=3D FPF_LONG || extract32(m4, 0, 2) || erm > 7 || erm =3D=3D = 2) { + gen_program_exception(s, PGM_SPECIFICATION); + return DISAS_NORETURN; + } + + switch (s->fields->op2) { + case 0xc3: + fn =3D se ? gen_helper_gvec_vcdg64s : gen_helper_gvec_vcdg64; + break; + default: + g_assert_not_reached(); + } + gen_gvec_2_ptr(get_field(s->fields, v1), get_field(s->fields, v2), cpu= _env, + deposit32(m4, 4, 4, erm), fn); + return DISAS_NEXT; +} diff --git a/target/s390x/vec_fpu_helper.c b/target/s390x/vec_fpu_helper.c index 1c4d4661ba..488895efdc 100644 --- a/target/s390x/vec_fpu_helper.c +++ b/target/s390x/vec_fpu_helper.c @@ -78,6 +78,30 @@ static void handle_ieee_exc(CPUS390XState *env, uint8_t = vxc, uint8_t vec_exc, } } =20 +typedef uint64_t (*vop64_2_fn)(uint64_t a, float_status *s); +static void vop64_2(S390Vector *v1, const S390Vector *v2, CPUS390XState *e= nv, + bool s, bool XxC, uint8_t erm, vop64_2_fn fn, + uintptr_t retaddr) +{ + uint8_t vxc, vec_exc =3D 0; + S390Vector tmp =3D {}; + int i, old_mode; + + old_mode =3D s390_swap_bfp_rounding_mode(env, erm); + for (i =3D 0; i < 2; i++) { + const uint64_t a =3D s390_vec_read_element64(v2, i); + + s390_vec_write_element64(&tmp, i, fn(a, &env->fpu_status)); + vxc =3D check_ieee_exc(env, i, XxC, &vec_exc); + if (s || vxc) { + break; + } + } + s390_restore_bfp_rounding_mode(env, old_mode); + handle_ieee_exc(env, vxc, vec_exc, retaddr); + *v1 =3D tmp; +} + typedef uint64_t (*vop64_3_fn)(uint64_t a, uint64_t b, float_status *s); static void vop64_3(S390Vector *v1, const S390Vector *v2, const S390Vector= *v3, CPUS390XState *env, bool s, vop64_3_fn fn, @@ -256,3 +280,26 @@ void HELPER(gvec_vfche64s_cc)(void *v1, const void *v2= , const void *v3, { env->cc_op =3D vfc64(v1, v2, v3, env, true, true, true, GETPC()); } + +static uint64_t vcdg64(uint64_t a, float_status *s) +{ + return float64_val(int64_to_float64(a, s)); +} + +void HELPER(gvec_vcdg64)(void *v1, const void *v2, CPUS390XState *env, + uint32_t desc) +{ + const uint8_t erm =3D extract32(simd_data(desc), 4, 4); + const bool XxC =3D extract32(simd_data(desc), 2, 1); + + vop64_2(v1, v2, env, false, XxC, erm, vcdg64, GETPC()); +} + +void HELPER(gvec_vcdg64s)(void *v1, const void *v2, CPUS390XState *env, + uint32_t desc) +{ + const uint8_t erm =3D extract32(simd_data(desc), 4, 4); + const bool XxC =3D extract32(simd_data(desc), 2, 1); + + vop64_2(v1, v2, env, true, XxC, erm, vcdg64, GETPC()); +} --=20 2.20.1 From nobody Mon Nov 10 20:55:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559299629; cv=none; d=zoho.com; s=zohoarc; b=noJb6g/pN1jB5zzh5DlXZlUQsfaYXzyEcQjESNprpz0ReK5DBaj9UXWV3lmw7UekNe9dFW5rKpTfO+Dtwm8GdHIiUslHPy+yRhidoiH7qwdlwk0qBNLJ3D1nXa4wm2+bO60BUmvZlIYLtsGcV76CscjoFA7WEykVAw8h+zzM2oU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559299629; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=VPPM2W+yOnpJwhsYWGfOSk245s8pHdmak3iMcSs2Mnk=; b=FuRigy7w8H8HK5IUF+Z3z6Mo0/uNbGQThBRvtE3fzKscnI7BuylJ7qe0ZkjwvzuMZuu9NTU0YD8i9TjsO3nQUQDcaIE5v3e3Xgicf7Lk3Bk6WMqK9sKOy2cZHD0T9731gj5c2inp/8+fUGz77dtuL1Szr+07lSMG6Hn0/q7HrNs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 155929962978286.95283975246025; Fri, 31 May 2019 03:47:09 -0700 (PDT) Received: from localhost ([127.0.0.1]:40832 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf3t-0008Ij-K5 for importer@patchew.org; Fri, 31 May 2019 06:47:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf1n-0006qB-M5 for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf1m-0001MD-Da for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43062) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf1m-0001K9-5j for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:50 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 70DA7307D911; Fri, 31 May 2019 10:44:49 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6337F271AE; Fri, 31 May 2019 10:44:48 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:17 +0200 Message-Id: <20190531104432.29379-9-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 31 May 2019 10:44:49 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 08/23] s390x/tcg: Implement VECTOR FP CONVERT FROM LOGICAL 64-BIT X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- target/s390x/helper.h | 2 ++ target/s390x/insn-data.def | 2 ++ target/s390x/translate_vx.inc.c | 3 +++ target/s390x/vec_fpu_helper.c | 23 +++++++++++++++++++++++ 4 files changed, 30 insertions(+) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index a60f4c49fc..6fd996e924 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -268,6 +268,8 @@ DEF_HELPER_5(gvec_vfche64_cc, void, ptr, cptr, cptr, en= v, i32) DEF_HELPER_5(gvec_vfche64s_cc, void, ptr, cptr, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vcdg64, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vcdg64s, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) +DEF_HELPER_FLAGS_4(gvec_vcdlg64, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) +DEF_HELPER_FLAGS_4(gvec_vcdlg64s, TCG_CALL_NO_WG, void, ptr, cptr, env, i3= 2) =20 #ifndef CONFIG_USER_ONLY DEF_HELPER_3(servc, i32, env, i64, i64) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index d3386024c8..465b36dd70 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -1220,6 +1220,8 @@ F(0xe7ea, VFCHE, VRR_c, V, 0, 0, 0, 0, vfc, 0, IF_VEC) /* VECTOR FP CONVERT FROM FIXED 64-BIT */ F(0xe7c3, VCDG, VRR_a, V, 0, 0, 0, 0, vcdg, 0, IF_VEC) +/* VECTOR FP CONVERT FROM LOGICAL 64-BIT */ + F(0xe7c1, VCDLG, VRR_a, V, 0, 0, 0, 0, vcdg, 0, IF_VEC) =20 #ifndef CONFIG_USER_ONLY /* COMPARE AND SWAP AND PURGE */ diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.in= c.c index 6741b707cc..fa755cd1d6 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -2657,6 +2657,9 @@ static DisasJumpType op_vcdg(DisasContext *s, DisasOp= s *o) case 0xc3: fn =3D se ? gen_helper_gvec_vcdg64s : gen_helper_gvec_vcdg64; break; + case 0xc1: + fn =3D se ? gen_helper_gvec_vcdlg64s : gen_helper_gvec_vcdlg64; + break; default: g_assert_not_reached(); } diff --git a/target/s390x/vec_fpu_helper.c b/target/s390x/vec_fpu_helper.c index 488895efdc..8f7dac0439 100644 --- a/target/s390x/vec_fpu_helper.c +++ b/target/s390x/vec_fpu_helper.c @@ -303,3 +303,26 @@ void HELPER(gvec_vcdg64s)(void *v1, const void *v2, CP= US390XState *env, =20 vop64_2(v1, v2, env, true, XxC, erm, vcdg64, GETPC()); } + +static uint64_t vcdlg64(uint64_t a, float_status *s) +{ + return float64_val(uint64_to_float64(a, s)); +} + +void HELPER(gvec_vcdlg64)(void *v1, const void *v2, CPUS390XState *env, + uint32_t desc) +{ + const uint8_t erm =3D extract32(simd_data(desc), 4, 4); + const bool XxC =3D extract32(simd_data(desc), 2, 1); + + vop64_2(v1, v2, env, false, XxC, erm, vcdlg64, GETPC()); +} + +void HELPER(gvec_vcdlg64s)(void *v1, const void *v2, CPUS390XState *env, + uint32_t desc) +{ + const uint8_t erm =3D extract32(simd_data(desc), 4, 4); + const bool XxC =3D extract32(simd_data(desc), 2, 1); + + vop64_2(v1, v2, env, true, XxC, erm, vcdlg64, GETPC()); +} --=20 2.20.1 From nobody Mon Nov 10 20:55:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559300026; cv=none; d=zoho.com; s=zohoarc; b=mkI29Fgu1/USoboAqF+0ElSsNaTJWd7oX9fDTU8SQzZO3LCQU32r4spn9G0zeyoLDVBoaUYdu8LLahSWbeBP2DZHHIYj1BSEGxnLqZeFxGKwy/8v/bSbNpFQgxk+VxUB5yD/91TyAlUkwTN8HQiu0SspwlowwbGUbM94i5vfiaU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559300026; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=oUiFFqlbrb9ISrzxMPWLcDpo3Xyga/OqV0y+h4K78DI=; b=lVnvqXKjvDCmnuksbnD1gYaGeqcbtXi1cpbEFfqndcdnB9lb29meV1RI+nRadXAK0/f4cW/HZNmwXIAHTVVzjKkIr1vJxqqdA9syXmcecdOQpOToyIPbCT2NXkGnjBrO3e5IhvsN0O9BQE98/Q7PuKkrZnpS2ROdLXb59H9MnXI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559300026810482.6627722040521; Fri, 31 May 2019 03:53:46 -0700 (PDT) Received: from localhost ([127.0.0.1]:40913 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWfAJ-0005G8-PI for importer@patchew.org; Fri, 31 May 2019 06:53:39 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf1p-0006sT-Bc for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf1n-0001QL-Sf for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42196) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf1n-0001Ne-Hv for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:51 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CD763317917C; Fri, 31 May 2019 10:44:50 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id BDEF9473DB; Fri, 31 May 2019 10:44:49 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:18 +0200 Message-Id: <20190531104432.29379-10-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 31 May 2019 10:44:50 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 09/23] s390x/tcg: Implement VECTOR FP CONVERT TO FIXED 64-BIT X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- target/s390x/helper.h | 2 ++ target/s390x/insn-data.def | 2 ++ target/s390x/translate_vx.inc.c | 3 +++ target/s390x/vec_fpu_helper.c | 23 +++++++++++++++++++++++ 4 files changed, 30 insertions(+) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index 6fd996e924..9893c677da 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -270,6 +270,8 @@ DEF_HELPER_FLAGS_4(gvec_vcdg64, TCG_CALL_NO_WG, void, p= tr, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vcdg64s, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vcdlg64, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vcdlg64s, TCG_CALL_NO_WG, void, ptr, cptr, env, i3= 2) +DEF_HELPER_FLAGS_4(gvec_vcgd64, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) +DEF_HELPER_FLAGS_4(gvec_vcgd64s, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) =20 #ifndef CONFIG_USER_ONLY DEF_HELPER_3(servc, i32, env, i64, i64) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index 465b36dd70..97c62a8af5 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -1222,6 +1222,8 @@ F(0xe7c3, VCDG, VRR_a, V, 0, 0, 0, 0, vcdg, 0, IF_VEC) /* VECTOR FP CONVERT FROM LOGICAL 64-BIT */ F(0xe7c1, VCDLG, VRR_a, V, 0, 0, 0, 0, vcdg, 0, IF_VEC) +/* VECTOR FP CONVERT TO FIXED 64-BIT */ + F(0xe7c2, VCGD, VRR_a, V, 0, 0, 0, 0, vcdg, 0, IF_VEC) =20 #ifndef CONFIG_USER_ONLY /* COMPARE AND SWAP AND PURGE */ diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.in= c.c index fa755cd1d6..a42de2ff01 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -2660,6 +2660,9 @@ static DisasJumpType op_vcdg(DisasContext *s, DisasOp= s *o) case 0xc1: fn =3D se ? gen_helper_gvec_vcdlg64s : gen_helper_gvec_vcdlg64; break; + case 0xc2: + fn =3D se ? gen_helper_gvec_vcgd64s : gen_helper_gvec_vcgd64; + break; default: g_assert_not_reached(); } diff --git a/target/s390x/vec_fpu_helper.c b/target/s390x/vec_fpu_helper.c index 8f7dac0439..e1a797ecca 100644 --- a/target/s390x/vec_fpu_helper.c +++ b/target/s390x/vec_fpu_helper.c @@ -326,3 +326,26 @@ void HELPER(gvec_vcdlg64s)(void *v1, const void *v2, C= PUS390XState *env, =20 vop64_2(v1, v2, env, true, XxC, erm, vcdlg64, GETPC()); } + +static uint64_t vcgd64(uint64_t a, float_status *s) +{ + return float64_to_int64(make_float64(a), s); +} + +void HELPER(gvec_vcgd64)(void *v1, const void *v2, CPUS390XState *env, + uint32_t desc) +{ + const uint8_t erm =3D extract32(simd_data(desc), 4, 4); + const bool XxC =3D extract32(simd_data(desc), 2, 1); + + vop64_2(v1, v2, env, false, XxC, erm, vcgd64, GETPC()); +} + +void HELPER(gvec_vcgd64s)(void *v1, const void *v2, CPUS390XState *env, + uint32_t desc) +{ + const uint8_t erm =3D extract32(simd_data(desc), 4, 4); + const bool XxC =3D extract32(simd_data(desc), 2, 1); + + vop64_2(v1, v2, env, true, XxC, erm, vcgd64, GETPC()); +} --=20 2.20.1 From nobody Mon Nov 10 20:55:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559300244; cv=none; d=zoho.com; s=zohoarc; b=B3H90PZHBS7LUm/SGJw+EeI/BhfGXFyHkt4yCw2c+pFwz64E7SdYcP0TKSzQkloaapesE0NDQhncBt6Xwn+Sai9oQ9IuF7a7Q29crErYqDrXnyPwTTrYX/44utDzEfFjnHl9xkVGwNXwnxZIG5fqdfuked7gVUiNZI4/RVny8NY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559300244; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=EsC6FQbCb96InNqgjJTEIRdsAO9JkezWh/4ofAi/2Z0=; b=hQlNIMGY7xBDa1ydMOxh8gSVr+LMlfNxbH2alYpZ9HovBeUpsM+2ttkQ0u4fp/P7t6xGzZFmJuUDnPal2njOJ0YQRWbNABpNxe3/WozQGhNIJQd8asoKDPfx53HAsYZ2YZBHwkT/oeWzEaKS6qztHHaxXC2+4s91kX6FAoQ1qHk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559300244679721.145057559102; Fri, 31 May 2019 03:57:24 -0700 (PDT) Received: from localhost ([127.0.0.1]:40967 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWfDJ-0007lY-7w for importer@patchew.org; Fri, 31 May 2019 06:56:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf1q-0006up-73 for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf1p-0001Sc-5H for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57302) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf1o-0001Rj-TZ for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:53 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 33A843066800; Fri, 31 May 2019 10:44:52 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 274C7473DB; Fri, 31 May 2019 10:44:50 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:19 +0200 Message-Id: <20190531104432.29379-11-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 31 May 2019 10:44:52 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 10/23] s390x/tcg: Implement VECTOR FP CONVERT TO LOGICAL 64-BIT X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- target/s390x/helper.h | 2 ++ target/s390x/insn-data.def | 2 ++ target/s390x/translate_vx.inc.c | 3 +++ target/s390x/vec_fpu_helper.c | 23 +++++++++++++++++++++++ 4 files changed, 30 insertions(+) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index 9893c677da..9b9062970a 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -272,6 +272,8 @@ DEF_HELPER_FLAGS_4(gvec_vcdlg64, TCG_CALL_NO_WG, void, = ptr, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vcdlg64s, TCG_CALL_NO_WG, void, ptr, cptr, env, i3= 2) DEF_HELPER_FLAGS_4(gvec_vcgd64, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vcgd64s, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) +DEF_HELPER_FLAGS_4(gvec_vclgd64, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) +DEF_HELPER_FLAGS_4(gvec_vclgd64s, TCG_CALL_NO_WG, void, ptr, cptr, env, i3= 2) =20 #ifndef CONFIG_USER_ONLY DEF_HELPER_3(servc, i32, env, i64, i64) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index 97c62a8af5..ed8b888d59 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -1224,6 +1224,8 @@ F(0xe7c1, VCDLG, VRR_a, V, 0, 0, 0, 0, vcdg, 0, IF_VEC) /* VECTOR FP CONVERT TO FIXED 64-BIT */ F(0xe7c2, VCGD, VRR_a, V, 0, 0, 0, 0, vcdg, 0, IF_VEC) +/* VECTOR FP CONVERT TO LOGICAL 64-BIT */ + F(0xe7c0, VCLGD, VRR_a, V, 0, 0, 0, 0, vcdg, 0, IF_VEC) =20 #ifndef CONFIG_USER_ONLY /* COMPARE AND SWAP AND PURGE */ diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.in= c.c index a42de2ff01..0395d69968 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -2663,6 +2663,9 @@ static DisasJumpType op_vcdg(DisasContext *s, DisasOp= s *o) case 0xc2: fn =3D se ? gen_helper_gvec_vcgd64s : gen_helper_gvec_vcgd64; break; + case 0xc0: + fn =3D se ? gen_helper_gvec_vclgd64s : gen_helper_gvec_vclgd64; + break; default: g_assert_not_reached(); } diff --git a/target/s390x/vec_fpu_helper.c b/target/s390x/vec_fpu_helper.c index e1a797ecca..92a2c04952 100644 --- a/target/s390x/vec_fpu_helper.c +++ b/target/s390x/vec_fpu_helper.c @@ -349,3 +349,26 @@ void HELPER(gvec_vcgd64s)(void *v1, const void *v2, CP= US390XState *env, =20 vop64_2(v1, v2, env, true, XxC, erm, vcgd64, GETPC()); } + +static uint64_t vclgd64(uint64_t a, float_status *s) +{ + return float64_to_uint64(make_float64(a), s); +} + +void HELPER(gvec_vclgd64)(void *v1, const void *v2, CPUS390XState *env, + uint32_t desc) +{ + const uint8_t erm =3D extract32(simd_data(desc), 4, 4); + const bool XxC =3D extract32(simd_data(desc), 2, 1); + + vop64_2(v1, v2, env, false, XxC, erm, vclgd64, GETPC()); +} + +void HELPER(gvec_vclgd64s)(void *v1, const void *v2, CPUS390XState *env, + uint32_t desc) +{ + const uint8_t erm =3D extract32(simd_data(desc), 4, 4); + const bool XxC =3D extract32(simd_data(desc), 2, 1); + + vop64_2(v1, v2, env, true, XxC, erm, vclgd64, GETPC()); +} --=20 2.20.1 From nobody Mon Nov 10 20:55:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559300041; cv=none; d=zoho.com; s=zohoarc; b=X1KDsKc4bMP6Pamh7uxh0kE9yYVISnDDSQrHLE6BuXSOf5crKUmA4C8KfL7gjhfm9FoDW8UjaAfadPZjskdMAj6edIikH0StS7a7rM2iH0jd93z0A5fx6/kCT76uo4gLpoZnC4TQ2dPIGROxBPiZnnGBJ8nr/ORxLCR1iobIdE0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559300041; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=rkwRtN6Ys5cELMBK8dnyIVM3SsU1CuO5AcfgL8dX3EI=; b=RfjSdG+g01jqJL5IBcxDWjU7YXwI3wrHvw6VgHgh75uwxp+EKc5w9gkShNnQYVtrPagxKy0Kc7OLxPIsrWEXn/GuDZROPaCCcE/AtfSyamOjUsmD9gewGpZwb4hIibHUwG8imVfewtEEUYH+yOSSrBoptAbuoskPMUBC02c8IUs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 155930004118339.28192272280387; Fri, 31 May 2019 03:54:01 -0700 (PDT) Received: from localhost ([127.0.0.1]:40915 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWfAZ-0005Sb-1s for importer@patchew.org; Fri, 31 May 2019 06:53:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf1t-0006zl-SR for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf1s-0001XS-Qr for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43088) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf1s-0001Wh-JT for qemu-devel@nongnu.org; Fri, 31 May 2019 06:44:56 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E490D307D911; Fri, 31 May 2019 10:44:55 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8065F271AE; Fri, 31 May 2019 10:44:52 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:20 +0200 Message-Id: <20190531104432.29379-12-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 31 May 2019 10:44:55 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 11/23] s390x/tcg: Implement VECTOR FP DIVIDE X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We can reuse most of the infrastructure added for VECTOR FP ADD. Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- target/s390x/helper.h | 2 ++ target/s390x/insn-data.def | 2 ++ target/s390x/translate_vx.inc.c | 3 +++ target/s390x/vec_fpu_helper.c | 17 +++++++++++++++++ 4 files changed, 24 insertions(+) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index 9b9062970a..238bfa2509 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -274,6 +274,8 @@ DEF_HELPER_FLAGS_4(gvec_vcgd64, TCG_CALL_NO_WG, void, p= tr, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vcgd64s, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vclgd64, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vclgd64s, TCG_CALL_NO_WG, void, ptr, cptr, env, i3= 2) +DEF_HELPER_FLAGS_5(gvec_vfd64, TCG_CALL_NO_WG, void, ptr, cptr, cptr, env,= i32) +DEF_HELPER_FLAGS_5(gvec_vfd64s, TCG_CALL_NO_WG, void, ptr, cptr, cptr, env= , i32) =20 #ifndef CONFIG_USER_ONLY DEF_HELPER_3(servc, i32, env, i64, i64) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index ed8b888d59..f9830deace 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -1226,6 +1226,8 @@ F(0xe7c2, VCGD, VRR_a, V, 0, 0, 0, 0, vcdg, 0, IF_VEC) /* VECTOR FP CONVERT TO LOGICAL 64-BIT */ F(0xe7c0, VCLGD, VRR_a, V, 0, 0, 0, 0, vcdg, 0, IF_VEC) +/* VECTOR FP DIVIDE */ + F(0xe7e5, VFD, VRR_c, V, 0, 0, 0, 0, vfa, 0, IF_VEC) =20 #ifndef CONFIG_USER_ONLY /* COMPARE AND SWAP AND PURGE */ diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.in= c.c index 0395d69968..9e55d4488b 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -2560,6 +2560,9 @@ static DisasJumpType op_vfa(DisasContext *s, DisasOps= *o) case 0xe3: fn =3D se ? gen_helper_gvec_vfa64s : gen_helper_gvec_vfa64; break; + case 0xe5: + fn =3D se ? gen_helper_gvec_vfd64s : gen_helper_gvec_vfd64; + break; default: g_assert_not_reached(); } diff --git a/target/s390x/vec_fpu_helper.c b/target/s390x/vec_fpu_helper.c index 92a2c04952..2c085a8849 100644 --- a/target/s390x/vec_fpu_helper.c +++ b/target/s390x/vec_fpu_helper.c @@ -372,3 +372,20 @@ void HELPER(gvec_vclgd64s)(void *v1, const void *v2, C= PUS390XState *env, =20 vop64_2(v1, v2, env, true, XxC, erm, vclgd64, GETPC()); } + +static uint64_t vfd64(uint64_t a, uint64_t b, float_status *s) +{ + return float64_val(float64_div(make_float64(a), make_float64(b), s)); +} + +void HELPER(gvec_vfd64)(void *v1, const void *v2, const void *v3, + CPUS390XState *env, uint32_t desc) +{ + vop64_3(v1, v2, v3, env, false, vfd64, GETPC()); +} + +void HELPER(gvec_vfd64s)(void *v1, const void *v2, const void *v3, + CPUS390XState *env, uint32_t desc) +{ + vop64_3(v1, v2, v3, env, true, vfd64, GETPC()); +} --=20 2.20.1 From nobody Mon Nov 10 20:55:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559300393; cv=none; d=zoho.com; s=zohoarc; b=UEt3Itq/6xTt8pU9A8Nid7glwBpO0uz7IgRGjzJvbfJlDADHyA38IOr34adYZQFv0/Y6706vEBjer1k7VgS6mcdDX7ILflwXylpI7me9AcLdyz/p13LoML+LBC+CbS3UmSozClocnLNwIK1ppNuNwTzvIFw7nfkm+j5ph/HyrmY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559300393; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=U9WKr/qcL+Q1ZCcSgusbaWupiW1fN7LJba/T6Phbnrc=; b=FDNMTiomo4NZwT++ee5INh+i2kmQ3MXYSZbsu5dm396y89CIj26DTOQ9wShX2UDPxKgY7kD2IMWaqF545jRzNxRjuZK9Cy/nXDDhQgKZwGE/Z2pizvaeqrIbFFdde0WRO0eFDM7X5OH5yBIQgFpCPatT6/rCxA1G24th7RJLvEM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559300393504105.86469763975686; Fri, 31 May 2019 03:59:53 -0700 (PDT) Received: from localhost ([127.0.0.1]:40997 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWfGE-0001x7-Ej for importer@patchew.org; Fri, 31 May 2019 06:59:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf1x-000760-BS for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf1w-0001cd-B8 for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46070) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf1w-0001ac-42 for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:00 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 741EE3688E; Fri, 31 May 2019 10:44:59 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3AE23473DB; Fri, 31 May 2019 10:44:56 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:21 +0200 Message-Id: <20190531104432.29379-13-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 31 May 2019 10:44:59 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 12/23] s390x/tcg: Implement VECTOR LOAD FP INTEGER X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We can reuse most of the infrastructure introduced for VECTOR FP CONVERT FROM FIXED 64-BIT and friends. Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- target/s390x/helper.h | 2 ++ target/s390x/insn-data.def | 2 ++ target/s390x/translate_vx.inc.c | 3 +++ target/s390x/vec_fpu_helper.c | 23 +++++++++++++++++++++++ 4 files changed, 30 insertions(+) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index 238bfa2509..10a9cb39b6 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -276,6 +276,8 @@ DEF_HELPER_FLAGS_4(gvec_vclgd64, TCG_CALL_NO_WG, void, = ptr, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vclgd64s, TCG_CALL_NO_WG, void, ptr, cptr, env, i3= 2) DEF_HELPER_FLAGS_5(gvec_vfd64, TCG_CALL_NO_WG, void, ptr, cptr, cptr, env,= i32) DEF_HELPER_FLAGS_5(gvec_vfd64s, TCG_CALL_NO_WG, void, ptr, cptr, cptr, env= , i32) +DEF_HELPER_FLAGS_4(gvec_vfi64, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) +DEF_HELPER_FLAGS_4(gvec_vfi64s, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) =20 #ifndef CONFIG_USER_ONLY DEF_HELPER_3(servc, i32, env, i64, i64) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index f9830deace..f77aa41253 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -1228,6 +1228,8 @@ F(0xe7c0, VCLGD, VRR_a, V, 0, 0, 0, 0, vcdg, 0, IF_VEC) /* VECTOR FP DIVIDE */ F(0xe7e5, VFD, VRR_c, V, 0, 0, 0, 0, vfa, 0, IF_VEC) +/* VECTOR LOAD FP INTEGER */ + F(0xe7c7, VFI, VRR_a, V, 0, 0, 0, 0, vcdg, 0, IF_VEC) =20 #ifndef CONFIG_USER_ONLY /* COMPARE AND SWAP AND PURGE */ diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.in= c.c index 9e55d4488b..59d8b971c0 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -2669,6 +2669,9 @@ static DisasJumpType op_vcdg(DisasContext *s, DisasOp= s *o) case 0xc0: fn =3D se ? gen_helper_gvec_vclgd64s : gen_helper_gvec_vclgd64; break; + case 0xc7: + fn =3D se ? gen_helper_gvec_vfi64s : gen_helper_gvec_vfi64; + break; default: g_assert_not_reached(); } diff --git a/target/s390x/vec_fpu_helper.c b/target/s390x/vec_fpu_helper.c index 2c085a8849..63ba4cf548 100644 --- a/target/s390x/vec_fpu_helper.c +++ b/target/s390x/vec_fpu_helper.c @@ -389,3 +389,26 @@ void HELPER(gvec_vfd64s)(void *v1, const void *v2, con= st void *v3, { vop64_3(v1, v2, v3, env, true, vfd64, GETPC()); } + +static uint64_t vfi64(uint64_t a, float_status *s) +{ + return float64_val(float64_round_to_int(make_float64(a), s)); +} + +void HELPER(gvec_vfi64)(void *v1, const void *v2, CPUS390XState *env, + uint32_t desc) +{ + const uint8_t erm =3D extract32(simd_data(desc), 4, 4); + const bool XxC =3D extract32(simd_data(desc), 2, 1); + + vop64_2(v1, v2, env, false, XxC, erm, vfi64, GETPC()); +} + +void HELPER(gvec_vfi64s)(void *v1, const void *v2, CPUS390XState *env, + uint32_t desc) +{ + const uint8_t erm =3D extract32(simd_data(desc), 4, 4); + const bool XxC =3D extract32(simd_data(desc), 2, 1); + + vop64_2(v1, v2, env, true, XxC, erm, vfi64, GETPC()); +} --=20 2.20.1 From nobody Mon Nov 10 20:55:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559300244; cv=none; d=zoho.com; s=zohoarc; b=dMSHOAi18UTWRObD3LqfWIMRjWNFfQ2vhuLcez91/dTg78BCkdYjblVWOJ/TiBuf3DpDt2tHyfxtOs4aTFJTa1vtKkKcgm2dOmy8rG5hxywRMqwEPBjEWx9cf8stLd1KEW1kp79WPhNn3/vIHv9gCvwqm2K9k8snW72Dtmb1x+M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559300244; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Mi+gfgvktCChX2TIfUwtJgk1mwLdLZYi6WZA3g+jx/U=; b=az32mMxP/CDcArNfXT3qMTc3GCeTeknpsIrPKcjeZE7yDKeTqv7ii2GPOFDHZhr2Sov5QGOp/z/s4oqc28tG9j5+HiX5HoEtzKIJsRGXn0r5E0oHSwrz3o9PbYJZ0FH/sVv8VSfx/8XfREUG2gktawMme8wCFXcNVXvyYTWSADM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559300244634879.5218491876267; Fri, 31 May 2019 03:57:24 -0700 (PDT) Received: from localhost ([127.0.0.1]:40965 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWfDJ-0007ia-4n for importer@patchew.org; Fri, 31 May 2019 06:56:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf1y-00077b-OS for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf1x-0001f0-MU for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42130) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf1x-0001do-F7 for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:01 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CC3E537EEF; Fri, 31 May 2019 10:45:00 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id C1206271AE; Fri, 31 May 2019 10:44:59 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:22 +0200 Message-Id: <20190531104432.29379-14-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 31 May 2019 10:45:00 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 13/23] s390x/tcg: Implement VECTOR LOAD LENGTHENED X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Take care of reading/indicating the 32-bit elements. Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- target/s390x/helper.h | 2 ++ target/s390x/insn-data.def | 2 ++ target/s390x/translate_vx.inc.c | 19 +++++++++++++++++ target/s390x/vec_fpu_helper.c | 36 +++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index 10a9cb39b6..cb25141ffe 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -278,6 +278,8 @@ DEF_HELPER_FLAGS_5(gvec_vfd64, TCG_CALL_NO_WG, void, pt= r, cptr, cptr, env, i32) DEF_HELPER_FLAGS_5(gvec_vfd64s, TCG_CALL_NO_WG, void, ptr, cptr, cptr, env= , i32) DEF_HELPER_FLAGS_4(gvec_vfi64, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vfi64s, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) +DEF_HELPER_FLAGS_4(gvec_vfll32, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) +DEF_HELPER_FLAGS_4(gvec_vfll32s, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) =20 #ifndef CONFIG_USER_ONLY DEF_HELPER_3(servc, i32, env, i64, i64) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index f77aa41253..5afdb36aec 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -1230,6 +1230,8 @@ F(0xe7e5, VFD, VRR_c, V, 0, 0, 0, 0, vfa, 0, IF_VEC) /* VECTOR LOAD FP INTEGER */ F(0xe7c7, VFI, VRR_a, V, 0, 0, 0, 0, vcdg, 0, IF_VEC) +/* VECTOR LOAD LENGTHENED */ + F(0xe7c4, VFLL, VRR_a, V, 0, 0, 0, 0, vfll, 0, IF_VEC) =20 #ifndef CONFIG_USER_ONLY /* COMPARE AND SWAP AND PURGE */ diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.in= c.c index 59d8b971c0..a25985e5c9 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -2679,3 +2679,22 @@ static DisasJumpType op_vcdg(DisasContext *s, DisasO= ps *o) deposit32(m4, 4, 4, erm), fn); return DISAS_NEXT; } + +static DisasJumpType op_vfll(DisasContext *s, DisasOps *o) +{ + const uint8_t fpf =3D get_field(s->fields, m3); + const uint8_t m4 =3D get_field(s->fields, m4); + gen_helper_gvec_2_ptr *fn =3D gen_helper_gvec_vfll32; + + if (fpf !=3D FPF_SHORT || extract32(m4, 0, 3)) { + gen_program_exception(s, PGM_SPECIFICATION); + return DISAS_NORETURN; + } + + if (extract32(m4, 3, 1)) { + fn =3D gen_helper_gvec_vfll32s; + } + gen_gvec_2_ptr(get_field(s->fields, v1), get_field(s->fields, v2), cpu= _env, + 0, fn); + return DISAS_NEXT; +} diff --git a/target/s390x/vec_fpu_helper.c b/target/s390x/vec_fpu_helper.c index 63ba4cf548..f8919beed5 100644 --- a/target/s390x/vec_fpu_helper.c +++ b/target/s390x/vec_fpu_helper.c @@ -412,3 +412,39 @@ void HELPER(gvec_vfi64s)(void *v1, const void *v2, CPU= S390XState *env, =20 vop64_2(v1, v2, env, true, XxC, erm, vfi64, GETPC()); } + +static void vfll32(S390Vector *v1, const S390Vector *v2, CPUS390XState *en= v, + bool s, uintptr_t retaddr) +{ + uint8_t vxc, vec_exc =3D 0; + S390Vector tmp =3D {}; + int i; + + for (i =3D 0; i < 2; i++) { + /* load from even element */ + const float32 a =3D make_float32(s390_vec_read_element32(v2, i * 2= )); + const uint64_t ret =3D float64_val(float32_to_float64(a, + &env->fpu_stat= us)); + + s390_vec_write_element64(&tmp, i, ret); + /* indicate the source element */ + vxc =3D check_ieee_exc(env, i * 2, false, &vec_exc); + if (s || vxc) { + break; + } + } + handle_ieee_exc(env, vxc, vec_exc, retaddr); + *v1 =3D tmp; +} + +void HELPER(gvec_vfll32)(void *v1, const void *v2, CPUS390XState *env, + uint32_t desc) +{ + vfll32(v1, v2, env, false, GETPC()); +} + +void HELPER(gvec_vfll32s)(void *v1, const void *v2, CPUS390XState *env, + uint32_t desc) +{ + vfll32(v1, v2, env, true, GETPC()); +} --=20 2.20.1 From nobody Mon Nov 10 20:55:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559300390; cv=none; d=zoho.com; s=zohoarc; b=ew2ib8DHW9GA/t4HopWlO8Zef/o/BVeMVKbHMJZhVLFeZ2u2wkVNsK/1iF8T+JKRWi9N7s89guCNOgvB9XXkKDY53s3boLx6SWKM7XwBe1+I81ecbT7Wih1iEmH8YaKXWHktq+b5Fhc2eD1JqCxZ3T84pfJbZmI/XXeunGEwx1k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559300390; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=q2c7Dzarvx6LAyd9K1A2puHMJOcCpZy3SF9AgS51Rcs=; b=SsLnEbp0A22Pafg5KzNUnQQuwpnWOq+b4r/0X0Vq40iDJEn23pKzqFWXgatVYf4cdfMS1qD1DsITAQOjDkL5JGztkI64aKeThay6KtGZxIGvy7mgybIF6rS1O/jDy8lGW8AcuXBZs0yxsfEwBO94RuN7Rdt1/8vmyVMTjeoJhLA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559300390819239.5912355340746; Fri, 31 May 2019 03:59:50 -0700 (PDT) Received: from localhost ([127.0.0.1]:40995 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWfGB-0001ts-PP for importer@patchew.org; Fri, 31 May 2019 06:59:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf20-00079I-8K for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf1z-0001gl-6K for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56248) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf1y-0001fr-Tu for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:03 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3A4A7302451A; Fri, 31 May 2019 10:45:02 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 24D51473DB; Fri, 31 May 2019 10:45:00 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:23 +0200 Message-Id: <20190531104432.29379-15-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 31 May 2019 10:45:02 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 14/23] s390x/tcg: Implement VECTOR LOAD ROUNDED X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We can reuse some of the infrastructure introduced for VECTOR FP CONVERT FROM FIXED 64-BIT and friends. Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- target/s390x/helper.h | 2 ++ target/s390x/insn-data.def | 2 ++ target/s390x/translate_vx.inc.c | 3 +++ target/s390x/vec_fpu_helper.c | 43 +++++++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index cb25141ffe..7526f8e8c6 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -280,6 +280,8 @@ DEF_HELPER_FLAGS_4(gvec_vfi64, TCG_CALL_NO_WG, void, pt= r, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vfi64s, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vfll32, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vfll32s, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) +DEF_HELPER_FLAGS_4(gvec_vflr64, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) +DEF_HELPER_FLAGS_4(gvec_vflr64s, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) =20 #ifndef CONFIG_USER_ONLY DEF_HELPER_3(servc, i32, env, i64, i64) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index 5afdb36aec..f03914d528 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -1232,6 +1232,8 @@ F(0xe7c7, VFI, VRR_a, V, 0, 0, 0, 0, vcdg, 0, IF_VEC) /* VECTOR LOAD LENGTHENED */ F(0xe7c4, VFLL, VRR_a, V, 0, 0, 0, 0, vfll, 0, IF_VEC) +/* VECTOR LOAD ROUNDED */ + F(0xe7c5, VFLR, VRR_a, V, 0, 0, 0, 0, vcdg, 0, IF_VEC) =20 #ifndef CONFIG_USER_ONLY /* COMPARE AND SWAP AND PURGE */ diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.in= c.c index a25985e5c9..73e1b1062a 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -2672,6 +2672,9 @@ static DisasJumpType op_vcdg(DisasContext *s, DisasOp= s *o) case 0xc7: fn =3D se ? gen_helper_gvec_vfi64s : gen_helper_gvec_vfi64; break; + case 0xc5: + fn =3D se ? gen_helper_gvec_vflr64s : gen_helper_gvec_vflr64; + break; default: g_assert_not_reached(); } diff --git a/target/s390x/vec_fpu_helper.c b/target/s390x/vec_fpu_helper.c index f8919beed5..d5fd931b61 100644 --- a/target/s390x/vec_fpu_helper.c +++ b/target/s390x/vec_fpu_helper.c @@ -448,3 +448,46 @@ void HELPER(gvec_vfll32s)(void *v1, const void *v2, CP= US390XState *env, { vfll32(v1, v2, env, true, GETPC()); } + +static void vflr64(S390Vector *v1, const S390Vector *v2, CPUS390XState *en= v, + bool s, bool XxC, uint8_t erm, uintptr_t retaddr) +{ + uint8_t vxc, vec_exc =3D 0; + S390Vector tmp =3D {}; + int i, old_mode; + + old_mode =3D s390_swap_bfp_rounding_mode(env, erm); + for (i =3D 0; i < 2; i++) { + float64 a =3D make_float64(s390_vec_read_element64(v2, i)); + uint32_t ret =3D float32_val(float64_to_float32(a, &env->fpu_statu= s)); + + /* place at even element */ + s390_vec_write_element32(&tmp, i * 2, ret); + /* indicate the source element */ + vxc =3D check_ieee_exc(env, i, XxC, &vec_exc); + if (s || vxc) { + break; + } + } + s390_restore_bfp_rounding_mode(env, old_mode); + handle_ieee_exc(env, vxc, vec_exc, retaddr); + *v1 =3D tmp; +} + +void HELPER(gvec_vflr64)(void *v1, const void *v2, CPUS390XState *env, + uint32_t desc) +{ + const uint8_t erm =3D extract32(simd_data(desc), 4, 4); + const bool XxC =3D extract32(simd_data(desc), 2, 1); + + vflr64(v1, v2, env, false, XxC, erm, GETPC()); +} + +void HELPER(gvec_vflr64s)(void *v1, const void *v2, CPUS390XState *env, + uint32_t desc) +{ + const uint8_t erm =3D extract32(simd_data(desc), 4, 4); + const bool XxC =3D extract32(simd_data(desc), 2, 1); + + vflr64(v1, v2, env, true, XxC, erm, GETPC()); +} --=20 2.20.1 From nobody Mon Nov 10 20:55:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559300280; cv=none; d=zoho.com; s=zohoarc; b=YZFhsHMg1PmqLbk2+Yxdsmu+OCXmhcFKfD+aVLLnuLLsyqhhkWNpNDexLlMScpU9v4Jcb7xSQuPoUikz8H/gHJqZxEq01KS39r5SahdkvEdM6exbNdDDw2Ko06SjGoFBMB4DfJ+30ExyXGztnumiCThwWjFd+x79yDCCdvOUwMg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559300280; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=eDGwFORX9ZIrnpx8gjLAtRkGF6kYYvEq/5EeEwvLvgw=; b=gYV7oCLc2GCv6rJOP/hiEeEENGhd/+dIAAfmp3F8lvh9rYE0CsVAdAHoIE4b1m+V/LG1BZOX5oiY9KIXgmbK0kh2ct3Zq6c5LgARhge9/gL3zUVtLloOUG/Xhh8ccxAcU4EzbaEpXyObGEMic6JOLFVuGRD3iJy7mETOhKtO6aA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559300280812637.0476172480071; Fri, 31 May 2019 03:58:00 -0700 (PDT) Received: from localhost ([127.0.0.1]:40971 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWfEM-0000OH-MT for importer@patchew.org; Fri, 31 May 2019 06:57:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf23-0007CS-IE for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf22-0001kW-I3 for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42778) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf22-0001jb-Ad for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:06 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A106F30821F8; Fri, 31 May 2019 10:45:05 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7FB32271AE; Fri, 31 May 2019 10:45:02 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:24 +0200 Message-Id: <20190531104432.29379-16-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 31 May 2019 10:45:05 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 15/23] s390x/tcg: Implement VECTOR FP MULTIPLY X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Very similar to VECTOR FP DIVIDE. Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- target/s390x/helper.h | 2 ++ target/s390x/insn-data.def | 2 ++ target/s390x/translate_vx.inc.c | 3 +++ target/s390x/vec_fpu_helper.c | 17 +++++++++++++++++ 4 files changed, 24 insertions(+) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index 7526f8e8c6..22e02a0178 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -282,6 +282,8 @@ DEF_HELPER_FLAGS_4(gvec_vfll32, TCG_CALL_NO_WG, void, p= tr, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vfll32s, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vflr64, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vflr64s, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) +DEF_HELPER_FLAGS_5(gvec_vfm64, TCG_CALL_NO_WG, void, ptr, cptr, cptr, env,= i32) +DEF_HELPER_FLAGS_5(gvec_vfm64s, TCG_CALL_NO_WG, void, ptr, cptr, cptr, env= , i32) =20 #ifndef CONFIG_USER_ONLY DEF_HELPER_3(servc, i32, env, i64, i64) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index f03914d528..e56059ac34 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -1234,6 +1234,8 @@ F(0xe7c4, VFLL, VRR_a, V, 0, 0, 0, 0, vfll, 0, IF_VEC) /* VECTOR LOAD ROUNDED */ F(0xe7c5, VFLR, VRR_a, V, 0, 0, 0, 0, vcdg, 0, IF_VEC) +/* VECTOR FP MULTIPLY */ + F(0xe7e7, VFM, VRR_c, V, 0, 0, 0, 0, vfa, 0, IF_VEC) =20 #ifndef CONFIG_USER_ONLY /* COMPARE AND SWAP AND PURGE */ diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.in= c.c index 73e1b1062a..ae31a327cf 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -2563,6 +2563,9 @@ static DisasJumpType op_vfa(DisasContext *s, DisasOps= *o) case 0xe5: fn =3D se ? gen_helper_gvec_vfd64s : gen_helper_gvec_vfd64; break; + case 0xe7: + fn =3D se ? gen_helper_gvec_vfm64s : gen_helper_gvec_vfm64; + break; default: g_assert_not_reached(); } diff --git a/target/s390x/vec_fpu_helper.c b/target/s390x/vec_fpu_helper.c index d5fd931b61..fd147cc055 100644 --- a/target/s390x/vec_fpu_helper.c +++ b/target/s390x/vec_fpu_helper.c @@ -491,3 +491,20 @@ void HELPER(gvec_vflr64s)(void *v1, const void *v2, CP= US390XState *env, =20 vflr64(v1, v2, env, true, XxC, erm, GETPC()); } + +static uint64_t vfm64(uint64_t a, uint64_t b, float_status *s) +{ + return float64_val(float64_mul(make_float64(a), make_float64(b), s)); +} + +void HELPER(gvec_vfm64)(void *v1, const void *v2, const void *v3, + CPUS390XState *env, uint32_t desc) +{ + vop64_3(v1, v2, v3, env, false, vfm64, GETPC()); +} + +void HELPER(gvec_vfm64s)(void *v1, const void *v2, const void *v3, + CPUS390XState *env, uint32_t desc) +{ + vop64_3(v1, v2, v3, env, true, vfm64, GETPC()); +} --=20 2.20.1 From nobody Mon Nov 10 20:55:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559300453; cv=none; d=zoho.com; s=zohoarc; b=K3eEMDNF2Y6oBFKv+p8EYCiS9ru/Oy7B7wMRmqcwCow7EfxedR/e7Wny0Fvwx/WD34rQVzizosBcC2C62NLvrTGSW+57wSKIoA+s6Sx67awgdsza9J3UotsiyIPSIxznbPkMqpwK7XdMeYrqJaptd8e4BX1zya4XYPYe9cVN4yo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559300453; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=t+7B+rIXs9TVCUVV3LrmlBV0hduTA55U9fUGrSIIFi0=; b=h74shlH862KcpS+VIa3VtCL+ioyOIQSkpA1mNgJCRUDjgW0FIrtyGNPh2PXf7CdUAVSl4MAUxviqGBgTmfsAcYjoro70h3BGMa/jjMJ+LR+4jE8g5GI1oa+Slk7k4rr9wuTYo7W3ildfBbR/KGnlXljEZRhKUFmXCBOtqIRVCvo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559300453995298.41324810431627; Fri, 31 May 2019 04:00:53 -0700 (PDT) Received: from localhost ([127.0.0.1]:41022 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWfHC-0002sy-Rv for importer@patchew.org; Fri, 31 May 2019 07:00:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf27-0007ET-CU for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf26-0001oB-2i for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42800) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf25-0001nO-Rj for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:10 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 344E830821C0; Fri, 31 May 2019 10:45:09 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id E7870271AE; Fri, 31 May 2019 10:45:05 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:25 +0200 Message-Id: <20190531104432.29379-17-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 31 May 2019 10:45:09 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 16/23] s390x/tcg: Implement VECTOR FP MULTIPLY AND (ADD|SUBTRACT) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Signed-off-by: David Hildenbrand --- target/s390x/helper.h | 4 +++ target/s390x/insn-data.def | 4 +++ target/s390x/translate_vx.inc.c | 23 +++++++++++++ target/s390x/vec_fpu_helper.c | 61 +++++++++++++++++++++++++++++++++ 4 files changed, 92 insertions(+) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index 22e02a0178..bcaabb91a5 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -284,6 +284,10 @@ DEF_HELPER_FLAGS_4(gvec_vflr64, TCG_CALL_NO_WG, void, = ptr, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vflr64s, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) DEF_HELPER_FLAGS_5(gvec_vfm64, TCG_CALL_NO_WG, void, ptr, cptr, cptr, env,= i32) DEF_HELPER_FLAGS_5(gvec_vfm64s, TCG_CALL_NO_WG, void, ptr, cptr, cptr, env= , i32) +DEF_HELPER_FLAGS_6(gvec_vfma64, TCG_CALL_NO_WG, void, ptr, cptr, cptr, cpt= r, env, i32) +DEF_HELPER_FLAGS_6(gvec_vfma64s, TCG_CALL_NO_WG, void, ptr, cptr, cptr, cp= tr, env, i32) +DEF_HELPER_FLAGS_6(gvec_vfms64, TCG_CALL_NO_WG, void, ptr, cptr, cptr, cpt= r, env, i32) +DEF_HELPER_FLAGS_6(gvec_vfms64s, TCG_CALL_NO_WG, void, ptr, cptr, cptr, cp= tr, env, i32) =20 #ifndef CONFIG_USER_ONLY DEF_HELPER_3(servc, i32, env, i64, i64) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index e56059ac34..e86ade9e44 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -1236,6 +1236,10 @@ F(0xe7c5, VFLR, VRR_a, V, 0, 0, 0, 0, vcdg, 0, IF_VEC) /* VECTOR FP MULTIPLY */ F(0xe7e7, VFM, VRR_c, V, 0, 0, 0, 0, vfa, 0, IF_VEC) +/* VECTOR FP MULTIPLY AND ADD */ + F(0xe78f, VFMA, VRR_e, V, 0, 0, 0, 0, vfma, 0, IF_VEC) +/* VECTOR FP MULTIPLY AND SUBTRACT */ + F(0xe78e, VFMS, VRR_e, V, 0, 0, 0, 0, vfma, 0, IF_VEC) =20 #ifndef CONFIG_USER_ONLY /* COMPARE AND SWAP AND PURGE */ diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.in= c.c index ae31a327cf..b624c7a8aa 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -2704,3 +2704,26 @@ static DisasJumpType op_vfll(DisasContext *s, DisasO= ps *o) 0, fn); return DISAS_NEXT; } + +static DisasJumpType op_vfma(DisasContext *s, DisasOps *o) +{ + const uint8_t m5 =3D get_field(s->fields, m5); + const uint8_t fpf =3D get_field(s->fields, m6); + const bool se =3D extract32(m5, 3, 1); + gen_helper_gvec_4_ptr *fn; + + if (fpf !=3D FPF_LONG || extract32(m5, 0, 3)) { + gen_program_exception(s, PGM_SPECIFICATION); + return DISAS_NORETURN; + } + + if (s->fields->op2 =3D=3D 0x8f) { + fn =3D se ? gen_helper_gvec_vfma64s : gen_helper_gvec_vfma64; + } else { + fn =3D se ? gen_helper_gvec_vfms64s : gen_helper_gvec_vfms64; + } + gen_gvec_4_ptr(get_field(s->fields, v1), get_field(s->fields, v2), + get_field(s->fields, v3), get_field(s->fields, v4), cpu= _env, + 0, fn); + return DISAS_NEXT; +} diff --git a/target/s390x/vec_fpu_helper.c b/target/s390x/vec_fpu_helper.c index fd147cc055..a27b354214 100644 --- a/target/s390x/vec_fpu_helper.c +++ b/target/s390x/vec_fpu_helper.c @@ -125,6 +125,31 @@ static void vop64_3(S390Vector *v1, const S390Vector *= v2, const S390Vector *v3, *v1 =3D tmp; } =20 +typedef uint64_t (*vop64_4_fn)(uint64_t a, uint64_t b, uint64_t c, + float_status *s); +static void vop64_4(S390Vector *v1, const S390Vector *v2, const S390Vector= *v3, + const S390Vector *v4, CPUS390XState *env, bool s, + vop64_4_fn fn, uintptr_t retaddr) +{ + uint8_t vxc, vec_exc =3D 0; + S390Vector tmp =3D {}; + int i; + + for (i =3D 0; i < 2; i++) { + const uint64_t a =3D s390_vec_read_element64(v2, i); + const uint64_t b =3D s390_vec_read_element64(v3, i); + const uint64_t c =3D s390_vec_read_element64(v4, i); + + s390_vec_write_element64(&tmp, i, fn(a, b, c, &env->fpu_status)); + vxc =3D check_ieee_exc(env, i, false, &vec_exc); + if (s || vxc) { + break; + } + } + handle_ieee_exc(env, vxc, vec_exc, retaddr); + *v1 =3D tmp; +} + static uint64_t vfa64(uint64_t a, uint64_t b, float_status *s) { return float64_val(float64_add(make_float64(a), make_float64(b), s)); @@ -508,3 +533,39 @@ void HELPER(gvec_vfm64s)(void *v1, const void *v2, con= st void *v3, { vop64_3(v1, v2, v3, env, true, vfm64, GETPC()); } + +static uint64_t vfma64(uint64_t a, uint64_t b, uint64_t c, float_status *s) +{ + return float64_val(float64_muladd(make_float64(a), make_float64(b), + make_float64(c), 0, s)); +} + +void HELPER(gvec_vfma64)(void *v1, const void *v2, const void *v3, + const void *v4, CPUS390XState *env, uint32_t desc) +{ + vop64_4(v1, v2, v3, v4, env, false, vfma64, GETPC()); +} + +void HELPER(gvec_vfma64s)(void *v1, const void *v2, const void *v3, + const void *v4, CPUS390XState *env, uint32_t desc) +{ + vop64_4(v1, v2, v3, v4, env, true, vfma64, GETPC()); +} + +static uint64_t vfms64(uint64_t a, uint64_t b, uint64_t c, float_status *s) +{ + return float64_val(float64_muladd(make_float64(a), make_float64(b), + make_float64(c), float_muladd_negate_c, s)); +} + +void HELPER(gvec_vfms64)(void *v1, const void *v2, const void *v3, + const void *v4, CPUS390XState *env, uint32_t desc) +{ + vop64_4(v1, v2, v3, v4, env, false, vfms64, GETPC()); +} + +void HELPER(gvec_vfms64s)(void *v1, const void *v2, const void *v3, + const void *v4, CPUS390XState *env, uint32_t desc) +{ + vop64_4(v1, v2, v3, v4, env, true, vfms64, GETPC()); +} --=20 2.20.1 From nobody Mon Nov 10 20:55:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559300667; cv=none; d=zoho.com; s=zohoarc; b=MFLClZeK1UhSULhNzBgmUnHhZPC7OeEWtp3G4BA2QducYgPHgc4TTFh/mq/JOpIH+Y+DG5lRhriCuqfQNPQItHoSSWEakT0UujPvBlD9/EHXJfirpkFMMJ0OHsm+G/JJo/D4rTutyCJr69w/3/h/bdzrHMsQrMqGBpH9SDJqh6Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559300667; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=VlmIZIemGIxSdjvmGJK8YV8uEkzGNvyNsXo6Qkt3kTI=; b=KMcaAjo6aWNY+2Le8nAQBDuNy5XvMeeTlbuWUIySbYMoFhWC1iUjnqoD41mt0ZWBJeCGE6G9Yje/ic0e6VHN5n5sOS8zMlblllGOuX1UOJs818CsC4+Eez9xqMEMqVO8O833/6r65YX7c612cxS1gAyRvGc9ARMWWHZJk/5lVMg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 155930066737572.91266189259352; Fri, 31 May 2019 04:04:27 -0700 (PDT) Received: from localhost ([127.0.0.1]:41061 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWfKX-0005lq-Rf for importer@patchew.org; Fri, 31 May 2019 07:04:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf28-0007FY-DK for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf27-0001pW-D3 for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29114) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf27-0001ol-6H for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:11 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 851D1859FF; Fri, 31 May 2019 10:45:10 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 72F6D271AE; Fri, 31 May 2019 10:45:09 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:26 +0200 Message-Id: <20190531104432.29379-18-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 31 May 2019 10:45:10 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 17/23] s390x/tcg: Implement VECTOR FP PERFORM SIGN OPERATION X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The only FP instruction we can implement without an helper. Signed-off-by: David Hildenbrand --- target/s390x/insn-data.def | 2 ++ target/s390x/translate_vx.inc.c | 42 +++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index e86ade9e44..fa2e801747 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -1240,6 +1240,8 @@ F(0xe78f, VFMA, VRR_e, V, 0, 0, 0, 0, vfma, 0, IF_VEC) /* VECTOR FP MULTIPLY AND SUBTRACT */ F(0xe78e, VFMS, VRR_e, V, 0, 0, 0, 0, vfma, 0, IF_VEC) +/* VECTOR FP PERFORM SIGN OPERATION */ + F(0xe7cc, VFPSO, VRR_a, V, 0, 0, 0, 0, vfpso, 0, IF_VEC) =20 #ifndef CONFIG_USER_ONLY /* COMPARE AND SWAP AND PURGE */ diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.in= c.c index b624c7a8aa..b80d2a7a88 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -2727,3 +2727,45 @@ static DisasJumpType op_vfma(DisasContext *s, DisasO= ps *o) 0, fn); return DISAS_NEXT; } + +static DisasJumpType op_vfpso(DisasContext *s, DisasOps *o) +{ + const uint8_t fpf =3D get_field(s->fields, m3); + const uint8_t m4 =3D get_field(s->fields, m4); + const uint8_t m5 =3D get_field(s->fields, m5); + const bool se =3D extract32(m4, 3, 1); + TCGv_i64 tmp; + int i; + + if (fpf !=3D FPF_LONG || extract32(m4, 0, 3) || m5 > 2) { + gen_program_exception(s, PGM_SPECIFICATION); + return DISAS_NORETURN; + } + + tmp =3D tcg_temp_new_i64(); + for (i =3D 0; i < 2; i++) { + read_vec_element_i64(tmp, get_field(s->fields, v2), i, ES_64); + + switch (m5) { + case 0: + /* sign bit is inverted (complement) */ + tcg_gen_xori_i64(tmp, tmp, 1ull << 63); + break; + case 1: + /* sign bit is set to one (negative) */ + tcg_gen_ori_i64(tmp, tmp, 1ull << 63); + break; + case 2: + /* sign bit is set to zero (positive) */ + tcg_gen_andi_i64(tmp, tmp, (1ull << 63) - 1); + break; + } + + write_vec_element_i64(tmp, get_field(s->fields, v1), i, ES_64); + if (se) { + break; + } + } + tcg_temp_free_i64(tmp); + return DISAS_NEXT; +} --=20 2.20.1 From nobody Mon Nov 10 20:55:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559300830; cv=none; d=zoho.com; s=zohoarc; b=HvK6LYZPNfXoeTQgx2tWO0cq8vYBc5uRB4OD81AajkpFxsOb0taOgYHCr/MdTVBIjA35+/a4K2xeBkQhYgVD4nrM6kfViUuhAF6HSZiXcQh8ts1fx0j6wcviRFM11szrzESY/P5k1RZTA4FOU02fCHpKx3R5fpLSRPiIBI0g4j4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559300830; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=xhdKpWXIf5eCw916GurcX8XXmHHeFo8dbyL84h0xcMk=; b=JI2LYvnYKJUh4l9ho5JH3yL5VMFycL1A6FkrAbhO4aBToOyE+Us+GLicjuwgh8zdeSsdjpmXcHrL/D82w54KT27z5xLBQ+iTriQnym2O30UTW2rd1vNulcfnU5gThvUon1TxREzx3Q/LmjysLtcn4q3iFKZMFGLGlm3HhIQCdmY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559300830710705.6241592124646; Fri, 31 May 2019 04:07:10 -0700 (PDT) Received: from localhost ([127.0.0.1]:41121 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWfNH-0007vT-Mn for importer@patchew.org; Fri, 31 May 2019 07:07:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56290) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf2F-0007Nh-OX for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf2B-0001w9-71 for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60074) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf2A-0001vJ-W7 for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:15 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 53E10C05091A; Fri, 31 May 2019 10:45:14 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id CCE99271AE; Fri, 31 May 2019 10:45:10 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:27 +0200 Message-Id: <20190531104432.29379-19-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 31 May 2019 10:45:14 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 18/23] s390x/tcg: Implement VECTOR FP SQUARE ROOT X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Simulate XxC=3D0 and ERM=3D0 (current mode), so we can use the existing helper function. Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- target/s390x/helper.h | 2 ++ target/s390x/insn-data.def | 2 ++ target/s390x/translate_vx.inc.c | 19 +++++++++++++++++++ target/s390x/vec_fpu_helper.c | 17 +++++++++++++++++ 4 files changed, 40 insertions(+) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index bcaabb91a5..23b37af1e4 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -288,6 +288,8 @@ DEF_HELPER_FLAGS_6(gvec_vfma64, TCG_CALL_NO_WG, void, p= tr, cptr, cptr, cptr, env DEF_HELPER_FLAGS_6(gvec_vfma64s, TCG_CALL_NO_WG, void, ptr, cptr, cptr, cp= tr, env, i32) DEF_HELPER_FLAGS_6(gvec_vfms64, TCG_CALL_NO_WG, void, ptr, cptr, cptr, cpt= r, env, i32) DEF_HELPER_FLAGS_6(gvec_vfms64s, TCG_CALL_NO_WG, void, ptr, cptr, cptr, cp= tr, env, i32) +DEF_HELPER_FLAGS_4(gvec_vfsq64, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) +DEF_HELPER_FLAGS_4(gvec_vfsq64s, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) =20 #ifndef CONFIG_USER_ONLY DEF_HELPER_3(servc, i32, env, i64, i64) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index fa2e801747..354252d57c 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -1242,6 +1242,8 @@ F(0xe78e, VFMS, VRR_e, V, 0, 0, 0, 0, vfma, 0, IF_VEC) /* VECTOR FP PERFORM SIGN OPERATION */ F(0xe7cc, VFPSO, VRR_a, V, 0, 0, 0, 0, vfpso, 0, IF_VEC) +/* VECTOR FP SQUARE ROOT */ + F(0xe7ce, VFSQ, VRR_a, V, 0, 0, 0, 0, vfsq, 0, IF_VEC) =20 #ifndef CONFIG_USER_ONLY /* COMPARE AND SWAP AND PURGE */ diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.in= c.c index b80d2a7a88..48b4e6008c 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -2769,3 +2769,22 @@ static DisasJumpType op_vfpso(DisasContext *s, Disas= Ops *o) tcg_temp_free_i64(tmp); return DISAS_NEXT; } + +static DisasJumpType op_vfsq(DisasContext *s, DisasOps *o) +{ + const uint8_t fpf =3D get_field(s->fields, m3); + const uint8_t m4 =3D get_field(s->fields, m4); + gen_helper_gvec_2_ptr *fn =3D gen_helper_gvec_vfsq64; + + if (fpf !=3D FPF_LONG || extract32(m4, 0, 3)) { + gen_program_exception(s, PGM_SPECIFICATION); + return DISAS_NORETURN; + } + + if (extract32(m4, 3, 1)) { + fn =3D gen_helper_gvec_vfsq64s; + } + gen_gvec_2_ptr(get_field(s->fields, v1), get_field(s->fields, v2), cpu= _env, + 0, fn); + return DISAS_NEXT; +} diff --git a/target/s390x/vec_fpu_helper.c b/target/s390x/vec_fpu_helper.c index a27b354214..a78c9dccdc 100644 --- a/target/s390x/vec_fpu_helper.c +++ b/target/s390x/vec_fpu_helper.c @@ -569,3 +569,20 @@ void HELPER(gvec_vfms64s)(void *v1, const void *v2, co= nst void *v3, { vop64_4(v1, v2, v3, v4, env, true, vfms64, GETPC()); } + +static uint64_t vfsq64(uint64_t a, float_status *s) +{ + return float64_val(float64_sqrt(make_float64(a), s)); +} + +void HELPER(gvec_vfsq64)(void *v1, const void *v2, CPUS390XState *env, + uint32_t desc) +{ + vop64_2(v1, v2, env, false, false, 0, vfsq64, GETPC()); +} + +void HELPER(gvec_vfsq64s)(void *v1, const void *v2, CPUS390XState *env, + uint32_t desc) +{ + vop64_2(v1, v2, env, true, false, 0, vfsq64, GETPC()); +} --=20 2.20.1 From nobody Mon Nov 10 20:55:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559300987; cv=none; d=zoho.com; s=zohoarc; b=AhInOkaNvSwATj/9EgemDCgAmtZLuszEdsV2jFksZmRYhD8rBKJr+KJ7YvfX+SeerQn8VxtAOa3N+LC8jCU423Epnf6eH446Qv44NyHAl27jUhhUmu/sZ+79YEFjkUQpJrA8NJTDteB0Jhs5pdlKzD00BwPXaSi3wq1AGq1kGas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559300987; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=fCyadLojiuRU1lxwAqo9/pVCGsJBIJ2jg0x+xrgveU8=; b=OfverFHe/yGL4QHUJF6rq3jOvm5F94PrG8QAyOzfyynlzXLDbqo4VNPxtJ8YSTlBEmGxaSRf+3GHtw0eJoO6ZFKLsNE1dyOHGCGgd1wCTg2OHQ/yNNDFJMNiB98Ml9CEd0aP1x2u8BboGxfMDQggjf6+J9lwUWzwhoLrJvN8rbc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559300987491588.3278680065749; Fri, 31 May 2019 04:09:47 -0700 (PDT) Received: from localhost ([127.0.0.1]:41163 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWfPl-0001Lr-Qt for importer@patchew.org; Fri, 31 May 2019 07:09:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf2U-0007eX-6t for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf2L-0002DM-67 for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48134) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf2G-0001wm-LK for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:21 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AEBA73084246; Fri, 31 May 2019 10:45:15 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id A10F74EE0C; Fri, 31 May 2019 10:45:14 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:28 +0200 Message-Id: <20190531104432.29379-20-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Fri, 31 May 2019 10:45:15 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 19/23] s390x/tcg: Implement VECTOR FP SUBTRACT X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Similar to VECTOR FP ADD. Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- target/s390x/helper.h | 2 ++ target/s390x/insn-data.def | 2 ++ target/s390x/translate_vx.inc.c | 3 +++ target/s390x/vec_fpu_helper.c | 17 +++++++++++++++++ 4 files changed, 24 insertions(+) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index 23b37af1e4..c788fc1b7f 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -290,6 +290,8 @@ DEF_HELPER_FLAGS_6(gvec_vfms64, TCG_CALL_NO_WG, void, p= tr, cptr, cptr, cptr, env DEF_HELPER_FLAGS_6(gvec_vfms64s, TCG_CALL_NO_WG, void, ptr, cptr, cptr, cp= tr, env, i32) DEF_HELPER_FLAGS_4(gvec_vfsq64, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vfsq64s, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) +DEF_HELPER_FLAGS_5(gvec_vfs64, TCG_CALL_NO_WG, void, ptr, cptr, cptr, env,= i32) +DEF_HELPER_FLAGS_5(gvec_vfs64s, TCG_CALL_NO_WG, void, ptr, cptr, cptr, env= , i32) =20 #ifndef CONFIG_USER_ONLY DEF_HELPER_3(servc, i32, env, i64, i64) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index 354252d57c..4426f40250 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -1244,6 +1244,8 @@ F(0xe7cc, VFPSO, VRR_a, V, 0, 0, 0, 0, vfpso, 0, IF_VEC) /* VECTOR FP SQUARE ROOT */ F(0xe7ce, VFSQ, VRR_a, V, 0, 0, 0, 0, vfsq, 0, IF_VEC) +/* VECTOR FP SUBTRACT */ + F(0xe7e2, VFS, VRR_c, V, 0, 0, 0, 0, vfa, 0, IF_VEC) =20 #ifndef CONFIG_USER_ONLY /* COMPARE AND SWAP AND PURGE */ diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.in= c.c index 48b4e6008c..bc75a147b6 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -2566,6 +2566,9 @@ static DisasJumpType op_vfa(DisasContext *s, DisasOps= *o) case 0xe7: fn =3D se ? gen_helper_gvec_vfm64s : gen_helper_gvec_vfm64; break; + case 0xe2: + fn =3D se ? gen_helper_gvec_vfs64s : gen_helper_gvec_vfs64; + break; default: g_assert_not_reached(); } diff --git a/target/s390x/vec_fpu_helper.c b/target/s390x/vec_fpu_helper.c index a78c9dccdc..10249c5105 100644 --- a/target/s390x/vec_fpu_helper.c +++ b/target/s390x/vec_fpu_helper.c @@ -586,3 +586,20 @@ void HELPER(gvec_vfsq64s)(void *v1, const void *v2, CP= US390XState *env, { vop64_2(v1, v2, env, true, false, 0, vfsq64, GETPC()); } + +static uint64_t vfs64(uint64_t a, uint64_t b, float_status *s) +{ + return float64_val(float64_sub(make_float64(a), make_float64(b), s)); +} + +void HELPER(gvec_vfs64)(void *v1, const void *v2, const void *v3, + CPUS390XState *env, uint32_t desc) +{ + vop64_3(v1, v2, v3, env, false, vfs64, GETPC()); +} + +void HELPER(gvec_vfs64s)(void *v1, const void *v2, const void *v3, + CPUS390XState *env, uint32_t desc) +{ + vop64_3(v1, v2, v3, env, true, vfs64, GETPC()); +} --=20 2.20.1 From nobody Mon Nov 10 20:55:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559300592; cv=none; d=zoho.com; s=zohoarc; b=nkXBKET5bWzcC2RMh7ESkb7J771wLKN3EnPznw13IFHgSfd2Z791Q8Kn139B7ca1DKn96S1Izjbhk9Rw+8FEYVswhpTNNjYPrqx6WRO/BP5SNo4vB1kieFnDYr5LBDo+XR8WQKPcXKsorB27VbLLv/4KQnHccnkPKB1NVD7bHkk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559300592; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=vtV4LzDpt5sIjs4g+MiNxI8o5AkgG8cgKe5m2Li8fcA=; b=h3jq0sL4a55oyUmKRk6dmiNtlpUIGo7S3sk5fpY0UhS6W2uZOFieZ1BoJcQN1MHumGlROnDPzHCb9EH7dFfZM71Plo/00xraqX81mLQm8SkfW55zs6X0tjMuLcDjWumE6WSnpT0JZh5uF3tcBNwzxtM5XpNCUdxUPEqwEJq1auE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 155930059252156.324678911880596; Fri, 31 May 2019 04:03:12 -0700 (PDT) Received: from localhost ([127.0.0.1]:41057 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWfJO-0004vb-7k for importer@patchew.org; Fri, 31 May 2019 07:03:02 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf2W-0007gQ-5o for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf2U-0002OD-83 for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34740) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf2Q-0001xv-8E for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:32 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1590081F0C; Fri, 31 May 2019 10:45:17 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 07453473BC; Fri, 31 May 2019 10:45:15 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:29 +0200 Message-Id: <20190531104432.29379-21-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 31 May 2019 10:45:17 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 20/23] s390x/tcg: Implement VECTOR FP TEST DATA CLASS IMMEDIATE X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We can reuse float64_dcmask(). Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- target/s390x/helper.h | 2 ++ target/s390x/insn-data.def | 2 ++ target/s390x/translate_vx.inc.c | 21 ++++++++++++++++++ target/s390x/vec_fpu_helper.c | 39 +++++++++++++++++++++++++++++++++ 4 files changed, 64 insertions(+) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index c788fc1b7f..e9aff83b05 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -292,6 +292,8 @@ DEF_HELPER_FLAGS_4(gvec_vfsq64, TCG_CALL_NO_WG, void, p= tr, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vfsq64s, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) DEF_HELPER_FLAGS_5(gvec_vfs64, TCG_CALL_NO_WG, void, ptr, cptr, cptr, env,= i32) DEF_HELPER_FLAGS_5(gvec_vfs64s, TCG_CALL_NO_WG, void, ptr, cptr, cptr, env= , i32) +DEF_HELPER_4(gvec_vftci64, void, ptr, cptr, env, i32) +DEF_HELPER_4(gvec_vftci64s, void, ptr, cptr, env, i32) =20 #ifndef CONFIG_USER_ONLY DEF_HELPER_3(servc, i32, env, i64, i64) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index 4426f40250..f421184fcd 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -1246,6 +1246,8 @@ F(0xe7ce, VFSQ, VRR_a, V, 0, 0, 0, 0, vfsq, 0, IF_VEC) /* VECTOR FP SUBTRACT */ F(0xe7e2, VFS, VRR_c, V, 0, 0, 0, 0, vfa, 0, IF_VEC) +/* VECTOR FP TEST DATA CLASS IMMEDIATE */ + F(0xe74a, VFTCI, VRI_e, V, 0, 0, 0, 0, vftci, 0, IF_VEC) =20 #ifndef CONFIG_USER_ONLY /* COMPARE AND SWAP AND PURGE */ diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.in= c.c index bc75a147b6..715fcb2cb5 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -2791,3 +2791,24 @@ static DisasJumpType op_vfsq(DisasContext *s, DisasO= ps *o) 0, fn); return DISAS_NEXT; } + +static DisasJumpType op_vftci(DisasContext *s, DisasOps *o) +{ + const uint16_t i3 =3D get_field(s->fields, i3); + const uint8_t fpf =3D get_field(s->fields, m4); + const uint8_t m5 =3D get_field(s->fields, m5); + gen_helper_gvec_2_ptr *fn =3D gen_helper_gvec_vftci64; + + if (fpf !=3D FPF_LONG || extract32(m5, 0, 3)) { + gen_program_exception(s, PGM_SPECIFICATION); + return DISAS_NORETURN; + } + + if (extract32(m5, 3, 1)) { + fn =3D gen_helper_gvec_vftci64s; + } + gen_gvec_2_ptr(get_field(s->fields, v1), get_field(s->fields, v2), cpu= _env, + i3, fn); + set_cc_static(s); + return DISAS_NEXT; +} diff --git a/target/s390x/vec_fpu_helper.c b/target/s390x/vec_fpu_helper.c index 10249c5105..930b6d1db4 100644 --- a/target/s390x/vec_fpu_helper.c +++ b/target/s390x/vec_fpu_helper.c @@ -603,3 +603,42 @@ void HELPER(gvec_vfs64s)(void *v1, const void *v2, con= st void *v3, { vop64_3(v1, v2, v3, env, true, vfs64, GETPC()); } + +static int vftci64(S390Vector *v1, const S390Vector *v2, CPUS390XState *en= v, + bool s, uint16_t i3) +{ + int i, match =3D 0; + + for (i =3D 0; i < 2; i++) { + float64 a =3D make_float64(s390_vec_read_element64(v2, i)); + + if (float64_dcmask(env, a) & i3) { + match++; + s390_vec_write_element64(v1, i, -1ull); + } else { + s390_vec_write_element64(v1, i, 0); + } + if (s) { + break; + } + } + + if (match =3D=3D i + 1) { + return 0; + } else if (match) { + return 1; + } + return 3; +} + +void HELPER(gvec_vftci64)(void *v1, const void *v2, CPUS390XState *env, + uint32_t desc) +{ + env->cc_op =3D vftci64(v1, v2, env, false, simd_data(desc)); +} + +void HELPER(gvec_vftci64s)(void *v1, const void *v2, CPUS390XState *env, + uint32_t desc) +{ + env->cc_op =3D vftci64(v1, v2, env, true, simd_data(desc)); +} --=20 2.20.1 From nobody Mon Nov 10 20:55:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559300773; cv=none; d=zoho.com; s=zohoarc; b=dEUQr0QM+GSfp+LVVahXLxrOagbR6xlzRfzg2nXDhWqhel7rgv3V0y43HMnsv2M4hM63AjtCxGcqAVWBMrFtfyEhDVkz4jLS1AnQIDN0FDpLPfNBQBKxVaoD7uPi1z+N+18t8xMsW7YSyEg28YsTBRKVCgYkb00PnCuZRDDadQ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559300773; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=wC6mWIZOL5mWiIXY0GZfsfuA/REzevnDCOFHiWMqK70=; b=D1v7EgGZQL3vL3UJ0aSPPTbfgVcOTqTE3Isum+YekLab4/X/sJJdaC6oOVfk+H29YO1Qz5lv1Ti4gCR6dJuXSSdeIlOkQ+0IpiyCAmam4uQkkw2XT0mAva7Q8/6q2r/MIpTYUGm4NC0843ViMQjhDodzH4hEAHbq9Yju3+G0iTQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559300773829999.7799136189071; Fri, 31 May 2019 04:06:13 -0700 (PDT) Received: from localhost ([127.0.0.1]:41119 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWfMM-0007Fv-SS for importer@patchew.org; Fri, 31 May 2019 07:06:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56389) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf2b-0007l8-4k for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf2a-0002X2-AJ for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48160) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf2a-00020c-4l for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:40 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 723F930024B1; Fri, 31 May 2019 10:45:18 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6234A4EE0C; Fri, 31 May 2019 10:45:17 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:30 +0200 Message-Id: <20190531104432.29379-22-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Fri, 31 May 2019 10:45:18 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 21/23] s390x/tcg: Allow linux-user to use vector instructions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Once we unlock S390_FEAT_VECTOR for TCG, we want linux-user to be able to make use of it. Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- target/s390x/cpu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index b1df63d82c..6af1a1530f 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -145,6 +145,9 @@ static void s390_cpu_full_reset(CPUState *s) #if defined(CONFIG_USER_ONLY) /* user mode should always be allowed to use the full FPU */ env->cregs[0] |=3D CR0_AFP; + if (s390_has_feat(S390_FEAT_VECTOR)) { + env->cregs[0] |=3D CR0_VECTOR; + } #endif =20 /* architectured initial value for Breaking-Event-Address register */ --=20 2.20.1 From nobody Mon Nov 10 20:55:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559300227; cv=none; d=zoho.com; s=zohoarc; b=Doid+dTyPyUHqD8XvK6u3A512d3wrc43JebPdP8UMZlYT6wYiVu4Dyl5D57i+yUoXY3SXgi9iUZx5qn1PJTrF+Exujxsiq2MKFRUB/41Y7fPx64/cmS9NsSq9/WFs0JHTd3lofjN7UgWYcqGkbxMtW95SCPhg5QZKe7W+EzhFDI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559300227; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=k/AvAxry3Ch7Zm9L9XPH1AjPBUHKiB7BQj2l2yrawIk=; b=JEhghyxonijM1ZpJhOq3i9AttWu3dri36OIrYUvKqIsgU+jeyN6AYE5/4E8H5Vo5dTaTQXLobEah9IsL6RSMYTMLES7cJLvuvPa2+/8226IGQHr/+FhrYUCrB3QXim7ORhjZo94B9wkNgt6KlpT4bweRrzd3Xk+foupmrFpanTM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559300227924431.30692063257095; Fri, 31 May 2019 03:57:07 -0700 (PDT) Received: from localhost ([127.0.0.1]:40969 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWfDU-0007vv-0l for importer@patchew.org; Fri, 31 May 2019 06:56:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf2a-0007kq-QE for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf2Z-0002WL-W1 for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56362) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf2Y-00021w-1i for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:38 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CFD81302451A; Fri, 31 May 2019 10:45:19 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id BE377271AE; Fri, 31 May 2019 10:45:18 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:31 +0200 Message-Id: <20190531104432.29379-23-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 31 May 2019 10:45:19 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 22/23] s390x/tcg: We support the Vector Facility X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Let's add it to the max model, so we can enable it. Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- target/s390x/gen-features.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c index c346b76bdf..a818c80332 100644 --- a/target/s390x/gen-features.c +++ b/target/s390x/gen-features.c @@ -702,6 +702,7 @@ static uint16_t qemu_LATEST[] =3D { static uint16_t qemu_MAX[] =3D { /* z13+ features */ S390_FEAT_STFLE_53, + S390_FEAT_VECTOR, /* generates a dependency warning, leave it out for now */ S390_FEAT_MSA_EXT_5, }; --=20 2.20.1 From nobody Mon Nov 10 20:55:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559300616; cv=none; d=zoho.com; s=zohoarc; b=Tj1VhF3UO9BdGLE/zSRg0FIcLZN6uF0ITc3dljZfsChiOns/FYOKlYuobLtj7BLmMcALe+F72y3gPmCXDFfbyw2vQdVOIy3aLmOmwrYYDjv6MrKCutH3KnBvOi1lrHseZRsNYENBAJt2SiKUK7H0UlEy5MxUwVlLO5oCHXLNpZk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559300616; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=JshvKsQq6ikhvUFDnvTdA7Z9U///kIJrZSbQS9vEC+g=; b=I3d2grFY0qSjqgX6Ejk0Ag7sjxEk2LSvaQbJxHDwMM7OeqChHFYGMiiKhqueBCo7rSObvDlXiTIoJHNJyzDgogBO75cRWQQUKEdZqWrB1kLuAf/+2YVsl9/9aBeBZpcdbo1EIEd3DLRInqwGRGWI3EJkr7Gby27WsqYqjEE1UpU= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559300616764504.7709306540704; Fri, 31 May 2019 04:03:36 -0700 (PDT) Received: from localhost ([127.0.0.1]:41055 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWfJL-0004rF-5a for importer@patchew.org; Fri, 31 May 2019 07:02:59 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56352) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf2a-0007k9-1n for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf2Y-0002UP-5G for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42856) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf2X-000236-WA for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:38 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 383DD30821C0; Fri, 31 May 2019 10:45:21 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 27403473BC; Fri, 31 May 2019 10:45:19 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:32 +0200 Message-Id: <20190531104432.29379-24-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 31 May 2019 10:45:21 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 23/23] s390x: Bump the "qemu" CPU model up to a stripped-down z13 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We don't care about the other two missing base features: - S390_FEAT_DFP_PACKED_CONVERSION - S390_FEAT_GROUP_GEN13_PTFF Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- hw/s390x/s390-virtio-ccw.c | 2 ++ target/s390x/cpu_models.c | 4 ++-- target/s390x/gen-features.c | 11 +++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index bbc6e8fa0b..4d643686cb 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -669,7 +669,9 @@ DEFINE_CCW_MACHINE(4_1, "4.1", true); =20 static void ccw_machine_4_0_instance_options(MachineState *machine) { + static const S390FeatInit qemu_cpu_feat =3D { S390_FEAT_LIST_QEMU_V4_0= }; ccw_machine_4_1_instance_options(machine); + s390_set_qemu_cpu_model(0x2827, 12, 2, qemu_cpu_feat); } =20 static void ccw_machine_4_0_class_options(MachineClass *mc) diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 21ea819483..b5d16e4c89 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -86,8 +86,8 @@ static S390CPUDef s390_cpu_defs[] =3D { CPUDEF_INIT(0x8562, 15, 1, 47, 0x08000000U, "gen15b", "IBM 8562 GA1"), }; =20 -#define QEMU_MAX_CPU_TYPE 0x2827 -#define QEMU_MAX_CPU_GEN 12 +#define QEMU_MAX_CPU_TYPE 0x2964 +#define QEMU_MAX_CPU_GEN 13 #define QEMU_MAX_CPU_EC_GA 2 static const S390FeatInit qemu_max_cpu_feat_init =3D { S390_FEAT_LIST_QEMU= _MAX }; static S390FeatBitmap qemu_max_cpu_feat; diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c index a818c80332..dc320a06c2 100644 --- a/target/s390x/gen-features.c +++ b/target/s390x/gen-features.c @@ -689,7 +689,7 @@ static uint16_t qemu_V3_1[] =3D { S390_FEAT_MSA_EXT_4, }; =20 -static uint16_t qemu_LATEST[] =3D { +static uint16_t qemu_V4_0[] =3D { /* * Only BFP bits are implemented (HFP, DFP, PFPO and DIVIDE TO INTEGER= not * implemented yet). @@ -698,11 +698,13 @@ static uint16_t qemu_LATEST[] =3D { S390_FEAT_ZPCI, }; =20 -/* add all new definitions before this point */ -static uint16_t qemu_MAX[] =3D { - /* z13+ features */ +static uint16_t qemu_LATEST[] =3D { S390_FEAT_STFLE_53, S390_FEAT_VECTOR, +}; + +/* add all new definitions before this point */ +static uint16_t qemu_MAX[] =3D { /* generates a dependency warning, leave it out for now */ S390_FEAT_MSA_EXT_5, }; @@ -821,6 +823,7 @@ static FeatGroupDefSpec FeatGroupDef[] =3D { static FeatGroupDefSpec QemuFeatDef[] =3D { QEMU_FEAT_INITIALIZER(V2_11), QEMU_FEAT_INITIALIZER(V3_1), + QEMU_FEAT_INITIALIZER(V4_0), QEMU_FEAT_INITIALIZER(LATEST), QEMU_FEAT_INITIALIZER(MAX), }; --=20 2.20.1