From patchwork Tue Aug 25 20:58:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 248271 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp3768035ils; Tue, 25 Aug 2020 14:06:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQODsjInmDdVK315sVUYBkc+/z4sJVGEGoC7Eo7XxOAB7HICNnm0Oq/vwcegbNGPG8jgJI X-Received: by 2002:a25:c347:: with SMTP id t68mr18229668ybf.105.1598389564065; Tue, 25 Aug 2020 14:06:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598389564; cv=none; d=google.com; s=arc-20160816; b=ArjwyanlzISK53Wuqr8DRK70p4ZFGQBhAMbDVLqtvtlv6eWPwrQYwW8VJt3zT5WVox dFVfjx1sXMCR7t2njQ3Blk6W/3j+iwjcgABc1HzQ72fmk2eJoEF35bQQ8es78IQiGvh4 /yxB5GTI/DWYkUd96t5Q2nBsJRkpwNm9kfHpU0k5yrvKLJio/8qKGiJat7l6rvz74dIh f+gUmwL8MUM/cElEXhaI25HnkNxauSgreQ6LySO4vThxbMywmzJxaZGOzNyzx47rkXJG /ESji/JVsE9ESn0gWA5pZQobNeh/zZW5Fc125FdK21dxpPFhAA/NRr6IkKm8iNEer0ht ZmCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=v5cOPITpAORhIDF2PS7d5r/AWbCGGzSRkZP2Jde8Lx4=; b=kEC6wvKMqDi3RuG7JOcd0Llg4ZossoZOGPJFkNnPl+R/3sDVGsy2gHp2+sxkxWpHGF /2Zxu3sBquxmTxfhDF8ihvifLtlb+XjkNnR78PbgEeTM6fzD725HyZxAJHQkbqFA2uKD vFLuxQnXPLweGEIuASkXQXu2tk/XWCbJfisPJfQ+9PJ0IVQh4C8YeZbL+cuBe5ocYlBH Ggif8MT5Vl/8PS+oJQcc3TLkWTXVnvyfoQBt5443arnif8ChR99V9I7K2ypmklexLRfJ oRTn/noVZhQqurolv3cZDlzk4ugP0UMWO2DacUwBJvBgnOkRjlSbvWaqUXR/XezwBBJk A1kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pdYgUZe6; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w67si15163ybc.303.2020.08.25.14.06.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Aug 2020 14:06:04 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pdYgUZe6; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAg8p-0007ED-GT for patch@linaro.org; Tue, 25 Aug 2020 17:06:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35444) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAg36-00075a-8n for qemu-devel@nongnu.org; Tue, 25 Aug 2020 17:00:08 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:33104) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAg33-0001fN-UG for qemu-devel@nongnu.org; Tue, 25 Aug 2020 17:00:07 -0400 Received: by mail-pg1-x544.google.com with SMTP id o13so7688493pgf.0 for ; Tue, 25 Aug 2020 14:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=v5cOPITpAORhIDF2PS7d5r/AWbCGGzSRkZP2Jde8Lx4=; b=pdYgUZe6lsB1pe/3gIVvPQOv5GC3Mqs9Pbpakba3p5aq/sFfxKlTowoIhVu5ZU2Dne rJeM0a2a7oZ5d5HI1lLYoMkbV3tYeAwoqF+/nA133px+lk/i59ApSc4kKUlRHh3sU0fB LBUucSGSRRW508uAh4vlrTkGYXXPrD0hIjO18vm3Vgd0lFz03Fd6BjdGZzmhZMk5AION 5gJasLRTIKp59Y116jgacGKEsik+HFt+e/oN/CMRSq4ppPElhauEYm4Z3IABZ2Z2eMbD YEJOVN+Srbp0C2DcjhqH2e9TqqQkFZbq2sR1gqWlAKU6cFxcclUShdIgnMyjlSwJhEh7 f5VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=v5cOPITpAORhIDF2PS7d5r/AWbCGGzSRkZP2Jde8Lx4=; b=J2zQ+ix7/d8Q5bSmGjFehTFKJnjcMGMUaYf/NkYh9KlRZEfhnfNRWmBQKbkZe88/Tm RctcRa7nvkEnu/9lsPYJxIG+bX3nclv16PurKKzeDp1Paq6zofJiwapFUcSb7ai7fexN aIufzBzZ1t0YDzS3MAMRKqz8DakHEaxhO2sLVUtD+m5x9rgT8uwt6Wg6VELGlDog9T73 xR6TRbnGnx/DaXXncnwmfp5RtW/lTlsTFJHmNpu6q/FfBamglbvJtA0Gra3+FXi3LaoO 6F5+yeWBeA9THIqe+dvh+LSo4QAFc/3dgfepTerS5kOBxspUAPn0P/wQnrVMl155zx75 havg== X-Gm-Message-State: AOAM530/lZ9mJ7bDzov4hrC8AjT3PtnSA5hEQ98YdJLGIpf2nKUQbdSH ZG34JmOwx4I0TJZcwIH8GgngcZGBgMmvGQ== X-Received: by 2002:a62:7acb:: with SMTP id v194mr9400232pfc.302.1598389203993; Tue, 25 Aug 2020 14:00:03 -0700 (PDT) Received: from localhost.localdomain (h216-228-167-147.bendor.dedicated.static.tds.net. [216.228.167.147]) by smtp.gmail.com with ESMTPSA id k4sm16074pgr.87.2020.08.25.14.00.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2020 14:00:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 09/77] target/microblaze: Split out FSR from env->sregs Date: Tue, 25 Aug 2020 13:58:42 -0700 Message-Id: <20200825205950.730499-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200825205950.730499-1-richard.henderson@linaro.org> References: <20200825205950.730499-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::544; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x544.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Continue eliminating the sregs array in favor of individual members. Does not correct the width of FSR, yet. Signed-off-by: Richard Henderson --- target/microblaze/cpu.h | 1 + linux-user/microblaze/cpu_loop.c | 4 ++-- target/microblaze/gdbstub.c | 4 ++-- target/microblaze/op_helper.c | 8 ++++---- target/microblaze/translate.c | 6 ++++-- 5 files changed, 13 insertions(+), 10 deletions(-) -- 2.25.1 diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index 7d94af43ed..bcafef99b0 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -240,6 +240,7 @@ struct CPUMBState { uint64_t msr; uint64_t ear; uint64_t esr; + uint64_t fsr; uint64_t sregs[14]; float_status fp_status; /* Stack protectors. Yes, it's a hw feature. */ diff --git a/linux-user/microblaze/cpu_loop.c b/linux-user/microblaze/cpu_loop.c index c10e3e0261..da5e98b784 100644 --- a/linux-user/microblaze/cpu_loop.c +++ b/linux-user/microblaze/cpu_loop.c @@ -96,10 +96,10 @@ void cpu_loop(CPUMBState *env) case ESR_EC_FPU: info.si_signo = TARGET_SIGFPE; info.si_errno = 0; - if (env->sregs[SR_FSR] & FSR_IO) { + if (env->fsr & FSR_IO) { info.si_code = TARGET_FPE_FLTINV; } - if (env->sregs[SR_FSR] & FSR_DZ) { + if (env->fsr & FSR_DZ) { info.si_code = TARGET_FPE_FLTDIV; } info._sifields._sigfault._addr = 0; diff --git a/target/microblaze/gdbstub.c b/target/microblaze/gdbstub.c index 05e22f233d..2634ce49fc 100644 --- a/target/microblaze/gdbstub.c +++ b/target/microblaze/gdbstub.c @@ -71,7 +71,7 @@ int mb_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) val = env->esr; break; case GDB_FSR: - val = env->sregs[SR_FSR]; + val = env->fsr; break; case GDB_BTR: val = env->sregs[SR_BTR]; @@ -127,7 +127,7 @@ int mb_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) env->esr = tmp; break; case GDB_FSR: - env->sregs[SR_FSR] = tmp; + env->fsr = tmp; break; case GDB_BTR: env->sregs[SR_BTR] = tmp; diff --git a/target/microblaze/op_helper.c b/target/microblaze/op_helper.c index f01cf9be64..ae57d45536 100644 --- a/target/microblaze/op_helper.c +++ b/target/microblaze/op_helper.c @@ -175,19 +175,19 @@ static void update_fpu_flags(CPUMBState *env, int flags) int raise = 0; if (flags & float_flag_invalid) { - env->sregs[SR_FSR] |= FSR_IO; + env->fsr |= FSR_IO; raise = 1; } if (flags & float_flag_divbyzero) { - env->sregs[SR_FSR] |= FSR_DZ; + env->fsr |= FSR_DZ; raise = 1; } if (flags & float_flag_overflow) { - env->sregs[SR_FSR] |= FSR_OF; + env->fsr |= FSR_OF; raise = 1; } if (flags & float_flag_underflow) { - env->sregs[SR_FSR] |= FSR_UF; + env->fsr |= FSR_UF; raise = 1; } if (raise diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 411c7b6e49..c58c49ea8f 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1810,7 +1810,7 @@ void mb_cpu_dump_state(CPUState *cs, FILE *f, int flags) "debug=%x imm=%x iflags=%x fsr=%" PRIx64 " " "rbtr=%" PRIx64 "\n", env->msr, env->esr, env->ear, - env->debug, env->imm, env->iflags, env->sregs[SR_FSR], + env->debug, env->imm, env->iflags, env->fsr, env->sregs[SR_BTR]); qemu_fprintf(f, "btaken=%d btarget=%" PRIx64 " mode=%s(saved=%s) " "eip=%d ie=%d\n", @@ -1877,8 +1877,10 @@ void mb_tcg_init(void) tcg_global_mem_new_i64(cpu_env, offsetof(CPUMBState, ear), "rear"); cpu_SR[SR_ESR] = tcg_global_mem_new_i64(cpu_env, offsetof(CPUMBState, esr), "resr"); + cpu_SR[SR_FSR] = + tcg_global_mem_new_i64(cpu_env, offsetof(CPUMBState, fsr), "rfsr"); - for (i = SR_ESR + 1; i < ARRAY_SIZE(cpu_SR); i++) { + for (i = SR_FSR + 1; i < ARRAY_SIZE(cpu_SR); i++) { cpu_SR[i] = tcg_global_mem_new_i64(cpu_env, offsetof(CPUMBState, sregs[i]), special_regnames[i]);