From patchwork Thu Jul 14 09:41:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsuneo Saito X-Patchwork-Id: 104660 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E69E8B6EDF for ; Thu, 14 Jul 2011 20:25:45 +1000 (EST) Received: from localhost ([::1]:56702 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhJ6y-0003PN-Tv for incoming@patchwork.ozlabs.org; Thu, 14 Jul 2011 06:25:40 -0400 Received: from eggs.gnu.org ([140.186.70.92]:47714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhIR3-0001DE-8W for qemu-devel@nongnu.org; Thu, 14 Jul 2011 05:42:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QhIR1-0002vq-DS for qemu-devel@nongnu.org; Thu, 14 Jul 2011 05:42:20 -0400 Received: from mail-iw0-f173.google.com ([209.85.214.173]:61123) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhIR0-0002tG-NA for qemu-devel@nongnu.org; Thu, 14 Jul 2011 05:42:18 -0400 Received: by mail-iw0-f173.google.com with SMTP id 3so42824iwn.4 for ; Thu, 14 Jul 2011 02:42:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=ybg/9falpDwrQsgwLv6AGPl0rioGHkrn1LcS1NxZiEQ=; b=C4gk2G02IAJBlWZSKe0ORRqZEbM+yasovXIqmUkLspcV4BJ2wm32Ee91xKLObAHtxZ a6w+IkmUoMnYwPeARVP+lZ4MXmsXY2U9udgXULgjf26/RB6wb8pK1559KJJx4HM1C9XS WUCPeq0YK/93/rMcyuyzIGdmunxLFz+GMedAs= Received: by 10.42.223.7 with SMTP id ii7mr353414icb.287.1310636537721; Thu, 14 Jul 2011 02:42:17 -0700 (PDT) Received: from localhost.localdomain (tetkyo149119.tkyo.te.ftth2.ppp.infoweb.ne.jp [202.219.195.119]) by mx.google.com with ESMTPS id hq1sm92469icc.2.2011.07.14.02.42.16 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 14 Jul 2011 02:42:17 -0700 (PDT) From: Tsuneo Saito To: qemu-devel@nongnu.org Date: Thu, 14 Jul 2011 18:41:39 +0900 Message-Id: <1310636503-8956-5-git-send-email-tsnsaito@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1310636503-8956-1-git-send-email-tsnsaito@gmail.com> References: <1310636503-8956-1-git-send-email-tsnsaito@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.214.173 Cc: Tsuneo Saito Subject: [Qemu-devel] [PATCH v2 4/8] SPARC64: fp_disabled checks on stfa/stdfa/stqfa X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org stfa/stdfa/stqfa instructions should raise fp_disabled exceptions if %pstate.PEF==0 or %fprs.FEF==0. Signed-off-by: Tsuneo Saito --- target-sparc/translate.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/target-sparc/translate.c b/target-sparc/translate.c index a5a8eaf..5f92dbb 100644 --- a/target-sparc/translate.c +++ b/target-sparc/translate.c @@ -4732,6 +4732,9 @@ static void disas_sparc_insn(DisasContext * dc) switch (xop) { #ifdef TARGET_SPARC64 case 0x34: /* V9 stfa */ + if (gen_trap_ifnofpu(dc, cpu_cond)) { + goto jmp_insn; + } gen_stf_asi(cpu_addr, insn, 4, rd); break; case 0x36: /* V9 stqfa */ @@ -4739,6 +4742,9 @@ static void disas_sparc_insn(DisasContext * dc) TCGv_i32 r_const; CHECK_FPU_FEATURE(dc, FLOAT128); + if (gen_trap_ifnofpu(dc, cpu_cond)) { + goto jmp_insn; + } r_const = tcg_const_i32(7); gen_helper_check_align(cpu_addr, r_const); tcg_temp_free_i32(r_const); @@ -4746,6 +4752,9 @@ static void disas_sparc_insn(DisasContext * dc) } break; case 0x37: /* V9 stdfa */ + if (gen_trap_ifnofpu(dc, cpu_cond)) { + goto jmp_insn; + } gen_stf_asi(cpu_addr, insn, 8, DFPREG(rd)); break; case 0x3c: /* V9 casa */