From patchwork Thu Apr 21 21:39:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 1620483 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=D4WmLUtb; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KkrcP0j30z9s0w for ; Fri, 22 Apr 2022 07:42:45 +1000 (AEST) Received: from localhost ([::1]:42956 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nheZX-0002gF-4q for incoming@patchwork.ozlabs.org; Thu, 21 Apr 2022 17:42:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39788) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nheWT-0005hC-Oq for qemu-devel@nongnu.org; Thu, 21 Apr 2022 17:39:33 -0400 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]:40924) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nheWS-00072n-2M for qemu-devel@nongnu.org; Thu, 21 Apr 2022 17:39:33 -0400 Received: by mail-pg1-x529.google.com with SMTP id h5so5721283pgc.7 for ; Thu, 21 Apr 2022 14:39:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fBvMdhyQyGT4XBuYWcE8QFdmjK0EoeDOCL9zswq18nM=; b=D4WmLUtbc92lCbmUF/06WzUzXDKEXRBYkKcLlOrAgotWUDC7UFZzpCJ2hJXuisaRvS AX51d48apmEUZioMS9iWFEIgM4bm47Eky2bREXbc/J+80BivgVVBFfWIwKlSODPJf4ui aW2NLmsdjlvvd1JSwHafMp98MVKWnBkJQYjENQmCyqEDvBaev7lsJ4fKRZPAAwCZC5sX HRMXCcRFDSahJg9YY/APTSern9cCWI4xUAhP3wwLU1QdoXEwvgdcBrpQHaIat3SlSzxX 3TYqQRPTJRNbMVkb/gFA0CKU0cU1hmpKNEWV2dQ2GAVbYZoXTs45a/Tec6x2ulrH8uOt UyGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fBvMdhyQyGT4XBuYWcE8QFdmjK0EoeDOCL9zswq18nM=; b=yn2tveWNzDxXqmSWOQKaUilsnwoyyxwvHIVxrYLMcX2IlnaTjbol/e+0OjHG8Oi++Y ygnF2mo6RogaOYjVRfeK6LmqCdMO1rdgkRd4BSKAwL0SQsTYp046YbyagUNRMfYQ8pu4 x2zji9K5aF+ChShw3oG6w3lrijueuv1clPcWF/z/sCy/2q1O4I5+PkWDzopjBaK8/hjw iCzB8UZog+m0nJgARIxwzSmKU6wFb7hm9xF32cFHlFL+cJlAjwsYyyxPSwxsK8aqo4po GRP9w+hL+U2kX5amrsLJ3LUoqMoyMHhkcnrI5dF7ssFut3UtVwQ0Jwle3T3S6IP/5kXU 06Yw== X-Gm-Message-State: AOAM531ciifOZMUGiWeR5KYe/y+x70H/bUqcX6Bk9Kz5kSWes4gWWXjh qj5ttTuoAs/EaeBsAOOHVP0OLbkuv4bIhg== X-Google-Smtp-Source: ABdhPJxRLzQOyaoaBvlzZYPVq2Dpgi5LV47hs+iaHJG8/wTyJ7+Ysnbuydn/xIxg/AQ7VuJ7pXbVhQ== X-Received: by 2002:a63:3e0a:0:b0:3aa:646f:f445 with SMTP id l10-20020a633e0a000000b003aa646ff445mr1212226pga.30.1650577170679; Thu, 21 Apr 2022 14:39:30 -0700 (PDT) Received: from octofox.hsd1.ca.comcast.net ([2601:641:401:1d20:df13:3d47:8c92:6576]) by smtp.gmail.com with ESMTPSA id y4-20020a056a00190400b004fac0896e35sm73977pfi.42.2022.04.21.14.39.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 14:39:30 -0700 (PDT) From: Max Filippov To: qemu-devel@nongnu.org Subject: [PATCH 1/6] target/xtensa: use tcg_contatnt_* for numeric literals Date: Thu, 21 Apr 2022 14:39:12 -0700 Message-Id: <20220421213917.368830-2-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220421213917.368830-1-jcmvbkbc@gmail.com> References: <20220421213917.368830-1-jcmvbkbc@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=jcmvbkbc@gmail.com; helo=mail-pg1-x529.google.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 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, FREEMAIL_FROM=0.001, FROM_LOCAL_NOVOWEL=0.5, HK_RANDOM_ENVFROM=0.998, HK_RANDOM_FROM=0.998, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace tcg_const_* for numeric literals with tcg_constant_*. Signed-off-by: Max Filippov Reviewed-by: Richard Henderson --- target/xtensa/translate.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index f4dac27507fd..3379fc1fc774 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -306,16 +306,14 @@ static void gen_right_shift_sar(DisasContext *dc, TCGv_i32 sa) static void gen_left_shift_sar(DisasContext *dc, TCGv_i32 sa) { - TCGv_i32 tmp = tcg_const_i32(32); if (!dc->sar_m32_allocated) { dc->sar_m32 = tcg_temp_local_new_i32(); dc->sar_m32_allocated = true; } tcg_gen_andi_i32(dc->sar_m32, sa, 0x1f); - tcg_gen_sub_i32(cpu_SR[SAR], tmp, dc->sar_m32); + tcg_gen_sub_i32(cpu_SR[SAR], tcg_constant_i32(32), dc->sar_m32); dc->sar_5bit = false; dc->sar_m32_5bit = true; - tcg_temp_free(tmp); } static void gen_exception(DisasContext *dc, int excp) @@ -1957,11 +1955,10 @@ static void translate_mov(DisasContext *dc, const OpcodeArg arg[], static void translate_movcond(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { - TCGv_i32 zero = tcg_const_i32(0); + TCGv_i32 zero = tcg_constant_i32(0); tcg_gen_movcond_i32(par[0], arg[0].out, arg[2].in, zero, arg[1].in, arg[0].in); - tcg_temp_free(zero); } static void translate_movi(DisasContext *dc, const OpcodeArg arg[], @@ -1973,7 +1970,7 @@ static void translate_movi(DisasContext *dc, const OpcodeArg arg[], static void translate_movp(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { - TCGv_i32 zero = tcg_const_i32(0); + TCGv_i32 zero = tcg_constant_i32(0); TCGv_i32 tmp = tcg_temp_new_i32(); tcg_gen_andi_i32(tmp, arg[2].in, 1 << arg[2].imm); @@ -1981,7 +1978,6 @@ static void translate_movp(DisasContext *dc, const OpcodeArg arg[], arg[0].out, tmp, zero, arg[1].in, arg[0].in); tcg_temp_free(tmp); - tcg_temp_free(zero); } static void translate_movsp(DisasContext *dc, const OpcodeArg arg[], @@ -6444,7 +6440,7 @@ static void translate_compare_d(DisasContext *dc, const OpcodeArg arg[], [COMPARE_OLE] = gen_helper_ole_d, [COMPARE_ULE] = gen_helper_ule_d, }; - TCGv_i32 zero = tcg_const_i32(0); + TCGv_i32 zero = tcg_constant_i32(0); TCGv_i32 res = tcg_temp_new_i32(); TCGv_i32 set_br = tcg_temp_new_i32(); TCGv_i32 clr_br = tcg_temp_new_i32(); @@ -6456,7 +6452,6 @@ static void translate_compare_d(DisasContext *dc, const OpcodeArg arg[], tcg_gen_movcond_i32(TCG_COND_NE, arg[0].out, res, zero, set_br, clr_br); - tcg_temp_free(zero); tcg_temp_free(res); tcg_temp_free(set_br); tcg_temp_free(clr_br); @@ -6476,7 +6471,7 @@ static void translate_compare_s(DisasContext *dc, const OpcodeArg arg[], [COMPARE_ULE] = gen_helper_ule_s, }; OpcodeArg arg32[3]; - TCGv_i32 zero = tcg_const_i32(0); + TCGv_i32 zero = tcg_constant_i32(0); TCGv_i32 res = tcg_temp_new_i32(); TCGv_i32 set_br = tcg_temp_new_i32(); TCGv_i32 clr_br = tcg_temp_new_i32(); @@ -6490,7 +6485,6 @@ static void translate_compare_s(DisasContext *dc, const OpcodeArg arg[], arg[0].out, res, zero, set_br, clr_br); put_f32_i2(arg, arg32, 1, 2); - tcg_temp_free(zero); tcg_temp_free(res); tcg_temp_free(set_br); tcg_temp_free(clr_br); @@ -6666,14 +6660,13 @@ static void translate_mov_s(DisasContext *dc, const OpcodeArg arg[], static void translate_movcond_d(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { - TCGv_i64 zero = tcg_const_i64(0); + TCGv_i64 zero = tcg_constant_i64(0); TCGv_i64 arg2 = tcg_temp_new_i64(); tcg_gen_ext_i32_i64(arg2, arg[2].in); tcg_gen_movcond_i64(par[0], arg[0].out, arg2, zero, arg[1].in, arg[0].in); - tcg_temp_free_i64(zero); tcg_temp_free_i64(arg2); } @@ -6681,12 +6674,11 @@ static void translate_movcond_s(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { if (arg[0].num_bits == 32) { - TCGv_i32 zero = tcg_const_i32(0); + TCGv_i32 zero = tcg_constant_i32(0); tcg_gen_movcond_i32(par[0], arg[0].out, arg[2].in, zero, arg[1].in, arg[0].in); - tcg_temp_free(zero); } else { translate_movcond_d(dc, arg, par); } @@ -6695,7 +6687,7 @@ static void translate_movcond_s(DisasContext *dc, const OpcodeArg arg[], static void translate_movp_d(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { - TCGv_i64 zero = tcg_const_i64(0); + TCGv_i64 zero = tcg_constant_i64(0); TCGv_i32 tmp1 = tcg_temp_new_i32(); TCGv_i64 tmp2 = tcg_temp_new_i64(); @@ -6704,7 +6696,6 @@ static void translate_movp_d(DisasContext *dc, const OpcodeArg arg[], tcg_gen_movcond_i64(par[0], arg[0].out, tmp2, zero, arg[1].in, arg[0].in); - tcg_temp_free_i64(zero); tcg_temp_free_i32(tmp1); tcg_temp_free_i64(tmp2); } @@ -6713,7 +6704,7 @@ static void translate_movp_s(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { if (arg[0].num_bits == 32) { - TCGv_i32 zero = tcg_const_i32(0); + TCGv_i32 zero = tcg_constant_i32(0); TCGv_i32 tmp = tcg_temp_new_i32(); tcg_gen_andi_i32(tmp, arg[2].in, 1 << arg[2].imm); @@ -6721,7 +6712,6 @@ static void translate_movp_s(DisasContext *dc, const OpcodeArg arg[], arg[0].out, tmp, zero, arg[1].in, arg[0].in); tcg_temp_free(tmp); - tcg_temp_free(zero); } else { translate_movp_d(dc, arg, par); } From patchwork Thu Apr 21 21:39:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 1620481 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=OBKiG4uK; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KkrZ91dFJz9s0w for ; Fri, 22 Apr 2022 07:40:49 +1000 (AEST) Received: from localhost ([::1]:36678 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nheXe-0005lw-U5 for incoming@patchwork.ozlabs.org; Thu, 21 Apr 2022 17:40:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39800) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nheWU-0005jn-QQ for qemu-devel@nongnu.org; Thu, 21 Apr 2022 17:39:34 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]:36357) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nheWT-00072t-AS for qemu-devel@nongnu.org; Thu, 21 Apr 2022 17:39:34 -0400 Received: by mail-pl1-x632.google.com with SMTP id q3so6614722plg.3 for ; Thu, 21 Apr 2022 14:39:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QtJWgG8v92YkV/RDj3IEQM6swhApoLGHsqChmQQq0cc=; b=OBKiG4uK9rAMl7Ot9Cx6jWnS0Tml/ftLCvVv4r0wXA9jO1ues6LUDZHt5vxfP2oM1f V8RLSaEc5hE0qNtMtssnvZOCV9nuVBYrl18hU1lbE8oisr8N3jAGsSXPZk3x9UViQH1E JSMZoXj3wYAL7xp467aIOY7rC/IbU+YhDWvdBhDOop99c7R2ILbFPtgZCxut4NDjXR9d +YCSn4OtDJT3WupEF9MaHy5z5Mfw/3/52CcmibgTfDTskRJYc7Sq+ZdCA8LE+mZiNepL 0N7rUbe92XQo8+OfEBVOxDuB7tiKlIyZSm5X0XJ0FmSsr/qRY/NEn0Wd5u5hruHOIpAd QEpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QtJWgG8v92YkV/RDj3IEQM6swhApoLGHsqChmQQq0cc=; b=Mx96h3w/xV3rn8ksBwiFVdEH4hibVlGIphKULD2JJ3nPJFM/Uvb3u/3AgX6UK/Q7Ro +BF/9UBrGVx8ckmkrc+cW3S36Y8erj16aKEpOkc6YxwZfMBVIK/x1hBXqEjSYO5Dwqub B6m52DZep52j3jevHYHQxsFiB84X8Y2HVuUY0oNSHCjq4zkRDINt7qa4XYkz5YDWV8k+ TvriiqacRAb+Ox8OfIri+NaaWbY/eyFymzXKy+tvCL/IcYEhnw10OOr5S/WzBugvUXzN MMK0dSH+X+sWivioaNlkvc7ZbOHgUzj4pxbG1+9Q8oOd8X1T9/O6rPrbythDrI84HShB ZAHQ== X-Gm-Message-State: AOAM5315rilsoHwE2YQ3BMFW8BPwSFvxFVoA6CFfyD2c5CiOU2aqqpE4 MXfQeCU4UpC//0F1wyB3jGbKxdii01nB8w== X-Google-Smtp-Source: ABdhPJwYzVUkRqreuOaft1aF+10vYO70dkvyHhWzwF6ICw/nbKqxaWhOngU/YlDsviZ6vU2hXOE5jg== X-Received: by 2002:a17:90b:390f:b0:1d2:853c:5b99 with SMTP id ob15-20020a17090b390f00b001d2853c5b99mr1775803pjb.8.1650577171926; Thu, 21 Apr 2022 14:39:31 -0700 (PDT) Received: from octofox.hsd1.ca.comcast.net ([2601:641:401:1d20:df13:3d47:8c92:6576]) by smtp.gmail.com with ESMTPSA id y4-20020a056a00190400b004fac0896e35sm73977pfi.42.2022.04.21.14.39.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 14:39:31 -0700 (PDT) From: Max Filippov To: qemu-devel@nongnu.org Subject: [PATCH 2/6] target/xtensa: use tcg_constant_* for exceptions Date: Thu, 21 Apr 2022 14:39:13 -0700 Message-Id: <20220421213917.368830-3-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220421213917.368830-1-jcmvbkbc@gmail.com> References: <20220421213917.368830-1-jcmvbkbc@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=jcmvbkbc@gmail.com; helo=mail-pl1-x632.google.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 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, FREEMAIL_FROM=0.001, FROM_LOCAL_NOVOWEL=0.5, HK_RANDOM_ENVFROM=0.998, HK_RANDOM_FROM=0.998, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Exception number, exception cause and debug cause codes are small numbers, use tcg_contant_* for them. Signed-off-by: Max Filippov Reviewed-by: Richard Henderson --- target/xtensa/translate.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 3379fc1fc774..77d2e1303746 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -318,18 +318,14 @@ static void gen_left_shift_sar(DisasContext *dc, TCGv_i32 sa) static void gen_exception(DisasContext *dc, int excp) { - TCGv_i32 tmp = tcg_const_i32(excp); - gen_helper_exception(cpu_env, tmp); - tcg_temp_free(tmp); + gen_helper_exception(cpu_env, tcg_constant_i32(excp)); } static void gen_exception_cause(DisasContext *dc, uint32_t cause) { TCGv_i32 tpc = tcg_const_i32(dc->pc); - TCGv_i32 tcause = tcg_const_i32(cause); - gen_helper_exception_cause(cpu_env, tpc, tcause); + gen_helper_exception_cause(cpu_env, tpc, tcg_constant_i32(cause)); tcg_temp_free(tpc); - tcg_temp_free(tcause); if (cause == ILLEGAL_INSTRUCTION_CAUSE || cause == SYSCALL_CAUSE) { dc->base.is_jmp = DISAS_NORETURN; @@ -339,10 +335,8 @@ static void gen_exception_cause(DisasContext *dc, uint32_t cause) static void gen_debug_exception(DisasContext *dc, uint32_t cause) { TCGv_i32 tpc = tcg_const_i32(dc->pc); - TCGv_i32 tcause = tcg_const_i32(cause); - gen_helper_debug_exception(cpu_env, tpc, tcause); + gen_helper_debug_exception(cpu_env, tpc, tcg_constant_i32(cause)); tcg_temp_free(tpc); - tcg_temp_free(tcause); if (cause & (DEBUGCAUSE_IB | DEBUGCAUSE_BI | DEBUGCAUSE_BN)) { dc->base.is_jmp = DISAS_NORETURN; } From patchwork Thu Apr 21 21:39:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 1620482 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=nc03PdL5; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KkrZ965XDz9sFN for ; Fri, 22 Apr 2022 07:40:49 +1000 (AEST) Received: from localhost ([::1]:36810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nheXf-0005w1-TW for incoming@patchwork.ozlabs.org; Thu, 21 Apr 2022 17:40:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nheWW-0005mz-0Y for qemu-devel@nongnu.org; Thu, 21 Apr 2022 17:39:36 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:43953) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nheWU-000733-HC for qemu-devel@nongnu.org; Thu, 21 Apr 2022 17:39:35 -0400 Received: by mail-pl1-x630.google.com with SMTP id d15so6588710pll.10 for ; Thu, 21 Apr 2022 14:39:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GkOVLKdXxegKlp83Sy1ujnBKWFv4qJCtgt4Rfj9+MPw=; b=nc03PdL52tYfUTR+LCnT1e4b3FEsXqlXbhDg9L0rj4DVSU2ExnaVJbq8N/hdOoFEUb yHTEforn2/3sIXUGl9/kY1qRQ1tAKsrCtFVoDE7EtgU3D0qBeejsadYrV3YjQzkqFKos l4SM20hLF7PpSX4BFm8Y4zb2ti9UqA85CtM/HwmCtlsFOvN2X/dVJi+YsQp8v6d1Hnwi qelKsYsVUYZLkyrGsjBGRgCivkBdKMLo/JKW6MGxyacq7JHOA7I4PDtGxiONpT2Zt+Xf QfE/T1jbLbFsLIjTZX5jXWjm9L3lA9vtQVY/a3nTBhULCY/oWgY2blgVCSV+8dXIcgeR HBKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GkOVLKdXxegKlp83Sy1ujnBKWFv4qJCtgt4Rfj9+MPw=; b=Uaz29TSdT5tizsoan9atQ7kiG2Hlz8NbDqBktNhu7yP0b1EvsdNIX5CpKWwX/WKoFG BIhCl8DTG3Zo13ZxMc4edpITP8O26QkendWFUCPjoaLvtiLwFHbPMql0uB8a8RSJFUoO pzZsuS8ktCPFHDp2/FveoaqtgKOz52STyph1EdTN+K4LYbeehOF5RcYgEnNcoW21lBoA g2m0R+EgCrorV1tP3G4Fimntle24Ql+3ih3dbwi6xItXDkCOi143W3aNMN0nHLk+hJaP tFmCQX9LHeMUkkoH17XGEVSTWyLEwEVsMbmfLTySiJIUxOFY7X10qzDWNPWqNnRlVe56 nElw== X-Gm-Message-State: AOAM532KGqqLlvgLGDiTt7AOP4Ny6VapnQk/XqqDyZBNcofzEkbkTlHw dDYuxhF5y5Q6LkH7GiNFUoPOXmnaVJl91A== X-Google-Smtp-Source: ABdhPJw+vc019jhTwOedNV7PVENnxD8LoOEkzQObfKHsGY3wzWTsXCW9xuZtqfdLbU2k6HdoMd4OYg== X-Received: by 2002:a17:90a:72ce:b0:1cb:6ec7:cd61 with SMTP id l14-20020a17090a72ce00b001cb6ec7cd61mr12718123pjk.213.1650577172817; Thu, 21 Apr 2022 14:39:32 -0700 (PDT) Received: from octofox.hsd1.ca.comcast.net ([2601:641:401:1d20:df13:3d47:8c92:6576]) by smtp.gmail.com with ESMTPSA id y4-20020a056a00190400b004fac0896e35sm73977pfi.42.2022.04.21.14.39.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 14:39:32 -0700 (PDT) From: Max Filippov To: qemu-devel@nongnu.org Subject: [PATCH 3/6] target/xtensa: use tcg_constant_* for TLB opcodes Date: Thu, 21 Apr 2022 14:39:14 -0700 Message-Id: <20220421213917.368830-4-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220421213917.368830-1-jcmvbkbc@gmail.com> References: <20220421213917.368830-1-jcmvbkbc@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=jcmvbkbc@gmail.com; helo=mail-pl1-x630.google.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 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, FREEMAIL_FROM=0.001, FROM_LOCAL_NOVOWEL=0.5, HK_RANDOM_ENVFROM=0.998, HK_RANDOM_FROM=0.998, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" dtlb is a boolean flag, use tcg_constant_* for it. Signed-off-by: Max Filippov Reviewed-by: Richard Henderson --- target/xtensa/translate.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 77d2e1303746..82a0dbf46d7c 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -1710,10 +1710,9 @@ static void translate_itlb(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { #ifndef CONFIG_USER_ONLY - TCGv_i32 dtlb = tcg_const_i32(par[0]); + TCGv_i32 dtlb = tcg_constant_i32(par[0]); gen_helper_itlb(cpu_env, arg[0].in, dtlb); - tcg_temp_free(dtlb); #endif } @@ -2050,11 +2049,10 @@ static void translate_ptlb(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { #ifndef CONFIG_USER_ONLY - TCGv_i32 dtlb = tcg_const_i32(par[0]); + TCGv_i32 dtlb = tcg_constant_i32(par[0]); tcg_gen_movi_i32(cpu_pc, dc->pc); gen_helper_ptlb(arg[0].out, cpu_env, arg[1].in, dtlb); - tcg_temp_free(dtlb); #endif } @@ -2253,10 +2251,9 @@ static void translate_rtlb(DisasContext *dc, const OpcodeArg arg[], gen_helper_rtlb0, gen_helper_rtlb1, }; - TCGv_i32 dtlb = tcg_const_i32(par[0]); + TCGv_i32 dtlb = tcg_constant_i32(par[0]); helper[par[1]](arg[0].out, cpu_env, arg[1].in, dtlb); - tcg_temp_free(dtlb); #endif } @@ -2564,10 +2561,9 @@ static void translate_wtlb(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { #ifndef CONFIG_USER_ONLY - TCGv_i32 dtlb = tcg_const_i32(par[0]); + TCGv_i32 dtlb = tcg_constant_i32(par[0]); gen_helper_wtlb(cpu_env, arg[0].in, arg[1].in, dtlb); - tcg_temp_free(dtlb); #endif } From patchwork Thu Apr 21 21:39:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 1620487 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=CQQuIRIx; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kkrf006Plz9s0w for ; Fri, 22 Apr 2022 07:44:06 +1000 (AEST) Received: from localhost ([::1]:47396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nheap-00068Z-KJ for incoming@patchwork.ozlabs.org; Thu, 21 Apr 2022 17:44:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39828) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nheWW-0005r8-V2 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 17:39:38 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:40561) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nheWV-00073G-FT for qemu-devel@nongnu.org; Thu, 21 Apr 2022 17:39:36 -0400 Received: by mail-pf1-x42b.google.com with SMTP id i24so6158054pfa.7 for ; Thu, 21 Apr 2022 14:39:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=D4/QWtXWUGL6bGLYMAeUnisR9BYGfOC4zsLjYQrXeY8=; b=CQQuIRIxGhBn1Od8BfeBqHg+4UGk5wvSgChpODe3xQ39N8RS7QjmoWs7i2ULvXJUUP L4G4Z1mVj4PGcsbSW0GI5iYJH5M4jHZes3/FjY1cvxVEYKb34rGvtLYTJcc5rftdxISC ml50WUUaXaqsKhCukXLsq2KWwJJbIBNJStZMqagR4Kir15HS6E5JB9GnGQVozftQ1Pu9 GpmCaDwsUr9IuLfWJoudRDGffheBDql+bK486ktrsFy9PtR07fxZ6pJ9T/UKul8pIT+g LG2i+7HIjwFhpMhn8CafwfVRcffJoBwRqPHt2MPNT446RHFMEuiVpRueTD5ocmIT4f+M vVXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=D4/QWtXWUGL6bGLYMAeUnisR9BYGfOC4zsLjYQrXeY8=; b=b6nXEFOUcgeamjNdfyQQn9SMRZG8si/HwpYG5z6FetjbL7wEaXqRnZnt3ABML++XJQ Q2HEChjFNtoqXZpw3sfrkQPjmcbB0+XqUeuVIPEVcXTpm8wG69TJtj/5WT17xMMGXzkN xzXWQiG/+Vyuh3CWY6xnQKIv+9nhbH0WtB/8wPUAAFQvVDXk0J5K3WpBmkLdtAPWtM9C RPvCGHyrAHQnHvrav5gllYtJ6qxiE1eD3TCjvEpn9HgGj/WI5tkudt1YQqVVHbK3L6tK ZPG47lZ/4lc6l6bbLwxbgXS7am+/x1Fy0XNPIF4wT0P8W7nFDuCMJo8BaMDiNnGnpgoj VKjQ== X-Gm-Message-State: AOAM5320LCeYZtk6kUmj9glKCmUCjuLErTN9Ty+ReD0SuIlvbVhJcFKk pPH/0eicdDEeF5avWkvSZWIG7DN2D8TgmQ== X-Google-Smtp-Source: ABdhPJxrv23of5FM+8LeXBR+MUCjgGj2jltCKcggN02jy39/FolSFCY3ab5PfP9queUG2QHAhYvBew== X-Received: by 2002:a63:503:0:b0:3aa:63e6:d1f7 with SMTP id 3-20020a630503000000b003aa63e6d1f7mr1182103pgf.387.1650577174105; Thu, 21 Apr 2022 14:39:34 -0700 (PDT) Received: from octofox.hsd1.ca.comcast.net ([2601:641:401:1d20:df13:3d47:8c92:6576]) by smtp.gmail.com with ESMTPSA id y4-20020a056a00190400b004fac0896e35sm73977pfi.42.2022.04.21.14.39.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 14:39:33 -0700 (PDT) From: Max Filippov To: qemu-devel@nongnu.org Subject: [PATCH 4/6] target/xtensa: use tcg_constant_* for numbered special registers Date: Thu, 21 Apr 2022 14:39:15 -0700 Message-Id: <20220421213917.368830-5-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220421213917.368830-1-jcmvbkbc@gmail.com> References: <20220421213917.368830-1-jcmvbkbc@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=jcmvbkbc@gmail.com; helo=mail-pf1-x42b.google.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 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, FREEMAIL_FROM=0.001, FROM_LOCAL_NOVOWEL=0.5, HK_RANDOM_ENVFROM=0.998, HK_RANDOM_FROM=0.998, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Numbered special registers are small arrays of consecutive SRs. Use tcg_constant_* for the SR index. Signed-off-by: Max Filippov Reviewed-by: Richard Henderson --- target/xtensa/translate.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 82a0dbf46d7c..c4991735ead7 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -2615,15 +2615,13 @@ static void translate_wsr_ccompare(DisasContext *dc, const OpcodeArg arg[], { #ifndef CONFIG_USER_ONLY uint32_t id = par[0] - CCOMPARE; - TCGv_i32 tmp = tcg_const_i32(id); assert(id < dc->config->nccompare); if (tb_cflags(dc->base.tb) & CF_USE_ICOUNT) { gen_io_start(); } tcg_gen_mov_i32(cpu_SR[par[0]], arg[0].in); - gen_helper_update_ccompare(cpu_env, tmp); - tcg_temp_free(tmp); + gen_helper_update_ccompare(cpu_env, tcg_constant_i32(id)); #endif } @@ -2643,11 +2641,9 @@ static void translate_wsr_dbreaka(DisasContext *dc, const OpcodeArg arg[], { #ifndef CONFIG_USER_ONLY unsigned id = par[0] - DBREAKA; - TCGv_i32 tmp = tcg_const_i32(id); assert(id < dc->config->ndbreak); - gen_helper_wsr_dbreaka(cpu_env, tmp, arg[0].in); - tcg_temp_free(tmp); + gen_helper_wsr_dbreaka(cpu_env, tcg_constant_i32(id), arg[0].in); #endif } @@ -2656,11 +2652,9 @@ static void translate_wsr_dbreakc(DisasContext *dc, const OpcodeArg arg[], { #ifndef CONFIG_USER_ONLY unsigned id = par[0] - DBREAKC; - TCGv_i32 tmp = tcg_const_i32(id); assert(id < dc->config->ndbreak); - gen_helper_wsr_dbreakc(cpu_env, tmp, arg[0].in); - tcg_temp_free(tmp); + gen_helper_wsr_dbreakc(cpu_env, tcg_constant_i32(id), arg[0].in); #endif } @@ -2669,11 +2663,9 @@ static void translate_wsr_ibreaka(DisasContext *dc, const OpcodeArg arg[], { #ifndef CONFIG_USER_ONLY unsigned id = par[0] - IBREAKA; - TCGv_i32 tmp = tcg_const_i32(id); assert(id < dc->config->nibreak); - gen_helper_wsr_ibreaka(cpu_env, tmp, arg[0].in); - tcg_temp_free(tmp); + gen_helper_wsr_ibreaka(cpu_env, tcg_constant_i32(id), arg[0].in); #endif } From patchwork Thu Apr 21 21:39:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 1620485 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=CBlkgWSb; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KkrcY6DMyz9s0w for ; Fri, 22 Apr 2022 07:42:53 +1000 (AEST) Received: from localhost ([::1]:43404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nheZf-0002z6-UN for incoming@patchwork.ozlabs.org; Thu, 21 Apr 2022 17:42:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nheWY-0005sa-Su for qemu-devel@nongnu.org; Thu, 21 Apr 2022 17:39:38 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]:47033) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nheWW-00073T-M3 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 17:39:38 -0400 Received: by mail-pl1-x62f.google.com with SMTP id q1so5423062plx.13 for ; Thu, 21 Apr 2022 14:39:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jDyJgvNM0c5Urpik9yfZ6F1Cx1+upvgUQ/VZpYWE2kQ=; b=CBlkgWSbOwdvvy8Zy+h25WGJKjRLPzRXjixsa6JnCZJmO4mHCqpaUi50b1Wr9uUI1l 6hASGVOYoXEGr/8Bss5QB/u01TlRRsNnG553B44cDCjy0Peh7JhAgvivhcMxvIWQavzO ZcToud80FYQqpncJefy3r1EKHg1hgaLfGgkBVpPaa8/rMIeiylDlnHbOsvfLqid6bGdc ACnCqcdxhlLQhGYcpixtg8gbijuXK7c4vXvaa39Uije46TSdQ6yLoXxjgS2s4kREqPgO tSgked9CjUZ1ETUTUsUModX61rU69rY9m7vBro1NsMdeagiK/WhdZxkoByoY0POHNMyF OrSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jDyJgvNM0c5Urpik9yfZ6F1Cx1+upvgUQ/VZpYWE2kQ=; b=BJs80M5jcBb+fIISLYr42rl5wFbTUIIYSv98TGSdWryAz30Xfx8JPNMz3s3EySRXyo rPIT6iMlYoEJ1UlwRJ6SKK6G564TxRkkQGwjAoWq9i748y8zRM33wAi4TALtIdR4KFuh WA2nTKfFEWMa1O9F+DnCi958RipOMG/fOFcVdb9a2uYQ6T4LI6MPTY0YsBWcjZbM6y+m cjR4rsTslxJ6ZhZn0wOBeGPpVj4P3vqH4uKlcWRwGLwUn6dUHIf8tkHFMW6B7Cw8Xi/k BLBb2AvTPIOo50mz3nvUrW7Fkzc/V1euMUkYZ9LNVtl37toQkqZiwp4g6Jm4lBXLz9EW 6nMg== X-Gm-Message-State: AOAM530HoltAxl4vWys4N0usrU7+Xz268TubphGnTU3FzpK5clX/oNCZ mJByGdVRvx2L8ji3l/7CEXXtHaL5SL9zuQ== X-Google-Smtp-Source: ABdhPJwmWBE9H5P04DRkgSIgogxqJ5wxFZ/tQLp1aA80CfHcE+SNQc0xLEeUUu0TZ/YMh4gIG6l2fQ== X-Received: by 2002:a17:902:e541:b0:159:db95:9d30 with SMTP id n1-20020a170902e54100b00159db959d30mr1402433plf.91.1650577175263; Thu, 21 Apr 2022 14:39:35 -0700 (PDT) Received: from octofox.hsd1.ca.comcast.net ([2601:641:401:1d20:df13:3d47:8c92:6576]) by smtp.gmail.com with ESMTPSA id y4-20020a056a00190400b004fac0896e35sm73977pfi.42.2022.04.21.14.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 14:39:34 -0700 (PDT) From: Max Filippov To: qemu-devel@nongnu.org Subject: [PATCH 5/6] target/xtensa: use tcg_constant_* for FPU conversion opcodes Date: Thu, 21 Apr 2022 14:39:16 -0700 Message-Id: <20220421213917.368830-6-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220421213917.368830-1-jcmvbkbc@gmail.com> References: <20220421213917.368830-1-jcmvbkbc@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=jcmvbkbc@gmail.com; helo=mail-pl1-x62f.google.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 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, FREEMAIL_FROM=0.001, FROM_LOCAL_NOVOWEL=0.5, HK_RANDOM_ENVFROM=0.998, HK_RANDOM_FROM=0.998, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" FPU conversion opcodes pass scale (range 0..15) and rounding mode to their helpers. Use tcg_constant_* for them. Signed-off-by: Max Filippov Reviewed-by: Richard Henderson --- target/xtensa/translate.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index c4991735ead7..fb4d80669c47 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -6515,20 +6515,19 @@ static void translate_const_s(DisasContext *dc, const OpcodeArg arg[], static void translate_float_d(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { - TCGv_i32 scale = tcg_const_i32(-arg[2].imm); + TCGv_i32 scale = tcg_constant_i32(-arg[2].imm); if (par[0]) { gen_helper_uitof_d(arg[0].out, cpu_env, arg[1].in, scale); } else { gen_helper_itof_d(arg[0].out, cpu_env, arg[1].in, scale); } - tcg_temp_free(scale); } static void translate_float_s(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { - TCGv_i32 scale = tcg_const_i32(-arg[2].imm); + TCGv_i32 scale = tcg_constant_i32(-arg[2].imm); OpcodeArg arg32[1]; get_f32_o1(arg, arg32, 0); @@ -6538,14 +6537,13 @@ static void translate_float_s(DisasContext *dc, const OpcodeArg arg[], gen_helper_itof_s(arg32[0].out, cpu_env, arg[1].in, scale); } put_f32_o1(arg, arg32, 0); - tcg_temp_free(scale); } static void translate_ftoi_d(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { - TCGv_i32 rounding_mode = tcg_const_i32(par[0]); - TCGv_i32 scale = tcg_const_i32(arg[2].imm); + TCGv_i32 rounding_mode = tcg_constant_i32(par[0]); + TCGv_i32 scale = tcg_constant_i32(arg[2].imm); if (par[1]) { gen_helper_ftoui_d(arg[0].out, cpu_env, arg[1].in, @@ -6554,15 +6552,13 @@ static void translate_ftoi_d(DisasContext *dc, const OpcodeArg arg[], gen_helper_ftoi_d(arg[0].out, cpu_env, arg[1].in, rounding_mode, scale); } - tcg_temp_free(rounding_mode); - tcg_temp_free(scale); } static void translate_ftoi_s(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { - TCGv_i32 rounding_mode = tcg_const_i32(par[0]); - TCGv_i32 scale = tcg_const_i32(arg[2].imm); + TCGv_i32 rounding_mode = tcg_constant_i32(par[0]); + TCGv_i32 scale = tcg_constant_i32(arg[2].imm); OpcodeArg arg32[2]; get_f32_i1(arg, arg32, 1); @@ -6574,8 +6570,6 @@ static void translate_ftoi_s(DisasContext *dc, const OpcodeArg arg[], rounding_mode, scale); } put_f32_i1(arg, arg32, 1); - tcg_temp_free(rounding_mode); - tcg_temp_free(scale); } static void translate_ldsti(DisasContext *dc, const OpcodeArg arg[], From patchwork Thu Apr 21 21:39:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 1620488 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=qGcO6W4F; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kkrf92kggz9s0w for ; Fri, 22 Apr 2022 07:44:17 +1000 (AEST) Received: from localhost ([::1]:47792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nheb1-0006PU-F3 for incoming@patchwork.ozlabs.org; Thu, 21 Apr 2022 17:44:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nheWa-0005uH-5T for qemu-devel@nongnu.org; Thu, 21 Apr 2022 17:39:40 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:43948) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nheWY-00073h-JN for qemu-devel@nongnu.org; Thu, 21 Apr 2022 17:39:39 -0400 Received: by mail-pl1-x62a.google.com with SMTP id d15so6588944pll.10 for ; Thu, 21 Apr 2022 14:39:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GOAh0XZ349iUnYzRrlljpuqmWYAueRiNiXJQDTtsGOo=; b=qGcO6W4F6eM0Ur3I45fHHIwH35u+iK+Isg/WpJoUlnKjdrNmrLhI7TgeNFfmCAAMSo QxoGWYMpqN0jOq0robokosASe0Zw/WWgTqkeyscpHiFvZf9vyuSKG+pL0y9XFdw6U7b5 AVtKDIULMoZ8gy4Hd8aIYS8nn6FgtOVRzxczo08qttq5af6aRTZqmrlLWc7BmPwEo8Zx nd0h7HuOOJ2RV2d/ZNQg1vDhYn/Dm+Gu9p5K5U9tjBKgSUso6az1DbzfYURpI3DQ/5sW 7UYr5Ed1seycX7yhJI7egtK+HYaLYHHskEEfpqSgnVud1WCZBAoAew9IwcQswMtoe120 ZtPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GOAh0XZ349iUnYzRrlljpuqmWYAueRiNiXJQDTtsGOo=; b=iGnEyfdMWkYwcyg55sgEPDKtlBRTYcsbfRaRbc0BTqHoHLzjODxvTMPetXNWrlj9+S V4Et9uT9LzrNK3hhAVsIh31DW4uxBVfGh8mbIRfSGFGiYcCJ+ZPGoFvOxCIf5CyYabyv scHaieI7rSpYw5qpOBaRC871pJFWodX0DwdcRSwlDGxmYr8ohvBWEQO4mHRmrGSexyVJ WInzn1+qpPw35vYAfJ3T1/bvunT9YXA5Sfem93Lvd8UHPgvQDSay+nV3zHAsZ/vaRLtP dm4I7TIq+PLPDwBERAXdNXYrQ9OaJxrVs4Wfs3qRiwxgt/x7OnQSFviQuAJ4tYUXgIzQ nhaA== X-Gm-Message-State: AOAM532UX8lrehLC2mjXRGibakqlVPfmFPZiPSFweGOhf8nFOwpXLyCG ZZbnyNCg65gjNqVSVJpgyMN6rANLXm9QxA== X-Google-Smtp-Source: ABdhPJzIAWJog0UHmyVrx6pmgns+m3VWV3jCH6Si9YRy6sFUgyjyvTQxSjoH+KT9qefTj52Hkw4X/w== X-Received: by 2002:a17:902:b710:b0:156:47a6:c575 with SMTP id d16-20020a170902b71000b0015647a6c575mr1174014pls.37.1650577176453; Thu, 21 Apr 2022 14:39:36 -0700 (PDT) Received: from octofox.hsd1.ca.comcast.net ([2601:641:401:1d20:df13:3d47:8c92:6576]) by smtp.gmail.com with ESMTPSA id y4-20020a056a00190400b004fac0896e35sm73977pfi.42.2022.04.21.14.39.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 14:39:35 -0700 (PDT) From: Max Filippov To: qemu-devel@nongnu.org Subject: [PATCH 6/6] target/xtensa: use tcg_constant_* for remaining opcodes Date: Thu, 21 Apr 2022 14:39:17 -0700 Message-Id: <20220421213917.368830-7-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220421213917.368830-1-jcmvbkbc@gmail.com> References: <20220421213917.368830-1-jcmvbkbc@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=jcmvbkbc@gmail.com; helo=mail-pl1-x62a.google.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 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, FREEMAIL_FROM=0.001, FROM_LOCAL_NOVOWEL=0.5, HK_RANDOM_ENVFROM=0.998, HK_RANDOM_FROM=0.998, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" - gen_brcondi passes immediate field (less than 32 different possible values) to the helper; - gen_callw_slot uses callinc (1..3); - translate_entry passes stack register number (0..15) to the helper; - gen_check_exclusive passes boolean to the helper; - translate_ssai passes immediate shift amount (0..31) to the helper; - gen_waiti passes immediate (0..15) to the helper; use tcg_constant_* for the constants listed above. Fold gen_waiti body into the translate_waiti as it's the only user. Signed-off-by: Max Filippov Reviewed-by: Richard Henderson --- target/xtensa/translate.c | 44 ++++++++++++--------------------------- 1 file changed, 13 insertions(+), 31 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index fb4d80669c47..b3f8348dee26 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -406,11 +406,8 @@ static void gen_jumpi(DisasContext *dc, uint32_t dest, int slot) static void gen_callw_slot(DisasContext *dc, int callinc, TCGv_i32 dest, int slot) { - TCGv_i32 tcallinc = tcg_const_i32(callinc); - tcg_gen_deposit_i32(cpu_SR[PS], cpu_SR[PS], - tcallinc, PS_CALLINC_SHIFT, PS_CALLINC_LEN); - tcg_temp_free(tcallinc); + tcg_constant_i32(callinc), PS_CALLINC_SHIFT, PS_CALLINC_LEN); tcg_gen_movi_i32(cpu_R[callinc << 2], (callinc << 30) | (dc->base.pc_next & 0x3fffffff)); gen_jump_slot(dc, dest, slot); @@ -456,9 +453,7 @@ static void gen_brcond(DisasContext *dc, TCGCond cond, static void gen_brcondi(DisasContext *dc, TCGCond cond, TCGv_i32 t0, uint32_t t1, uint32_t addr) { - TCGv_i32 tmp = tcg_const_i32(t1); - gen_brcond(dc, cond, t0, tmp, addr); - tcg_temp_free(tmp); + gen_brcond(dc, cond, t0, tcg_constant_i32(t1), addr); } static uint32_t test_exceptions_sr(DisasContext *dc, const OpcodeArg arg[], @@ -543,21 +538,6 @@ static MemOp gen_load_store_alignment(DisasContext *dc, MemOp mop, return mop; } -#ifndef CONFIG_USER_ONLY -static void gen_waiti(DisasContext *dc, uint32_t imm4) -{ - TCGv_i32 pc = tcg_const_i32(dc->base.pc_next); - TCGv_i32 intlevel = tcg_const_i32(imm4); - - if (tb_cflags(dc->base.tb) & CF_USE_ICOUNT) { - gen_io_start(); - } - gen_helper_waiti(cpu_env, pc, intlevel); - tcg_temp_free(pc); - tcg_temp_free(intlevel); -} -#endif - static bool gen_window_check(DisasContext *dc, uint32_t mask) { unsigned r = 31 - clz32(mask); @@ -1663,11 +1643,10 @@ static void translate_entry(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { TCGv_i32 pc = tcg_const_i32(dc->pc); - TCGv_i32 s = tcg_const_i32(arg[0].imm); + TCGv_i32 s = tcg_constant_i32(arg[0].imm); TCGv_i32 imm = tcg_const_i32(arg[1].imm); gen_helper_entry(cpu_env, pc, s, imm); tcg_temp_free(imm); - tcg_temp_free(s); tcg_temp_free(pc); } @@ -1749,11 +1728,10 @@ static void gen_check_exclusive(DisasContext *dc, TCGv_i32 addr, bool is_write) { if (!option_enabled(dc, XTENSA_OPTION_MPU)) { TCGv_i32 tpc = tcg_const_i32(dc->pc); - TCGv_i32 write = tcg_const_i32(is_write); - gen_helper_check_exclusive(cpu_env, tpc, addr, write); + gen_helper_check_exclusive(cpu_env, tpc, addr, + tcg_constant_i32(is_write)); tcg_temp_free(tpc); - tcg_temp_free(write); } } #endif @@ -2517,9 +2495,7 @@ static void translate_ssa8l(DisasContext *dc, const OpcodeArg arg[], static void translate_ssai(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { - TCGv_i32 tmp = tcg_const_i32(arg[0].imm); - gen_right_shift_sar(dc, tmp); - tcg_temp_free(tmp); + gen_right_shift_sar(dc, tcg_constant_i32(arg[0].imm)); } static void translate_ssl(DisasContext *dc, const OpcodeArg arg[], @@ -2553,7 +2529,13 @@ static void translate_waiti(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { #ifndef CONFIG_USER_ONLY - gen_waiti(dc, arg[0].imm); + TCGv_i32 pc = tcg_const_i32(dc->base.pc_next); + + if (tb_cflags(dc->base.tb) & CF_USE_ICOUNT) { + gen_io_start(); + } + gen_helper_waiti(cpu_env, pc, tcg_constant_i32(arg[0].imm)); + tcg_temp_free(pc); #endif }