From patchwork Mon Feb 15 03:42:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 8309001 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BAB92C02AA for ; Mon, 15 Feb 2016 03:43:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0FBAA20520 for ; Mon, 15 Feb 2016 03:43:28 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 48F5C2051F for ; Mon, 15 Feb 2016 03:43:27 +0000 (UTC) Received: from localhost ([::1]:55940 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVA4M-0007J3-OI for patchwork-qemu-devel@patchwork.kernel.org; Sun, 14 Feb 2016 22:43:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55251) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVA4D-0007IM-9U for qemu-devel@nongnu.org; Sun, 14 Feb 2016 22:43:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVA4B-0006F3-K0 for qemu-devel@nongnu.org; Sun, 14 Feb 2016 22:43:17 -0500 Received: from mail-qg0-x242.google.com ([2607:f8b0:400d:c04::242]:35396) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVA4B-0006Ez-FU for qemu-devel@nongnu.org; Sun, 14 Feb 2016 22:43:15 -0500 Received: by mail-qg0-x242.google.com with SMTP id b35so9796741qge.2 for ; Sun, 14 Feb 2016 19:43:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=hY65f9asA/hmlGTW5/2x62ellsB+4o3lx5C/FGfRRNE=; b=EUqRNi3MOSMo2pDqTbI1VeiaSorXRrnVBA6Tv6fryahQZN/hrnOcZ8ydhoZyjH5ACq bZosrFQiy9C2KUbkzEcZfu+3VvlqANT88H/0qsIlrhGbY9sSwEtapBPvK2+/1JJ8KpeZ R0l2M+dKCZquGIvERVFnQt4is5mgfU+7kV6bkqK9kHFKH6b/kp2+loXu57kWiSo8HypK AImmr5kdq+JuSPz0P3afQCQ40KMIfHZ6T6i/MmKt2P7ybk1bNlUsnTTNLgYPz2icOEie QnF401qW8bG/+MDhprYk9P200v308fUu4LxozCGSQhnUY0PIn20QsU557z3AIzL+iJFT 4lzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=hY65f9asA/hmlGTW5/2x62ellsB+4o3lx5C/FGfRRNE=; b=Zoj3va6/62BsEZWPwkzZqICaoQQ4b/pGkmKusE+RdiH6owhmWJVxihCSwewJRkP9NB qG0gydGsok1zyo+d4X5xeO1UqceKgaIZOoYQ9LSmbIa+/LmuF8tAh4xKmUXCccbjs1RB OM4zOXOJJCIM+BOn0BPSwPrRY01s5wsqdpLhPLtQ5nu6bso2r60Y51U5v2XcwbNaZKRT fQICAyeZUNhaE+2EDw6xBdo2iXrVS8osdsYfR77YZ2Mvcx7bc7DLw3bhrgDtPAWYSN2w 9Zyq+gaqZqRr/wyCxIr2k0kJ/wtB0VZkvprR3S1FEyk/Y6byS1Y5RN7GWfsbSZdXYmFz PCpw== X-Gm-Message-State: AG10YOQy1fRWHKntetaPLrZ5nrMeuvyjPc/zIFIyqrU1xZKmyTEK/HmE5Q1AIzYM87q5xA== X-Received: by 10.140.177.71 with SMTP id x68mr18804503qhx.39.1455507795093; Sun, 14 Feb 2016 19:43:15 -0800 (PST) Received: from bigtime.com ([103.226.32.154]) by smtp.gmail.com with ESMTPSA id z132sm10424704qka.14.2016.02.14.19.43.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Feb 2016 19:43:14 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 15 Feb 2016 14:42:19 +1100 Message-Id: <1455507754-8978-2-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455507754-8978-1-git-send-email-rth@twiddle.net> References: <1455507754-8978-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c04::242 Cc: mark.cave-ayland@ilande.co.uk, aurelien@aurel32.net Subject: [Qemu-devel] [PATCH v2 01/16] tcg-mips: Always use tcg_debug_assert 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Richard Henderson Reviewed-by: Aurelien Jarno --- tcg/mips/tcg-target.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tcg/mips/tcg-target.c b/tcg/mips/tcg-target.c index 2dc4998..ebb936d 100644 --- a/tcg/mips/tcg-target.c +++ b/tcg/mips/tcg-target.c @@ -128,7 +128,7 @@ static inline uint32_t reloc_pc16_val(tcg_insn_unit *pc, tcg_insn_unit *target) { /* Let the compiler perform the right-shift as part of the arithmetic. */ ptrdiff_t disp = target - (pc + 1); - assert(disp == (int16_t)disp); + tcg_debug_assert(disp == (int16_t)disp); return disp & 0xffff; } @@ -139,7 +139,7 @@ static inline void reloc_pc16(tcg_insn_unit *pc, tcg_insn_unit *target) static inline uint32_t reloc_26_val(tcg_insn_unit *pc, tcg_insn_unit *target) { - assert((((uintptr_t)pc ^ (uintptr_t)target) & 0xf0000000) == 0); + tcg_debug_assert((((uintptr_t)pc ^ (uintptr_t)target) & 0xf0000000) == 0); return ((uintptr_t)target >> 2) & 0x3ffffff; } @@ -151,8 +151,8 @@ static inline void reloc_26(tcg_insn_unit *pc, tcg_insn_unit *target) static void patch_reloc(tcg_insn_unit *code_ptr, int type, intptr_t value, intptr_t addend) { - assert(type == R_MIPS_PC16); - assert(addend == 0); + tcg_debug_assert(type == R_MIPS_PC16); + tcg_debug_assert(addend == 0); reloc_pc16(code_ptr, (tcg_insn_unit *)value); } @@ -433,7 +433,7 @@ static bool tcg_out_opc_jmp(TCGContext *s, MIPSInsn opc, void *target) if ((from ^ dest) & -(1 << 28)) { return false; } - assert((dest & 3) == 0); + tcg_debug_assert((dest & 3) == 0); inst = opc; inst |= (dest >> 2) & 0x3ffffff; @@ -808,9 +808,9 @@ static void tcg_out_setcond2(TCGContext *s, TCGCond cond, TCGReg ret, TCGReg tmp0 = TCG_TMP0; TCGReg tmp1 = ret; - assert(ret != TCG_TMP0); + tcg_debug_assert(ret != TCG_TMP0); if (ret == ah || ret == bh) { - assert(ret != TCG_TMP1); + tcg_debug_assert(ret != TCG_TMP1); tmp1 = TCG_TMP1; } @@ -1471,8 +1471,8 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, case INDEX_op_and_i32: if (c2 && a2 != (uint16_t)a2) { int msb = ctz32(~a2) - 1; - assert(use_mips32r2_instructions); - assert(is_p2m1(a2)); + tcg_debug_assert(use_mips32r2_instructions); + tcg_debug_assert(is_p2m1(a2)); tcg_out_opc_bf(s, OPC_EXT, a0, a1, msb, 0); break; }