From patchwork Tue Aug 22 07:13:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 715690 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp118531wrp; Tue, 22 Aug 2023 00:14:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHn9TvyT5dccMu6jpHzgQL+SzDBNDY8Gtw5nNFyRTKxHejOuvJlONG+MY6iDilpVUxJAaqI X-Received: by 2002:a05:622a:15c5:b0:410:7ba7:3820 with SMTP id d5-20020a05622a15c500b004107ba73820mr10627752qty.13.1692688488063; Tue, 22 Aug 2023 00:14:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692688488; cv=none; d=google.com; s=arc-20160816; b=n/GHJbbF9yvaEw3Poin90YHORJlCoE1fqgW2FRcuQsv1NtwGPQRdzNSosXeGT6S93t 7GT8/uTMznDi1Sd0PAfxyqdn+Jt81K0gbl4mWoQ8eop5r7ZecA9VlraZhShlZKuzqu/r WLhar4IQlOIYvXuD59qgw1x0IQNzzCv/SF8AaG3qhIbBvpH2lg7ueuq65+4aAPbFePvb wV/BpYfJCxF1VC7KRoQA4jzQ40/kD4qjdMDpDH3WfIi2goLrE13Y0p/vBUuxac3iMmsV WqmxZDkyHD7go9r3oYW5/870bVJbifXBx8HF6FfkjVFH+HbfnWTz3NUaPYr0r7eXL1t3 IcWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=js7oG4DiRv1a4biKMcFP1KhLlrjkX0Ffo4ofKONC+vY=; fh=4esUdvAEMIazVUYz2fOQGDzgzc22eZT4lgTXTia56sI=; b=pRoc0Ox5yBzyBykbLUk5Xs0YdpiDxOTGX/zVVmeCOx999fvgxcSNZSaW97RdKLhga5 P6hNF9fdVahG6ByRhvzWneKty97zae68q8VG0WazSvXY7lEGzB0Q/09X/DIYM7SZvJBw 8Q69xNUmMukLGFhMj/zjDM+rugrxJOZaa3D0KYnykJbcYn0H/17DoTLO07+hgjtrVC+m B05NfSxgmE+bgGLH/v5MV9+Wl4rzUtSNqVHWrTKKmA1oTWttvlvQC8WVeGlY4QociK1o lXck6f0RgK6Tr4KSryh3xqYENIH1y8IsiZ8JyMIYqqzY5EoqQz1L9taaKqseFIpa5oCW MEew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IVyed04y; 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 p6-20020a05622a13c600b00403fe965af8si3445215qtk.33.2023.08.22.00.14.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 00:14:48 -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=IVyed04y; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYLan-0008Md-6R; Tue, 22 Aug 2023 03:14:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYLam-0008MV-0I for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:14:20 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYLai-0002pb-Jl for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:14:19 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-31adc5c899fso3886373f8f.2 for ; Tue, 22 Aug 2023 00:14:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692688455; x=1693293255; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=js7oG4DiRv1a4biKMcFP1KhLlrjkX0Ffo4ofKONC+vY=; b=IVyed04yOf53m/KTlRhA6/Mq0qXTxSpKsYKJ+1ffnhX8lPIjeMgXzrlkYHxgyBK4Su bqODQ0fDD6Vhjy3WPcFEK10iC4q727VsklbEdzCHdoKkhuMTO/rkilVuy7ueDAoN/MUT PcoPifHZv42/Otzx0PSom3hdGvTgtlijBV7hb28YMPdieKaOwZfCmsyQecibSrxb2YDu 2890Hb5Tw/eYCROdvzOpxec/Yhy3SX1YnY2AIcNMp6GkFzIpymNoYyCB6nHPV26khCrD C2HKP5duM/Gb4D0bTmtTQJj6yTb6nlusBnc5hVqTSSTEBrDep3n1oW9zhnDPayMDzVAi XYWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692688455; x=1693293255; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=js7oG4DiRv1a4biKMcFP1KhLlrjkX0Ffo4ofKONC+vY=; b=B2YqeNv4SgkQKPAbiUtKdVv54tT8P6aGCyD6P+0UzEDackm79kgfHyZteq3OPsfve5 y4RPmpZBKIpKqaX8dCghgjprXYxdEMG3LhsI7+mzW4ncyNMVcZY0SvoDednvh21hOHv3 1rIURi0yF6u+gY7Gsqv5R1KwkrXiGXba3YyjvUY8/TONyYkciWB8CO6MAtlSr4hWjRr1 oQile9Gt0J28XE5I5W6ItazQEMipO7bC0PJCbWGiJqDrxnhJrdCbvRRRKtDFQo9AvFpR GZkSHRiM++e3mNUpsbCPafaNHkmv2RpzkZdFUQQE/iNuIy3RO8SXCx7Kk++v4AezatGo uoMw== X-Gm-Message-State: AOJu0YxJt4lgvLht8d8am6p2bDg+ydnuoP8zBQWyJPAU24D51md0gz7D 8dVWLvfIKXj0G1BB1LXtNfVvHthf1xVj81gj943GVw== X-Received: by 2002:a5d:5242:0:b0:317:5351:e428 with SMTP id k2-20020a5d5242000000b003175351e428mr6798342wrc.4.1692688454951; Tue, 22 Aug 2023 00:14:14 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id c10-20020adffb4a000000b00317a29af4b2sm14740574wrs.68.2023.08.22.00.14.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 00:14:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Song Gao Cc: Xiaojuan Yang , Huacai Chen , Jiajie Chen , Richard Henderson Subject: [PATCH RESEND v5 01/19] target/loongarch: Support LoongArch32 TLB entry Date: Tue, 22 Aug 2023 09:13:47 +0200 Message-ID: <20230822071405.35386-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822071405.35386-1-philmd@linaro.org> References: <20230822071405.35386-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Jiajie Chen The TLB entry of LA32 lacks NR, NX and RPLV and they are hardwired to zero in LoongArch32. Signed-off-by: Jiajie Chen Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-ID: <20230822032724.1353391-2-gaosong@loongson.cn> --- target/loongarch/cpu-csr.h | 9 +++++---- target/loongarch/tlb_helper.c | 17 ++++++++++++----- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/target/loongarch/cpu-csr.h b/target/loongarch/cpu-csr.h index f8f24032cb..48ed2e0632 100644 --- a/target/loongarch/cpu-csr.h +++ b/target/loongarch/cpu-csr.h @@ -66,10 +66,11 @@ FIELD(TLBENTRY, D, 1, 1) FIELD(TLBENTRY, PLV, 2, 2) FIELD(TLBENTRY, MAT, 4, 2) FIELD(TLBENTRY, G, 6, 1) -FIELD(TLBENTRY, PPN, 12, 36) -FIELD(TLBENTRY, NR, 61, 1) -FIELD(TLBENTRY, NX, 62, 1) -FIELD(TLBENTRY, RPLV, 63, 1) +FIELD(TLBENTRY_32, PPN, 8, 24) +FIELD(TLBENTRY_64, PPN, 12, 36) +FIELD(TLBENTRY_64, NR, 61, 1) +FIELD(TLBENTRY_64, NX, 62, 1) +FIELD(TLBENTRY_64, RPLV, 63, 1) #define LOONGARCH_CSR_ASID 0x18 /* Address space identifier */ FIELD(CSR_ASID, ASID, 0, 10) diff --git a/target/loongarch/tlb_helper.c b/target/loongarch/tlb_helper.c index 6e00190547..cef10e2257 100644 --- a/target/loongarch/tlb_helper.c +++ b/target/loongarch/tlb_helper.c @@ -48,10 +48,17 @@ static int loongarch_map_tlb_entry(CPULoongArchState *env, hwaddr *physical, tlb_v = FIELD_EX64(tlb_entry, TLBENTRY, V); tlb_d = FIELD_EX64(tlb_entry, TLBENTRY, D); tlb_plv = FIELD_EX64(tlb_entry, TLBENTRY, PLV); - tlb_ppn = FIELD_EX64(tlb_entry, TLBENTRY, PPN); - tlb_nx = FIELD_EX64(tlb_entry, TLBENTRY, NX); - tlb_nr = FIELD_EX64(tlb_entry, TLBENTRY, NR); - tlb_rplv = FIELD_EX64(tlb_entry, TLBENTRY, RPLV); + if (is_la64(env)) { + tlb_ppn = FIELD_EX64(tlb_entry, TLBENTRY_64, PPN); + tlb_nx = FIELD_EX64(tlb_entry, TLBENTRY_64, NX); + tlb_nr = FIELD_EX64(tlb_entry, TLBENTRY_64, NR); + tlb_rplv = FIELD_EX64(tlb_entry, TLBENTRY_64, RPLV); + } else { + tlb_ppn = FIELD_EX64(tlb_entry, TLBENTRY_32, PPN); + tlb_nx = 0; + tlb_nr = 0; + tlb_rplv = 0; + } /* Check access rights */ if (!tlb_v) { @@ -79,7 +86,7 @@ static int loongarch_map_tlb_entry(CPULoongArchState *env, hwaddr *physical, * tlb_entry contains ppn[47:12] while 16KiB ppn is [47:15] * need adjust. */ - *physical = (tlb_ppn << R_TLBENTRY_PPN_SHIFT) | + *physical = (tlb_ppn << R_TLBENTRY_64_PPN_SHIFT) | (address & MAKE_64BIT_MASK(0, tlb_ps)); *prot = PAGE_READ; if (tlb_d) { From patchwork Tue Aug 22 07:13:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 715689 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp118456wrp; Tue, 22 Aug 2023 00:14:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGMVa+Fj3ckZTeqfAMwofxKK0T0P4AO96/XUfZ8Z57Ha0FmYConaEhaaeixuaccTS3tUjsu X-Received: by 2002:a1f:edc4:0:b0:48d:c08:3e99 with SMTP id l187-20020a1fedc4000000b0048d0c083e99mr3568373vkh.4.1692688474743; Tue, 22 Aug 2023 00:14:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692688474; cv=none; d=google.com; s=arc-20160816; b=GhWpQFtSGnOuiNgYifQepbqLQLKYP/8/pRUteUwDlAGX+79RY5w+tutS5pOMkDTsEJ DjIBcEoYyLbhdsh8BGaSWGVacaHQnLCZb/nTCAm+jheTM5BZ6UJAxhnEyBmI1Rsw5K+F NxBSk9PjB6Oo+DIB5AvK/yz24pY2RSXZYwi6YRz3zBg2poOEvjN+Q7B/VqgFnR1A9mXi hyuY1BSH7BOMCmWu6/ZFnaWPyj9uyzB+Xc+vIS43mXlIgzYqLr3y9Pjedw6nQlMuSVjx Fsbp9PtiKVBAbkXpmuegf+pjLIZ3ba8rWvjWz+WXPVTD+I+67Xf0N66Gi1sfFdFYJ2Qu DbBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=zxHqKmOyuuNOftyTGwcwCJthKGUr1Tn3UywBr6PkJwE=; fh=4esUdvAEMIazVUYz2fOQGDzgzc22eZT4lgTXTia56sI=; b=gb/CeVg4FuftbPKyES+fMOZuyP+wNRrLQHJMKhbob9gtMVvj4v3tdWdKjpuTPoDjDl Q5IOrfDFYHo+r3LBdo2OBpRcK+q3zM8YEv1L5cJHRoJf3P/jGeM9PlmxtZui52H279+Q czT8aU+q/Kcc7EJa2aYBmW6UuOjbjDfYl2CJg8dic9gEhYJNTfWQB4+1gAnSVfEcuy20 xcfj3oUNYcvW4BteW7hxJmMqq7RRhDCGE0gtD3MP5SbC18DymRebQ3VmgAkW5X5XueH0 Yj3kan+qVC3M5KVcqEYd8iq36HeqXme3w7QIuioKmJchKq56hJVjS5RIOjrywEZ8qqHa lvaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wq4l8SWS; 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 t21-20020a05622a01d500b0040556bb3b65si5700514qtw.674.2023.08.22.00.14.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 00:14:34 -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=wq4l8SWS; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYLas-0008NA-VR; Tue, 22 Aug 2023 03:14:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYLar-0008N1-0l for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:14:25 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYLao-0002qG-QP for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:14:24 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-317c3ac7339so3653907f8f.0 for ; Tue, 22 Aug 2023 00:14:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692688461; x=1693293261; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zxHqKmOyuuNOftyTGwcwCJthKGUr1Tn3UywBr6PkJwE=; b=wq4l8SWSJCljirT1dgf1kQSIrA9fazN37wng3NeXxpInwqnEB94N6tAkrFG7ysPQhC oR1cPLVHCnq+Pae8tBILoMUddCAJNGy8Dnmn3Kxfu3GISmVHjGpey+DBmJAvXSD2f9cq WnhZpXhmJShrqjxpJWRvMxnt0jgg7uqDe3KKL8kH0I+8NM2q4m83hNLw0+kbNuLyU6Vf hwHtBpCzk4ZZw2d980lxjXRQaiRnysQg6e4dotdG7upQwkZw+F3Mp6P3tYcCVA9SYm5L rrRwIoMgtAm0vwQDl0SBlD4h/YrqmVd4suN4wVpmYbq8ipYpyVNxBEEgitp265H6kYN+ H7og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692688461; x=1693293261; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zxHqKmOyuuNOftyTGwcwCJthKGUr1Tn3UywBr6PkJwE=; b=Gct17ov0xUeyA082JsPBfHG6Y6U0dd8waECkZOesOTmonCr5eMBB99usn21S8SiWJj fNEJj6k2soxfVZKcGymRD/fFs4DyqK/uUZzsnslrINcMBHSyNZjyng86QLUEHDAhMm3z s8EeZf+O/wmQ1pYW8J1yubdb8Q/elwTTgyknMvHYj40wQwNDI7SCbbZvFkl2y8nyGa4B XXEiEZoLwag4cmwKnEuoV/HAXTKAjQBOn/bl9rTGzAsi6eILQWRoZ5hIIqeW1+qZrEi2 QFdWbWoMgIilZzDRaKr9fr5hec8NfirRT6CkkjwhA1fDVc1PL8yIT41+XIlYlsGzYqvf dgmg== X-Gm-Message-State: AOJu0YwEIW8CKz5+mNvx2QZOF6J1VKs2X4YMnAQ3SQuo50H+4+qbsUqQ n1gEvD+aLGcM8ShgyT+7gYbJ/A3YWtsAgMYMEA00AQ== X-Received: by 2002:adf:f70c:0:b0:317:5af3:caa4 with SMTP id r12-20020adff70c000000b003175af3caa4mr6633446wrp.38.1692688461263; Tue, 22 Aug 2023 00:14:21 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id e10-20020a5d594a000000b003140f47224csm14854681wri.15.2023.08.22.00.14.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 00:14:20 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Song Gao Cc: Xiaojuan Yang , Huacai Chen , Jiajie Chen , Richard Henderson Subject: [PATCH RESEND v5 02/19] target/loongarch: Support LoongArch32 DMW Date: Tue, 22 Aug 2023 09:13:48 +0200 Message-ID: <20230822071405.35386-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822071405.35386-1-philmd@linaro.org> References: <20230822071405.35386-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Jiajie Chen LA32 uses a different encoding for CSR.DMW and a new direct mapping mechanism. Signed-off-by: Jiajie Chen Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-ID: <20230822032724.1353391-3-gaosong@loongson.cn> --- target/loongarch/cpu-csr.h | 7 +++---- target/loongarch/tlb_helper.c | 26 +++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/target/loongarch/cpu-csr.h b/target/loongarch/cpu-csr.h index 48ed2e0632..b93f99a9ef 100644 --- a/target/loongarch/cpu-csr.h +++ b/target/loongarch/cpu-csr.h @@ -188,10 +188,9 @@ FIELD(CSR_DMW, PLV1, 1, 1) FIELD(CSR_DMW, PLV2, 2, 1) FIELD(CSR_DMW, PLV3, 3, 1) FIELD(CSR_DMW, MAT, 4, 2) -FIELD(CSR_DMW, VSEG, 60, 4) - -#define dmw_va2pa(va) \ - (va & MAKE_64BIT_MASK(0, TARGET_VIRT_ADDR_SPACE_BITS)) +FIELD(CSR_DMW_32, PSEG, 25, 3) +FIELD(CSR_DMW_32, VSEG, 29, 3) +FIELD(CSR_DMW_64, VSEG, 60, 4) /* Debug CSRs */ #define LOONGARCH_CSR_DBG 0x500 /* debug config */ diff --git a/target/loongarch/tlb_helper.c b/target/loongarch/tlb_helper.c index cef10e2257..1f8e7911c7 100644 --- a/target/loongarch/tlb_helper.c +++ b/target/loongarch/tlb_helper.c @@ -173,6 +173,18 @@ static int loongarch_map_address(CPULoongArchState *env, hwaddr *physical, return TLBRET_NOMATCH; } +static hwaddr dmw_va2pa(CPULoongArchState *env, target_ulong va, + target_ulong dmw) +{ + if (is_la64(env)) { + return va & TARGET_VIRT_MASK; + } else { + uint32_t pseg = FIELD_EX32(dmw, CSR_DMW_32, PSEG); + return (va & MAKE_64BIT_MASK(0, R_CSR_DMW_32_VSEG_SHIFT)) | \ + (pseg << R_CSR_DMW_32_VSEG_SHIFT); + } +} + static int get_physical_address(CPULoongArchState *env, hwaddr *physical, int *prot, target_ulong address, MMUAccessType access_type, int mmu_idx) @@ -192,12 +204,20 @@ static int get_physical_address(CPULoongArchState *env, hwaddr *physical, } plv = kernel_mode | (user_mode << R_CSR_DMW_PLV3_SHIFT); - base_v = address >> R_CSR_DMW_VSEG_SHIFT; + if (is_la64(env)) { + base_v = address >> R_CSR_DMW_64_VSEG_SHIFT; + } else { + base_v = address >> R_CSR_DMW_32_VSEG_SHIFT; + } /* Check direct map window */ for (int i = 0; i < 4; i++) { - base_c = FIELD_EX64(env->CSR_DMW[i], CSR_DMW, VSEG); + if (is_la64(env)) { + base_c = FIELD_EX64(env->CSR_DMW[i], CSR_DMW_64, VSEG); + } else { + base_c = FIELD_EX64(env->CSR_DMW[i], CSR_DMW_32, VSEG); + } if ((plv & env->CSR_DMW[i]) && (base_c == base_v)) { - *physical = dmw_va2pa(address); + *physical = dmw_va2pa(env, address, env->CSR_DMW[i]); *prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC; return TLBRET_MATCH; } From patchwork Tue Aug 22 07:13:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 715695 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp119091wrp; Tue, 22 Aug 2023 00:16:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/lWFTspESMjR1GlG4AgQq4ZNHn6eYqx4ZB9Qw9rddl3eHAnUNO+VKRPnte5/eMyVkF8hb X-Received: by 2002:a05:620a:2591:b0:767:dc9f:5141 with SMTP id x17-20020a05620a259100b00767dc9f5141mr10523209qko.19.1692688563017; Tue, 22 Aug 2023 00:16:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692688563; cv=none; d=google.com; s=arc-20160816; b=RyMKKawzX1v15ddRqlqQcju2XKyr4v0Pq8pp5/Qh985LHwQTypsn32citefzazBiF0 sZM+18TCnlT3+3dZ8q/TMlNaRWqsbWaxQRTZpZOAfbMET4xaq0gb+rwr466h5iBoinXb tyuIKrwVId3PRWBKtKqc7Ff1HEEpwxrVni7JvXxKAXf1M3Yelg2btUFKktASAqERCvQj zsiR4W15lymAkjPmyJqwV1GnauEgptx/gRio6vwgVwveNzxqT+qtEOvzS/ocUWO17eG/ oEjgiEwFLmh8Nfjxm8sZEfBUZLAfAemRqqIl+R5E0unoSva6JoKNG+sDkUzztvn49h7Z Wy+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=3rrV84vf0KvDLl6SX1WoOdtWUazfK9wKjoL6Oup5qkU=; fh=4esUdvAEMIazVUYz2fOQGDzgzc22eZT4lgTXTia56sI=; b=Wf5tLtkcrAq/j2uusKUskSxUoLVu7Z4Y8K4OclSzAvk1aF2N0cKH1fxA3kJLaHdU/p b3b9Bcw2VKuFlXicTIIW2mg3EnI68OzJe8LhyMlmwtHLXsdbTqFHrydzOPeHBOXrbtxM o6piWCODE4UDSW+Co7kePVK1jXZ42yV1ptHksmezTL3I5xDM78xltBLT0gjdgnPUq+bo DB2iqmdd/j9/x3URu3lBciPiVoewy2DtjxqJAPHi/7+/9fV6YZVZF42zEObouNU1eOG0 XhXDbwfSf2DYi+9JZ2k6WcSvp005XFHiwmusOK2QK5RlsadG6OV3GqARO3+qAZ2DNyFG fH+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="PC+/Km5S"; 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 f10-20020a05620a280a00b0076ced1c6090si5929664qkp.759.2023.08.22.00.16.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 00:16:02 -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="PC+/Km5S"; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYLay-0008Rf-CP; Tue, 22 Aug 2023 03:14:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYLax-0008RQ-EN for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:14:31 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYLav-0002tQ-5d for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:14:31 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3fea0640d7aso41860155e9.0 for ; Tue, 22 Aug 2023 00:14:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692688467; x=1693293267; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3rrV84vf0KvDLl6SX1WoOdtWUazfK9wKjoL6Oup5qkU=; b=PC+/Km5SxI4X5X0Gx6f4EEn6I/6em3GGwABRT6IAYoSRDNTE9dc4l+Z+AcEEDsg54Y zjXU9JCSwRL+atwP0qH0lV8+XijGnYgQDIgJmUWNz67SvlZ2mxSfkrAJSxO07lNQF5le yT4Benu628hfbsEqlqLCUliW4RBlNvHL+JzyNKDYcFOOs2HtzJ9pE6AlFVjnL7gxwzV2 AkYSQ9GyvT8BC9X3n5br6y1zKuQoKHz+F4kcKRTLvwsItTP3wup4ppCZewfLqwULmHCj +MCxlbFrARIDbQMu7NtixN8D4LZy7HE0yGaJtY5tw2DU6kZpsZZ4tX4n8kFxabORMGgS GPDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692688467; x=1693293267; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3rrV84vf0KvDLl6SX1WoOdtWUazfK9wKjoL6Oup5qkU=; b=SItBdedvtPkvVg/AfoQNmo9SCc5iY1yMZJW0sTHu998a2F6Xxw7IRAiT2LHA/Zt/MD 0H3uSvi+mCsqYd6/jS6lhKeactXP0HIk3E4eDx2O5gD4PiD/PKoZFCt9qZvfuo4HiR9g +FRf47TGiWKcDrZHKmz3Box+u8mfAiLIfZ6fXPCE9MQy1Mmv1rPCIN3E66DoXCBQ0GSK wRvWpPnKQTIJkapipryAVprs1RZx0Cv8PyFsTkeP2CdfRrSoyv0Y5SXpsPlD56EmciGQ FcVcSz4rNbtVsewp0tcOgaZSCsCZR3gpmXjig7TfwRuuXVqqp77mJhxLT4QU4SgjXpcR OgqA== X-Gm-Message-State: AOJu0YzHmu1MHzYekBJVrK4XLv7bEvg5V/6IyMCKHKuGR30DgNgEF/A+ y5X1OR2XI1ffEacbACCFRqvwDU6YIHBh3HrDOErBrg== X-Received: by 2002:adf:fa47:0:b0:319:6e74:1637 with SMTP id y7-20020adffa47000000b003196e741637mr5816620wrr.27.1692688467340; Tue, 22 Aug 2023 00:14:27 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id a8-20020adfed08000000b003196dba130asm14866177wro.106.2023.08.22.00.14.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 00:14:26 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Song Gao Cc: Xiaojuan Yang , Huacai Chen , Jiajie Chen , Richard Henderson Subject: [PATCH RESEND v5 03/19] target/loongarch: Support LoongArch32 VPPN Date: Tue, 22 Aug 2023 09:13:49 +0200 Message-ID: <20230822071405.35386-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822071405.35386-1-philmd@linaro.org> References: <20230822071405.35386-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Jiajie Chen VPPN of TLBEHI/TLBREHI is limited to 19 bits in LA32. Signed-off-by: Jiajie Chen Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-ID: <20230822032724.1353391-4-gaosong@loongson.cn> --- target/loongarch/cpu-csr.h | 6 ++++-- target/loongarch/tlb_helper.c | 23 ++++++++++++++++++----- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/target/loongarch/cpu-csr.h b/target/loongarch/cpu-csr.h index b93f99a9ef..c59d7a9fcb 100644 --- a/target/loongarch/cpu-csr.h +++ b/target/loongarch/cpu-csr.h @@ -57,7 +57,8 @@ FIELD(CSR_TLBIDX, PS, 24, 6) FIELD(CSR_TLBIDX, NE, 31, 1) #define LOONGARCH_CSR_TLBEHI 0x11 /* TLB EntryHi */ -FIELD(CSR_TLBEHI, VPPN, 13, 35) +FIELD(CSR_TLBEHI_32, VPPN, 13, 19) +FIELD(CSR_TLBEHI_64, VPPN, 13, 35) #define LOONGARCH_CSR_TLBELO0 0x12 /* TLB EntryLo0 */ #define LOONGARCH_CSR_TLBELO1 0x13 /* TLB EntryLo1 */ @@ -164,7 +165,8 @@ FIELD(CSR_TLBRERA, PC, 2, 62) #define LOONGARCH_CSR_TLBRELO1 0x8d /* TLB refill entrylo1 */ #define LOONGARCH_CSR_TLBREHI 0x8e /* TLB refill entryhi */ FIELD(CSR_TLBREHI, PS, 0, 6) -FIELD(CSR_TLBREHI, VPPN, 13, 35) +FIELD(CSR_TLBREHI_32, VPPN, 13, 19) +FIELD(CSR_TLBREHI_64, VPPN, 13, 35) #define LOONGARCH_CSR_TLBRPRMD 0x8f /* TLB refill mode info */ FIELD(CSR_TLBRPRMD, PPLV, 0, 2) FIELD(CSR_TLBRPRMD, PIE, 2, 1) diff --git a/target/loongarch/tlb_helper.c b/target/loongarch/tlb_helper.c index 1f8e7911c7..c8b8b0497f 100644 --- a/target/loongarch/tlb_helper.c +++ b/target/loongarch/tlb_helper.c @@ -300,8 +300,13 @@ static void raise_mmu_exception(CPULoongArchState *env, target_ulong address, if (tlb_error == TLBRET_NOMATCH) { env->CSR_TLBRBADV = address; - env->CSR_TLBREHI = FIELD_DP64(env->CSR_TLBREHI, CSR_TLBREHI, VPPN, - extract64(address, 13, 35)); + if (is_la64(env)) { + env->CSR_TLBREHI = FIELD_DP64(env->CSR_TLBREHI, CSR_TLBREHI_64, + VPPN, extract64(address, 13, 35)); + } else { + env->CSR_TLBREHI = FIELD_DP64(env->CSR_TLBREHI, CSR_TLBREHI_32, + VPPN, extract64(address, 13, 19)); + } } else { if (!FIELD_EX64(env->CSR_DBG, CSR_DBG, DST)) { env->CSR_BADV = address; @@ -366,12 +371,20 @@ static void fill_tlb_entry(CPULoongArchState *env, int index) if (FIELD_EX64(env->CSR_TLBRERA, CSR_TLBRERA, ISTLBR)) { csr_ps = FIELD_EX64(env->CSR_TLBREHI, CSR_TLBREHI, PS); - csr_vppn = FIELD_EX64(env->CSR_TLBREHI, CSR_TLBREHI, VPPN); + if (is_la64(env)) { + csr_vppn = FIELD_EX64(env->CSR_TLBREHI, CSR_TLBREHI_64, VPPN); + } else { + csr_vppn = FIELD_EX64(env->CSR_TLBREHI, CSR_TLBREHI_32, VPPN); + } lo0 = env->CSR_TLBRELO0; lo1 = env->CSR_TLBRELO1; } else { csr_ps = FIELD_EX64(env->CSR_TLBIDX, CSR_TLBIDX, PS); - csr_vppn = FIELD_EX64(env->CSR_TLBEHI, CSR_TLBEHI, VPPN); + if (is_la64(env)) { + csr_vppn = FIELD_EX64(env->CSR_TLBEHI, CSR_TLBEHI_64, VPPN); + } else { + csr_vppn = FIELD_EX64(env->CSR_TLBEHI, CSR_TLBEHI_32, VPPN); + } lo0 = env->CSR_TLBELO0; lo1 = env->CSR_TLBELO1; } @@ -491,7 +504,7 @@ void helper_tlbfill(CPULoongArchState *env) if (pagesize == stlb_ps) { /* Only write into STLB bits [47:13] */ - address = entryhi & ~MAKE_64BIT_MASK(0, R_CSR_TLBEHI_VPPN_SHIFT); + address = entryhi & ~MAKE_64BIT_MASK(0, R_CSR_TLBEHI_64_VPPN_SHIFT); /* Choose one set ramdomly */ set = get_random_tlb(0, 7); From patchwork Tue Aug 22 07:13:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 715697 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp119110wrp; Tue, 22 Aug 2023 00:16:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHPNUNSSZabMt3haZP/iE+AIXJF26BlWA1iTgWdovtfOEPZ0qb0JjUCOCMwnIzk4YcZOG/w X-Received: by 2002:a05:620a:448e:b0:768:f02:532e with SMTP id x14-20020a05620a448e00b007680f02532emr12216457qkp.39.1692688565017; Tue, 22 Aug 2023 00:16:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692688565; cv=none; d=google.com; s=arc-20160816; b=e4TE4PbVQndhU78hb1C10ZK5a/VhBLW3yNyq5JZt5Kqjmc8stwOKE1kSvEtzl5skJd 1r0Iyau/fgr38NnWNVhkW1oaV0X8fjcQ8ubiOrk9rp/DjAJb0mNhPiF3Prkp2Was33N9 g2CaVgE0BVzWuPL1XYZGGjtCeO22R1qKqZjZIkbuT3GOezoYoAX4a+ROZL4eci/7WnEk gW8dAAcYx8M++jmVTv5v4GzwXd6V+gX9VrQ947JMwlxFhbUnGdK93EjQqoYnL510yP2U f2WEcWqbZxRlEwBgX6xCun5X1mRGVZD/arShJj77VL2otBPskv/UDVF4LyBBIg8FQ27L vHCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=0lC9gMe2kWPLwbVJidGFgIBdYr23SH/S3e9rEjZW5mo=; fh=4esUdvAEMIazVUYz2fOQGDzgzc22eZT4lgTXTia56sI=; b=NY3JiyfZ96APj4o35b8ty/pX3DS/B16fTrlqSw3Egl5F/s/pakoWokLe3ukMicwJHD P7/0uXwjHCpuR35uTdqsUpjH/6ERrI2WTVGn4xFJQxWRJYYdFLl8e5oBjDykTDijB8Wo 9npxa4YazTjSVKS2CLelmtwAAm2s/+ulmLRKulrMW9qps/rxop3FKmE1fXM2tzJGRNuO NQrfcfNinhYE3G4ugjrkb9+BCtTkM3NQMRFYc6q51cngoqpzvzmOyvqe/gd3YNQNHSHw tlxwSSeAKOc5d/213c8mwe5ZqrNyVU/mLqNiKieVeHo9aDrTou/mfVZaOteQkO7xsYuO 9FHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="nP2U1bj/"; 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 i18-20020a05620a405200b0076717c99ea8si6023098qko.536.2023.08.22.00.16.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 00:16:05 -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="nP2U1bj/"; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYLb4-0000Lt-Iy; Tue, 22 Aug 2023 03:14:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYLb3-0000Ip-8S for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:14:37 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYLb0-0002uP-UF for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:14:36 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-31aeee69de0so2337913f8f.2 for ; Tue, 22 Aug 2023 00:14:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692688473; x=1693293273; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0lC9gMe2kWPLwbVJidGFgIBdYr23SH/S3e9rEjZW5mo=; b=nP2U1bj/etP5Yaz4ynuojDOb7fmBjoHmnVElezX7HghxDO4bzePSaY+e78zmebV6zo Ik4OQbhYcWI97i3qyUxvf/x/VIfKhRp/0JxPJsRrZMdY9G/lw2oaVNUFcsJ0/XmUf6rf IlEGMjsYIx7SN0afyBqEMA8u0kGVcRxHCsvgBhMIDSpwjsEuggz2G4qLDx3PDdAgtpVk amrTvwAaDAvsh+46Q3dCbhnDj4t/t8TxDBlNyU5CX4Kv8HHA9l5/5hdphXMZPBgagHMp HpMA3yQAstaNF/RERguQLoSQUEGPT8PEo/8ZBnY1kDmd5MD0j4EgzcNb2U8vMEbox76C Q78w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692688473; x=1693293273; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0lC9gMe2kWPLwbVJidGFgIBdYr23SH/S3e9rEjZW5mo=; b=D8DsiFBkCIw2zsjkn/qGzhAsMyzg21DjfPLabmcuNt9+/f9BNPb2l07eOz1CAbuPJl QQZn2DAbEhsqLBgBbbln5Z6e5C86xmheMaPoAg5TZblsrHqrewQ/+OlRSv1990xxz4KP 5Dexrfb1JF0i36X+OYv7Q7/ORkKyfk0LCx8ijljE5zP691jSb6vvcLz2awYVqE/1/k+p CvyySMdcvUGPQXlaVm0f9vxeZFLxAzLJP925eue7ukQ8FFwDsjcHa2FzBAuZ/foGK6mc WWAFkGsz3lVEq4KJ3uilIUwGZqCZH6ZRJfywm7VrVtIkQu2gHx0dOZDKqsvloZkziH/Q 5OBw== X-Gm-Message-State: AOJu0YwqsK2LhCSDmSp//53sTax6trn5e9hArmtWmfi9XqU7dq+F3PwB BO8h51Cq9ZQZ2ERrEyn4oT90wrQhANhm4RgsyxbLDQ== X-Received: by 2002:a5d:688c:0:b0:31a:dc2e:2db2 with SMTP id h12-20020a5d688c000000b0031adc2e2db2mr5892955wru.49.1692688473437; Tue, 22 Aug 2023 00:14:33 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id h11-20020a5d548b000000b00317e77106dbsm14988453wrv.48.2023.08.22.00.14.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 00:14:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Song Gao Cc: Xiaojuan Yang , Huacai Chen , Jiajie Chen , Richard Henderson Subject: [PATCH RESEND v5 04/19] target/loongarch: Add LA64 & VA32 to DisasContext Date: Tue, 22 Aug 2023 09:13:50 +0200 Message-ID: <20230822071405.35386-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822071405.35386-1-philmd@linaro.org> References: <20230822071405.35386-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Jiajie Chen Add LA64 and VA32(32-bit Virtual Address) to DisasContext to allow the translator to reject doubleword instructions in LA32 mode for example. Signed-off-by: Jiajie Chen Reviewed-by: Richard Henderson Signed-off-by: Song Gao Message-ID: <20230822032724.1353391-5-gaosong@loongson.cn> --- target/loongarch/cpu.h | 13 +++++++++++++ target/loongarch/translate.h | 2 ++ target/loongarch/translate.c | 3 +++ 3 files changed, 18 insertions(+) diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h index b8af491041..72109095e4 100644 --- a/target/loongarch/cpu.h +++ b/target/loongarch/cpu.h @@ -432,6 +432,17 @@ static inline bool is_la64(CPULoongArchState *env) return FIELD_EX32(env->cpucfg[1], CPUCFG1, ARCH) == CPUCFG1_ARCH_LA64; } +static inline bool is_va32(CPULoongArchState *env) +{ + /* VA32 if !LA64 or VA32L[1-3] */ + bool va32 = !is_la64(env); + uint64_t plv = FIELD_EX64(env->CSR_CRMD, CSR_CRMD, PLV); + if (plv >= 1 && (FIELD_EX64(env->CSR_MISC, CSR_MISC, VA32) & (1 << plv))) { + va32 = true; + } + return va32; +} + /* * LoongArch CPUs hardware flags. */ @@ -439,6 +450,7 @@ static inline bool is_la64(CPULoongArchState *env) #define HW_FLAGS_CRMD_PG R_CSR_CRMD_PG_MASK /* 0x10 */ #define HW_FLAGS_EUEN_FPE 0x04 #define HW_FLAGS_EUEN_SXE 0x08 +#define HW_FLAGS_VA32 0x20 static inline void cpu_get_tb_cpu_state(CPULoongArchState *env, vaddr *pc, uint64_t *cs_base, uint32_t *flags) @@ -448,6 +460,7 @@ static inline void cpu_get_tb_cpu_state(CPULoongArchState *env, vaddr *pc, *flags = env->CSR_CRMD & (R_CSR_CRMD_PLV_MASK | R_CSR_CRMD_PG_MASK); *flags |= FIELD_EX64(env->CSR_EUEN, CSR_EUEN, FPE) * HW_FLAGS_EUEN_FPE; *flags |= FIELD_EX64(env->CSR_EUEN, CSR_EUEN, SXE) * HW_FLAGS_EUEN_SXE; + *flags |= is_va32(env) * HW_FLAGS_VA32; } void loongarch_cpu_list(void); diff --git a/target/loongarch/translate.h b/target/loongarch/translate.h index 7f60090580..b6fa5df82d 100644 --- a/target/loongarch/translate.h +++ b/target/loongarch/translate.h @@ -33,6 +33,8 @@ typedef struct DisasContext { uint16_t plv; int vl; /* Vector length */ TCGv zero; + bool la64; /* LoongArch64 mode */ + bool va32; /* 32-bit virtual address */ } DisasContext; void generate_exception(DisasContext *ctx, int excp); diff --git a/target/loongarch/translate.c b/target/loongarch/translate.c index 3146a2d4ac..ac847745df 100644 --- a/target/loongarch/translate.c +++ b/target/loongarch/translate.c @@ -119,6 +119,9 @@ static void loongarch_tr_init_disas_context(DisasContextBase *dcbase, ctx->vl = LSX_LEN; } + ctx->la64 = is_la64(env); + ctx->va32 = (ctx->base.tb->flags & HW_FLAGS_VA32) != 0; + ctx->zero = tcg_constant_tl(0); } From patchwork Tue Aug 22 07:13:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 715692 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp118675wrp; Tue, 22 Aug 2023 00:15:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH37G86kpjCO4Ggc5FboZfSJUO3URoFON86mb5NUEJZasCDqfejY02wii/QhsMWW4p51yzK X-Received: by 2002:ac5:c644:0:b0:48d:d3b:7dd9 with SMTP id j4-20020ac5c644000000b0048d0d3b7dd9mr4409916vkl.3.1692688511354; Tue, 22 Aug 2023 00:15:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692688511; cv=none; d=google.com; s=arc-20160816; b=bnt1l1wlew8eOQTV9Rz48ToLKOLRUfmIfwYCZjoF/gL3vCFy1opsEv5QCPrc/jWwei wHcjUqITyG2DTRd/zHgH7/hNTmCt1ZOyVw1nhzt/gWteYZq8k4JN8JUSP7PgKjutE5gZ 9re78lKub7CgBXkmbky9E1ekmuZzbZI/SCm7ey+qFHcV/47Gi/YwlWXEDrdq8d2e/H3W f53xO/q/4I705tKP4uhkQWbdbMJCXCxCNUUZCr8wE6feZYvo9tb+XHcJjtiRnwkBVpqq 37b3TqPRW1jx5HGtUteqolGzdqJ/nmbiiZ7srcYiPORvogf0BtpuBviSxYqJp3BT5upb QjlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=V161z4Ei7sDtuZQE5rhbvAPYD0+mOubaYtO5GaVSVj4=; fh=iI1r750v8r6y4onCPOGlc5pA/zLiNuJX+n5Trfvo6Hc=; b=Ifra+Erpf2UwFHknxIQtb2kCX5B4GAiasXv6eniOFsaaB7pfOe9feCXzhtlB+jy54o q80ixGudKFjqY3UWm8qit9J4DGHQTZ/F8JsVgMm7l+0F8Izq6Eqjy9rTdSpZkfmdarB1 V5kpsWg0olV1RSAFLdyFMIk7hj+HrqkK/XDA0o/Gyq1pc8MYuHKTnGZnoGAQgbziTBQV MeIV+RMuoGsq+87Xoi3jVIXxsxB4T5/vBu9K2R/c2U2OEwxIzVWK8ux0M43xzhQKUzXk Pf+l/LWAD3VlD6Rg0LUsOeRNcUf4xtrEOXn/GHr10j9wWCKoDhfdUdB8ffRuxOy9KhQl bxvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l6y7g1Z2; 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 m8-20020a05622a118800b004042849cfb3si5999815qtk.262.2023.08.22.00.15.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 00:15:11 -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=l6y7g1Z2; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYLbB-0000R9-4d; Tue, 22 Aug 2023 03:14:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYLb9-0000Qc-Jo for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:14:43 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYLb7-0002vD-26 for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:14:43 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3fee87dd251so23569965e9.2 for ; Tue, 22 Aug 2023 00:14:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692688479; x=1693293279; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=V161z4Ei7sDtuZQE5rhbvAPYD0+mOubaYtO5GaVSVj4=; b=l6y7g1Z2XmIlzqb2EtQ23lFR7Ihy9YhI0ETra6VmkrEAju6q1zJhwPAwIZF3kVV2BC L42C5jOWFE1En7zrUwR9iy2d7geehWp/TZtcG8YD64fx9LjWSPSCVyKD878eJqpGKkOM Q7556v+j2M8gvfYwISalA5zUnEFssVFYdK3jwrj29NkbS+f1nePeldr3jlbo+Ab3lMqu 0/BauZVFTIYyaUAf1HsjKUe2/WKRpQuT303c/mQeTHjJfyDZ/yGlxu+XoulvppWbN/aU zoQmNcc0t6vtA4PQfxDdRRQ+tfkpQ+pY4gM4RmltmTtIFrceq7kk7sG/dfg3R0/pCU71 /arw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692688479; x=1693293279; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=V161z4Ei7sDtuZQE5rhbvAPYD0+mOubaYtO5GaVSVj4=; b=ARfe8n2xhIeaBaIRmc04HR1h0TDXFFDxIFTFesYRr01mTpzIPJFX0n7mvB4p2Y0ozK VSiRgRNnV5rGENnd2hTlqo9dx3qkfoti0gTxwXTg6JsB5JwqRfjp4lmGOLoKYpdBfKGW GYzdgvKN80IroC89qS+nlhiEt84Smf2lfQ3Gh6b9N4FBeJR7tWsff2jTD51KgFKyqHy9 mfa5+T+JSXBDk3S5Jid8mKwjLWl1KDiXmTVlTykQ2nQ0sAZW/Xif0u6V7R85wv9IR76q wtDdD4NVz4CLVMsCqyzLTr0bmTXr5LdxcT+J6C9jX58xHuPgW9PuRG4f4hoRBNG3hdDQ 3Phg== X-Gm-Message-State: AOJu0YxpaouwdcpCNiFuBAxgO8euVbhHqIStwbingqxjfEK37QXqNQdc PN8HpidVRUMbM3cdJBP70LvJvP7Sa6IDQ356S3dbBg== X-Received: by 2002:a1c:f204:0:b0:3fe:1c33:2814 with SMTP id s4-20020a1cf204000000b003fe1c332814mr6779899wmc.30.1692688479531; Tue, 22 Aug 2023 00:14:39 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id s12-20020a7bc38c000000b003fbb06af219sm14971591wmj.32.2023.08.22.00.14.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 00:14:39 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Song Gao Cc: Xiaojuan Yang , Huacai Chen , Jiajie Chen , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH RESEND v5 05/19] target/loongarch: Extract make_address_x() helper Date: Tue, 22 Aug 2023 09:13:51 +0200 Message-ID: <20230822071405.35386-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822071405.35386-1-philmd@linaro.org> References: <20230822071405.35386-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Jiajie Chen Signed-off-by: Jiajie Chen Co-authored-by: Richard Henderson Reviewed-by: Richard Henderson Signed-off-by: Song Gao Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20230822032724.1353391-6-gaosong@loongson.cn> [PMD: Extract helper from bigger patch] Signed-off-by: Philippe Mathieu-Daudé --- target/loongarch/translate.c | 12 ++++++++++++ .../loongarch/insn_trans/trans_fmemory.c.inc | 18 ++++++------------ target/loongarch/insn_trans/trans_lsx.c.inc | 6 ++---- target/loongarch/insn_trans/trans_memory.c.inc | 6 ++---- 4 files changed, 22 insertions(+), 20 deletions(-) diff --git a/target/loongarch/translate.c b/target/loongarch/translate.c index ac847745df..a68a979a55 100644 --- a/target/loongarch/translate.c +++ b/target/loongarch/translate.c @@ -208,6 +208,18 @@ static void set_fpr(int reg_num, TCGv val) offsetof(CPULoongArchState, fpr[reg_num].vreg.D(0))); } +static TCGv make_address_x(DisasContext *ctx, TCGv base, TCGv addend) +{ + TCGv temp = NULL; + + if (addend) { + temp = tcg_temp_new(); + tcg_gen_add_tl(temp, base, addend); + base = temp; + } + return base; +} + #include "decode-insns.c.inc" #include "insn_trans/trans_arith.c.inc" #include "insn_trans/trans_shift.c.inc" diff --git a/target/loongarch/insn_trans/trans_fmemory.c.inc b/target/loongarch/insn_trans/trans_fmemory.c.inc index 91c09fb6d9..88ad209338 100644 --- a/target/loongarch/insn_trans/trans_fmemory.c.inc +++ b/target/loongarch/insn_trans/trans_fmemory.c.inc @@ -57,8 +57,7 @@ static bool gen_floadx(DisasContext *ctx, arg_frr *a, MemOp mop) CHECK_FPE; - addr = tcg_temp_new(); - tcg_gen_add_tl(addr, src1, src2); + addr = make_address_x(ctx, src1, src2); tcg_gen_qemu_ld_tl(dest, addr, ctx->mem_idx, mop); maybe_nanbox_load(dest, mop); set_fpr(a->fd, dest); @@ -75,8 +74,7 @@ static bool gen_fstorex(DisasContext *ctx, arg_frr *a, MemOp mop) CHECK_FPE; - addr = tcg_temp_new(); - tcg_gen_add_tl(addr, src1, src2); + addr = make_address_x(ctx, src1, src2); tcg_gen_qemu_st_tl(src3, addr, ctx->mem_idx, mop); return true; @@ -91,9 +89,8 @@ static bool gen_fload_gt(DisasContext *ctx, arg_frr *a, MemOp mop) CHECK_FPE; - addr = tcg_temp_new(); gen_helper_asrtgt_d(cpu_env, src1, src2); - tcg_gen_add_tl(addr, src1, src2); + addr = make_address_x(ctx, src1, src2); tcg_gen_qemu_ld_tl(dest, addr, ctx->mem_idx, mop); maybe_nanbox_load(dest, mop); set_fpr(a->fd, dest); @@ -110,9 +107,8 @@ static bool gen_fstore_gt(DisasContext *ctx, arg_frr *a, MemOp mop) CHECK_FPE; - addr = tcg_temp_new(); gen_helper_asrtgt_d(cpu_env, src1, src2); - tcg_gen_add_tl(addr, src1, src2); + addr = make_address_x(ctx, src1, src2); tcg_gen_qemu_st_tl(src3, addr, ctx->mem_idx, mop); return true; @@ -127,9 +123,8 @@ static bool gen_fload_le(DisasContext *ctx, arg_frr *a, MemOp mop) CHECK_FPE; - addr = tcg_temp_new(); gen_helper_asrtle_d(cpu_env, src1, src2); - tcg_gen_add_tl(addr, src1, src2); + addr = make_address_x(ctx, src1, src2); tcg_gen_qemu_ld_tl(dest, addr, ctx->mem_idx, mop); maybe_nanbox_load(dest, mop); set_fpr(a->fd, dest); @@ -146,9 +141,8 @@ static bool gen_fstore_le(DisasContext *ctx, arg_frr *a, MemOp mop) CHECK_FPE; - addr = tcg_temp_new(); gen_helper_asrtle_d(cpu_env, src1, src2); - tcg_gen_add_tl(addr, src1, src2); + addr = make_address_x(ctx, src1, src2); tcg_gen_qemu_st_tl(src3, addr, ctx->mem_idx, mop); return true; diff --git a/target/loongarch/insn_trans/trans_lsx.c.inc b/target/loongarch/insn_trans/trans_lsx.c.inc index 68779daff6..875cb7d51d 100644 --- a/target/loongarch/insn_trans/trans_lsx.c.inc +++ b/target/loongarch/insn_trans/trans_lsx.c.inc @@ -4315,14 +4315,13 @@ static bool trans_vldx(DisasContext *ctx, arg_vrr *a) CHECK_SXE; - addr = tcg_temp_new(); src1 = gpr_src(ctx, a->rj, EXT_NONE); src2 = gpr_src(ctx, a->rk, EXT_NONE); val = tcg_temp_new_i128(); rl = tcg_temp_new_i64(); rh = tcg_temp_new_i64(); - tcg_gen_add_tl(addr, src1, src2); + addr = make_address_x(ctx, src1, src2); tcg_gen_qemu_ld_i128(val, addr, ctx->mem_idx, MO_128 | MO_TE); tcg_gen_extr_i128_i64(rl, rh, val); set_vreg64(rh, a->vd, 1); @@ -4339,14 +4338,13 @@ static bool trans_vstx(DisasContext *ctx, arg_vrr *a) CHECK_SXE; - addr = tcg_temp_new(); src1 = gpr_src(ctx, a->rj, EXT_NONE); src2 = gpr_src(ctx, a->rk, EXT_NONE); val = tcg_temp_new_i128(); ah = tcg_temp_new_i64(); al = tcg_temp_new_i64(); - tcg_gen_add_tl(addr, src1, src2); + addr = make_address_x(ctx, src1, src2); get_vreg64(ah, a->vd, 1); get_vreg64(al, a->vd, 0); tcg_gen_concat_i64_i128(val, al, ah); diff --git a/target/loongarch/insn_trans/trans_memory.c.inc b/target/loongarch/insn_trans/trans_memory.c.inc index 75cfdf59ad..ccebd0a4e0 100644 --- a/target/loongarch/insn_trans/trans_memory.c.inc +++ b/target/loongarch/insn_trans/trans_memory.c.inc @@ -39,9 +39,8 @@ static bool gen_loadx(DisasContext *ctx, arg_rrr *a, MemOp mop) TCGv dest = gpr_dst(ctx, a->rd, EXT_NONE); TCGv src1 = gpr_src(ctx, a->rj, EXT_NONE); TCGv src2 = gpr_src(ctx, a->rk, EXT_NONE); - TCGv addr = tcg_temp_new(); + TCGv addr = make_address_x(ctx, src1, src2); - tcg_gen_add_tl(addr, src1, src2); tcg_gen_qemu_ld_tl(dest, addr, ctx->mem_idx, mop); gen_set_gpr(a->rd, dest, EXT_NONE); @@ -53,9 +52,8 @@ static bool gen_storex(DisasContext *ctx, arg_rrr *a, MemOp mop) TCGv data = gpr_src(ctx, a->rd, EXT_NONE); TCGv src1 = gpr_src(ctx, a->rj, EXT_NONE); TCGv src2 = gpr_src(ctx, a->rk, EXT_NONE); - TCGv addr = tcg_temp_new(); + TCGv addr = make_address_x(ctx, src1, src2); - tcg_gen_add_tl(addr, src1, src2); tcg_gen_qemu_st_tl(data, addr, ctx->mem_idx, mop); return true; From patchwork Tue Aug 22 07:13:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 715698 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp119193wrp; Tue, 22 Aug 2023 00:16:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGhUi24Y+fQgZtVeZW4HrGBlqZ87jzJPPUpaUOGG4fy6+YfdElzjuJFBb0aXEMzDqwY9k7Y X-Received: by 2002:a05:622a:4c7:b0:410:92f3:8eca with SMTP id q7-20020a05622a04c700b0041092f38ecamr9965929qtx.33.1692688572890; Tue, 22 Aug 2023 00:16:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692688572; cv=none; d=google.com; s=arc-20160816; b=Csgu9rLxc7Dc2ugPDintjZ1Yun4cOzZVLo+7l4qF6+qbrcB9YNmZ5Ul7bB3F1cDXfW RqVG+XN9tfthnNcv5eNzC8J0GKRs6yI5kvNr7VSvGvnRGNsZC3uq36p6gCEquCEjbHHw c67koNKB3dPRbxYQEJMU+bIqlnLthTJXfL/565epqdEN0m4SPiaNtwwdvGvZ7G8ldSss bdWDdlpvx8id9HurRQxqf23jleULXmqId2TnE3JQLokMNWnK3jhHbwhDUlEKYVtnwX1v Hb+/Lg0eaBCDdga1HTWg/CtUeQaA7jYbScGh0LWpr6AuT+6Vcexttc3CphlvtH6U3TuK ZK2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=fvQZedijPtJ34ELRwqSS7RfwCk60jvhcOCv1VkYXcvk=; fh=iI1r750v8r6y4onCPOGlc5pA/zLiNuJX+n5Trfvo6Hc=; b=j448kzRibp9e+DqCN7biSuO42K4vuRCRJORMuuYP+TgEuSF3RX7LaBcw9G2WUZoQ18 LNtDrhk77WS2ExcaxE7CVLc7O2Z1rI6cqkxDTSpYogD7UWfZZYwsHM0CyXstMBZe2UQE OwtvC9bzfEHfCrtNOnRaVl498XxXoa11nSKqd/a5u0S31id/yCqV8xxcZ63K7HFHm53g 8tSreTakPn9I1Y87wlENJYEi4h/Ljr9ZQq8S4C45LwawtD8ELvMwBAx/tv3d/y/2XmxZ Wr92oMGc7cEn5WT4XSWDz7BKgAfm0n81L8nKkwXETHl7j5RAipCJRvJ3Bg+jAl8Xez07 B22Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wO7IGU2f; 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 g21-20020ac87d15000000b00403a8e58423si4442412qtb.448.2023.08.22.00.16.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 00:16:12 -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=wO7IGU2f; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYLbI-0000mg-UX; Tue, 22 Aug 2023 03:14:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYLbG-0000fT-Vp for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:14:51 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYLbE-0002vk-41 for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:14:50 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3fe1a17f983so39478365e9.3 for ; Tue, 22 Aug 2023 00:14:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692688486; x=1693293286; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fvQZedijPtJ34ELRwqSS7RfwCk60jvhcOCv1VkYXcvk=; b=wO7IGU2fnBG6Mn1I0vtOJP1sErgRhzuMztjjrUBwI+VZDAPpnXGnlFaQX0fKCi5K9F 0O+v5cerBq3MKD+I/6TuueSZXk3o6wBBJsrrUDbtuRP+a9tUaCHj4IumrxbA4z0f5Csn 0GVXB52k/c6xgETqiy2cHnPXV9a0r309v2nzPT/aTfCviD9CwP8rrIF50ND2WVRc+osE o4K4JUTDS3OxLFjAdAdnupGdon60Imc0M3nnhjKOA6txkd8lL6wGNI5ACI6McrXBh4eI jRTuuaki4ARHJrXU+R28jHfrvcEb3N2yBmLAfSXu9TqkOWJS4Azyc0qM3pHXFe8R+m6g XVcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692688486; x=1693293286; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fvQZedijPtJ34ELRwqSS7RfwCk60jvhcOCv1VkYXcvk=; b=dgfqQQje64N7agft8WDnLhcIzD18ZxB1RzTFlQ397WEQS7j4RfmtS7oeY6nVe0+pCI FAh1RGDM2PKf8v0pHOFkQZXHiW2152ngRewaN1sceHbDnEm4NUHhq7FnuuJusKCarrLE BpJqn9HMbC+CDdNWAPI5l+I3idDd6b6h4c+3X3n5In7YgguS+IS8GGyAFMRPU79xHfZ/ sN1Z1ggbiNU2+4GV0o5iyP7lWTD9CBo+Q3Ytva4JjGQ6kQu6AtrMIjQqGNx82N97a7Jt J3fGFCpqtXVKMLL6PycY7oOzwlBH3YDFyK5ULpyy+hdhHra9IgQEaHbIgk+LYIcZLImZ 7EYA== X-Gm-Message-State: AOJu0YwxNCSSs9FVOh9BaNd4s2fliBRyeO08uOz5tvDJ0E+J+GgQaf0x LllTBoVVHQJLwBRPryOsB9H8YcJMky+Ox09r9w2t4Q== X-Received: by 2002:a5d:55c3:0:b0:319:72f8:7244 with SMTP id i3-20020a5d55c3000000b0031972f87244mr5737000wrw.45.1692688486170; Tue, 22 Aug 2023 00:14:46 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id j16-20020a056000125000b0031779a6b451sm14859609wrx.83.2023.08.22.00.14.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 00:14:45 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Song Gao Cc: Xiaojuan Yang , Huacai Chen , Jiajie Chen , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH RESEND v5 06/19] target/loongarch: Extract make_address_i() helper Date: Tue, 22 Aug 2023 09:13:52 +0200 Message-ID: <20230822071405.35386-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822071405.35386-1-philmd@linaro.org> References: <20230822071405.35386-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Jiajie Chen Signed-off-by: Jiajie Chen Co-authored-by: Richard Henderson Reviewed-by: Richard Henderson Signed-off-by: Song Gao Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20230822032724.1353391-6-gaosong@loongson.cn> [PMD: Extract helper from bigger patch] Signed-off-by: Philippe Mathieu-Daudé --- target/loongarch/translate.c | 6 ++++ .../loongarch/insn_trans/trans_atomic.c.inc | 5 +-- .../loongarch/insn_trans/trans_branch.c.inc | 3 +- .../loongarch/insn_trans/trans_fmemory.c.inc | 12 ++----- target/loongarch/insn_trans/trans_lsx.c.inc | 32 +++++-------------- .../loongarch/insn_trans/trans_memory.c.inc | 28 +++++----------- 6 files changed, 29 insertions(+), 57 deletions(-) diff --git a/target/loongarch/translate.c b/target/loongarch/translate.c index a68a979a55..acc54d7587 100644 --- a/target/loongarch/translate.c +++ b/target/loongarch/translate.c @@ -220,6 +220,12 @@ static TCGv make_address_x(DisasContext *ctx, TCGv base, TCGv addend) return base; } +static TCGv make_address_i(DisasContext *ctx, TCGv base, target_long ofs) +{ + TCGv addend = ofs ? tcg_constant_tl(ofs) : NULL; + return make_address_x(ctx, base, addend); +} + #include "decode-insns.c.inc" #include "insn_trans/trans_arith.c.inc" #include "insn_trans/trans_shift.c.inc" diff --git a/target/loongarch/insn_trans/trans_atomic.c.inc b/target/loongarch/insn_trans/trans_atomic.c.inc index 612709f2a7..fbc081448d 100644 --- a/target/loongarch/insn_trans/trans_atomic.c.inc +++ b/target/loongarch/insn_trans/trans_atomic.c.inc @@ -7,9 +7,8 @@ static bool gen_ll(DisasContext *ctx, arg_rr_i *a, MemOp mop) { TCGv dest = gpr_dst(ctx, a->rd, EXT_NONE); TCGv src1 = gpr_src(ctx, a->rj, EXT_NONE); - TCGv t0 = tcg_temp_new(); + TCGv t0 = make_address_i(ctx, src1, a->imm); - tcg_gen_addi_tl(t0, src1, a->imm); tcg_gen_qemu_ld_i64(dest, t0, ctx->mem_idx, mop); tcg_gen_st_tl(t0, cpu_env, offsetof(CPULoongArchState, lladdr)); tcg_gen_st_tl(dest, cpu_env, offsetof(CPULoongArchState, llval)); @@ -62,6 +61,8 @@ static bool gen_am(DisasContext *ctx, arg_rrr *a, return false; } + addr = make_address_i(ctx, addr, 0); + func(dest, addr, val, ctx->mem_idx, mop); gen_set_gpr(a->rd, dest, EXT_NONE); diff --git a/target/loongarch/insn_trans/trans_branch.c.inc b/target/loongarch/insn_trans/trans_branch.c.inc index a860f7e733..3ad34bcc05 100644 --- a/target/loongarch/insn_trans/trans_branch.c.inc +++ b/target/loongarch/insn_trans/trans_branch.c.inc @@ -23,7 +23,8 @@ static bool trans_jirl(DisasContext *ctx, arg_jirl *a) TCGv dest = gpr_dst(ctx, a->rd, EXT_NONE); TCGv src1 = gpr_src(ctx, a->rj, EXT_NONE); - tcg_gen_addi_tl(cpu_pc, src1, a->imm); + TCGv addr = make_address_i(ctx, src1, a->imm); + tcg_gen_mov_tl(cpu_pc, addr); tcg_gen_movi_tl(dest, ctx->base.pc_next + 4); gen_set_gpr(a->rd, dest, EXT_NONE); tcg_gen_lookup_and_goto_ptr(); diff --git a/target/loongarch/insn_trans/trans_fmemory.c.inc b/target/loongarch/insn_trans/trans_fmemory.c.inc index 88ad209338..bd3aba2c49 100644 --- a/target/loongarch/insn_trans/trans_fmemory.c.inc +++ b/target/loongarch/insn_trans/trans_fmemory.c.inc @@ -17,11 +17,7 @@ static bool gen_fload_i(DisasContext *ctx, arg_fr_i *a, MemOp mop) CHECK_FPE; - if (a->imm) { - TCGv temp = tcg_temp_new(); - tcg_gen_addi_tl(temp, addr, a->imm); - addr = temp; - } + addr = make_address_i(ctx, addr, a->imm); tcg_gen_qemu_ld_tl(dest, addr, ctx->mem_idx, mop); maybe_nanbox_load(dest, mop); @@ -37,11 +33,7 @@ static bool gen_fstore_i(DisasContext *ctx, arg_fr_i *a, MemOp mop) CHECK_FPE; - if (a->imm) { - TCGv temp = tcg_temp_new(); - tcg_gen_addi_tl(temp, addr, a->imm); - addr = temp; - } + addr = make_address_i(ctx, addr, a->imm); tcg_gen_qemu_st_tl(src, addr, ctx->mem_idx, mop); diff --git a/target/loongarch/insn_trans/trans_lsx.c.inc b/target/loongarch/insn_trans/trans_lsx.c.inc index 875cb7d51d..50153d6d0b 100644 --- a/target/loongarch/insn_trans/trans_lsx.c.inc +++ b/target/loongarch/insn_trans/trans_lsx.c.inc @@ -4255,7 +4255,7 @@ TRANS(vextrins_d, gen_vv_i, gen_helper_vextrins_d) static bool trans_vld(DisasContext *ctx, arg_vr_i *a) { - TCGv addr, temp; + TCGv addr; TCGv_i64 rl, rh; TCGv_i128 val; @@ -4266,11 +4266,7 @@ static bool trans_vld(DisasContext *ctx, arg_vr_i *a) rl = tcg_temp_new_i64(); rh = tcg_temp_new_i64(); - if (a->imm) { - temp = tcg_temp_new(); - tcg_gen_addi_tl(temp, addr, a->imm); - addr = temp; - } + addr = make_address_i(ctx, addr, a->imm); tcg_gen_qemu_ld_i128(val, addr, ctx->mem_idx, MO_128 | MO_TE); tcg_gen_extr_i128_i64(rl, rh, val); @@ -4282,7 +4278,7 @@ static bool trans_vld(DisasContext *ctx, arg_vr_i *a) static bool trans_vst(DisasContext *ctx, arg_vr_i *a) { - TCGv addr, temp; + TCGv addr; TCGv_i128 val; TCGv_i64 ah, al; @@ -4293,11 +4289,7 @@ static bool trans_vst(DisasContext *ctx, arg_vr_i *a) ah = tcg_temp_new_i64(); al = tcg_temp_new_i64(); - if (a->imm) { - temp = tcg_temp_new(); - tcg_gen_addi_tl(temp, addr, a->imm); - addr = temp; - } + addr = make_address_i(ctx, addr, a->imm); get_vreg64(ah, a->vd, 1); get_vreg64(al, a->vd, 0); @@ -4356,7 +4348,7 @@ static bool trans_vstx(DisasContext *ctx, arg_vrr *a) #define VLDREPL(NAME, MO) \ static bool trans_## NAME (DisasContext *ctx, arg_vr_i *a) \ { \ - TCGv addr, temp; \ + TCGv addr; \ TCGv_i64 val; \ \ CHECK_SXE; \ @@ -4364,11 +4356,7 @@ static bool trans_## NAME (DisasContext *ctx, arg_vr_i *a) \ addr = gpr_src(ctx, a->rj, EXT_NONE); \ val = tcg_temp_new_i64(); \ \ - if (a->imm) { \ - temp = tcg_temp_new(); \ - tcg_gen_addi_tl(temp, addr, a->imm); \ - addr = temp; \ - } \ + addr = make_address_i(ctx, addr, a->imm); \ \ tcg_gen_qemu_ld_i64(val, addr, ctx->mem_idx, MO); \ tcg_gen_gvec_dup_i64(MO, vec_full_offset(a->vd), 16, ctx->vl/8, val); \ @@ -4384,7 +4372,7 @@ VLDREPL(vldrepl_d, MO_64) #define VSTELM(NAME, MO, E) \ static bool trans_## NAME (DisasContext *ctx, arg_vr_ii *a) \ { \ - TCGv addr, temp; \ + TCGv addr; \ TCGv_i64 val; \ \ CHECK_SXE; \ @@ -4392,11 +4380,7 @@ static bool trans_## NAME (DisasContext *ctx, arg_vr_ii *a) \ addr = gpr_src(ctx, a->rj, EXT_NONE); \ val = tcg_temp_new_i64(); \ \ - if (a->imm) { \ - temp = tcg_temp_new(); \ - tcg_gen_addi_tl(temp, addr, a->imm); \ - addr = temp; \ - } \ + addr = make_address_i(ctx, addr, a->imm); \ \ tcg_gen_ld_i64(val, cpu_env, \ offsetof(CPULoongArchState, fpr[a->vd].vreg.E(a->imm2))); \ diff --git a/target/loongarch/insn_trans/trans_memory.c.inc b/target/loongarch/insn_trans/trans_memory.c.inc index ccebd0a4e0..88953f0ab0 100644 --- a/target/loongarch/insn_trans/trans_memory.c.inc +++ b/target/loongarch/insn_trans/trans_memory.c.inc @@ -8,11 +8,7 @@ static bool gen_load(DisasContext *ctx, arg_rr_i *a, MemOp mop) TCGv dest = gpr_dst(ctx, a->rd, EXT_NONE); TCGv addr = gpr_src(ctx, a->rj, EXT_NONE); - if (a->imm) { - TCGv temp = tcg_temp_new(); - tcg_gen_addi_tl(temp, addr, a->imm); - addr = temp; - } + addr = make_address_i(ctx, addr, a->imm); tcg_gen_qemu_ld_tl(dest, addr, ctx->mem_idx, mop); gen_set_gpr(a->rd, dest, EXT_NONE); @@ -24,11 +20,7 @@ static bool gen_store(DisasContext *ctx, arg_rr_i *a, MemOp mop) TCGv data = gpr_src(ctx, a->rd, EXT_NONE); TCGv addr = gpr_src(ctx, a->rj, EXT_NONE); - if (a->imm) { - TCGv temp = tcg_temp_new(); - tcg_gen_addi_tl(temp, addr, a->imm); - addr = temp; - } + addr = make_address_i(ctx, addr, a->imm); tcg_gen_qemu_st_tl(data, addr, ctx->mem_idx, mop); return true; @@ -66,6 +58,7 @@ static bool gen_load_gt(DisasContext *ctx, arg_rrr *a, MemOp mop) TCGv src2 = gpr_src(ctx, a->rk, EXT_NONE); gen_helper_asrtgt_d(cpu_env, src1, src2); + src1 = make_address_i(ctx, src1, 0); tcg_gen_qemu_ld_tl(dest, src1, ctx->mem_idx, mop); gen_set_gpr(a->rd, dest, EXT_NONE); @@ -79,6 +72,7 @@ static bool gen_load_le(DisasContext *ctx, arg_rrr *a, MemOp mop) TCGv src2 = gpr_src(ctx, a->rk, EXT_NONE); gen_helper_asrtle_d(cpu_env, src1, src2); + src1 = make_address_i(ctx, src1, 0); tcg_gen_qemu_ld_tl(dest, src1, ctx->mem_idx, mop); gen_set_gpr(a->rd, dest, EXT_NONE); @@ -92,6 +86,7 @@ static bool gen_store_gt(DisasContext *ctx, arg_rrr *a, MemOp mop) TCGv src2 = gpr_src(ctx, a->rk, EXT_NONE); gen_helper_asrtgt_d(cpu_env, src1, src2); + src1 = make_address_i(ctx, src1, 0); tcg_gen_qemu_st_tl(data, src1, ctx->mem_idx, mop); return true; @@ -104,6 +99,7 @@ static bool gen_store_le(DisasContext *ctx, arg_rrr *a, MemOp mop) TCGv src2 = gpr_src(ctx, a->rk, EXT_NONE); gen_helper_asrtle_d(cpu_env, src1, src2); + src1 = make_address_i(ctx, src1, 0); tcg_gen_qemu_st_tl(data, src1, ctx->mem_idx, mop); return true; @@ -131,11 +127,7 @@ static bool gen_ldptr(DisasContext *ctx, arg_rr_i *a, MemOp mop) TCGv dest = gpr_dst(ctx, a->rd, EXT_NONE); TCGv addr = gpr_src(ctx, a->rj, EXT_NONE); - if (a->imm) { - TCGv temp = tcg_temp_new(); - tcg_gen_addi_tl(temp, addr, a->imm); - addr = temp; - } + addr = make_address_i(ctx, addr, a->imm); tcg_gen_qemu_ld_tl(dest, addr, ctx->mem_idx, mop); gen_set_gpr(a->rd, dest, EXT_NONE); @@ -147,11 +139,7 @@ static bool gen_stptr(DisasContext *ctx, arg_rr_i *a, MemOp mop) TCGv data = gpr_src(ctx, a->rd, EXT_NONE); TCGv addr = gpr_src(ctx, a->rj, EXT_NONE); - if (a->imm) { - TCGv temp = tcg_temp_new(); - tcg_gen_addi_tl(temp, addr, a->imm); - addr = temp; - } + addr = make_address_i(ctx, addr, a->imm); tcg_gen_qemu_st_tl(data, addr, ctx->mem_idx, mop); return true; From patchwork Tue Aug 22 07:13:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 715694 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp118966wrp; Tue, 22 Aug 2023 00:15:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEHP+4JBNxD/wODKhE0SSg9G9e80Xri6LIP8T3J0cNKKTVtK2lYugwAxhfqZq6h/tTFGXH6 X-Received: by 2002:a05:620a:371c:b0:767:64cc:21c1 with SMTP id de28-20020a05620a371c00b0076764cc21c1mr9731541qkb.16.1692688546606; Tue, 22 Aug 2023 00:15:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692688546; cv=none; d=google.com; s=arc-20160816; b=tI3tPHPcI2WtqUrsv2xX2h74hj18I+z4q7oguwdWM5Fc17jlleIKuDYffkIcNsqRkU YO2DrEFEJJ0d1dJOImF2oxXsN2uZ2sYoZMVkWI7ly58BlCFbjmRGnUA8SWt/5bFP5iHh J5bPFnRP2Im7YwbQiIDW295Vnor38CpoPaiF7G+Dmi/DSt+AL2K28xpdNdUGmdMHTYts b5qblpB2sy9Cdu+cnxjYHRIcV34MMoaUjdFgmPnECII7FprfzyHAFEzPUX2NKj8vvyVs zZiJG1H4ZEuyMHYeZbecFZYhxPSHS9ZNTXfg8HrdcudHxO/lXqsHsSFMefk2DH0USQ3G PySg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=ac7pv2kpb0ajeFGbtJ3onoCTyP2ZNqDH1hhRLbCbPbE=; fh=iI1r750v8r6y4onCPOGlc5pA/zLiNuJX+n5Trfvo6Hc=; b=VAJrDnhhvoxAq+cmtkjyuTWFu6s5hTaSuxdiCBANwCYwI6V56LntVW0uLK3TyxCLeO WCNzhxQZRW/teJgzAjTeNyYomI5aVpwkmKSlrbWD1rCqmlsgszz2Oi92TdQPwT5C3Ws5 ZKBVTm2nQbSW7o9pEwL8hZaGSYuPoOCsWM8uprzRt3qR2gRqAJPr4FYGTmlvAGBG9zjM IU4JPYUNxSNPqqcT8r8uyKAnLthSmif8Ohg6BseVEvWTJ7HYhUUS/MTG5PAsYabW6HlO kAMwmHvdZKPSemEO/LFKlEVwQ6xIO8XpWxfCvaNw507BNetaSO0Qo/8Y4ySsEoW+aW1z TV1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t7hWtp1X; 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 u4-20020a05620a430400b0076770e82424si5806015qko.18.2023.08.22.00.15.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 00:15:46 -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=t7hWtp1X; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYLbQ-0001GK-9W; Tue, 22 Aug 2023 03:15:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYLbO-0001Dg-6Z for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:14:58 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYLbL-0002wi-QE for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:14:57 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3fef34c33d6so13457755e9.3 for ; Tue, 22 Aug 2023 00:14:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692688494; x=1693293294; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ac7pv2kpb0ajeFGbtJ3onoCTyP2ZNqDH1hhRLbCbPbE=; b=t7hWtp1XXtA92hEauBLXvL4NRLQtopFBPefeCNXAmepOE4/nZ4nHlSipRrBuhQ/3cu jkySjBR3gOweCCw+oxLQhuWQy8JB6szAmII9I91+DseISbmTquTFPA4GItcQo7z+r/Of ib2ndPoDlN87CvpavmvBVIHRqBw0n8HVPFATt/0qBdTFJJkTgKsonyCU+fffTmcemKVy yBPeflCb2GNKEtnVKuzsh60L6zORQK9CE54KdVh5vLyWsVssd2wLx7veNaeQL2/C/V7D qf5c2meGSllAzJFrV/BtlhS3j0dpzSEv2svztPmaz7dv3d3ZbadLnBphNhtEeNcDEjOs vc3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692688494; x=1693293294; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ac7pv2kpb0ajeFGbtJ3onoCTyP2ZNqDH1hhRLbCbPbE=; b=PPLUAS6ova86Aww9rHmNA8wLZeDrMKwgs4E8+8PB9Me1nsgdMBBY9hTvYwECiwtoGe nrBSwkW3UejMn0MkHf3TG/mUnuAvFUjpAyNhFqUkUkhbXlrmFVmIJDVEY08UVtkoFuCX wwOWUaHn7LqDlG1bcuPqAVDsFNxj0zDhvlpAXeVnj+Nz70yU4QtmVcxQZGvRs88bZ3aG Z54asr1Y/8jsjGntXFqYzqrV5mWesrGjSFMzV4cns0sEuACdfA0S1SlBoHabYHaUlQtb jGzOaywGjicA/tnJUYFqOmLL6mwPFn2WjSEGe7WURaSayOjgYk7oocdx8Hz++1eeHniV 7xBA== X-Gm-Message-State: AOJu0YxMa360lKgPG0dBjCmyevwLXmivsGuU+jjjeEgEbZzj4zAUCN/m wVOxCUT6VC4acx7QlJLfaTZa0YpS9AONzGHgw/UZrA== X-Received: by 2002:a05:600c:210b:b0:3fe:ef5b:bb6 with SMTP id u11-20020a05600c210b00b003feef5b0bb6mr4233930wml.35.1692688492733; Tue, 22 Aug 2023 00:14:52 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id a19-20020a05600c225300b003fee83ae4a3sm9452540wmm.9.2023.08.22.00.14.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 00:14:52 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Song Gao Cc: Xiaojuan Yang , Huacai Chen , Jiajie Chen , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH RESEND v5 07/19] target/loongarch: Extract make_address_pc() helper Date: Tue, 22 Aug 2023 09:13:53 +0200 Message-ID: <20230822071405.35386-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822071405.35386-1-philmd@linaro.org> References: <20230822071405.35386-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Jiajie Chen Signed-off-by: Jiajie Chen Reviewed-by: Richard Henderson Signed-off-by: Song Gao Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20230822032724.1353391-7-gaosong@loongson.cn> [PMD: Extract helper from bigger patch] Signed-off-by: Philippe Mathieu-Daudé --- target/loongarch/translate.c | 5 +++++ target/loongarch/insn_trans/trans_arith.c.inc | 2 +- target/loongarch/insn_trans/trans_branch.c.inc | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/target/loongarch/translate.c b/target/loongarch/translate.c index acc54d7587..8b26555a27 100644 --- a/target/loongarch/translate.c +++ b/target/loongarch/translate.c @@ -226,6 +226,11 @@ static TCGv make_address_i(DisasContext *ctx, TCGv base, target_long ofs) return make_address_x(ctx, base, addend); } +static uint64_t make_address_pc(DisasContext *ctx, uint64_t addr) +{ + return addr; +} + #include "decode-insns.c.inc" #include "insn_trans/trans_arith.c.inc" #include "insn_trans/trans_shift.c.inc" diff --git a/target/loongarch/insn_trans/trans_arith.c.inc b/target/loongarch/insn_trans/trans_arith.c.inc index 43d6cf261d..2aea4e41d5 100644 --- a/target/loongarch/insn_trans/trans_arith.c.inc +++ b/target/loongarch/insn_trans/trans_arith.c.inc @@ -72,7 +72,7 @@ static bool gen_pc(DisasContext *ctx, arg_r_i *a, target_ulong (*func)(target_ulong, int)) { TCGv dest = gpr_dst(ctx, a->rd, EXT_NONE); - target_ulong addr = func(ctx->base.pc_next, a->imm); + target_ulong addr = make_address_pc(ctx, func(ctx->base.pc_next, a->imm)); tcg_gen_movi_tl(dest, addr); gen_set_gpr(a->rd, dest, EXT_NONE); diff --git a/target/loongarch/insn_trans/trans_branch.c.inc b/target/loongarch/insn_trans/trans_branch.c.inc index 3ad34bcc05..2e35572cea 100644 --- a/target/loongarch/insn_trans/trans_branch.c.inc +++ b/target/loongarch/insn_trans/trans_branch.c.inc @@ -12,7 +12,7 @@ static bool trans_b(DisasContext *ctx, arg_b *a) static bool trans_bl(DisasContext *ctx, arg_bl *a) { - tcg_gen_movi_tl(cpu_gpr[1], ctx->base.pc_next + 4); + tcg_gen_movi_tl(cpu_gpr[1], make_address_pc(ctx, ctx->base.pc_next + 4)); gen_goto_tb(ctx, 0, ctx->base.pc_next + a->offs); ctx->base.is_jmp = DISAS_NORETURN; return true; @@ -25,7 +25,7 @@ static bool trans_jirl(DisasContext *ctx, arg_jirl *a) TCGv addr = make_address_i(ctx, src1, a->imm); tcg_gen_mov_tl(cpu_pc, addr); - tcg_gen_movi_tl(dest, ctx->base.pc_next + 4); + tcg_gen_movi_tl(dest, make_address_pc(ctx, ctx->base.pc_next + 4)); gen_set_gpr(a->rd, dest, EXT_NONE); tcg_gen_lookup_and_goto_ptr(); ctx->base.is_jmp = DISAS_NORETURN; From patchwork Tue Aug 22 07:13:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 715693 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp118879wrp; Tue, 22 Aug 2023 00:15:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtHtVSkonbOgs9R9oACDqUWd1LHxLNPfSI8BIvwlZFMSjASSNgsA2/YIWxtHtUFeLy0uKE X-Received: by 2002:a1f:4ec7:0:b0:486:e696:c69a with SMTP id c190-20020a1f4ec7000000b00486e696c69amr6753041vkb.16.1692688535643; Tue, 22 Aug 2023 00:15:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692688535; cv=none; d=google.com; s=arc-20160816; b=foNVD+tM/z2cen7wUlu3uka60pQj0lG1kdzF+rFRIQT0O6JHONmZEuGhmNuF9vG5KN 6Demyi+VhoF4f10rd624MqAXXKYOO5SGhPdectONFPP6hUiwGcqlv0BIs+skNsVhhOgU kXZyDDPypgvv9pL0piV439RE0CTnriCME7UhKGmEcz2nADaqOKe3L0Vo8RODsTkUJFQL aXnWtFle4OwAwueQsjXvhsf5cfdUP3edKx3iJMcwiAyHG2trCuF3RYIizySsJRMvPEoK IqW4Bck5ukNB+1jSJcy0Oz54wesfo0PoI9VfvneCWLCCFRTwoheYFxU3UKy2MwBBeGvY Q9BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=33DmERFUsYdjL3Dz9aMKxeBhsxHS9Ddy+t/2WnyHXOg=; fh=iI1r750v8r6y4onCPOGlc5pA/zLiNuJX+n5Trfvo6Hc=; b=pWywD/v9iHfO91RnxQ/rFSo7b1yplTV+Na8Y2FIN7eY7RTx5muKE5ZPF0ReGDw0vlk jMITrvQngm7z2yE3MoQ36R59aOzF3FhCOgUoeL+e0K6LY3sh1WpK5hFUxK6JGQEG78n4 gwDZWV4S2vLdqSxJyuEcyIUMkE8/dQJKGJ8FepWG6J+ozZwdPE8480oMcIx8r+VQgjT3 0PY+vKSZw2lnxorsmuwX1FRAe1Sto7mHpICKmoj2Zsmlv3Dscf7qYQlANdIYE/phKNj2 POjjbCjr5pTGhArZefhgVwgotWJVydp8+aVHAMulaWcq93JzOJV0wOtoL6sBTxmNgARP M/zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x2zqfScV; 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 m14-20020a05622a118e00b00403ab0d6550si5793419qtk.213.2023.08.22.00.15.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 00:15:35 -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=x2zqfScV; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYLbY-0001Yl-41; Tue, 22 Aug 2023 03:15:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYLbV-0001P9-P2 for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:15:05 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYLbS-0002xb-M8 for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:15:05 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-31c3726cc45so1966848f8f.0 for ; Tue, 22 Aug 2023 00:15:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692688500; x=1693293300; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=33DmERFUsYdjL3Dz9aMKxeBhsxHS9Ddy+t/2WnyHXOg=; b=x2zqfScVQOrpTc5S5O3uqic6Rn3AoSvtmbwzSnUk8ihH26moiU4Lizi7H4qUzptJJH TJ+FwUEf1QE8FCqvolnRcBgxtljRX02cEKrdylJ1KQ6sRcZ6MPD3RmLP27MwxkJhc82A sl2Q+DiYFX08wDrvW0IfXTkOuX3f7DoOtoWJgmukB1fM4Xq30yH0rNYsITyV0lpFOwPu KHUhZj36LtSeGgcLXcQMpeGXmrOU2DW1B0eN6p1US71BmIC3tnkL5sBgVsCZknug+COS hoPKDN/z06f230t8zpN3VmsV2bxibGopqQpkgHVSaQ2ElQT5tYh33quLW/KHqbFWqCaj 9dvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692688500; x=1693293300; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=33DmERFUsYdjL3Dz9aMKxeBhsxHS9Ddy+t/2WnyHXOg=; b=fDdQzbw3izBG0jN6JoDUh9TPz7IWWzhyqMQj5PVhvXkPGPE4r+V/b6wg0uVxueGlne m01Xr2fpFO72+h7aExGhORu5hBJC87yAO6C0wgm6gFI3z8L3yvSr4gaupAyLrP8qF3NU ceUzf3sAT14wjbrGsvdK+Iwcp5l2DJtO96ShiKLNbB0GgPq9UHoxomfxx4CuIGUSUH5G 8cQr0ZSGBQ+a+dIL23OCvtU0O5pUyg2BkpdWiRUGIA87SV8FsIVacghyqN5h48aSdwLe 9Pq8C2HrfNw89cDIPVG9rNNewsD/gnMK/2J90EGVVk0WMSKnh68iSyvRj1vx22MohB9X 6ZeA== X-Gm-Message-State: AOJu0YwtFvfe6klQqlGXQ3KJ4JZoNjmvB33vVwf51Jss+/g5Xa8DON6K UMPmSBe33Hlb0YjrtUoHmQJ5vDL+Wwga7LcVfGOrbA== X-Received: by 2002:adf:fe86:0:b0:31c:6525:770d with SMTP id l6-20020adffe86000000b0031c6525770dmr68580wrr.1.1692688500582; Tue, 22 Aug 2023 00:15:00 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id x4-20020adff0c4000000b003180fdf5589sm15093474wro.6.2023.08.22.00.14.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 00:15:00 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Song Gao Cc: Xiaojuan Yang , Huacai Chen , Jiajie Chen , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH RESEND v5 08/19] target/loongarch: Extract set_pc() helper Date: Tue, 22 Aug 2023 09:13:54 +0200 Message-ID: <20230822071405.35386-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822071405.35386-1-philmd@linaro.org> References: <20230822071405.35386-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Jiajie Chen Signed-off-by: Jiajie Chen Co-authored-by: Richard Henderson Reviewed-by: Richard Henderson Signed-off-by: Song Gao Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20230822032724.1353391-6-gaosong@loongson.cn> [PMD: Extract helper from bigger patch] Signed-off-by: Philippe Mathieu-Daudé --- target/loongarch/cpu.h | 5 +++++ target/loongarch/cpu.c | 16 ++++++++-------- target/loongarch/gdbstub.c | 2 +- target/loongarch/op_helper.c | 4 ++-- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h index 72109095e4..e1562695e8 100644 --- a/target/loongarch/cpu.h +++ b/target/loongarch/cpu.h @@ -443,6 +443,11 @@ static inline bool is_va32(CPULoongArchState *env) return va32; } +static inline void set_pc(CPULoongArchState *env, uint64_t value) +{ + env->pc = value; +} + /* * LoongArch CPUs hardware flags. */ diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index 822f2a72e5..67eb6c3135 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -81,7 +81,7 @@ static void loongarch_cpu_set_pc(CPUState *cs, vaddr value) LoongArchCPU *cpu = LOONGARCH_CPU(cs); CPULoongArchState *env = &cpu->env; - env->pc = value; + set_pc(env, value); } static vaddr loongarch_cpu_get_pc(CPUState *cs) @@ -168,7 +168,7 @@ static void loongarch_cpu_do_interrupt(CPUState *cs) set_DERA: env->CSR_DERA = env->pc; env->CSR_DBG = FIELD_DP64(env->CSR_DBG, CSR_DBG, DST, 1); - env->pc = env->CSR_EENTRY + 0x480; + set_pc(env, env->CSR_EENTRY + 0x480); break; case EXCCODE_INT: if (FIELD_EX64(env->CSR_DBG, CSR_DBG, DST)) { @@ -249,7 +249,8 @@ static void loongarch_cpu_do_interrupt(CPUState *cs) /* Find the highest-priority interrupt. */ vector = 31 - clz32(pending); - env->pc = env->CSR_EENTRY + (EXCCODE_EXTERNAL_INT + vector) * vec_size; + set_pc(env, env->CSR_EENTRY + \ + (EXCCODE_EXTERNAL_INT + vector) * vec_size); qemu_log_mask(CPU_LOG_INT, "%s: PC " TARGET_FMT_lx " ERA " TARGET_FMT_lx " cause %d\n" " A " TARGET_FMT_lx " D " @@ -260,10 +261,9 @@ static void loongarch_cpu_do_interrupt(CPUState *cs) env->CSR_ECFG, env->CSR_ESTAT); } else { if (tlbfill) { - env->pc = env->CSR_TLBRENTRY; + set_pc(env, env->CSR_TLBRENTRY); } else { - env->pc = env->CSR_EENTRY; - env->pc += EXCODE_MCODE(cause) * vec_size; + set_pc(env, env->CSR_EENTRY + EXCODE_MCODE(cause) * vec_size); } qemu_log_mask(CPU_LOG_INT, "%s: PC " TARGET_FMT_lx " ERA " TARGET_FMT_lx @@ -324,7 +324,7 @@ static void loongarch_cpu_synchronize_from_tb(CPUState *cs, CPULoongArchState *env = &cpu->env; tcg_debug_assert(!(cs->tcg_cflags & CF_PCREL)); - env->pc = tb->pc; + set_pc(env, tb->pc); } static void loongarch_restore_state_to_opc(CPUState *cs, @@ -334,7 +334,7 @@ static void loongarch_restore_state_to_opc(CPUState *cs, LoongArchCPU *cpu = LOONGARCH_CPU(cs); CPULoongArchState *env = &cpu->env; - env->pc = data[0]; + set_pc(env, data[0]); } #endif /* CONFIG_TCG */ diff --git a/target/loongarch/gdbstub.c b/target/loongarch/gdbstub.c index a462e25737..e20b20f99b 100644 --- a/target/loongarch/gdbstub.c +++ b/target/loongarch/gdbstub.c @@ -77,7 +77,7 @@ int loongarch_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) env->gpr[n] = tmp; length = read_length; } else if (n == 33) { - env->pc = tmp; + set_pc(env, tmp); length = read_length; } return length; diff --git a/target/loongarch/op_helper.c b/target/loongarch/op_helper.c index 60335a05e2..cf84f20aba 100644 --- a/target/loongarch/op_helper.c +++ b/target/loongarch/op_helper.c @@ -114,14 +114,14 @@ void helper_ertn(CPULoongArchState *env) env->CSR_TLBRERA = FIELD_DP64(env->CSR_TLBRERA, CSR_TLBRERA, ISTLBR, 0); env->CSR_CRMD = FIELD_DP64(env->CSR_CRMD, CSR_CRMD, DA, 0); env->CSR_CRMD = FIELD_DP64(env->CSR_CRMD, CSR_CRMD, PG, 1); - env->pc = env->CSR_TLBRERA; + set_pc(env, env->CSR_TLBRERA); qemu_log_mask(CPU_LOG_INT, "%s: TLBRERA " TARGET_FMT_lx "\n", __func__, env->CSR_TLBRERA); } else { csr_pplv = FIELD_EX64(env->CSR_PRMD, CSR_PRMD, PPLV); csr_pie = FIELD_EX64(env->CSR_PRMD, CSR_PRMD, PIE); - env->pc = env->CSR_ERA; + set_pc(env, env->CSR_ERA); qemu_log_mask(CPU_LOG_INT, "%s: ERA " TARGET_FMT_lx "\n", __func__, env->CSR_ERA); } From patchwork Tue Aug 22 07:13:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 715696 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp119086wrp; Tue, 22 Aug 2023 00:16:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEskVrvxe471RNe4K3qqDZi2CRVhrppvstDKIsc/cymVnwVIeqJPlLVIw/r+92qkwhfDpop X-Received: by 2002:a05:622a:1ba7:b0:403:a91f:893d with SMTP id bp39-20020a05622a1ba700b00403a91f893dmr13909553qtb.26.1692688562222; Tue, 22 Aug 2023 00:16:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692688562; cv=none; d=google.com; s=arc-20160816; b=pwLaboLfSAzHOT9e0awi8QVj22/9vcRRHL0tn67C/hTbud5md33Vqhw+g3pNeaV1rF IYSHzlfo+KeLzRO+a5/vv/WccxRLIPF/hVa/U5cL9FsgQFt/bjj/QhUsZ0rYP6i+6gXM TssN3t7JudyLFnFO24FB31lYD8nXcoX5dp1kEk/UyHVnkoQB4fGjG2o05T+7zHvTGYSx uY48FjcYSORtsjjXjFEtIoVJfFz7USYgn2Qpwt6aHcjuWBaQvTOO7xf3Bq9kqMUqaBHV C5ePb6tjc/1AKpshKPOz5xEWTh9TMK/YQ81ZU5l7yzv9GNZ8Fqs11aXj0zRmTLWSO7w5 9egw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=7qFzQwheFK9AxDde5uR4/WWTrinK6kAcK+JYbJLTxP0=; fh=iI1r750v8r6y4onCPOGlc5pA/zLiNuJX+n5Trfvo6Hc=; b=aCeGcrkBGVkHdRznM23vopdM/CTRGXUsmGIYdCbx6zt/yLW+FsAil4RAjn8mkGU5HV rNQl6PKJImW/MdEylERRH3Hj+NwODcJMxXNy+ksoEeZMuRfomx6Ep/OjbRQNCY1OtJUV nz7EcQj/s44Q9OfBeHUjKUhikOxq04hIBgcKm/QOzOX/5lBAI+OUu1v3Bmj2MCkX3tSb JZg13lrYiD/W0kPLFhbc4X8Iq/gx9AcYUhOBfhu+DqCDE9MkB728cMnUWxvjDPbGfFKo wrtieIUT/2DgPqqcpo2EIZwJwHuJlIKimlXr8rIrezeECiRHl3/I6Nwo6/JX1nq2aZDE 59Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O9nEF4u4; 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 b3-20020a05622a020300b00403ebf5cabfsi5918951qtx.423.2023.08.22.00.16.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 00:16:02 -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=O9nEF4u4; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYLbw-0002Aj-KX; Tue, 22 Aug 2023 03:15:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYLbf-0001xU-2r for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:15:18 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYLbY-0002z9-Kf for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:15:13 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3198d2745feso3708511f8f.1 for ; Tue, 22 Aug 2023 00:15:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692688507; x=1693293307; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7qFzQwheFK9AxDde5uR4/WWTrinK6kAcK+JYbJLTxP0=; b=O9nEF4u4uoo56fvng+xawxfBrUhZUIIZRcPUf1moFrXLegGrb+lDEywVYNd8PbKffL lR3CE3G3L52MuWomCbCdKkPj76vuA1tT8+XYv3YtVp85VXXKp6ZPCpdnXFWbeAghkAvL aV2rV7alU+FQNFhk0TB16v9NrnvneRgQCl93htcdCMBItDWOJqSvzZT3FQhrtOxMv/Fr H/RWlWPrx6S+u82h82PmqBGRYqIUA/leXdoy98YhcDfQOncDUsQYhdBKl2s6UYKGXtWA XEWxcTA/cLiWF5qKVp7yTp5wHMyhvAEId6JuhheIR5R2W8n5Bb3GrAXqUdTQRBD24UJO sDfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692688507; x=1693293307; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7qFzQwheFK9AxDde5uR4/WWTrinK6kAcK+JYbJLTxP0=; b=bLKPxtxJRZQ3Jh4InZSr8iMw0BUKal94WlfFF6xW4ZKziDbiD+9gTFElM/0sjYAI5I HGD00EYBveLrXFIYKxqigjN3wN4tl3QntEhrLPWqSr0rukW3mrh9Ul6MUhGU+Z7Klg6H VYZsi6niDpGtyDlfS7rup1chTUP5aRvIatC31Z1Gkj1Z/1EbmXrL71E7XuCppcR/Mp+1 n2nptdTDT28zaAgN2l4yMHr9lm4A+5TmX4r9E/cvYAd5ssedP/pR0d1iiDN2twLIs6KG hl6jCFReJ9qfyKKZEU/tCSeqieDiZtPUuEQnUda7KXXRCZOisFau2FtaO2hLuGKN34A8 oIMQ== X-Gm-Message-State: AOJu0YzER3hPk3rs/VDbmom779sjU8A8IuuPWbXsnG3SqOVJhjk1ZyLP L3GOXrNiAycd3iTliLZYrVV4S/paJzkXNMxHb07TKQ== X-Received: by 2002:a5d:408b:0:b0:31a:d1c3:97ca with SMTP id o11-20020a5d408b000000b0031ad1c397camr6230133wrp.20.1692688506834; Tue, 22 Aug 2023 00:15:06 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id j16-20020a056000125000b00317e6f06e22sm14942867wrx.77.2023.08.22.00.15.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 00:15:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Song Gao Cc: Xiaojuan Yang , Huacai Chen , Jiajie Chen , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH RESEND v5 09/19] target/loongarch: Truncate high 32 bits of address in VA32 mode Date: Tue, 22 Aug 2023 09:13:55 +0200 Message-ID: <20230822071405.35386-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822071405.35386-1-philmd@linaro.org> References: <20230822071405.35386-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Jiajie Chen When running in VA32 mode(!LA64 or VA32L[1-3] matching PLV), virtual address is truncated to 32 bits before address mapping. Signed-off-by: Jiajie Chen Co-authored-by: Richard Henderson Reviewed-by: Richard Henderson Signed-off-by: Song Gao Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20230822032724.1353391-6-gaosong@loongson.cn> --- target/loongarch/cpu.h | 6 +++++- target/loongarch/translate.c | 16 +++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h index e1562695e8..25a0ef7e41 100644 --- a/target/loongarch/cpu.h +++ b/target/loongarch/cpu.h @@ -445,7 +445,11 @@ static inline bool is_va32(CPULoongArchState *env) static inline void set_pc(CPULoongArchState *env, uint64_t value) { - env->pc = value; + if (is_va32(env)) { + env->pc = (uint32_t)value; + } else { + env->pc = value; + } } /* diff --git a/target/loongarch/translate.c b/target/loongarch/translate.c index 8b26555a27..9a23ec786d 100644 --- a/target/loongarch/translate.c +++ b/target/loongarch/translate.c @@ -86,6 +86,10 @@ void generate_exception(DisasContext *ctx, int excp) static inline void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) { + if (ctx->va32) { + dest = (uint32_t) dest; + } + if (translator_use_goto_tb(&ctx->base, dest)) { tcg_gen_goto_tb(n); tcg_gen_movi_tl(cpu_pc, dest); @@ -212,11 +216,17 @@ static TCGv make_address_x(DisasContext *ctx, TCGv base, TCGv addend) { TCGv temp = NULL; - if (addend) { + if (addend || ctx->va32) { temp = tcg_temp_new(); + } + if (addend) { tcg_gen_add_tl(temp, base, addend); base = temp; } + if (ctx->va32) { + tcg_gen_ext32u_tl(temp, base); + base = temp; + } return base; } @@ -262,6 +272,10 @@ static void loongarch_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) } ctx->base.pc_next += 4; + + if (ctx->va32) { + ctx->base.pc_next = (uint32_t)ctx->base.pc_next; + } } static void loongarch_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) From patchwork Tue Aug 22 07:19:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 715699 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp120582wrp; Tue, 22 Aug 2023 00:20:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEkWJIwqvn6wHHr4TkSgjyNALBdh6j1Bl1Rc3OViutybcf1yj5SKVNQ8UhCyeIcX4ZWuqu+ X-Received: by 2002:ae9:e011:0:b0:765:a7c3:69ab with SMTP id m17-20020ae9e011000000b00765a7c369abmr8767897qkk.45.1692688831999; Tue, 22 Aug 2023 00:20:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692688831; cv=none; d=google.com; s=arc-20160816; b=W6r1NdKYpIBpYYpkQaKUjmx4YDRXIBehxc3LgwqlVmH6YNmWWZUE/v9eoYBE8vS1ru 2z+0M8jRYdj5W4LOdYCiRmXXwHswg3FhXJXfUCOXT7kH3lLwPnvWDiel/eJ63nf/S2L8 caZKCtbRCcBlps9VJVLA+PeFmNSxplZ/3ASYAQHW1o/yI9cl3VTheWOof2B1O2zhOjtw AOcwDup76Z0LAOMvDKho8xETWbfc7OsNBa0HI0QHG8PROBH4QFpyYbFTAOpAYcVjDsm2 44+eqGUnb56RIH8A9AhOrNnkJ4JXiLELSMv+2iMJ9JWLkd6NgDkD6msa06pXnFo7Fi+a tRKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=MhjR1Tf2TeBu860wg/l8a21u7QsD4djihIlF5A0hbsE=; fh=IauHLtGdVi5m9rCNCDXgkBuY8q6wkaEoqBTGXQDGRRo=; b=LhUaOh8bmj1cgcnAB+/tOME2mRt1Ny34R2OjCOAbQonu8IkjAVb4IQw/BHxTh4xu3H bOptgBAet30llbudlVsAeaKIBC5ZhtG5DdNPV1f0AQC/csy9VjWs3W9CO0lP0vpTtmwI kJkbZH26/SeYEq72STepmwCYIqDz9jGjUt+pitpHx3OT/rfXYgwdshQlPy71qSgu8B2Z DA8L87TZtcEGVL1WJ3dHg2jUgfwOO6+UL5NyOujNWujLmlFvqLLTjZrf5XAdAsngLPqS 406zvCdGf600FLPye2EoKhFzk0fUIpoJS+tF2TRncaq0ODS5EkBs4NTEFDQZWljvzv9Z XY9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TxFtfTqf; 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 j8-20020a05620a288800b0076cb2727c15si863754qkp.638.2023.08.22.00.20.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 00:20:31 -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=TxFtfTqf; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYLgY-0006xj-Oc; Tue, 22 Aug 2023 03:20:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYLgW-0006xY-04 for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:20:16 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYLgS-0004cY-74 for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:20:14 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-31aeee69de0so2341457f8f.2 for ; Tue, 22 Aug 2023 00:20:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692688810; x=1693293610; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MhjR1Tf2TeBu860wg/l8a21u7QsD4djihIlF5A0hbsE=; b=TxFtfTqfzuP86TULQjBP9Fc9LyCmXjZfx39IvEUzYF/HziXdHqK7ZTJAlKSF+W1YF9 6hi+MwW63lcpE4iwjOvfE9eCrEGOREHnAP7z8zboMW0TdwzZc4uto1doQ1Kr1KeDplfV LjZlQCRu3bMrSjLgghLC9hc9Vu4wLRD3wljyjrL/ynVILJbTe7AsERNOHpwpbDmqxbUU XGD9DjFYDdGEwIh2d7nmwmTAQFpREB5ZvCCm5yc0YmSeeh1g4FWtDYd6iKnsC/G2FABL Crdkb2vl8casZLfuWfofEEsEn0FxyizV1DwroDbtgTvZUGdXlC9z+ww9JqUyKPU9g0ox AzlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692688810; x=1693293610; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MhjR1Tf2TeBu860wg/l8a21u7QsD4djihIlF5A0hbsE=; b=MsXcaud7dl8lSLFCSJxm8d7OUZSR2gaOgEsZ4MtHz3duC9eWi+1Jkg450q8raP/lUM VvU0iNVqwUTA9a6W+d0ZFRC+Ezu4AiLrTf8SqB5ZAXkDy0Xvv8/Md/b3glkOZxV6vanp S8GYhYna9GPek6R+tO5c3K1k5MDhiKPV/KpKuBzMj8V0F+0HkK5wzIG/fI0iIvIXshMN fJff700r88bsL3V6YAXvonyQyF2aYcyUh5yZlXCbEZXfpjxBCInR5w2TIJWxokcdyY0t X93hspfiL9/0djQh4gNpAV5DwIO0ja9aUcFPxK/lUERz5sCbog63wsGoaUHm5z214qAu lTUw== X-Gm-Message-State: AOJu0YyDdy3q/mXuVB4DDpBJMFKkQ/Dnnr8wy2d5OFLbI6gMpFlR5ger MxiOgsONSdvJhZAAySTtuvP9fxJnV/xJ6xi9wkMLkg== X-Received: by 2002:adf:fed1:0:b0:317:5b5f:2328 with SMTP id q17-20020adffed1000000b003175b5f2328mr6828132wrs.24.1692688810034; Tue, 22 Aug 2023 00:20:10 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id g18-20020a5d5552000000b003142ea7a661sm14807924wrw.21.2023.08.22.00.20.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 00:20:09 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Song Gao Cc: Jiajie Chen , Xiaojuan Yang , Huacai Chen , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH RESEND v5 10/19] target/loongarch: Sign extend results in VA32 mode Date: Tue, 22 Aug 2023 09:19:50 +0200 Message-ID: <20230822071959.35620-1-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822071405.35386-1-philmd@linaro.org> References: <20230822071405.35386-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Jiajie Chen In VA32 mode, BL, JIRL and PC* instructions should sign-extend the low 32 bit result to 64 bits. Signed-off-by: Jiajie Chen Reviewed-by: Richard Henderson Signed-off-by: Song Gao Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20230822032724.1353391-7-gaosong@loongson.cn> --- target/loongarch/translate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/loongarch/translate.c b/target/loongarch/translate.c index 9a23ec786d..de7c1c5d1f 100644 --- a/target/loongarch/translate.c +++ b/target/loongarch/translate.c @@ -238,6 +238,9 @@ static TCGv make_address_i(DisasContext *ctx, TCGv base, target_long ofs) static uint64_t make_address_pc(DisasContext *ctx, uint64_t addr) { + if (ctx->va32) { + addr = (int32_t)addr; + } return addr; } From patchwork Tue Aug 22 07:19:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 715701 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp120675wrp; Tue, 22 Aug 2023 00:20:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEBgENotAzoXfxMoO1s+BNMXPJIBIBJQPZMGFnczyG7LipiCW/vKpb1wARFbsN9n4Pcw8Ny X-Received: by 2002:a05:622a:19a1:b0:403:b6ab:48d1 with SMTP id u33-20020a05622a19a100b00403b6ab48d1mr12062963qtc.11.1692688857526; Tue, 22 Aug 2023 00:20:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692688857; cv=none; d=google.com; s=arc-20160816; b=Pn4O4kjyMLhmdPrF9cLhejod2yMrxqWfJDVwfOsK1ij3k28/+3Hmrh9jVwCo9xuQug 1NzfaMpmv8iwS2RnIgi3A9/+t2u6AjbUTNxXZ5lsCRbZC0Vc13PCQ/5sFhk0GfPSNGRK Vb6KhBxL1+OhvtLVg0PcotameSWI+CY4gXiUkawkmNLU0UjjZKDoq9t1PMcR9m6JlCBL +VEdERPLYMrztzhwQz7EV6FiTLpUWacsLWsZb0dHrYI4OwrPPZ/FlbWUhNS8no+BQQZr 0hTrcFSmypTVqZCMh2ZaTdJc1W3bFiEVIIghRhpuRdJGJAM/uj+zC+ofgqkkVANuKJCn CQKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=9bnBUwDIJFSVAQUUrPJSE5oq5MCBotmK31JNu1D2650=; fh=IauHLtGdVi5m9rCNCDXgkBuY8q6wkaEoqBTGXQDGRRo=; b=o1G6pvV/Jku6c0LgYsqOMN16Gz8RTpCHJykICynEbpF0fXDV00jHEpkuL2KyjGWBqD qT09VWT5nYOXmyBKLh5i1sKxn5OogxUfzF3QLcUYOUcFi7xh6IcVQ9kkGTMyNT9nlt9B bBG3pnvcW+AynHps7Cgu98jGb6V2WElFO0LYLmLICZ1Bni4RsXwf06HvefOJOFfQBH8c XdMWr98XZqArL00EauRn9Lr7csyXyWLHIiuD32gBNM/xC8D0IVmKfmX14nDn+2jB/owv fgdpI23wLJ/Kk3f1x1aWIEXgQdlEIxlqyLwtbCx0EzdoCS/Gw2mLeNmEHbgioZfeV7ZZ inSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bmHlXp9M; 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 u17-20020ac858d1000000b003ef42cd0da8si5834398qta.223.2023.08.22.00.20.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 00:20:57 -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=bmHlXp9M; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYLgl-0006z7-BZ; Tue, 22 Aug 2023 03:20:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYLgh-0006yf-8p for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:20:27 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYLgb-0004eL-Sl for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:20:27 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3fe12baec61so41754345e9.2 for ; Tue, 22 Aug 2023 00:20:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692688820; x=1693293620; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9bnBUwDIJFSVAQUUrPJSE5oq5MCBotmK31JNu1D2650=; b=bmHlXp9MwVoL15MbcViGW9S9Gz7maxwv52BW3tyTupI6HQxII38hd+apBdL1nvYtvO ZaZpGG87m3M5aZFkSF9P4zAbCuFFxY7sfpY2blAthnRxEkQoduDJa/lc3eyy/O/p+twu bXpxGLpV92/JwDGFrSVee64pmWOlpfavOEDSP1LdnjaRDNxPJv494gTtplcKiHrGo244 KBxGtXLMLPQuzYgazFi/ZcXkVDxViVm7hv68JgA60+HLL7tLxuDqmrsoERmMxxWc70QD WBAoMYEGg0dwlAos4YzZHI66XaqTgPn4GouOQdZkS5ZcVt00DAx+up4FoU3/EkQ6jzl1 ndTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692688820; x=1693293620; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9bnBUwDIJFSVAQUUrPJSE5oq5MCBotmK31JNu1D2650=; b=dz35h5HKvIIo/LWkOocRjc8O8kBoIalnJE6oXdagfKr2wHkUHgrCSXQ9vNYMnlMVZu pa27dFaVUl3VzSdB8QEArkkpNtKLpuQh+OaqksWmRq+QmwGEqqzOmNYvMPw66IhwUm1w IFhFPNENIJOZWGJCxdVKBxwyrH1IyGOgkdvN4W5bDxl0YHLntMEy5qIuqROnsZw9jNB8 FIQLrWVpSeOBlNaGieug6r7s+ZW7I7jhmASwrhfPCWg+G2Ck+So8M3/cik9Klxw/hQEL OxXejXSm3jbmok6OzO3H5HISw4nuA6Z8vUHFLHAGNnj+6CsleSDu65/D5g6fhIHs5hFP P6lw== X-Gm-Message-State: AOJu0YyGkRE2BA0LAh+uSLpUqEo5CoQxHU0oA8cxiCKJrm8sZ1sLt0GH 7ESX4+T/Pk/k2RP17+T0Nip2NDN4bmUoJpYhxARWlw== X-Received: by 2002:a5d:4d85:0:b0:319:7b57:8dc5 with SMTP id b5-20020a5d4d85000000b003197b578dc5mr6403161wru.54.1692688819356; Tue, 22 Aug 2023 00:20:19 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id d4-20020adffd84000000b003141f96ed36sm14889859wrr.0.2023.08.22.00.20.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 00:20:18 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Song Gao Cc: Jiajie Chen , Xiaojuan Yang , Huacai Chen , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH RESEND v5 11/19] target/loongarch: Add a check parameter to the TRANS macro Date: Tue, 22 Aug 2023 09:19:51 +0200 Message-ID: <20230822071959.35620-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822071405.35386-1-philmd@linaro.org> References: <20230822071405.35386-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Song Gao The default check parmeter is ALL. Suggested-by: Richard Henderson Signed-off-by: Song Gao Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-ID: <20230822032724.1353391-8-gaosong@loongson.cn> --- target/loongarch/translate.h | 6 +- target/loongarch/insn_trans/trans_arith.c.inc | 84 +- .../loongarch/insn_trans/trans_atomic.c.inc | 80 +- target/loongarch/insn_trans/trans_bit.c.inc | 56 +- .../loongarch/insn_trans/trans_branch.c.inc | 20 +- target/loongarch/insn_trans/trans_extra.c.inc | 16 +- .../loongarch/insn_trans/trans_farith.c.inc | 72 +- target/loongarch/insn_trans/trans_fcnv.c.inc | 56 +- .../loongarch/insn_trans/trans_fmemory.c.inc | 32 +- target/loongarch/insn_trans/trans_fmov.c.inc | 16 +- target/loongarch/insn_trans/trans_lsx.c.inc | 1236 ++++++++--------- .../loongarch/insn_trans/trans_memory.c.inc | 84 +- .../insn_trans/trans_privileged.c.inc | 16 +- target/loongarch/insn_trans/trans_shift.c.inc | 30 +- 14 files changed, 903 insertions(+), 901 deletions(-) diff --git a/target/loongarch/translate.h b/target/loongarch/translate.h index b6fa5df82d..3c5c746f30 100644 --- a/target/loongarch/translate.h +++ b/target/loongarch/translate.h @@ -10,9 +10,11 @@ #include "exec/translator.h" -#define TRANS(NAME, FUNC, ...) \ +#define TRANS(NAME, AVAIL, FUNC, ...) \ static bool trans_##NAME(DisasContext *ctx, arg_##NAME * a) \ - { return FUNC(ctx, a, __VA_ARGS__); } + { return avail_##AVAIL(ctx) && FUNC(ctx, a, __VA_ARGS__); } + +#define avail_ALL(C) true /* * If an operation is being performed on less than TARGET_LONG_BITS, diff --git a/target/loongarch/insn_trans/trans_arith.c.inc b/target/loongarch/insn_trans/trans_arith.c.inc index 2aea4e41d5..d7f69a7553 100644 --- a/target/loongarch/insn_trans/trans_arith.c.inc +++ b/target/loongarch/insn_trans/trans_arith.c.inc @@ -248,45 +248,45 @@ static bool trans_addu16i_d(DisasContext *ctx, arg_addu16i_d *a) return true; } -TRANS(add_w, gen_rrr, EXT_NONE, EXT_NONE, EXT_SIGN, tcg_gen_add_tl) -TRANS(add_d, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_add_tl) -TRANS(sub_w, gen_rrr, EXT_NONE, EXT_NONE, EXT_SIGN, tcg_gen_sub_tl) -TRANS(sub_d, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_sub_tl) -TRANS(and, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_and_tl) -TRANS(or, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_or_tl) -TRANS(xor, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_xor_tl) -TRANS(nor, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_nor_tl) -TRANS(andn, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_andc_tl) -TRANS(orn, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_orc_tl) -TRANS(slt, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_slt) -TRANS(sltu, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_sltu) -TRANS(mul_w, gen_rrr, EXT_SIGN, EXT_SIGN, EXT_SIGN, tcg_gen_mul_tl) -TRANS(mul_d, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_mul_tl) -TRANS(mulh_w, gen_rrr, EXT_SIGN, EXT_SIGN, EXT_NONE, gen_mulh_w) -TRANS(mulh_wu, gen_rrr, EXT_ZERO, EXT_ZERO, EXT_NONE, gen_mulh_w) -TRANS(mulh_d, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_mulh_d) -TRANS(mulh_du, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_mulh_du) -TRANS(mulw_d_w, gen_rrr, EXT_SIGN, EXT_SIGN, EXT_NONE, tcg_gen_mul_tl) -TRANS(mulw_d_wu, gen_rrr, EXT_ZERO, EXT_ZERO, EXT_NONE, tcg_gen_mul_tl) -TRANS(div_w, gen_rrr, EXT_SIGN, EXT_SIGN, EXT_SIGN, gen_div_w) -TRANS(mod_w, gen_rrr, EXT_SIGN, EXT_SIGN, EXT_SIGN, gen_rem_w) -TRANS(div_wu, gen_rrr, EXT_ZERO, EXT_ZERO, EXT_SIGN, gen_div_du) -TRANS(mod_wu, gen_rrr, EXT_ZERO, EXT_ZERO, EXT_SIGN, gen_rem_du) -TRANS(div_d, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_div_d) -TRANS(mod_d, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_rem_d) -TRANS(div_du, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_div_du) -TRANS(mod_du, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_rem_du) -TRANS(slti, gen_rri_v, EXT_NONE, EXT_NONE, gen_slt) -TRANS(sltui, gen_rri_v, EXT_NONE, EXT_NONE, gen_sltu) -TRANS(addi_w, gen_rri_c, EXT_NONE, EXT_SIGN, tcg_gen_addi_tl) -TRANS(addi_d, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_addi_tl) -TRANS(alsl_w, gen_rrr_sa, EXT_NONE, EXT_SIGN, gen_alsl) -TRANS(alsl_wu, gen_rrr_sa, EXT_NONE, EXT_ZERO, gen_alsl) -TRANS(alsl_d, gen_rrr_sa, EXT_NONE, EXT_NONE, gen_alsl) -TRANS(pcaddi, gen_pc, gen_pcaddi) -TRANS(pcalau12i, gen_pc, gen_pcalau12i) -TRANS(pcaddu12i, gen_pc, gen_pcaddu12i) -TRANS(pcaddu18i, gen_pc, gen_pcaddu18i) -TRANS(andi, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_andi_tl) -TRANS(ori, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_ori_tl) -TRANS(xori, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_xori_tl) +TRANS(add_w, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_SIGN, tcg_gen_add_tl) +TRANS(add_d, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_add_tl) +TRANS(sub_w, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_SIGN, tcg_gen_sub_tl) +TRANS(sub_d, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_sub_tl) +TRANS(and, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_and_tl) +TRANS(or, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_or_tl) +TRANS(xor, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_xor_tl) +TRANS(nor, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_nor_tl) +TRANS(andn, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_andc_tl) +TRANS(orn, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_orc_tl) +TRANS(slt, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_slt) +TRANS(sltu, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_sltu) +TRANS(mul_w, ALL, gen_rrr, EXT_SIGN, EXT_SIGN, EXT_SIGN, tcg_gen_mul_tl) +TRANS(mul_d, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_mul_tl) +TRANS(mulh_w, ALL, gen_rrr, EXT_SIGN, EXT_SIGN, EXT_NONE, gen_mulh_w) +TRANS(mulh_wu, ALL, gen_rrr, EXT_ZERO, EXT_ZERO, EXT_NONE, gen_mulh_w) +TRANS(mulh_d, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_mulh_d) +TRANS(mulh_du, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_mulh_du) +TRANS(mulw_d_w, ALL, gen_rrr, EXT_SIGN, EXT_SIGN, EXT_NONE, tcg_gen_mul_tl) +TRANS(mulw_d_wu, ALL, gen_rrr, EXT_ZERO, EXT_ZERO, EXT_NONE, tcg_gen_mul_tl) +TRANS(div_w, ALL, gen_rrr, EXT_SIGN, EXT_SIGN, EXT_SIGN, gen_div_w) +TRANS(mod_w, ALL, gen_rrr, EXT_SIGN, EXT_SIGN, EXT_SIGN, gen_rem_w) +TRANS(div_wu, ALL, gen_rrr, EXT_ZERO, EXT_ZERO, EXT_SIGN, gen_div_du) +TRANS(mod_wu, ALL, gen_rrr, EXT_ZERO, EXT_ZERO, EXT_SIGN, gen_rem_du) +TRANS(div_d, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_div_d) +TRANS(mod_d, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_rem_d) +TRANS(div_du, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_div_du) +TRANS(mod_du, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_rem_du) +TRANS(slti, ALL, gen_rri_v, EXT_NONE, EXT_NONE, gen_slt) +TRANS(sltui, ALL, gen_rri_v, EXT_NONE, EXT_NONE, gen_sltu) +TRANS(addi_w, ALL, gen_rri_c, EXT_NONE, EXT_SIGN, tcg_gen_addi_tl) +TRANS(addi_d, ALL, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_addi_tl) +TRANS(alsl_w, ALL, gen_rrr_sa, EXT_NONE, EXT_SIGN, gen_alsl) +TRANS(alsl_wu, ALL, gen_rrr_sa, EXT_NONE, EXT_ZERO, gen_alsl) +TRANS(alsl_d, ALL, gen_rrr_sa, EXT_NONE, EXT_NONE, gen_alsl) +TRANS(pcaddi, ALL, gen_pc, gen_pcaddi) +TRANS(pcalau12i, ALL, gen_pc, gen_pcalau12i) +TRANS(pcaddu12i, ALL, gen_pc, gen_pcaddu12i) +TRANS(pcaddu18i, ALL, gen_pc, gen_pcaddu18i) +TRANS(andi, ALL, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_andi_tl) +TRANS(ori, ALL, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_ori_tl) +TRANS(xori, ALL, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_xori_tl) diff --git a/target/loongarch/insn_trans/trans_atomic.c.inc b/target/loongarch/insn_trans/trans_atomic.c.inc index fbc081448d..0a02f0dbf3 100644 --- a/target/loongarch/insn_trans/trans_atomic.c.inc +++ b/target/loongarch/insn_trans/trans_atomic.c.inc @@ -69,43 +69,43 @@ static bool gen_am(DisasContext *ctx, arg_rrr *a, return true; } -TRANS(ll_w, gen_ll, MO_TESL) -TRANS(sc_w, gen_sc, MO_TESL) -TRANS(ll_d, gen_ll, MO_TEUQ) -TRANS(sc_d, gen_sc, MO_TEUQ) -TRANS(amswap_w, gen_am, tcg_gen_atomic_xchg_tl, MO_TESL) -TRANS(amswap_d, gen_am, tcg_gen_atomic_xchg_tl, MO_TEUQ) -TRANS(amadd_w, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TESL) -TRANS(amadd_d, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TEUQ) -TRANS(amand_w, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TESL) -TRANS(amand_d, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TEUQ) -TRANS(amor_w, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TESL) -TRANS(amor_d, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TEUQ) -TRANS(amxor_w, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TESL) -TRANS(amxor_d, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TEUQ) -TRANS(ammax_w, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TESL) -TRANS(ammax_d, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TEUQ) -TRANS(ammin_w, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TESL) -TRANS(ammin_d, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TEUQ) -TRANS(ammax_wu, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TESL) -TRANS(ammax_du, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TEUQ) -TRANS(ammin_wu, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TESL) -TRANS(ammin_du, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TEUQ) -TRANS(amswap_db_w, gen_am, tcg_gen_atomic_xchg_tl, MO_TESL) -TRANS(amswap_db_d, gen_am, tcg_gen_atomic_xchg_tl, MO_TEUQ) -TRANS(amadd_db_w, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TESL) -TRANS(amadd_db_d, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TEUQ) -TRANS(amand_db_w, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TESL) -TRANS(amand_db_d, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TEUQ) -TRANS(amor_db_w, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TESL) -TRANS(amor_db_d, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TEUQ) -TRANS(amxor_db_w, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TESL) -TRANS(amxor_db_d, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TEUQ) -TRANS(ammax_db_w, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TESL) -TRANS(ammax_db_d, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TEUQ) -TRANS(ammin_db_w, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TESL) -TRANS(ammin_db_d, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TEUQ) -TRANS(ammax_db_wu, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TESL) -TRANS(ammax_db_du, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TEUQ) -TRANS(ammin_db_wu, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TESL) -TRANS(ammin_db_du, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TEUQ) +TRANS(ll_w, ALL, gen_ll, MO_TESL) +TRANS(sc_w, ALL, gen_sc, MO_TESL) +TRANS(ll_d, ALL, gen_ll, MO_TEUQ) +TRANS(sc_d, ALL, gen_sc, MO_TEUQ) +TRANS(amswap_w, ALL, gen_am, tcg_gen_atomic_xchg_tl, MO_TESL) +TRANS(amswap_d, ALL, gen_am, tcg_gen_atomic_xchg_tl, MO_TEUQ) +TRANS(amadd_w, ALL, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TESL) +TRANS(amadd_d, ALL, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TEUQ) +TRANS(amand_w, ALL, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TESL) +TRANS(amand_d, ALL, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TEUQ) +TRANS(amor_w, ALL, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TESL) +TRANS(amor_d, ALL, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TEUQ) +TRANS(amxor_w, ALL, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TESL) +TRANS(amxor_d, ALL, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TEUQ) +TRANS(ammax_w, ALL, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TESL) +TRANS(ammax_d, ALL, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TEUQ) +TRANS(ammin_w, ALL, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TESL) +TRANS(ammin_d, ALL, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TEUQ) +TRANS(ammax_wu, ALL, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TESL) +TRANS(ammax_du, ALL, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TEUQ) +TRANS(ammin_wu, ALL, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TESL) +TRANS(ammin_du, ALL, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TEUQ) +TRANS(amswap_db_w, ALL, gen_am, tcg_gen_atomic_xchg_tl, MO_TESL) +TRANS(amswap_db_d, ALL, gen_am, tcg_gen_atomic_xchg_tl, MO_TEUQ) +TRANS(amadd_db_w, ALL, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TESL) +TRANS(amadd_db_d, ALL, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TEUQ) +TRANS(amand_db_w, ALL, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TESL) +TRANS(amand_db_d, ALL, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TEUQ) +TRANS(amor_db_w, ALL, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TESL) +TRANS(amor_db_d, ALL, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TEUQ) +TRANS(amxor_db_w, ALL, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TESL) +TRANS(amxor_db_d, ALL, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TEUQ) +TRANS(ammax_db_w, ALL, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TESL) +TRANS(ammax_db_d, ALL, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TEUQ) +TRANS(ammin_db_w, ALL, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TESL) +TRANS(ammin_db_d, ALL, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TEUQ) +TRANS(ammax_db_wu, ALL, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TESL) +TRANS(ammax_db_du, ALL, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TEUQ) +TRANS(ammin_db_wu, ALL, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TESL) +TRANS(ammin_db_du, ALL, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TEUQ) diff --git a/target/loongarch/insn_trans/trans_bit.c.inc b/target/loongarch/insn_trans/trans_bit.c.inc index 25b4d7858b..d2a7ac28f7 100644 --- a/target/loongarch/insn_trans/trans_bit.c.inc +++ b/target/loongarch/insn_trans/trans_bit.c.inc @@ -178,31 +178,31 @@ static void gen_masknez(TCGv dest, TCGv src1, TCGv src2) tcg_gen_movcond_tl(TCG_COND_NE, dest, src2, zero, zero, src1); } -TRANS(ext_w_h, gen_rr, EXT_NONE, EXT_NONE, tcg_gen_ext16s_tl) -TRANS(ext_w_b, gen_rr, EXT_NONE, EXT_NONE, tcg_gen_ext8s_tl) -TRANS(clo_w, gen_rr, EXT_NONE, EXT_NONE, gen_clo_w) -TRANS(clz_w, gen_rr, EXT_ZERO, EXT_NONE, gen_clz_w) -TRANS(cto_w, gen_rr, EXT_NONE, EXT_NONE, gen_cto_w) -TRANS(ctz_w, gen_rr, EXT_NONE, EXT_NONE, gen_ctz_w) -TRANS(clo_d, gen_rr, EXT_NONE, EXT_NONE, gen_clo_d) -TRANS(clz_d, gen_rr, EXT_NONE, EXT_NONE, gen_clz_d) -TRANS(cto_d, gen_rr, EXT_NONE, EXT_NONE, gen_cto_d) -TRANS(ctz_d, gen_rr, EXT_NONE, EXT_NONE, gen_ctz_d) -TRANS(revb_2h, gen_rr, EXT_NONE, EXT_SIGN, gen_revb_2h) -TRANS(revb_4h, gen_rr, EXT_NONE, EXT_NONE, gen_revb_4h) -TRANS(revb_2w, gen_rr, EXT_NONE, EXT_NONE, gen_revb_2w) -TRANS(revb_d, gen_rr, EXT_NONE, EXT_NONE, tcg_gen_bswap64_i64) -TRANS(revh_2w, gen_rr, EXT_NONE, EXT_NONE, gen_revh_2w) -TRANS(revh_d, gen_rr, EXT_NONE, EXT_NONE, gen_revh_d) -TRANS(bitrev_4b, gen_rr, EXT_ZERO, EXT_SIGN, gen_helper_bitswap) -TRANS(bitrev_8b, gen_rr, EXT_NONE, EXT_NONE, gen_helper_bitswap) -TRANS(bitrev_w, gen_rr, EXT_NONE, EXT_SIGN, gen_helper_bitrev_w) -TRANS(bitrev_d, gen_rr, EXT_NONE, EXT_NONE, gen_helper_bitrev_d) -TRANS(maskeqz, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_maskeqz) -TRANS(masknez, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_masknez) -TRANS(bytepick_w, gen_rrr_sa, EXT_NONE, EXT_NONE, gen_bytepick_w) -TRANS(bytepick_d, gen_rrr_sa, EXT_NONE, EXT_NONE, gen_bytepick_d) -TRANS(bstrins_w, gen_bstrins, EXT_SIGN) -TRANS(bstrins_d, gen_bstrins, EXT_NONE) -TRANS(bstrpick_w, gen_bstrpick, EXT_SIGN) -TRANS(bstrpick_d, gen_bstrpick, EXT_NONE) +TRANS(ext_w_h, ALL, gen_rr, EXT_NONE, EXT_NONE, tcg_gen_ext16s_tl) +TRANS(ext_w_b, ALL, gen_rr, EXT_NONE, EXT_NONE, tcg_gen_ext8s_tl) +TRANS(clo_w, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_clo_w) +TRANS(clz_w, ALL, gen_rr, EXT_ZERO, EXT_NONE, gen_clz_w) +TRANS(cto_w, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_cto_w) +TRANS(ctz_w, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_ctz_w) +TRANS(clo_d, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_clo_d) +TRANS(clz_d, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_clz_d) +TRANS(cto_d, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_cto_d) +TRANS(ctz_d, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_ctz_d) +TRANS(revb_2h, ALL, gen_rr, EXT_NONE, EXT_SIGN, gen_revb_2h) +TRANS(revb_4h, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_revb_4h) +TRANS(revb_2w, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_revb_2w) +TRANS(revb_d, ALL, gen_rr, EXT_NONE, EXT_NONE, tcg_gen_bswap64_i64) +TRANS(revh_2w, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_revh_2w) +TRANS(revh_d, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_revh_d) +TRANS(bitrev_4b, ALL, gen_rr, EXT_ZERO, EXT_SIGN, gen_helper_bitswap) +TRANS(bitrev_8b, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_helper_bitswap) +TRANS(bitrev_w, ALL, gen_rr, EXT_NONE, EXT_SIGN, gen_helper_bitrev_w) +TRANS(bitrev_d, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_helper_bitrev_d) +TRANS(maskeqz, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_maskeqz) +TRANS(masknez, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_masknez) +TRANS(bytepick_w, ALL, gen_rrr_sa, EXT_NONE, EXT_NONE, gen_bytepick_w) +TRANS(bytepick_d, ALL, gen_rrr_sa, EXT_NONE, EXT_NONE, gen_bytepick_d) +TRANS(bstrins_w, ALL, gen_bstrins, EXT_SIGN) +TRANS(bstrins_d, ALL, gen_bstrins, EXT_NONE) +TRANS(bstrpick_w, ALL, gen_bstrpick, EXT_SIGN) +TRANS(bstrpick_d, ALL, gen_bstrpick, EXT_NONE) diff --git a/target/loongarch/insn_trans/trans_branch.c.inc b/target/loongarch/insn_trans/trans_branch.c.inc index 2e35572cea..50f7eb640a 100644 --- a/target/loongarch/insn_trans/trans_branch.c.inc +++ b/target/loongarch/insn_trans/trans_branch.c.inc @@ -72,13 +72,13 @@ static bool gen_cz_bc(DisasContext *ctx, arg_c_offs *a, TCGCond cond) return true; } -TRANS(beq, gen_rr_bc, TCG_COND_EQ) -TRANS(bne, gen_rr_bc, TCG_COND_NE) -TRANS(blt, gen_rr_bc, TCG_COND_LT) -TRANS(bge, gen_rr_bc, TCG_COND_GE) -TRANS(bltu, gen_rr_bc, TCG_COND_LTU) -TRANS(bgeu, gen_rr_bc, TCG_COND_GEU) -TRANS(beqz, gen_rz_bc, TCG_COND_EQ) -TRANS(bnez, gen_rz_bc, TCG_COND_NE) -TRANS(bceqz, gen_cz_bc, TCG_COND_EQ) -TRANS(bcnez, gen_cz_bc, TCG_COND_NE) +TRANS(beq, ALL, gen_rr_bc, TCG_COND_EQ) +TRANS(bne, ALL, gen_rr_bc, TCG_COND_NE) +TRANS(blt, ALL, gen_rr_bc, TCG_COND_LT) +TRANS(bge, ALL, gen_rr_bc, TCG_COND_GE) +TRANS(bltu, ALL, gen_rr_bc, TCG_COND_LTU) +TRANS(bgeu, ALL, gen_rr_bc, TCG_COND_GEU) +TRANS(beqz, ALL, gen_rz_bc, TCG_COND_EQ) +TRANS(bnez, ALL, gen_rz_bc, TCG_COND_NE) +TRANS(bceqz, ALL, gen_cz_bc, TCG_COND_EQ) +TRANS(bcnez, ALL, gen_cz_bc, TCG_COND_NE) diff --git a/target/loongarch/insn_trans/trans_extra.c.inc b/target/loongarch/insn_trans/trans_extra.c.inc index 06f4de4515..b354ca0f86 100644 --- a/target/loongarch/insn_trans/trans_extra.c.inc +++ b/target/loongarch/insn_trans/trans_extra.c.inc @@ -89,11 +89,11 @@ static bool gen_crc(DisasContext *ctx, arg_rrr *a, return true; } -TRANS(crc_w_b_w, gen_crc, gen_helper_crc32, tcg_constant_tl(1)) -TRANS(crc_w_h_w, gen_crc, gen_helper_crc32, tcg_constant_tl(2)) -TRANS(crc_w_w_w, gen_crc, gen_helper_crc32, tcg_constant_tl(4)) -TRANS(crc_w_d_w, gen_crc, gen_helper_crc32, tcg_constant_tl(8)) -TRANS(crcc_w_b_w, gen_crc, gen_helper_crc32c, tcg_constant_tl(1)) -TRANS(crcc_w_h_w, gen_crc, gen_helper_crc32c, tcg_constant_tl(2)) -TRANS(crcc_w_w_w, gen_crc, gen_helper_crc32c, tcg_constant_tl(4)) -TRANS(crcc_w_d_w, gen_crc, gen_helper_crc32c, tcg_constant_tl(8)) +TRANS(crc_w_b_w, ALL, gen_crc, gen_helper_crc32, tcg_constant_tl(1)) +TRANS(crc_w_h_w, ALL, gen_crc, gen_helper_crc32, tcg_constant_tl(2)) +TRANS(crc_w_w_w, ALL, gen_crc, gen_helper_crc32, tcg_constant_tl(4)) +TRANS(crc_w_d_w, ALL, gen_crc, gen_helper_crc32, tcg_constant_tl(8)) +TRANS(crcc_w_b_w, ALL, gen_crc, gen_helper_crc32c, tcg_constant_tl(1)) +TRANS(crcc_w_h_w, ALL, gen_crc, gen_helper_crc32c, tcg_constant_tl(2)) +TRANS(crcc_w_w_w, ALL, gen_crc, gen_helper_crc32c, tcg_constant_tl(4)) +TRANS(crcc_w_d_w, ALL, gen_crc, gen_helper_crc32c, tcg_constant_tl(8)) diff --git a/target/loongarch/insn_trans/trans_farith.c.inc b/target/loongarch/insn_trans/trans_farith.c.inc index 21ea47308b..b1a1dc7b01 100644 --- a/target/loongarch/insn_trans/trans_farith.c.inc +++ b/target/loongarch/insn_trans/trans_farith.c.inc @@ -143,41 +143,41 @@ static bool trans_fneg_d(DisasContext *ctx, arg_fneg_d *a) return true; } -TRANS(fadd_s, gen_fff, gen_helper_fadd_s) -TRANS(fadd_d, gen_fff, gen_helper_fadd_d) -TRANS(fsub_s, gen_fff, gen_helper_fsub_s) -TRANS(fsub_d, gen_fff, gen_helper_fsub_d) -TRANS(fmul_s, gen_fff, gen_helper_fmul_s) -TRANS(fmul_d, gen_fff, gen_helper_fmul_d) -TRANS(fdiv_s, gen_fff, gen_helper_fdiv_s) -TRANS(fdiv_d, gen_fff, gen_helper_fdiv_d) -TRANS(fmax_s, gen_fff, gen_helper_fmax_s) -TRANS(fmax_d, gen_fff, gen_helper_fmax_d) -TRANS(fmin_s, gen_fff, gen_helper_fmin_s) -TRANS(fmin_d, gen_fff, gen_helper_fmin_d) -TRANS(fmaxa_s, gen_fff, gen_helper_fmaxa_s) -TRANS(fmaxa_d, gen_fff, gen_helper_fmaxa_d) -TRANS(fmina_s, gen_fff, gen_helper_fmina_s) -TRANS(fmina_d, gen_fff, gen_helper_fmina_d) -TRANS(fscaleb_s, gen_fff, gen_helper_fscaleb_s) -TRANS(fscaleb_d, gen_fff, gen_helper_fscaleb_d) -TRANS(fsqrt_s, gen_ff, gen_helper_fsqrt_s) -TRANS(fsqrt_d, gen_ff, gen_helper_fsqrt_d) -TRANS(frecip_s, gen_ff, gen_helper_frecip_s) -TRANS(frecip_d, gen_ff, gen_helper_frecip_d) -TRANS(frsqrt_s, gen_ff, gen_helper_frsqrt_s) -TRANS(frsqrt_d, gen_ff, gen_helper_frsqrt_d) -TRANS(flogb_s, gen_ff, gen_helper_flogb_s) -TRANS(flogb_d, gen_ff, gen_helper_flogb_d) -TRANS(fclass_s, gen_ff, gen_helper_fclass_s) -TRANS(fclass_d, gen_ff, gen_helper_fclass_d) -TRANS(fmadd_s, gen_muladd, gen_helper_fmuladd_s, 0) -TRANS(fmadd_d, gen_muladd, gen_helper_fmuladd_d, 0) -TRANS(fmsub_s, gen_muladd, gen_helper_fmuladd_s, float_muladd_negate_c) -TRANS(fmsub_d, gen_muladd, gen_helper_fmuladd_d, float_muladd_negate_c) -TRANS(fnmadd_s, gen_muladd, gen_helper_fmuladd_s, float_muladd_negate_result) -TRANS(fnmadd_d, gen_muladd, gen_helper_fmuladd_d, float_muladd_negate_result) -TRANS(fnmsub_s, gen_muladd, gen_helper_fmuladd_s, +TRANS(fadd_s, ALL, gen_fff, gen_helper_fadd_s) +TRANS(fadd_d, ALL, gen_fff, gen_helper_fadd_d) +TRANS(fsub_s, ALL, gen_fff, gen_helper_fsub_s) +TRANS(fsub_d, ALL, gen_fff, gen_helper_fsub_d) +TRANS(fmul_s, ALL, gen_fff, gen_helper_fmul_s) +TRANS(fmul_d, ALL, gen_fff, gen_helper_fmul_d) +TRANS(fdiv_s, ALL, gen_fff, gen_helper_fdiv_s) +TRANS(fdiv_d, ALL, gen_fff, gen_helper_fdiv_d) +TRANS(fmax_s, ALL, gen_fff, gen_helper_fmax_s) +TRANS(fmax_d, ALL, gen_fff, gen_helper_fmax_d) +TRANS(fmin_s, ALL, gen_fff, gen_helper_fmin_s) +TRANS(fmin_d, ALL, gen_fff, gen_helper_fmin_d) +TRANS(fmaxa_s, ALL, gen_fff, gen_helper_fmaxa_s) +TRANS(fmaxa_d, ALL, gen_fff, gen_helper_fmaxa_d) +TRANS(fmina_s, ALL, gen_fff, gen_helper_fmina_s) +TRANS(fmina_d, ALL, gen_fff, gen_helper_fmina_d) +TRANS(fscaleb_s, ALL, gen_fff, gen_helper_fscaleb_s) +TRANS(fscaleb_d, ALL, gen_fff, gen_helper_fscaleb_d) +TRANS(fsqrt_s, ALL, gen_ff, gen_helper_fsqrt_s) +TRANS(fsqrt_d, ALL, gen_ff, gen_helper_fsqrt_d) +TRANS(frecip_s, ALL, gen_ff, gen_helper_frecip_s) +TRANS(frecip_d, ALL, gen_ff, gen_helper_frecip_d) +TRANS(frsqrt_s, ALL, gen_ff, gen_helper_frsqrt_s) +TRANS(frsqrt_d, ALL, gen_ff, gen_helper_frsqrt_d) +TRANS(flogb_s, ALL, gen_ff, gen_helper_flogb_s) +TRANS(flogb_d, ALL, gen_ff, gen_helper_flogb_d) +TRANS(fclass_s, ALL, gen_ff, gen_helper_fclass_s) +TRANS(fclass_d, ALL, gen_ff, gen_helper_fclass_d) +TRANS(fmadd_s, ALL, gen_muladd, gen_helper_fmuladd_s, 0) +TRANS(fmadd_d, ALL, gen_muladd, gen_helper_fmuladd_d, 0) +TRANS(fmsub_s, ALL, gen_muladd, gen_helper_fmuladd_s, float_muladd_negate_c) +TRANS(fmsub_d, ALL, gen_muladd, gen_helper_fmuladd_d, float_muladd_negate_c) +TRANS(fnmadd_s, ALL, gen_muladd, gen_helper_fmuladd_s, float_muladd_negate_result) +TRANS(fnmadd_d, ALL, gen_muladd, gen_helper_fmuladd_d, float_muladd_negate_result) +TRANS(fnmsub_s, ALL, gen_muladd, gen_helper_fmuladd_s, float_muladd_negate_c | float_muladd_negate_result) -TRANS(fnmsub_d, gen_muladd, gen_helper_fmuladd_d, +TRANS(fnmsub_d, ALL, gen_muladd, gen_helper_fmuladd_d, float_muladd_negate_c | float_muladd_negate_result) diff --git a/target/loongarch/insn_trans/trans_fcnv.c.inc b/target/loongarch/insn_trans/trans_fcnv.c.inc index c1c6918ad1..329a2d6872 100644 --- a/target/loongarch/insn_trans/trans_fcnv.c.inc +++ b/target/loongarch/insn_trans/trans_fcnv.c.inc @@ -3,31 +3,31 @@ * Copyright (c) 2021 Loongson Technology Corporation Limited */ -TRANS(fcvt_s_d, gen_ff, gen_helper_fcvt_s_d) -TRANS(fcvt_d_s, gen_ff, gen_helper_fcvt_d_s) -TRANS(ftintrm_w_s, gen_ff, gen_helper_ftintrm_w_s) -TRANS(ftintrm_w_d, gen_ff, gen_helper_ftintrm_w_d) -TRANS(ftintrm_l_s, gen_ff, gen_helper_ftintrm_l_s) -TRANS(ftintrm_l_d, gen_ff, gen_helper_ftintrm_l_d) -TRANS(ftintrp_w_s, gen_ff, gen_helper_ftintrp_w_s) -TRANS(ftintrp_w_d, gen_ff, gen_helper_ftintrp_w_d) -TRANS(ftintrp_l_s, gen_ff, gen_helper_ftintrp_l_s) -TRANS(ftintrp_l_d, gen_ff, gen_helper_ftintrp_l_d) -TRANS(ftintrz_w_s, gen_ff, gen_helper_ftintrz_w_s) -TRANS(ftintrz_w_d, gen_ff, gen_helper_ftintrz_w_d) -TRANS(ftintrz_l_s, gen_ff, gen_helper_ftintrz_l_s) -TRANS(ftintrz_l_d, gen_ff, gen_helper_ftintrz_l_d) -TRANS(ftintrne_w_s, gen_ff, gen_helper_ftintrne_w_s) -TRANS(ftintrne_w_d, gen_ff, gen_helper_ftintrne_w_d) -TRANS(ftintrne_l_s, gen_ff, gen_helper_ftintrne_l_s) -TRANS(ftintrne_l_d, gen_ff, gen_helper_ftintrne_l_d) -TRANS(ftint_w_s, gen_ff, gen_helper_ftint_w_s) -TRANS(ftint_w_d, gen_ff, gen_helper_ftint_w_d) -TRANS(ftint_l_s, gen_ff, gen_helper_ftint_l_s) -TRANS(ftint_l_d, gen_ff, gen_helper_ftint_l_d) -TRANS(ffint_s_w, gen_ff, gen_helper_ffint_s_w) -TRANS(ffint_s_l, gen_ff, gen_helper_ffint_s_l) -TRANS(ffint_d_w, gen_ff, gen_helper_ffint_d_w) -TRANS(ffint_d_l, gen_ff, gen_helper_ffint_d_l) -TRANS(frint_s, gen_ff, gen_helper_frint_s) -TRANS(frint_d, gen_ff, gen_helper_frint_d) +TRANS(fcvt_s_d, ALL, gen_ff, gen_helper_fcvt_s_d) +TRANS(fcvt_d_s, ALL, gen_ff, gen_helper_fcvt_d_s) +TRANS(ftintrm_w_s, ALL, gen_ff, gen_helper_ftintrm_w_s) +TRANS(ftintrm_w_d, ALL, gen_ff, gen_helper_ftintrm_w_d) +TRANS(ftintrm_l_s, ALL, gen_ff, gen_helper_ftintrm_l_s) +TRANS(ftintrm_l_d, ALL, gen_ff, gen_helper_ftintrm_l_d) +TRANS(ftintrp_w_s, ALL, gen_ff, gen_helper_ftintrp_w_s) +TRANS(ftintrp_w_d, ALL, gen_ff, gen_helper_ftintrp_w_d) +TRANS(ftintrp_l_s, ALL, gen_ff, gen_helper_ftintrp_l_s) +TRANS(ftintrp_l_d, ALL, gen_ff, gen_helper_ftintrp_l_d) +TRANS(ftintrz_w_s, ALL, gen_ff, gen_helper_ftintrz_w_s) +TRANS(ftintrz_w_d, ALL, gen_ff, gen_helper_ftintrz_w_d) +TRANS(ftintrz_l_s, ALL, gen_ff, gen_helper_ftintrz_l_s) +TRANS(ftintrz_l_d, ALL, gen_ff, gen_helper_ftintrz_l_d) +TRANS(ftintrne_w_s, ALL, gen_ff, gen_helper_ftintrne_w_s) +TRANS(ftintrne_w_d, ALL, gen_ff, gen_helper_ftintrne_w_d) +TRANS(ftintrne_l_s, ALL, gen_ff, gen_helper_ftintrne_l_s) +TRANS(ftintrne_l_d, ALL, gen_ff, gen_helper_ftintrne_l_d) +TRANS(ftint_w_s, ALL, gen_ff, gen_helper_ftint_w_s) +TRANS(ftint_w_d, ALL, gen_ff, gen_helper_ftint_w_d) +TRANS(ftint_l_s, ALL, gen_ff, gen_helper_ftint_l_s) +TRANS(ftint_l_d, ALL, gen_ff, gen_helper_ftint_l_d) +TRANS(ffint_s_w, ALL, gen_ff, gen_helper_ffint_s_w) +TRANS(ffint_s_l, ALL, gen_ff, gen_helper_ffint_s_l) +TRANS(ffint_d_w, ALL, gen_ff, gen_helper_ffint_d_w) +TRANS(ffint_d_l, ALL, gen_ff, gen_helper_ffint_d_l) +TRANS(frint_s, ALL, gen_ff, gen_helper_frint_s) +TRANS(frint_d, ALL, gen_ff, gen_helper_frint_d) diff --git a/target/loongarch/insn_trans/trans_fmemory.c.inc b/target/loongarch/insn_trans/trans_fmemory.c.inc index bd3aba2c49..8e3b4522c9 100644 --- a/target/loongarch/insn_trans/trans_fmemory.c.inc +++ b/target/loongarch/insn_trans/trans_fmemory.c.inc @@ -140,19 +140,19 @@ static bool gen_fstore_le(DisasContext *ctx, arg_frr *a, MemOp mop) return true; } -TRANS(fld_s, gen_fload_i, MO_TEUL) -TRANS(fst_s, gen_fstore_i, MO_TEUL) -TRANS(fld_d, gen_fload_i, MO_TEUQ) -TRANS(fst_d, gen_fstore_i, MO_TEUQ) -TRANS(fldx_s, gen_floadx, MO_TEUL) -TRANS(fldx_d, gen_floadx, MO_TEUQ) -TRANS(fstx_s, gen_fstorex, MO_TEUL) -TRANS(fstx_d, gen_fstorex, MO_TEUQ) -TRANS(fldgt_s, gen_fload_gt, MO_TEUL) -TRANS(fldgt_d, gen_fload_gt, MO_TEUQ) -TRANS(fldle_s, gen_fload_le, MO_TEUL) -TRANS(fldle_d, gen_fload_le, MO_TEUQ) -TRANS(fstgt_s, gen_fstore_gt, MO_TEUL) -TRANS(fstgt_d, gen_fstore_gt, MO_TEUQ) -TRANS(fstle_s, gen_fstore_le, MO_TEUL) -TRANS(fstle_d, gen_fstore_le, MO_TEUQ) +TRANS(fld_s, ALL, gen_fload_i, MO_TEUL) +TRANS(fst_s, ALL, gen_fstore_i, MO_TEUL) +TRANS(fld_d, ALL, gen_fload_i, MO_TEUQ) +TRANS(fst_d, ALL, gen_fstore_i, MO_TEUQ) +TRANS(fldx_s, ALL, gen_floadx, MO_TEUL) +TRANS(fldx_d, ALL, gen_floadx, MO_TEUQ) +TRANS(fstx_s, ALL, gen_fstorex, MO_TEUL) +TRANS(fstx_d, ALL, gen_fstorex, MO_TEUQ) +TRANS(fldgt_s, ALL, gen_fload_gt, MO_TEUL) +TRANS(fldgt_d, ALL, gen_fload_gt, MO_TEUQ) +TRANS(fldle_s, ALL, gen_fload_le, MO_TEUL) +TRANS(fldle_d, ALL, gen_fload_le, MO_TEUQ) +TRANS(fstgt_s, ALL, gen_fstore_gt, MO_TEUL) +TRANS(fstgt_d, ALL, gen_fstore_gt, MO_TEUQ) +TRANS(fstle_s, ALL, gen_fstore_le, MO_TEUL) +TRANS(fstle_d, ALL, gen_fstore_le, MO_TEUQ) diff --git a/target/loongarch/insn_trans/trans_fmov.c.inc b/target/loongarch/insn_trans/trans_fmov.c.inc index 5af0dd1b66..aa7fea67b5 100644 --- a/target/loongarch/insn_trans/trans_fmov.c.inc +++ b/target/loongarch/insn_trans/trans_fmov.c.inc @@ -178,11 +178,11 @@ static bool trans_movcf2gr(DisasContext *ctx, arg_movcf2gr *a) return true; } -TRANS(fmov_s, gen_f2f, tcg_gen_mov_tl, true) -TRANS(fmov_d, gen_f2f, tcg_gen_mov_tl, false) -TRANS(movgr2fr_w, gen_r2f, gen_movgr2fr_w) -TRANS(movgr2fr_d, gen_r2f, tcg_gen_mov_tl) -TRANS(movgr2frh_w, gen_r2f, gen_movgr2frh_w) -TRANS(movfr2gr_s, gen_f2r, tcg_gen_ext32s_tl) -TRANS(movfr2gr_d, gen_f2r, tcg_gen_mov_tl) -TRANS(movfrh2gr_s, gen_f2r, gen_movfrh2gr_s) +TRANS(fmov_s, ALL, gen_f2f, tcg_gen_mov_tl, true) +TRANS(fmov_d, ALL, gen_f2f, tcg_gen_mov_tl, false) +TRANS(movgr2fr_w, ALL, gen_r2f, gen_movgr2fr_w) +TRANS(movgr2fr_d, ALL, gen_r2f, tcg_gen_mov_tl) +TRANS(movgr2frh_w, ALL, gen_r2f, gen_movgr2frh_w) +TRANS(movfr2gr_s, ALL, gen_f2r, tcg_gen_ext32s_tl) +TRANS(movfr2gr_d, ALL, gen_f2r, tcg_gen_mov_tl) +TRANS(movfrh2gr_s, ALL, gen_f2r, gen_movfrh2gr_s) diff --git a/target/loongarch/insn_trans/trans_lsx.c.inc b/target/loongarch/insn_trans/trans_lsx.c.inc index 50153d6d0b..45e0e738ad 100644 --- a/target/loongarch/insn_trans/trans_lsx.c.inc +++ b/target/loongarch/insn_trans/trans_lsx.c.inc @@ -135,10 +135,10 @@ static bool gvec_subi(DisasContext *ctx, arg_vv_i *a, MemOp mop) return true; } -TRANS(vadd_b, gvec_vvv, MO_8, tcg_gen_gvec_add) -TRANS(vadd_h, gvec_vvv, MO_16, tcg_gen_gvec_add) -TRANS(vadd_w, gvec_vvv, MO_32, tcg_gen_gvec_add) -TRANS(vadd_d, gvec_vvv, MO_64, tcg_gen_gvec_add) +TRANS(vadd_b, ALL, gvec_vvv, MO_8, tcg_gen_gvec_add) +TRANS(vadd_h, ALL, gvec_vvv, MO_16, tcg_gen_gvec_add) +TRANS(vadd_w, ALL, gvec_vvv, MO_32, tcg_gen_gvec_add) +TRANS(vadd_d, ALL, gvec_vvv, MO_64, tcg_gen_gvec_add) #define VADDSUB_Q(NAME) \ static bool trans_v## NAME ##_q(DisasContext *ctx, arg_vvv *a) \ @@ -170,58 +170,58 @@ static bool trans_v## NAME ##_q(DisasContext *ctx, arg_vvv *a) \ VADDSUB_Q(add) VADDSUB_Q(sub) -TRANS(vsub_b, gvec_vvv, MO_8, tcg_gen_gvec_sub) -TRANS(vsub_h, gvec_vvv, MO_16, tcg_gen_gvec_sub) -TRANS(vsub_w, gvec_vvv, MO_32, tcg_gen_gvec_sub) -TRANS(vsub_d, gvec_vvv, MO_64, tcg_gen_gvec_sub) +TRANS(vsub_b, ALL, gvec_vvv, MO_8, tcg_gen_gvec_sub) +TRANS(vsub_h, ALL, gvec_vvv, MO_16, tcg_gen_gvec_sub) +TRANS(vsub_w, ALL, gvec_vvv, MO_32, tcg_gen_gvec_sub) +TRANS(vsub_d, ALL, gvec_vvv, MO_64, tcg_gen_gvec_sub) -TRANS(vaddi_bu, gvec_vv_i, MO_8, tcg_gen_gvec_addi) -TRANS(vaddi_hu, gvec_vv_i, MO_16, tcg_gen_gvec_addi) -TRANS(vaddi_wu, gvec_vv_i, MO_32, tcg_gen_gvec_addi) -TRANS(vaddi_du, gvec_vv_i, MO_64, tcg_gen_gvec_addi) -TRANS(vsubi_bu, gvec_subi, MO_8) -TRANS(vsubi_hu, gvec_subi, MO_16) -TRANS(vsubi_wu, gvec_subi, MO_32) -TRANS(vsubi_du, gvec_subi, MO_64) +TRANS(vaddi_bu, ALL, gvec_vv_i, MO_8, tcg_gen_gvec_addi) +TRANS(vaddi_hu, ALL, gvec_vv_i, MO_16, tcg_gen_gvec_addi) +TRANS(vaddi_wu, ALL, gvec_vv_i, MO_32, tcg_gen_gvec_addi) +TRANS(vaddi_du, ALL, gvec_vv_i, MO_64, tcg_gen_gvec_addi) +TRANS(vsubi_bu, ALL, gvec_subi, MO_8) +TRANS(vsubi_hu, ALL, gvec_subi, MO_16) +TRANS(vsubi_wu, ALL, gvec_subi, MO_32) +TRANS(vsubi_du, ALL, gvec_subi, MO_64) -TRANS(vneg_b, gvec_vv, MO_8, tcg_gen_gvec_neg) -TRANS(vneg_h, gvec_vv, MO_16, tcg_gen_gvec_neg) -TRANS(vneg_w, gvec_vv, MO_32, tcg_gen_gvec_neg) -TRANS(vneg_d, gvec_vv, MO_64, tcg_gen_gvec_neg) +TRANS(vneg_b, ALL, gvec_vv, MO_8, tcg_gen_gvec_neg) +TRANS(vneg_h, ALL, gvec_vv, MO_16, tcg_gen_gvec_neg) +TRANS(vneg_w, ALL, gvec_vv, MO_32, tcg_gen_gvec_neg) +TRANS(vneg_d, ALL, gvec_vv, MO_64, tcg_gen_gvec_neg) -TRANS(vsadd_b, gvec_vvv, MO_8, tcg_gen_gvec_ssadd) -TRANS(vsadd_h, gvec_vvv, MO_16, tcg_gen_gvec_ssadd) -TRANS(vsadd_w, gvec_vvv, MO_32, tcg_gen_gvec_ssadd) -TRANS(vsadd_d, gvec_vvv, MO_64, tcg_gen_gvec_ssadd) -TRANS(vsadd_bu, gvec_vvv, MO_8, tcg_gen_gvec_usadd) -TRANS(vsadd_hu, gvec_vvv, MO_16, tcg_gen_gvec_usadd) -TRANS(vsadd_wu, gvec_vvv, MO_32, tcg_gen_gvec_usadd) -TRANS(vsadd_du, gvec_vvv, MO_64, tcg_gen_gvec_usadd) -TRANS(vssub_b, gvec_vvv, MO_8, tcg_gen_gvec_sssub) -TRANS(vssub_h, gvec_vvv, MO_16, tcg_gen_gvec_sssub) -TRANS(vssub_w, gvec_vvv, MO_32, tcg_gen_gvec_sssub) -TRANS(vssub_d, gvec_vvv, MO_64, tcg_gen_gvec_sssub) -TRANS(vssub_bu, gvec_vvv, MO_8, tcg_gen_gvec_ussub) -TRANS(vssub_hu, gvec_vvv, MO_16, tcg_gen_gvec_ussub) -TRANS(vssub_wu, gvec_vvv, MO_32, tcg_gen_gvec_ussub) -TRANS(vssub_du, gvec_vvv, MO_64, tcg_gen_gvec_ussub) +TRANS(vsadd_b, ALL, gvec_vvv, MO_8, tcg_gen_gvec_ssadd) +TRANS(vsadd_h, ALL, gvec_vvv, MO_16, tcg_gen_gvec_ssadd) +TRANS(vsadd_w, ALL, gvec_vvv, MO_32, tcg_gen_gvec_ssadd) +TRANS(vsadd_d, ALL, gvec_vvv, MO_64, tcg_gen_gvec_ssadd) +TRANS(vsadd_bu, ALL, gvec_vvv, MO_8, tcg_gen_gvec_usadd) +TRANS(vsadd_hu, ALL, gvec_vvv, MO_16, tcg_gen_gvec_usadd) +TRANS(vsadd_wu, ALL, gvec_vvv, MO_32, tcg_gen_gvec_usadd) +TRANS(vsadd_du, ALL, gvec_vvv, MO_64, tcg_gen_gvec_usadd) +TRANS(vssub_b, ALL, gvec_vvv, MO_8, tcg_gen_gvec_sssub) +TRANS(vssub_h, ALL, gvec_vvv, MO_16, tcg_gen_gvec_sssub) +TRANS(vssub_w, ALL, gvec_vvv, MO_32, tcg_gen_gvec_sssub) +TRANS(vssub_d, ALL, gvec_vvv, MO_64, tcg_gen_gvec_sssub) +TRANS(vssub_bu, ALL, gvec_vvv, MO_8, tcg_gen_gvec_ussub) +TRANS(vssub_hu, ALL, gvec_vvv, MO_16, tcg_gen_gvec_ussub) +TRANS(vssub_wu, ALL, gvec_vvv, MO_32, tcg_gen_gvec_ussub) +TRANS(vssub_du, ALL, gvec_vvv, MO_64, tcg_gen_gvec_ussub) -TRANS(vhaddw_h_b, gen_vvv, gen_helper_vhaddw_h_b) -TRANS(vhaddw_w_h, gen_vvv, gen_helper_vhaddw_w_h) -TRANS(vhaddw_d_w, gen_vvv, gen_helper_vhaddw_d_w) -TRANS(vhaddw_q_d, gen_vvv, gen_helper_vhaddw_q_d) -TRANS(vhaddw_hu_bu, gen_vvv, gen_helper_vhaddw_hu_bu) -TRANS(vhaddw_wu_hu, gen_vvv, gen_helper_vhaddw_wu_hu) -TRANS(vhaddw_du_wu, gen_vvv, gen_helper_vhaddw_du_wu) -TRANS(vhaddw_qu_du, gen_vvv, gen_helper_vhaddw_qu_du) -TRANS(vhsubw_h_b, gen_vvv, gen_helper_vhsubw_h_b) -TRANS(vhsubw_w_h, gen_vvv, gen_helper_vhsubw_w_h) -TRANS(vhsubw_d_w, gen_vvv, gen_helper_vhsubw_d_w) -TRANS(vhsubw_q_d, gen_vvv, gen_helper_vhsubw_q_d) -TRANS(vhsubw_hu_bu, gen_vvv, gen_helper_vhsubw_hu_bu) -TRANS(vhsubw_wu_hu, gen_vvv, gen_helper_vhsubw_wu_hu) -TRANS(vhsubw_du_wu, gen_vvv, gen_helper_vhsubw_du_wu) -TRANS(vhsubw_qu_du, gen_vvv, gen_helper_vhsubw_qu_du) +TRANS(vhaddw_h_b, ALL, gen_vvv, gen_helper_vhaddw_h_b) +TRANS(vhaddw_w_h, ALL, gen_vvv, gen_helper_vhaddw_w_h) +TRANS(vhaddw_d_w, ALL, gen_vvv, gen_helper_vhaddw_d_w) +TRANS(vhaddw_q_d, ALL, gen_vvv, gen_helper_vhaddw_q_d) +TRANS(vhaddw_hu_bu, ALL, gen_vvv, gen_helper_vhaddw_hu_bu) +TRANS(vhaddw_wu_hu, ALL, gen_vvv, gen_helper_vhaddw_wu_hu) +TRANS(vhaddw_du_wu, ALL, gen_vvv, gen_helper_vhaddw_du_wu) +TRANS(vhaddw_qu_du, ALL, gen_vvv, gen_helper_vhaddw_qu_du) +TRANS(vhsubw_h_b, ALL, gen_vvv, gen_helper_vhsubw_h_b) +TRANS(vhsubw_w_h, ALL, gen_vvv, gen_helper_vhsubw_w_h) +TRANS(vhsubw_d_w, ALL, gen_vvv, gen_helper_vhsubw_d_w) +TRANS(vhsubw_q_d, ALL, gen_vvv, gen_helper_vhsubw_q_d) +TRANS(vhsubw_hu_bu, ALL, gen_vvv, gen_helper_vhsubw_hu_bu) +TRANS(vhsubw_wu_hu, ALL, gen_vvv, gen_helper_vhsubw_wu_hu) +TRANS(vhsubw_du_wu, ALL, gen_vvv, gen_helper_vhsubw_du_wu) +TRANS(vhsubw_qu_du, ALL, gen_vvv, gen_helper_vhsubw_qu_du) static void gen_vaddwev_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -301,10 +301,10 @@ static void do_vaddwev_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vaddwev_h_b, gvec_vvv, MO_8, do_vaddwev_s) -TRANS(vaddwev_w_h, gvec_vvv, MO_16, do_vaddwev_s) -TRANS(vaddwev_d_w, gvec_vvv, MO_32, do_vaddwev_s) -TRANS(vaddwev_q_d, gvec_vvv, MO_64, do_vaddwev_s) +TRANS(vaddwev_h_b, ALL, gvec_vvv, MO_8, do_vaddwev_s) +TRANS(vaddwev_w_h, ALL, gvec_vvv, MO_16, do_vaddwev_s) +TRANS(vaddwev_d_w, ALL, gvec_vvv, MO_32, do_vaddwev_s) +TRANS(vaddwev_q_d, ALL, gvec_vvv, MO_64, do_vaddwev_s) static void gen_vaddwod_w_h(TCGv_i32 t, TCGv_i32 a, TCGv_i32 b) { @@ -380,10 +380,10 @@ static void do_vaddwod_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vaddwod_h_b, gvec_vvv, MO_8, do_vaddwod_s) -TRANS(vaddwod_w_h, gvec_vvv, MO_16, do_vaddwod_s) -TRANS(vaddwod_d_w, gvec_vvv, MO_32, do_vaddwod_s) -TRANS(vaddwod_q_d, gvec_vvv, MO_64, do_vaddwod_s) +TRANS(vaddwod_h_b, ALL, gvec_vvv, MO_8, do_vaddwod_s) +TRANS(vaddwod_w_h, ALL, gvec_vvv, MO_16, do_vaddwod_s) +TRANS(vaddwod_d_w, ALL, gvec_vvv, MO_32, do_vaddwod_s) +TRANS(vaddwod_q_d, ALL, gvec_vvv, MO_64, do_vaddwod_s) static void gen_vsubwev_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -463,10 +463,10 @@ static void do_vsubwev_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vsubwev_h_b, gvec_vvv, MO_8, do_vsubwev_s) -TRANS(vsubwev_w_h, gvec_vvv, MO_16, do_vsubwev_s) -TRANS(vsubwev_d_w, gvec_vvv, MO_32, do_vsubwev_s) -TRANS(vsubwev_q_d, gvec_vvv, MO_64, do_vsubwev_s) +TRANS(vsubwev_h_b, ALL, gvec_vvv, MO_8, do_vsubwev_s) +TRANS(vsubwev_w_h, ALL, gvec_vvv, MO_16, do_vsubwev_s) +TRANS(vsubwev_d_w, ALL, gvec_vvv, MO_32, do_vsubwev_s) +TRANS(vsubwev_q_d, ALL, gvec_vvv, MO_64, do_vsubwev_s) static void gen_vsubwod_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -542,10 +542,10 @@ static void do_vsubwod_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vsubwod_h_b, gvec_vvv, MO_8, do_vsubwod_s) -TRANS(vsubwod_w_h, gvec_vvv, MO_16, do_vsubwod_s) -TRANS(vsubwod_d_w, gvec_vvv, MO_32, do_vsubwod_s) -TRANS(vsubwod_q_d, gvec_vvv, MO_64, do_vsubwod_s) +TRANS(vsubwod_h_b, ALL, gvec_vvv, MO_8, do_vsubwod_s) +TRANS(vsubwod_w_h, ALL, gvec_vvv, MO_16, do_vsubwod_s) +TRANS(vsubwod_d_w, ALL, gvec_vvv, MO_32, do_vsubwod_s) +TRANS(vsubwod_q_d, ALL, gvec_vvv, MO_64, do_vsubwod_s) static void gen_vaddwev_u(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -617,10 +617,10 @@ static void do_vaddwev_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vaddwev_h_bu, gvec_vvv, MO_8, do_vaddwev_u) -TRANS(vaddwev_w_hu, gvec_vvv, MO_16, do_vaddwev_u) -TRANS(vaddwev_d_wu, gvec_vvv, MO_32, do_vaddwev_u) -TRANS(vaddwev_q_du, gvec_vvv, MO_64, do_vaddwev_u) +TRANS(vaddwev_h_bu, ALL, gvec_vvv, MO_8, do_vaddwev_u) +TRANS(vaddwev_w_hu, ALL, gvec_vvv, MO_16, do_vaddwev_u) +TRANS(vaddwev_d_wu, ALL, gvec_vvv, MO_32, do_vaddwev_u) +TRANS(vaddwev_q_du, ALL, gvec_vvv, MO_64, do_vaddwev_u) static void gen_vaddwod_u(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -696,10 +696,10 @@ static void do_vaddwod_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vaddwod_h_bu, gvec_vvv, MO_8, do_vaddwod_u) -TRANS(vaddwod_w_hu, gvec_vvv, MO_16, do_vaddwod_u) -TRANS(vaddwod_d_wu, gvec_vvv, MO_32, do_vaddwod_u) -TRANS(vaddwod_q_du, gvec_vvv, MO_64, do_vaddwod_u) +TRANS(vaddwod_h_bu, ALL, gvec_vvv, MO_8, do_vaddwod_u) +TRANS(vaddwod_w_hu, ALL, gvec_vvv, MO_16, do_vaddwod_u) +TRANS(vaddwod_d_wu, ALL, gvec_vvv, MO_32, do_vaddwod_u) +TRANS(vaddwod_q_du, ALL, gvec_vvv, MO_64, do_vaddwod_u) static void gen_vsubwev_u(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -771,10 +771,10 @@ static void do_vsubwev_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vsubwev_h_bu, gvec_vvv, MO_8, do_vsubwev_u) -TRANS(vsubwev_w_hu, gvec_vvv, MO_16, do_vsubwev_u) -TRANS(vsubwev_d_wu, gvec_vvv, MO_32, do_vsubwev_u) -TRANS(vsubwev_q_du, gvec_vvv, MO_64, do_vsubwev_u) +TRANS(vsubwev_h_bu, ALL, gvec_vvv, MO_8, do_vsubwev_u) +TRANS(vsubwev_w_hu, ALL, gvec_vvv, MO_16, do_vsubwev_u) +TRANS(vsubwev_d_wu, ALL, gvec_vvv, MO_32, do_vsubwev_u) +TRANS(vsubwev_q_du, ALL, gvec_vvv, MO_64, do_vsubwev_u) static void gen_vsubwod_u(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -850,10 +850,10 @@ static void do_vsubwod_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vsubwod_h_bu, gvec_vvv, MO_8, do_vsubwod_u) -TRANS(vsubwod_w_hu, gvec_vvv, MO_16, do_vsubwod_u) -TRANS(vsubwod_d_wu, gvec_vvv, MO_32, do_vsubwod_u) -TRANS(vsubwod_q_du, gvec_vvv, MO_64, do_vsubwod_u) +TRANS(vsubwod_h_bu, ALL, gvec_vvv, MO_8, do_vsubwod_u) +TRANS(vsubwod_w_hu, ALL, gvec_vvv, MO_16, do_vsubwod_u) +TRANS(vsubwod_d_wu, ALL, gvec_vvv, MO_32, do_vsubwod_u) +TRANS(vsubwod_q_du, ALL, gvec_vvv, MO_64, do_vsubwod_u) static void gen_vaddwev_u_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -933,10 +933,10 @@ static void do_vaddwev_u_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vaddwev_h_bu_b, gvec_vvv, MO_8, do_vaddwev_u_s) -TRANS(vaddwev_w_hu_h, gvec_vvv, MO_16, do_vaddwev_u_s) -TRANS(vaddwev_d_wu_w, gvec_vvv, MO_32, do_vaddwev_u_s) -TRANS(vaddwev_q_du_d, gvec_vvv, MO_64, do_vaddwev_u_s) +TRANS(vaddwev_h_bu_b, ALL, gvec_vvv, MO_8, do_vaddwev_u_s) +TRANS(vaddwev_w_hu_h, ALL, gvec_vvv, MO_16, do_vaddwev_u_s) +TRANS(vaddwev_d_wu_w, ALL, gvec_vvv, MO_32, do_vaddwev_u_s) +TRANS(vaddwev_q_du_d, ALL, gvec_vvv, MO_64, do_vaddwev_u_s) static void gen_vaddwod_u_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -1013,10 +1013,10 @@ static void do_vaddwod_u_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vaddwod_h_bu_b, gvec_vvv, MO_8, do_vaddwod_u_s) -TRANS(vaddwod_w_hu_h, gvec_vvv, MO_16, do_vaddwod_u_s) -TRANS(vaddwod_d_wu_w, gvec_vvv, MO_32, do_vaddwod_u_s) -TRANS(vaddwod_q_du_d, gvec_vvv, MO_64, do_vaddwod_u_s) +TRANS(vaddwod_h_bu_b, ALL, gvec_vvv, MO_8, do_vaddwod_u_s) +TRANS(vaddwod_w_hu_h, ALL, gvec_vvv, MO_16, do_vaddwod_u_s) +TRANS(vaddwod_d_wu_w, ALL, gvec_vvv, MO_32, do_vaddwod_u_s) +TRANS(vaddwod_q_du_d, ALL, gvec_vvv, MO_64, do_vaddwod_u_s) static void do_vavg(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b, void (*gen_shr_vec)(unsigned, TCGv_vec, @@ -1125,14 +1125,14 @@ static void do_vavg_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vavg_b, gvec_vvv, MO_8, do_vavg_s) -TRANS(vavg_h, gvec_vvv, MO_16, do_vavg_s) -TRANS(vavg_w, gvec_vvv, MO_32, do_vavg_s) -TRANS(vavg_d, gvec_vvv, MO_64, do_vavg_s) -TRANS(vavg_bu, gvec_vvv, MO_8, do_vavg_u) -TRANS(vavg_hu, gvec_vvv, MO_16, do_vavg_u) -TRANS(vavg_wu, gvec_vvv, MO_32, do_vavg_u) -TRANS(vavg_du, gvec_vvv, MO_64, do_vavg_u) +TRANS(vavg_b, ALL, gvec_vvv, MO_8, do_vavg_s) +TRANS(vavg_h, ALL, gvec_vvv, MO_16, do_vavg_s) +TRANS(vavg_w, ALL, gvec_vvv, MO_32, do_vavg_s) +TRANS(vavg_d, ALL, gvec_vvv, MO_64, do_vavg_s) +TRANS(vavg_bu, ALL, gvec_vvv, MO_8, do_vavg_u) +TRANS(vavg_hu, ALL, gvec_vvv, MO_16, do_vavg_u) +TRANS(vavg_wu, ALL, gvec_vvv, MO_32, do_vavg_u) +TRANS(vavg_du, ALL, gvec_vvv, MO_64, do_vavg_u) static void do_vavgr_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, uint32_t vk_ofs, uint32_t oprsz, uint32_t maxsz) @@ -1206,14 +1206,14 @@ static void do_vavgr_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vavgr_b, gvec_vvv, MO_8, do_vavgr_s) -TRANS(vavgr_h, gvec_vvv, MO_16, do_vavgr_s) -TRANS(vavgr_w, gvec_vvv, MO_32, do_vavgr_s) -TRANS(vavgr_d, gvec_vvv, MO_64, do_vavgr_s) -TRANS(vavgr_bu, gvec_vvv, MO_8, do_vavgr_u) -TRANS(vavgr_hu, gvec_vvv, MO_16, do_vavgr_u) -TRANS(vavgr_wu, gvec_vvv, MO_32, do_vavgr_u) -TRANS(vavgr_du, gvec_vvv, MO_64, do_vavgr_u) +TRANS(vavgr_b, ALL, gvec_vvv, MO_8, do_vavgr_s) +TRANS(vavgr_h, ALL, gvec_vvv, MO_16, do_vavgr_s) +TRANS(vavgr_w, ALL, gvec_vvv, MO_32, do_vavgr_s) +TRANS(vavgr_d, ALL, gvec_vvv, MO_64, do_vavgr_s) +TRANS(vavgr_bu, ALL, gvec_vvv, MO_8, do_vavgr_u) +TRANS(vavgr_hu, ALL, gvec_vvv, MO_16, do_vavgr_u) +TRANS(vavgr_wu, ALL, gvec_vvv, MO_32, do_vavgr_u) +TRANS(vavgr_du, ALL, gvec_vvv, MO_64, do_vavgr_u) static void gen_vabsd_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -1301,14 +1301,14 @@ static void do_vabsd_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vabsd_b, gvec_vvv, MO_8, do_vabsd_s) -TRANS(vabsd_h, gvec_vvv, MO_16, do_vabsd_s) -TRANS(vabsd_w, gvec_vvv, MO_32, do_vabsd_s) -TRANS(vabsd_d, gvec_vvv, MO_64, do_vabsd_s) -TRANS(vabsd_bu, gvec_vvv, MO_8, do_vabsd_u) -TRANS(vabsd_hu, gvec_vvv, MO_16, do_vabsd_u) -TRANS(vabsd_wu, gvec_vvv, MO_32, do_vabsd_u) -TRANS(vabsd_du, gvec_vvv, MO_64, do_vabsd_u) +TRANS(vabsd_b, ALL, gvec_vvv, MO_8, do_vabsd_s) +TRANS(vabsd_h, ALL, gvec_vvv, MO_16, do_vabsd_s) +TRANS(vabsd_w, ALL, gvec_vvv, MO_32, do_vabsd_s) +TRANS(vabsd_d, ALL, gvec_vvv, MO_64, do_vabsd_s) +TRANS(vabsd_bu, ALL, gvec_vvv, MO_8, do_vabsd_u) +TRANS(vabsd_hu, ALL, gvec_vvv, MO_16, do_vabsd_u) +TRANS(vabsd_wu, ALL, gvec_vvv, MO_32, do_vabsd_u) +TRANS(vabsd_du, ALL, gvec_vvv, MO_64, do_vabsd_u) static void gen_vadda(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -1358,28 +1358,28 @@ static void do_vadda(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vadda_b, gvec_vvv, MO_8, do_vadda) -TRANS(vadda_h, gvec_vvv, MO_16, do_vadda) -TRANS(vadda_w, gvec_vvv, MO_32, do_vadda) -TRANS(vadda_d, gvec_vvv, MO_64, do_vadda) +TRANS(vadda_b, ALL, gvec_vvv, MO_8, do_vadda) +TRANS(vadda_h, ALL, gvec_vvv, MO_16, do_vadda) +TRANS(vadda_w, ALL, gvec_vvv, MO_32, do_vadda) +TRANS(vadda_d, ALL, gvec_vvv, MO_64, do_vadda) -TRANS(vmax_b, gvec_vvv, MO_8, tcg_gen_gvec_smax) -TRANS(vmax_h, gvec_vvv, MO_16, tcg_gen_gvec_smax) -TRANS(vmax_w, gvec_vvv, MO_32, tcg_gen_gvec_smax) -TRANS(vmax_d, gvec_vvv, MO_64, tcg_gen_gvec_smax) -TRANS(vmax_bu, gvec_vvv, MO_8, tcg_gen_gvec_umax) -TRANS(vmax_hu, gvec_vvv, MO_16, tcg_gen_gvec_umax) -TRANS(vmax_wu, gvec_vvv, MO_32, tcg_gen_gvec_umax) -TRANS(vmax_du, gvec_vvv, MO_64, tcg_gen_gvec_umax) +TRANS(vmax_b, ALL, gvec_vvv, MO_8, tcg_gen_gvec_smax) +TRANS(vmax_h, ALL, gvec_vvv, MO_16, tcg_gen_gvec_smax) +TRANS(vmax_w, ALL, gvec_vvv, MO_32, tcg_gen_gvec_smax) +TRANS(vmax_d, ALL, gvec_vvv, MO_64, tcg_gen_gvec_smax) +TRANS(vmax_bu, ALL, gvec_vvv, MO_8, tcg_gen_gvec_umax) +TRANS(vmax_hu, ALL, gvec_vvv, MO_16, tcg_gen_gvec_umax) +TRANS(vmax_wu, ALL, gvec_vvv, MO_32, tcg_gen_gvec_umax) +TRANS(vmax_du, ALL, gvec_vvv, MO_64, tcg_gen_gvec_umax) -TRANS(vmin_b, gvec_vvv, MO_8, tcg_gen_gvec_smin) -TRANS(vmin_h, gvec_vvv, MO_16, tcg_gen_gvec_smin) -TRANS(vmin_w, gvec_vvv, MO_32, tcg_gen_gvec_smin) -TRANS(vmin_d, gvec_vvv, MO_64, tcg_gen_gvec_smin) -TRANS(vmin_bu, gvec_vvv, MO_8, tcg_gen_gvec_umin) -TRANS(vmin_hu, gvec_vvv, MO_16, tcg_gen_gvec_umin) -TRANS(vmin_wu, gvec_vvv, MO_32, tcg_gen_gvec_umin) -TRANS(vmin_du, gvec_vvv, MO_64, tcg_gen_gvec_umin) +TRANS(vmin_b, ALL, gvec_vvv, MO_8, tcg_gen_gvec_smin) +TRANS(vmin_h, ALL, gvec_vvv, MO_16, tcg_gen_gvec_smin) +TRANS(vmin_w, ALL, gvec_vvv, MO_32, tcg_gen_gvec_smin) +TRANS(vmin_d, ALL, gvec_vvv, MO_64, tcg_gen_gvec_smin) +TRANS(vmin_bu, ALL, gvec_vvv, MO_8, tcg_gen_gvec_umin) +TRANS(vmin_hu, ALL, gvec_vvv, MO_16, tcg_gen_gvec_umin) +TRANS(vmin_wu, ALL, gvec_vvv, MO_32, tcg_gen_gvec_umin) +TRANS(vmin_du, ALL, gvec_vvv, MO_64, tcg_gen_gvec_umin) static void gen_vmini_s(unsigned vece, TCGv_vec t, TCGv_vec a, int64_t imm) { @@ -1473,14 +1473,14 @@ static void do_vmini_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_2i(vd_ofs, vj_ofs, oprsz, maxsz, imm, &op[vece]); } -TRANS(vmini_b, gvec_vv_i, MO_8, do_vmini_s) -TRANS(vmini_h, gvec_vv_i, MO_16, do_vmini_s) -TRANS(vmini_w, gvec_vv_i, MO_32, do_vmini_s) -TRANS(vmini_d, gvec_vv_i, MO_64, do_vmini_s) -TRANS(vmini_bu, gvec_vv_i, MO_8, do_vmini_u) -TRANS(vmini_hu, gvec_vv_i, MO_16, do_vmini_u) -TRANS(vmini_wu, gvec_vv_i, MO_32, do_vmini_u) -TRANS(vmini_du, gvec_vv_i, MO_64, do_vmini_u) +TRANS(vmini_b, ALL, gvec_vv_i, MO_8, do_vmini_s) +TRANS(vmini_h, ALL, gvec_vv_i, MO_16, do_vmini_s) +TRANS(vmini_w, ALL, gvec_vv_i, MO_32, do_vmini_s) +TRANS(vmini_d, ALL, gvec_vv_i, MO_64, do_vmini_s) +TRANS(vmini_bu, ALL, gvec_vv_i, MO_8, do_vmini_u) +TRANS(vmini_hu, ALL, gvec_vv_i, MO_16, do_vmini_u) +TRANS(vmini_wu, ALL, gvec_vv_i, MO_32, do_vmini_u) +TRANS(vmini_du, ALL, gvec_vv_i, MO_64, do_vmini_u) static void do_vmaxi_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, int64_t imm, uint32_t oprsz, uint32_t maxsz) @@ -1554,19 +1554,19 @@ static void do_vmaxi_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_2i(vd_ofs, vj_ofs, oprsz, maxsz, imm, &op[vece]); } -TRANS(vmaxi_b, gvec_vv_i, MO_8, do_vmaxi_s) -TRANS(vmaxi_h, gvec_vv_i, MO_16, do_vmaxi_s) -TRANS(vmaxi_w, gvec_vv_i, MO_32, do_vmaxi_s) -TRANS(vmaxi_d, gvec_vv_i, MO_64, do_vmaxi_s) -TRANS(vmaxi_bu, gvec_vv_i, MO_8, do_vmaxi_u) -TRANS(vmaxi_hu, gvec_vv_i, MO_16, do_vmaxi_u) -TRANS(vmaxi_wu, gvec_vv_i, MO_32, do_vmaxi_u) -TRANS(vmaxi_du, gvec_vv_i, MO_64, do_vmaxi_u) +TRANS(vmaxi_b, ALL, gvec_vv_i, MO_8, do_vmaxi_s) +TRANS(vmaxi_h, ALL, gvec_vv_i, MO_16, do_vmaxi_s) +TRANS(vmaxi_w, ALL, gvec_vv_i, MO_32, do_vmaxi_s) +TRANS(vmaxi_d, ALL, gvec_vv_i, MO_64, do_vmaxi_s) +TRANS(vmaxi_bu, ALL, gvec_vv_i, MO_8, do_vmaxi_u) +TRANS(vmaxi_hu, ALL, gvec_vv_i, MO_16, do_vmaxi_u) +TRANS(vmaxi_wu, ALL, gvec_vv_i, MO_32, do_vmaxi_u) +TRANS(vmaxi_du, ALL, gvec_vv_i, MO_64, do_vmaxi_u) -TRANS(vmul_b, gvec_vvv, MO_8, tcg_gen_gvec_mul) -TRANS(vmul_h, gvec_vvv, MO_16, tcg_gen_gvec_mul) -TRANS(vmul_w, gvec_vvv, MO_32, tcg_gen_gvec_mul) -TRANS(vmul_d, gvec_vvv, MO_64, tcg_gen_gvec_mul) +TRANS(vmul_b, ALL, gvec_vvv, MO_8, tcg_gen_gvec_mul) +TRANS(vmul_h, ALL, gvec_vvv, MO_16, tcg_gen_gvec_mul) +TRANS(vmul_w, ALL, gvec_vvv, MO_32, tcg_gen_gvec_mul) +TRANS(vmul_d, ALL, gvec_vvv, MO_64, tcg_gen_gvec_mul) static void gen_vmuh_w(TCGv_i32 t, TCGv_i32 a, TCGv_i32 b) { @@ -1607,10 +1607,10 @@ static void do_vmuh_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmuh_b, gvec_vvv, MO_8, do_vmuh_s) -TRANS(vmuh_h, gvec_vvv, MO_16, do_vmuh_s) -TRANS(vmuh_w, gvec_vvv, MO_32, do_vmuh_s) -TRANS(vmuh_d, gvec_vvv, MO_64, do_vmuh_s) +TRANS(vmuh_b, ALL, gvec_vvv, MO_8, do_vmuh_s) +TRANS(vmuh_h, ALL, gvec_vvv, MO_16, do_vmuh_s) +TRANS(vmuh_w, ALL, gvec_vvv, MO_32, do_vmuh_s) +TRANS(vmuh_d, ALL, gvec_vvv, MO_64, do_vmuh_s) static void gen_vmuh_wu(TCGv_i32 t, TCGv_i32 a, TCGv_i32 b) { @@ -1651,10 +1651,10 @@ static void do_vmuh_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmuh_bu, gvec_vvv, MO_8, do_vmuh_u) -TRANS(vmuh_hu, gvec_vvv, MO_16, do_vmuh_u) -TRANS(vmuh_wu, gvec_vvv, MO_32, do_vmuh_u) -TRANS(vmuh_du, gvec_vvv, MO_64, do_vmuh_u) +TRANS(vmuh_bu, ALL, gvec_vvv, MO_8, do_vmuh_u) +TRANS(vmuh_hu, ALL, gvec_vvv, MO_16, do_vmuh_u) +TRANS(vmuh_wu, ALL, gvec_vvv, MO_32, do_vmuh_u) +TRANS(vmuh_du, ALL, gvec_vvv, MO_64, do_vmuh_u) static void gen_vmulwev_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -1724,9 +1724,9 @@ static void do_vmulwev_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmulwev_h_b, gvec_vvv, MO_8, do_vmulwev_s) -TRANS(vmulwev_w_h, gvec_vvv, MO_16, do_vmulwev_s) -TRANS(vmulwev_d_w, gvec_vvv, MO_32, do_vmulwev_s) +TRANS(vmulwev_h_b, ALL, gvec_vvv, MO_8, do_vmulwev_s) +TRANS(vmulwev_w_h, ALL, gvec_vvv, MO_16, do_vmulwev_s) +TRANS(vmulwev_d_w, ALL, gvec_vvv, MO_32, do_vmulwev_s) static void tcg_gen_mulus2_i64(TCGv_i64 rl, TCGv_i64 rh, TCGv_i64 arg1, TCGv_i64 arg2) @@ -1828,9 +1828,9 @@ static void do_vmulwod_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmulwod_h_b, gvec_vvv, MO_8, do_vmulwod_s) -TRANS(vmulwod_w_h, gvec_vvv, MO_16, do_vmulwod_s) -TRANS(vmulwod_d_w, gvec_vvv, MO_32, do_vmulwod_s) +TRANS(vmulwod_h_b, ALL, gvec_vvv, MO_8, do_vmulwod_s) +TRANS(vmulwod_w_h, ALL, gvec_vvv, MO_16, do_vmulwod_s) +TRANS(vmulwod_d_w, ALL, gvec_vvv, MO_32, do_vmulwod_s) static void gen_vmulwev_u(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -1898,9 +1898,9 @@ static void do_vmulwev_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmulwev_h_bu, gvec_vvv, MO_8, do_vmulwev_u) -TRANS(vmulwev_w_hu, gvec_vvv, MO_16, do_vmulwev_u) -TRANS(vmulwev_d_wu, gvec_vvv, MO_32, do_vmulwev_u) +TRANS(vmulwev_h_bu, ALL, gvec_vvv, MO_8, do_vmulwev_u) +TRANS(vmulwev_w_hu, ALL, gvec_vvv, MO_16, do_vmulwev_u) +TRANS(vmulwev_d_wu, ALL, gvec_vvv, MO_32, do_vmulwev_u) static void gen_vmulwod_u(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -1968,9 +1968,9 @@ static void do_vmulwod_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmulwod_h_bu, gvec_vvv, MO_8, do_vmulwod_u) -TRANS(vmulwod_w_hu, gvec_vvv, MO_16, do_vmulwod_u) -TRANS(vmulwod_d_wu, gvec_vvv, MO_32, do_vmulwod_u) +TRANS(vmulwod_h_bu, ALL, gvec_vvv, MO_8, do_vmulwod_u) +TRANS(vmulwod_w_hu, ALL, gvec_vvv, MO_16, do_vmulwod_u) +TRANS(vmulwod_d_wu, ALL, gvec_vvv, MO_32, do_vmulwod_u) static void gen_vmulwev_u_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -2040,9 +2040,9 @@ static void do_vmulwev_u_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmulwev_h_bu_b, gvec_vvv, MO_8, do_vmulwev_u_s) -TRANS(vmulwev_w_hu_h, gvec_vvv, MO_16, do_vmulwev_u_s) -TRANS(vmulwev_d_wu_w, gvec_vvv, MO_32, do_vmulwev_u_s) +TRANS(vmulwev_h_bu_b, ALL, gvec_vvv, MO_8, do_vmulwev_u_s) +TRANS(vmulwev_w_hu_h, ALL, gvec_vvv, MO_16, do_vmulwev_u_s) +TRANS(vmulwev_d_wu_w, ALL, gvec_vvv, MO_32, do_vmulwev_u_s) static void gen_vmulwod_u_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -2109,9 +2109,9 @@ static void do_vmulwod_u_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmulwod_h_bu_b, gvec_vvv, MO_8, do_vmulwod_u_s) -TRANS(vmulwod_w_hu_h, gvec_vvv, MO_16, do_vmulwod_u_s) -TRANS(vmulwod_d_wu_w, gvec_vvv, MO_32, do_vmulwod_u_s) +TRANS(vmulwod_h_bu_b, ALL, gvec_vvv, MO_8, do_vmulwod_u_s) +TRANS(vmulwod_w_hu_h, ALL, gvec_vvv, MO_16, do_vmulwod_u_s) +TRANS(vmulwod_d_wu_w, ALL, gvec_vvv, MO_32, do_vmulwod_u_s) static void gen_vmadd(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -2182,10 +2182,10 @@ static void do_vmadd(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmadd_b, gvec_vvv, MO_8, do_vmadd) -TRANS(vmadd_h, gvec_vvv, MO_16, do_vmadd) -TRANS(vmadd_w, gvec_vvv, MO_32, do_vmadd) -TRANS(vmadd_d, gvec_vvv, MO_64, do_vmadd) +TRANS(vmadd_b, ALL, gvec_vvv, MO_8, do_vmadd) +TRANS(vmadd_h, ALL, gvec_vvv, MO_16, do_vmadd) +TRANS(vmadd_w, ALL, gvec_vvv, MO_32, do_vmadd) +TRANS(vmadd_d, ALL, gvec_vvv, MO_64, do_vmadd) static void gen_vmsub(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -2256,10 +2256,10 @@ static void do_vmsub(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmsub_b, gvec_vvv, MO_8, do_vmsub) -TRANS(vmsub_h, gvec_vvv, MO_16, do_vmsub) -TRANS(vmsub_w, gvec_vvv, MO_32, do_vmsub) -TRANS(vmsub_d, gvec_vvv, MO_64, do_vmsub) +TRANS(vmsub_b, ALL, gvec_vvv, MO_8, do_vmsub) +TRANS(vmsub_h, ALL, gvec_vvv, MO_16, do_vmsub) +TRANS(vmsub_w, ALL, gvec_vvv, MO_32, do_vmsub) +TRANS(vmsub_d, ALL, gvec_vvv, MO_64, do_vmsub) static void gen_vmaddwev_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -2331,9 +2331,9 @@ static void do_vmaddwev_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmaddwev_h_b, gvec_vvv, MO_8, do_vmaddwev_s) -TRANS(vmaddwev_w_h, gvec_vvv, MO_16, do_vmaddwev_s) -TRANS(vmaddwev_d_w, gvec_vvv, MO_32, do_vmaddwev_s) +TRANS(vmaddwev_h_b, ALL, gvec_vvv, MO_8, do_vmaddwev_s) +TRANS(vmaddwev_w_h, ALL, gvec_vvv, MO_16, do_vmaddwev_s) +TRANS(vmaddwev_d_w, ALL, gvec_vvv, MO_32, do_vmaddwev_s) #define VMADD_Q(NAME, FN, idx1, idx2) \ static bool trans_## NAME (DisasContext *ctx, arg_vvv *a) \ @@ -2435,9 +2435,9 @@ static void do_vmaddwod_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmaddwod_h_b, gvec_vvv, MO_8, do_vmaddwod_s) -TRANS(vmaddwod_w_h, gvec_vvv, MO_16, do_vmaddwod_s) -TRANS(vmaddwod_d_w, gvec_vvv, MO_32, do_vmaddwod_s) +TRANS(vmaddwod_h_b, ALL, gvec_vvv, MO_8, do_vmaddwod_s) +TRANS(vmaddwod_w_h, ALL, gvec_vvv, MO_16, do_vmaddwod_s) +TRANS(vmaddwod_d_w, ALL, gvec_vvv, MO_32, do_vmaddwod_s) static void gen_vmaddwev_u(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -2505,9 +2505,9 @@ static void do_vmaddwev_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmaddwev_h_bu, gvec_vvv, MO_8, do_vmaddwev_u) -TRANS(vmaddwev_w_hu, gvec_vvv, MO_16, do_vmaddwev_u) -TRANS(vmaddwev_d_wu, gvec_vvv, MO_32, do_vmaddwev_u) +TRANS(vmaddwev_h_bu, ALL, gvec_vvv, MO_8, do_vmaddwev_u) +TRANS(vmaddwev_w_hu, ALL, gvec_vvv, MO_16, do_vmaddwev_u) +TRANS(vmaddwev_d_wu, ALL, gvec_vvv, MO_32, do_vmaddwev_u) static void gen_vmaddwod_u(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -2576,9 +2576,9 @@ static void do_vmaddwod_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmaddwod_h_bu, gvec_vvv, MO_8, do_vmaddwod_u) -TRANS(vmaddwod_w_hu, gvec_vvv, MO_16, do_vmaddwod_u) -TRANS(vmaddwod_d_wu, gvec_vvv, MO_32, do_vmaddwod_u) +TRANS(vmaddwod_h_bu, ALL, gvec_vvv, MO_8, do_vmaddwod_u) +TRANS(vmaddwod_w_hu, ALL, gvec_vvv, MO_16, do_vmaddwod_u) +TRANS(vmaddwod_d_wu, ALL, gvec_vvv, MO_32, do_vmaddwod_u) static void gen_vmaddwev_u_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -2649,9 +2649,9 @@ static void do_vmaddwev_u_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmaddwev_h_bu_b, gvec_vvv, MO_8, do_vmaddwev_u_s) -TRANS(vmaddwev_w_hu_h, gvec_vvv, MO_16, do_vmaddwev_u_s) -TRANS(vmaddwev_d_wu_w, gvec_vvv, MO_32, do_vmaddwev_u_s) +TRANS(vmaddwev_h_bu_b, ALL, gvec_vvv, MO_8, do_vmaddwev_u_s) +TRANS(vmaddwev_w_hu_h, ALL, gvec_vvv, MO_16, do_vmaddwev_u_s) +TRANS(vmaddwev_d_wu_w, ALL, gvec_vvv, MO_32, do_vmaddwev_u_s) static void gen_vmaddwod_u_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -2721,26 +2721,26 @@ static void do_vmaddwod_u_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmaddwod_h_bu_b, gvec_vvv, MO_8, do_vmaddwod_u_s) -TRANS(vmaddwod_w_hu_h, gvec_vvv, MO_16, do_vmaddwod_u_s) -TRANS(vmaddwod_d_wu_w, gvec_vvv, MO_32, do_vmaddwod_u_s) +TRANS(vmaddwod_h_bu_b, ALL, gvec_vvv, MO_8, do_vmaddwod_u_s) +TRANS(vmaddwod_w_hu_h, ALL, gvec_vvv, MO_16, do_vmaddwod_u_s) +TRANS(vmaddwod_d_wu_w, ALL, gvec_vvv, MO_32, do_vmaddwod_u_s) -TRANS(vdiv_b, gen_vvv, gen_helper_vdiv_b) -TRANS(vdiv_h, gen_vvv, gen_helper_vdiv_h) -TRANS(vdiv_w, gen_vvv, gen_helper_vdiv_w) -TRANS(vdiv_d, gen_vvv, gen_helper_vdiv_d) -TRANS(vdiv_bu, gen_vvv, gen_helper_vdiv_bu) -TRANS(vdiv_hu, gen_vvv, gen_helper_vdiv_hu) -TRANS(vdiv_wu, gen_vvv, gen_helper_vdiv_wu) -TRANS(vdiv_du, gen_vvv, gen_helper_vdiv_du) -TRANS(vmod_b, gen_vvv, gen_helper_vmod_b) -TRANS(vmod_h, gen_vvv, gen_helper_vmod_h) -TRANS(vmod_w, gen_vvv, gen_helper_vmod_w) -TRANS(vmod_d, gen_vvv, gen_helper_vmod_d) -TRANS(vmod_bu, gen_vvv, gen_helper_vmod_bu) -TRANS(vmod_hu, gen_vvv, gen_helper_vmod_hu) -TRANS(vmod_wu, gen_vvv, gen_helper_vmod_wu) -TRANS(vmod_du, gen_vvv, gen_helper_vmod_du) +TRANS(vdiv_b, ALL, gen_vvv, gen_helper_vdiv_b) +TRANS(vdiv_h, ALL, gen_vvv, gen_helper_vdiv_h) +TRANS(vdiv_w, ALL, gen_vvv, gen_helper_vdiv_w) +TRANS(vdiv_d, ALL, gen_vvv, gen_helper_vdiv_d) +TRANS(vdiv_bu, ALL, gen_vvv, gen_helper_vdiv_bu) +TRANS(vdiv_hu, ALL, gen_vvv, gen_helper_vdiv_hu) +TRANS(vdiv_wu, ALL, gen_vvv, gen_helper_vdiv_wu) +TRANS(vdiv_du, ALL, gen_vvv, gen_helper_vdiv_du) +TRANS(vmod_b, ALL, gen_vvv, gen_helper_vmod_b) +TRANS(vmod_h, ALL, gen_vvv, gen_helper_vmod_h) +TRANS(vmod_w, ALL, gen_vvv, gen_helper_vmod_w) +TRANS(vmod_d, ALL, gen_vvv, gen_helper_vmod_d) +TRANS(vmod_bu, ALL, gen_vvv, gen_helper_vmod_bu) +TRANS(vmod_hu, ALL, gen_vvv, gen_helper_vmod_hu) +TRANS(vmod_wu, ALL, gen_vvv, gen_helper_vmod_wu) +TRANS(vmod_du, ALL, gen_vvv, gen_helper_vmod_du) static void gen_vsat_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec max) { @@ -2789,10 +2789,10 @@ static void do_vsat_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_constant_i64((1ll<< imm) -1), &op[vece]); } -TRANS(vsat_b, gvec_vv_i, MO_8, do_vsat_s) -TRANS(vsat_h, gvec_vv_i, MO_16, do_vsat_s) -TRANS(vsat_w, gvec_vv_i, MO_32, do_vsat_s) -TRANS(vsat_d, gvec_vv_i, MO_64, do_vsat_s) +TRANS(vsat_b, ALL, gvec_vv_i, MO_8, do_vsat_s) +TRANS(vsat_h, ALL, gvec_vv_i, MO_16, do_vsat_s) +TRANS(vsat_w, ALL, gvec_vv_i, MO_32, do_vsat_s) +TRANS(vsat_d, ALL, gvec_vv_i, MO_64, do_vsat_s) static void gen_vsat_u(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec max) { @@ -2838,19 +2838,19 @@ static void do_vsat_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_constant_i64(max), &op[vece]); } -TRANS(vsat_bu, gvec_vv_i, MO_8, do_vsat_u) -TRANS(vsat_hu, gvec_vv_i, MO_16, do_vsat_u) -TRANS(vsat_wu, gvec_vv_i, MO_32, do_vsat_u) -TRANS(vsat_du, gvec_vv_i, MO_64, do_vsat_u) +TRANS(vsat_bu, ALL, gvec_vv_i, MO_8, do_vsat_u) +TRANS(vsat_hu, ALL, gvec_vv_i, MO_16, do_vsat_u) +TRANS(vsat_wu, ALL, gvec_vv_i, MO_32, do_vsat_u) +TRANS(vsat_du, ALL, gvec_vv_i, MO_64, do_vsat_u) -TRANS(vexth_h_b, gen_vv, gen_helper_vexth_h_b) -TRANS(vexth_w_h, gen_vv, gen_helper_vexth_w_h) -TRANS(vexth_d_w, gen_vv, gen_helper_vexth_d_w) -TRANS(vexth_q_d, gen_vv, gen_helper_vexth_q_d) -TRANS(vexth_hu_bu, gen_vv, gen_helper_vexth_hu_bu) -TRANS(vexth_wu_hu, gen_vv, gen_helper_vexth_wu_hu) -TRANS(vexth_du_wu, gen_vv, gen_helper_vexth_du_wu) -TRANS(vexth_qu_du, gen_vv, gen_helper_vexth_qu_du) +TRANS(vexth_h_b, ALL, gen_vv, gen_helper_vexth_h_b) +TRANS(vexth_w_h, ALL, gen_vv, gen_helper_vexth_w_h) +TRANS(vexth_d_w, ALL, gen_vv, gen_helper_vexth_d_w) +TRANS(vexth_q_d, ALL, gen_vv, gen_helper_vexth_q_d) +TRANS(vexth_hu_bu, ALL, gen_vv, gen_helper_vexth_hu_bu) +TRANS(vexth_wu_hu, ALL, gen_vv, gen_helper_vexth_wu_hu) +TRANS(vexth_du_wu, ALL, gen_vv, gen_helper_vexth_du_wu) +TRANS(vexth_qu_du, ALL, gen_vv, gen_helper_vexth_qu_du) static void gen_vsigncov(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -2900,17 +2900,17 @@ static void do_vsigncov(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vsigncov_b, gvec_vvv, MO_8, do_vsigncov) -TRANS(vsigncov_h, gvec_vvv, MO_16, do_vsigncov) -TRANS(vsigncov_w, gvec_vvv, MO_32, do_vsigncov) -TRANS(vsigncov_d, gvec_vvv, MO_64, do_vsigncov) +TRANS(vsigncov_b, ALL, gvec_vvv, MO_8, do_vsigncov) +TRANS(vsigncov_h, ALL, gvec_vvv, MO_16, do_vsigncov) +TRANS(vsigncov_w, ALL, gvec_vvv, MO_32, do_vsigncov) +TRANS(vsigncov_d, ALL, gvec_vvv, MO_64, do_vsigncov) -TRANS(vmskltz_b, gen_vv, gen_helper_vmskltz_b) -TRANS(vmskltz_h, gen_vv, gen_helper_vmskltz_h) -TRANS(vmskltz_w, gen_vv, gen_helper_vmskltz_w) -TRANS(vmskltz_d, gen_vv, gen_helper_vmskltz_d) -TRANS(vmskgez_b, gen_vv, gen_helper_vmskgez_b) -TRANS(vmsknz_b, gen_vv, gen_helper_vmsknz_b) +TRANS(vmskltz_b, ALL, gen_vv, gen_helper_vmskltz_b) +TRANS(vmskltz_h, ALL, gen_vv, gen_helper_vmskltz_h) +TRANS(vmskltz_w, ALL, gen_vv, gen_helper_vmskltz_w) +TRANS(vmskltz_d, ALL, gen_vv, gen_helper_vmskltz_d) +TRANS(vmskgez_b, ALL, gen_vv, gen_helper_vmskgez_b) +TRANS(vmsknz_b, ALL, gen_vv, gen_helper_vmsknz_b) #define EXPAND_BYTE(bit) ((uint64_t)(bit ? 0xff : 0)) @@ -3049,10 +3049,10 @@ static bool trans_vldi(DisasContext *ctx, arg_vldi *a) return true; } -TRANS(vand_v, gvec_vvv, MO_64, tcg_gen_gvec_and) -TRANS(vor_v, gvec_vvv, MO_64, tcg_gen_gvec_or) -TRANS(vxor_v, gvec_vvv, MO_64, tcg_gen_gvec_xor) -TRANS(vnor_v, gvec_vvv, MO_64, tcg_gen_gvec_nor) +TRANS(vand_v, ALL, gvec_vvv, MO_64, tcg_gen_gvec_and) +TRANS(vor_v, ALL, gvec_vvv, MO_64, tcg_gen_gvec_or) +TRANS(vxor_v, ALL, gvec_vvv, MO_64, tcg_gen_gvec_xor) +TRANS(vnor_v, ALL, gvec_vvv, MO_64, tcg_gen_gvec_nor) static bool trans_vandn_v(DisasContext *ctx, arg_vvv *a) { @@ -3067,10 +3067,10 @@ static bool trans_vandn_v(DisasContext *ctx, arg_vvv *a) tcg_gen_gvec_andc(MO_64, vd_ofs, vk_ofs, vj_ofs, 16, ctx->vl/8); return true; } -TRANS(vorn_v, gvec_vvv, MO_64, tcg_gen_gvec_orc) -TRANS(vandi_b, gvec_vv_i, MO_8, tcg_gen_gvec_andi) -TRANS(vori_b, gvec_vv_i, MO_8, tcg_gen_gvec_ori) -TRANS(vxori_b, gvec_vv_i, MO_8, tcg_gen_gvec_xori) +TRANS(vorn_v, ALL, gvec_vvv, MO_64, tcg_gen_gvec_orc) +TRANS(vandi_b, ALL, gvec_vv_i, MO_8, tcg_gen_gvec_andi) +TRANS(vori_b, ALL, gvec_vv_i, MO_8, tcg_gen_gvec_ori) +TRANS(vxori_b, ALL, gvec_vv_i, MO_8, tcg_gen_gvec_xori) static void gen_vnori(unsigned vece, TCGv_vec t, TCGv_vec a, int64_t imm) { @@ -3103,176 +3103,176 @@ static void do_vnori_b(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_2i(vd_ofs, vj_ofs, oprsz, maxsz, imm, &op); } -TRANS(vnori_b, gvec_vv_i, MO_8, do_vnori_b) +TRANS(vnori_b, ALL, gvec_vv_i, MO_8, do_vnori_b) -TRANS(vsll_b, gvec_vvv, MO_8, tcg_gen_gvec_shlv) -TRANS(vsll_h, gvec_vvv, MO_16, tcg_gen_gvec_shlv) -TRANS(vsll_w, gvec_vvv, MO_32, tcg_gen_gvec_shlv) -TRANS(vsll_d, gvec_vvv, MO_64, tcg_gen_gvec_shlv) -TRANS(vslli_b, gvec_vv_i, MO_8, tcg_gen_gvec_shli) -TRANS(vslli_h, gvec_vv_i, MO_16, tcg_gen_gvec_shli) -TRANS(vslli_w, gvec_vv_i, MO_32, tcg_gen_gvec_shli) -TRANS(vslli_d, gvec_vv_i, MO_64, tcg_gen_gvec_shli) +TRANS(vsll_b, ALL, gvec_vvv, MO_8, tcg_gen_gvec_shlv) +TRANS(vsll_h, ALL, gvec_vvv, MO_16, tcg_gen_gvec_shlv) +TRANS(vsll_w, ALL, gvec_vvv, MO_32, tcg_gen_gvec_shlv) +TRANS(vsll_d, ALL, gvec_vvv, MO_64, tcg_gen_gvec_shlv) +TRANS(vslli_b, ALL, gvec_vv_i, MO_8, tcg_gen_gvec_shli) +TRANS(vslli_h, ALL, gvec_vv_i, MO_16, tcg_gen_gvec_shli) +TRANS(vslli_w, ALL, gvec_vv_i, MO_32, tcg_gen_gvec_shli) +TRANS(vslli_d, ALL, gvec_vv_i, MO_64, tcg_gen_gvec_shli) -TRANS(vsrl_b, gvec_vvv, MO_8, tcg_gen_gvec_shrv) -TRANS(vsrl_h, gvec_vvv, MO_16, tcg_gen_gvec_shrv) -TRANS(vsrl_w, gvec_vvv, MO_32, tcg_gen_gvec_shrv) -TRANS(vsrl_d, gvec_vvv, MO_64, tcg_gen_gvec_shrv) -TRANS(vsrli_b, gvec_vv_i, MO_8, tcg_gen_gvec_shri) -TRANS(vsrli_h, gvec_vv_i, MO_16, tcg_gen_gvec_shri) -TRANS(vsrli_w, gvec_vv_i, MO_32, tcg_gen_gvec_shri) -TRANS(vsrli_d, gvec_vv_i, MO_64, tcg_gen_gvec_shri) +TRANS(vsrl_b, ALL, gvec_vvv, MO_8, tcg_gen_gvec_shrv) +TRANS(vsrl_h, ALL, gvec_vvv, MO_16, tcg_gen_gvec_shrv) +TRANS(vsrl_w, ALL, gvec_vvv, MO_32, tcg_gen_gvec_shrv) +TRANS(vsrl_d, ALL, gvec_vvv, MO_64, tcg_gen_gvec_shrv) +TRANS(vsrli_b, ALL, gvec_vv_i, MO_8, tcg_gen_gvec_shri) +TRANS(vsrli_h, ALL, gvec_vv_i, MO_16, tcg_gen_gvec_shri) +TRANS(vsrli_w, ALL, gvec_vv_i, MO_32, tcg_gen_gvec_shri) +TRANS(vsrli_d, ALL, gvec_vv_i, MO_64, tcg_gen_gvec_shri) -TRANS(vsra_b, gvec_vvv, MO_8, tcg_gen_gvec_sarv) -TRANS(vsra_h, gvec_vvv, MO_16, tcg_gen_gvec_sarv) -TRANS(vsra_w, gvec_vvv, MO_32, tcg_gen_gvec_sarv) -TRANS(vsra_d, gvec_vvv, MO_64, tcg_gen_gvec_sarv) -TRANS(vsrai_b, gvec_vv_i, MO_8, tcg_gen_gvec_sari) -TRANS(vsrai_h, gvec_vv_i, MO_16, tcg_gen_gvec_sari) -TRANS(vsrai_w, gvec_vv_i, MO_32, tcg_gen_gvec_sari) -TRANS(vsrai_d, gvec_vv_i, MO_64, tcg_gen_gvec_sari) +TRANS(vsra_b, ALL, gvec_vvv, MO_8, tcg_gen_gvec_sarv) +TRANS(vsra_h, ALL, gvec_vvv, MO_16, tcg_gen_gvec_sarv) +TRANS(vsra_w, ALL, gvec_vvv, MO_32, tcg_gen_gvec_sarv) +TRANS(vsra_d, ALL, gvec_vvv, MO_64, tcg_gen_gvec_sarv) +TRANS(vsrai_b, ALL, gvec_vv_i, MO_8, tcg_gen_gvec_sari) +TRANS(vsrai_h, ALL, gvec_vv_i, MO_16, tcg_gen_gvec_sari) +TRANS(vsrai_w, ALL, gvec_vv_i, MO_32, tcg_gen_gvec_sari) +TRANS(vsrai_d, ALL, gvec_vv_i, MO_64, tcg_gen_gvec_sari) -TRANS(vrotr_b, gvec_vvv, MO_8, tcg_gen_gvec_rotrv) -TRANS(vrotr_h, gvec_vvv, MO_16, tcg_gen_gvec_rotrv) -TRANS(vrotr_w, gvec_vvv, MO_32, tcg_gen_gvec_rotrv) -TRANS(vrotr_d, gvec_vvv, MO_64, tcg_gen_gvec_rotrv) -TRANS(vrotri_b, gvec_vv_i, MO_8, tcg_gen_gvec_rotri) -TRANS(vrotri_h, gvec_vv_i, MO_16, tcg_gen_gvec_rotri) -TRANS(vrotri_w, gvec_vv_i, MO_32, tcg_gen_gvec_rotri) -TRANS(vrotri_d, gvec_vv_i, MO_64, tcg_gen_gvec_rotri) +TRANS(vrotr_b, ALL, gvec_vvv, MO_8, tcg_gen_gvec_rotrv) +TRANS(vrotr_h, ALL, gvec_vvv, MO_16, tcg_gen_gvec_rotrv) +TRANS(vrotr_w, ALL, gvec_vvv, MO_32, tcg_gen_gvec_rotrv) +TRANS(vrotr_d, ALL, gvec_vvv, MO_64, tcg_gen_gvec_rotrv) +TRANS(vrotri_b, ALL, gvec_vv_i, MO_8, tcg_gen_gvec_rotri) +TRANS(vrotri_h, ALL, gvec_vv_i, MO_16, tcg_gen_gvec_rotri) +TRANS(vrotri_w, ALL, gvec_vv_i, MO_32, tcg_gen_gvec_rotri) +TRANS(vrotri_d, ALL, gvec_vv_i, MO_64, tcg_gen_gvec_rotri) -TRANS(vsllwil_h_b, gen_vv_i, gen_helper_vsllwil_h_b) -TRANS(vsllwil_w_h, gen_vv_i, gen_helper_vsllwil_w_h) -TRANS(vsllwil_d_w, gen_vv_i, gen_helper_vsllwil_d_w) -TRANS(vextl_q_d, gen_vv, gen_helper_vextl_q_d) -TRANS(vsllwil_hu_bu, gen_vv_i, gen_helper_vsllwil_hu_bu) -TRANS(vsllwil_wu_hu, gen_vv_i, gen_helper_vsllwil_wu_hu) -TRANS(vsllwil_du_wu, gen_vv_i, gen_helper_vsllwil_du_wu) -TRANS(vextl_qu_du, gen_vv, gen_helper_vextl_qu_du) +TRANS(vsllwil_h_b, ALL, gen_vv_i, gen_helper_vsllwil_h_b) +TRANS(vsllwil_w_h, ALL, gen_vv_i, gen_helper_vsllwil_w_h) +TRANS(vsllwil_d_w, ALL, gen_vv_i, gen_helper_vsllwil_d_w) +TRANS(vextl_q_d, ALL, gen_vv, gen_helper_vextl_q_d) +TRANS(vsllwil_hu_bu, ALL, gen_vv_i, gen_helper_vsllwil_hu_bu) +TRANS(vsllwil_wu_hu, ALL, gen_vv_i, gen_helper_vsllwil_wu_hu) +TRANS(vsllwil_du_wu, ALL, gen_vv_i, gen_helper_vsllwil_du_wu) +TRANS(vextl_qu_du, ALL, gen_vv, gen_helper_vextl_qu_du) -TRANS(vsrlr_b, gen_vvv, gen_helper_vsrlr_b) -TRANS(vsrlr_h, gen_vvv, gen_helper_vsrlr_h) -TRANS(vsrlr_w, gen_vvv, gen_helper_vsrlr_w) -TRANS(vsrlr_d, gen_vvv, gen_helper_vsrlr_d) -TRANS(vsrlri_b, gen_vv_i, gen_helper_vsrlri_b) -TRANS(vsrlri_h, gen_vv_i, gen_helper_vsrlri_h) -TRANS(vsrlri_w, gen_vv_i, gen_helper_vsrlri_w) -TRANS(vsrlri_d, gen_vv_i, gen_helper_vsrlri_d) +TRANS(vsrlr_b, ALL, gen_vvv, gen_helper_vsrlr_b) +TRANS(vsrlr_h, ALL, gen_vvv, gen_helper_vsrlr_h) +TRANS(vsrlr_w, ALL, gen_vvv, gen_helper_vsrlr_w) +TRANS(vsrlr_d, ALL, gen_vvv, gen_helper_vsrlr_d) +TRANS(vsrlri_b, ALL, gen_vv_i, gen_helper_vsrlri_b) +TRANS(vsrlri_h, ALL, gen_vv_i, gen_helper_vsrlri_h) +TRANS(vsrlri_w, ALL, gen_vv_i, gen_helper_vsrlri_w) +TRANS(vsrlri_d, ALL, gen_vv_i, gen_helper_vsrlri_d) -TRANS(vsrar_b, gen_vvv, gen_helper_vsrar_b) -TRANS(vsrar_h, gen_vvv, gen_helper_vsrar_h) -TRANS(vsrar_w, gen_vvv, gen_helper_vsrar_w) -TRANS(vsrar_d, gen_vvv, gen_helper_vsrar_d) -TRANS(vsrari_b, gen_vv_i, gen_helper_vsrari_b) -TRANS(vsrari_h, gen_vv_i, gen_helper_vsrari_h) -TRANS(vsrari_w, gen_vv_i, gen_helper_vsrari_w) -TRANS(vsrari_d, gen_vv_i, gen_helper_vsrari_d) +TRANS(vsrar_b, ALL, gen_vvv, gen_helper_vsrar_b) +TRANS(vsrar_h, ALL, gen_vvv, gen_helper_vsrar_h) +TRANS(vsrar_w, ALL, gen_vvv, gen_helper_vsrar_w) +TRANS(vsrar_d, ALL, gen_vvv, gen_helper_vsrar_d) +TRANS(vsrari_b, ALL, gen_vv_i, gen_helper_vsrari_b) +TRANS(vsrari_h, ALL, gen_vv_i, gen_helper_vsrari_h) +TRANS(vsrari_w, ALL, gen_vv_i, gen_helper_vsrari_w) +TRANS(vsrari_d, ALL, gen_vv_i, gen_helper_vsrari_d) -TRANS(vsrln_b_h, gen_vvv, gen_helper_vsrln_b_h) -TRANS(vsrln_h_w, gen_vvv, gen_helper_vsrln_h_w) -TRANS(vsrln_w_d, gen_vvv, gen_helper_vsrln_w_d) -TRANS(vsran_b_h, gen_vvv, gen_helper_vsran_b_h) -TRANS(vsran_h_w, gen_vvv, gen_helper_vsran_h_w) -TRANS(vsran_w_d, gen_vvv, gen_helper_vsran_w_d) +TRANS(vsrln_b_h, ALL, gen_vvv, gen_helper_vsrln_b_h) +TRANS(vsrln_h_w, ALL, gen_vvv, gen_helper_vsrln_h_w) +TRANS(vsrln_w_d, ALL, gen_vvv, gen_helper_vsrln_w_d) +TRANS(vsran_b_h, ALL, gen_vvv, gen_helper_vsran_b_h) +TRANS(vsran_h_w, ALL, gen_vvv, gen_helper_vsran_h_w) +TRANS(vsran_w_d, ALL, gen_vvv, gen_helper_vsran_w_d) -TRANS(vsrlni_b_h, gen_vv_i, gen_helper_vsrlni_b_h) -TRANS(vsrlni_h_w, gen_vv_i, gen_helper_vsrlni_h_w) -TRANS(vsrlni_w_d, gen_vv_i, gen_helper_vsrlni_w_d) -TRANS(vsrlni_d_q, gen_vv_i, gen_helper_vsrlni_d_q) -TRANS(vsrani_b_h, gen_vv_i, gen_helper_vsrani_b_h) -TRANS(vsrani_h_w, gen_vv_i, gen_helper_vsrani_h_w) -TRANS(vsrani_w_d, gen_vv_i, gen_helper_vsrani_w_d) -TRANS(vsrani_d_q, gen_vv_i, gen_helper_vsrani_d_q) +TRANS(vsrlni_b_h, ALL, gen_vv_i, gen_helper_vsrlni_b_h) +TRANS(vsrlni_h_w, ALL, gen_vv_i, gen_helper_vsrlni_h_w) +TRANS(vsrlni_w_d, ALL, gen_vv_i, gen_helper_vsrlni_w_d) +TRANS(vsrlni_d_q, ALL, gen_vv_i, gen_helper_vsrlni_d_q) +TRANS(vsrani_b_h, ALL, gen_vv_i, gen_helper_vsrani_b_h) +TRANS(vsrani_h_w, ALL, gen_vv_i, gen_helper_vsrani_h_w) +TRANS(vsrani_w_d, ALL, gen_vv_i, gen_helper_vsrani_w_d) +TRANS(vsrani_d_q, ALL, gen_vv_i, gen_helper_vsrani_d_q) -TRANS(vsrlrn_b_h, gen_vvv, gen_helper_vsrlrn_b_h) -TRANS(vsrlrn_h_w, gen_vvv, gen_helper_vsrlrn_h_w) -TRANS(vsrlrn_w_d, gen_vvv, gen_helper_vsrlrn_w_d) -TRANS(vsrarn_b_h, gen_vvv, gen_helper_vsrarn_b_h) -TRANS(vsrarn_h_w, gen_vvv, gen_helper_vsrarn_h_w) -TRANS(vsrarn_w_d, gen_vvv, gen_helper_vsrarn_w_d) +TRANS(vsrlrn_b_h, ALL, gen_vvv, gen_helper_vsrlrn_b_h) +TRANS(vsrlrn_h_w, ALL, gen_vvv, gen_helper_vsrlrn_h_w) +TRANS(vsrlrn_w_d, ALL, gen_vvv, gen_helper_vsrlrn_w_d) +TRANS(vsrarn_b_h, ALL, gen_vvv, gen_helper_vsrarn_b_h) +TRANS(vsrarn_h_w, ALL, gen_vvv, gen_helper_vsrarn_h_w) +TRANS(vsrarn_w_d, ALL, gen_vvv, gen_helper_vsrarn_w_d) -TRANS(vsrlrni_b_h, gen_vv_i, gen_helper_vsrlrni_b_h) -TRANS(vsrlrni_h_w, gen_vv_i, gen_helper_vsrlrni_h_w) -TRANS(vsrlrni_w_d, gen_vv_i, gen_helper_vsrlrni_w_d) -TRANS(vsrlrni_d_q, gen_vv_i, gen_helper_vsrlrni_d_q) -TRANS(vsrarni_b_h, gen_vv_i, gen_helper_vsrarni_b_h) -TRANS(vsrarni_h_w, gen_vv_i, gen_helper_vsrarni_h_w) -TRANS(vsrarni_w_d, gen_vv_i, gen_helper_vsrarni_w_d) -TRANS(vsrarni_d_q, gen_vv_i, gen_helper_vsrarni_d_q) +TRANS(vsrlrni_b_h, ALL, gen_vv_i, gen_helper_vsrlrni_b_h) +TRANS(vsrlrni_h_w, ALL, gen_vv_i, gen_helper_vsrlrni_h_w) +TRANS(vsrlrni_w_d, ALL, gen_vv_i, gen_helper_vsrlrni_w_d) +TRANS(vsrlrni_d_q, ALL, gen_vv_i, gen_helper_vsrlrni_d_q) +TRANS(vsrarni_b_h, ALL, gen_vv_i, gen_helper_vsrarni_b_h) +TRANS(vsrarni_h_w, ALL, gen_vv_i, gen_helper_vsrarni_h_w) +TRANS(vsrarni_w_d, ALL, gen_vv_i, gen_helper_vsrarni_w_d) +TRANS(vsrarni_d_q, ALL, gen_vv_i, gen_helper_vsrarni_d_q) -TRANS(vssrln_b_h, gen_vvv, gen_helper_vssrln_b_h) -TRANS(vssrln_h_w, gen_vvv, gen_helper_vssrln_h_w) -TRANS(vssrln_w_d, gen_vvv, gen_helper_vssrln_w_d) -TRANS(vssran_b_h, gen_vvv, gen_helper_vssran_b_h) -TRANS(vssran_h_w, gen_vvv, gen_helper_vssran_h_w) -TRANS(vssran_w_d, gen_vvv, gen_helper_vssran_w_d) -TRANS(vssrln_bu_h, gen_vvv, gen_helper_vssrln_bu_h) -TRANS(vssrln_hu_w, gen_vvv, gen_helper_vssrln_hu_w) -TRANS(vssrln_wu_d, gen_vvv, gen_helper_vssrln_wu_d) -TRANS(vssran_bu_h, gen_vvv, gen_helper_vssran_bu_h) -TRANS(vssran_hu_w, gen_vvv, gen_helper_vssran_hu_w) -TRANS(vssran_wu_d, gen_vvv, gen_helper_vssran_wu_d) +TRANS(vssrln_b_h, ALL, gen_vvv, gen_helper_vssrln_b_h) +TRANS(vssrln_h_w, ALL, gen_vvv, gen_helper_vssrln_h_w) +TRANS(vssrln_w_d, ALL, gen_vvv, gen_helper_vssrln_w_d) +TRANS(vssran_b_h, ALL, gen_vvv, gen_helper_vssran_b_h) +TRANS(vssran_h_w, ALL, gen_vvv, gen_helper_vssran_h_w) +TRANS(vssran_w_d, ALL, gen_vvv, gen_helper_vssran_w_d) +TRANS(vssrln_bu_h, ALL, gen_vvv, gen_helper_vssrln_bu_h) +TRANS(vssrln_hu_w, ALL, gen_vvv, gen_helper_vssrln_hu_w) +TRANS(vssrln_wu_d, ALL, gen_vvv, gen_helper_vssrln_wu_d) +TRANS(vssran_bu_h, ALL, gen_vvv, gen_helper_vssran_bu_h) +TRANS(vssran_hu_w, ALL, gen_vvv, gen_helper_vssran_hu_w) +TRANS(vssran_wu_d, ALL, gen_vvv, gen_helper_vssran_wu_d) -TRANS(vssrlni_b_h, gen_vv_i, gen_helper_vssrlni_b_h) -TRANS(vssrlni_h_w, gen_vv_i, gen_helper_vssrlni_h_w) -TRANS(vssrlni_w_d, gen_vv_i, gen_helper_vssrlni_w_d) -TRANS(vssrlni_d_q, gen_vv_i, gen_helper_vssrlni_d_q) -TRANS(vssrani_b_h, gen_vv_i, gen_helper_vssrani_b_h) -TRANS(vssrani_h_w, gen_vv_i, gen_helper_vssrani_h_w) -TRANS(vssrani_w_d, gen_vv_i, gen_helper_vssrani_w_d) -TRANS(vssrani_d_q, gen_vv_i, gen_helper_vssrani_d_q) -TRANS(vssrlni_bu_h, gen_vv_i, gen_helper_vssrlni_bu_h) -TRANS(vssrlni_hu_w, gen_vv_i, gen_helper_vssrlni_hu_w) -TRANS(vssrlni_wu_d, gen_vv_i, gen_helper_vssrlni_wu_d) -TRANS(vssrlni_du_q, gen_vv_i, gen_helper_vssrlni_du_q) -TRANS(vssrani_bu_h, gen_vv_i, gen_helper_vssrani_bu_h) -TRANS(vssrani_hu_w, gen_vv_i, gen_helper_vssrani_hu_w) -TRANS(vssrani_wu_d, gen_vv_i, gen_helper_vssrani_wu_d) -TRANS(vssrani_du_q, gen_vv_i, gen_helper_vssrani_du_q) +TRANS(vssrlni_b_h, ALL, gen_vv_i, gen_helper_vssrlni_b_h) +TRANS(vssrlni_h_w, ALL, gen_vv_i, gen_helper_vssrlni_h_w) +TRANS(vssrlni_w_d, ALL, gen_vv_i, gen_helper_vssrlni_w_d) +TRANS(vssrlni_d_q, ALL, gen_vv_i, gen_helper_vssrlni_d_q) +TRANS(vssrani_b_h, ALL, gen_vv_i, gen_helper_vssrani_b_h) +TRANS(vssrani_h_w, ALL, gen_vv_i, gen_helper_vssrani_h_w) +TRANS(vssrani_w_d, ALL, gen_vv_i, gen_helper_vssrani_w_d) +TRANS(vssrani_d_q, ALL, gen_vv_i, gen_helper_vssrani_d_q) +TRANS(vssrlni_bu_h, ALL, gen_vv_i, gen_helper_vssrlni_bu_h) +TRANS(vssrlni_hu_w, ALL, gen_vv_i, gen_helper_vssrlni_hu_w) +TRANS(vssrlni_wu_d, ALL, gen_vv_i, gen_helper_vssrlni_wu_d) +TRANS(vssrlni_du_q, ALL, gen_vv_i, gen_helper_vssrlni_du_q) +TRANS(vssrani_bu_h, ALL, gen_vv_i, gen_helper_vssrani_bu_h) +TRANS(vssrani_hu_w, ALL, gen_vv_i, gen_helper_vssrani_hu_w) +TRANS(vssrani_wu_d, ALL, gen_vv_i, gen_helper_vssrani_wu_d) +TRANS(vssrani_du_q, ALL, gen_vv_i, gen_helper_vssrani_du_q) -TRANS(vssrlrn_b_h, gen_vvv, gen_helper_vssrlrn_b_h) -TRANS(vssrlrn_h_w, gen_vvv, gen_helper_vssrlrn_h_w) -TRANS(vssrlrn_w_d, gen_vvv, gen_helper_vssrlrn_w_d) -TRANS(vssrarn_b_h, gen_vvv, gen_helper_vssrarn_b_h) -TRANS(vssrarn_h_w, gen_vvv, gen_helper_vssrarn_h_w) -TRANS(vssrarn_w_d, gen_vvv, gen_helper_vssrarn_w_d) -TRANS(vssrlrn_bu_h, gen_vvv, gen_helper_vssrlrn_bu_h) -TRANS(vssrlrn_hu_w, gen_vvv, gen_helper_vssrlrn_hu_w) -TRANS(vssrlrn_wu_d, gen_vvv, gen_helper_vssrlrn_wu_d) -TRANS(vssrarn_bu_h, gen_vvv, gen_helper_vssrarn_bu_h) -TRANS(vssrarn_hu_w, gen_vvv, gen_helper_vssrarn_hu_w) -TRANS(vssrarn_wu_d, gen_vvv, gen_helper_vssrarn_wu_d) +TRANS(vssrlrn_b_h, ALL, gen_vvv, gen_helper_vssrlrn_b_h) +TRANS(vssrlrn_h_w, ALL, gen_vvv, gen_helper_vssrlrn_h_w) +TRANS(vssrlrn_w_d, ALL, gen_vvv, gen_helper_vssrlrn_w_d) +TRANS(vssrarn_b_h, ALL, gen_vvv, gen_helper_vssrarn_b_h) +TRANS(vssrarn_h_w, ALL, gen_vvv, gen_helper_vssrarn_h_w) +TRANS(vssrarn_w_d, ALL, gen_vvv, gen_helper_vssrarn_w_d) +TRANS(vssrlrn_bu_h, ALL, gen_vvv, gen_helper_vssrlrn_bu_h) +TRANS(vssrlrn_hu_w, ALL, gen_vvv, gen_helper_vssrlrn_hu_w) +TRANS(vssrlrn_wu_d, ALL, gen_vvv, gen_helper_vssrlrn_wu_d) +TRANS(vssrarn_bu_h, ALL, gen_vvv, gen_helper_vssrarn_bu_h) +TRANS(vssrarn_hu_w, ALL, gen_vvv, gen_helper_vssrarn_hu_w) +TRANS(vssrarn_wu_d, ALL, gen_vvv, gen_helper_vssrarn_wu_d) -TRANS(vssrlrni_b_h, gen_vv_i, gen_helper_vssrlrni_b_h) -TRANS(vssrlrni_h_w, gen_vv_i, gen_helper_vssrlrni_h_w) -TRANS(vssrlrni_w_d, gen_vv_i, gen_helper_vssrlrni_w_d) -TRANS(vssrlrni_d_q, gen_vv_i, gen_helper_vssrlrni_d_q) -TRANS(vssrarni_b_h, gen_vv_i, gen_helper_vssrarni_b_h) -TRANS(vssrarni_h_w, gen_vv_i, gen_helper_vssrarni_h_w) -TRANS(vssrarni_w_d, gen_vv_i, gen_helper_vssrarni_w_d) -TRANS(vssrarni_d_q, gen_vv_i, gen_helper_vssrarni_d_q) -TRANS(vssrlrni_bu_h, gen_vv_i, gen_helper_vssrlrni_bu_h) -TRANS(vssrlrni_hu_w, gen_vv_i, gen_helper_vssrlrni_hu_w) -TRANS(vssrlrni_wu_d, gen_vv_i, gen_helper_vssrlrni_wu_d) -TRANS(vssrlrni_du_q, gen_vv_i, gen_helper_vssrlrni_du_q) -TRANS(vssrarni_bu_h, gen_vv_i, gen_helper_vssrarni_bu_h) -TRANS(vssrarni_hu_w, gen_vv_i, gen_helper_vssrarni_hu_w) -TRANS(vssrarni_wu_d, gen_vv_i, gen_helper_vssrarni_wu_d) -TRANS(vssrarni_du_q, gen_vv_i, gen_helper_vssrarni_du_q) +TRANS(vssrlrni_b_h, ALL, gen_vv_i, gen_helper_vssrlrni_b_h) +TRANS(vssrlrni_h_w, ALL, gen_vv_i, gen_helper_vssrlrni_h_w) +TRANS(vssrlrni_w_d, ALL, gen_vv_i, gen_helper_vssrlrni_w_d) +TRANS(vssrlrni_d_q, ALL, gen_vv_i, gen_helper_vssrlrni_d_q) +TRANS(vssrarni_b_h, ALL, gen_vv_i, gen_helper_vssrarni_b_h) +TRANS(vssrarni_h_w, ALL, gen_vv_i, gen_helper_vssrarni_h_w) +TRANS(vssrarni_w_d, ALL, gen_vv_i, gen_helper_vssrarni_w_d) +TRANS(vssrarni_d_q, ALL, gen_vv_i, gen_helper_vssrarni_d_q) +TRANS(vssrlrni_bu_h, ALL, gen_vv_i, gen_helper_vssrlrni_bu_h) +TRANS(vssrlrni_hu_w, ALL, gen_vv_i, gen_helper_vssrlrni_hu_w) +TRANS(vssrlrni_wu_d, ALL, gen_vv_i, gen_helper_vssrlrni_wu_d) +TRANS(vssrlrni_du_q, ALL, gen_vv_i, gen_helper_vssrlrni_du_q) +TRANS(vssrarni_bu_h, ALL, gen_vv_i, gen_helper_vssrarni_bu_h) +TRANS(vssrarni_hu_w, ALL, gen_vv_i, gen_helper_vssrarni_hu_w) +TRANS(vssrarni_wu_d, ALL, gen_vv_i, gen_helper_vssrarni_wu_d) +TRANS(vssrarni_du_q, ALL, gen_vv_i, gen_helper_vssrarni_du_q) -TRANS(vclo_b, gen_vv, gen_helper_vclo_b) -TRANS(vclo_h, gen_vv, gen_helper_vclo_h) -TRANS(vclo_w, gen_vv, gen_helper_vclo_w) -TRANS(vclo_d, gen_vv, gen_helper_vclo_d) -TRANS(vclz_b, gen_vv, gen_helper_vclz_b) -TRANS(vclz_h, gen_vv, gen_helper_vclz_h) -TRANS(vclz_w, gen_vv, gen_helper_vclz_w) -TRANS(vclz_d, gen_vv, gen_helper_vclz_d) +TRANS(vclo_b, ALL, gen_vv, gen_helper_vclo_b) +TRANS(vclo_h, ALL, gen_vv, gen_helper_vclo_h) +TRANS(vclo_w, ALL, gen_vv, gen_helper_vclo_w) +TRANS(vclo_d, ALL, gen_vv, gen_helper_vclo_d) +TRANS(vclz_b, ALL, gen_vv, gen_helper_vclz_b) +TRANS(vclz_h, ALL, gen_vv, gen_helper_vclz_h) +TRANS(vclz_w, ALL, gen_vv, gen_helper_vclz_w) +TRANS(vclz_d, ALL, gen_vv, gen_helper_vclz_d) -TRANS(vpcnt_b, gen_vv, gen_helper_vpcnt_b) -TRANS(vpcnt_h, gen_vv, gen_helper_vpcnt_h) -TRANS(vpcnt_w, gen_vv, gen_helper_vpcnt_w) -TRANS(vpcnt_d, gen_vv, gen_helper_vpcnt_d) +TRANS(vpcnt_b, ALL, gen_vv, gen_helper_vpcnt_b) +TRANS(vpcnt_h, ALL, gen_vv, gen_helper_vpcnt_h) +TRANS(vpcnt_w, ALL, gen_vv, gen_helper_vpcnt_w) +TRANS(vpcnt_d, ALL, gen_vv, gen_helper_vpcnt_d) static void do_vbit(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b, void (*func)(unsigned, TCGv_vec, TCGv_vec, TCGv_vec)) @@ -3340,10 +3340,10 @@ static void do_vbitclr(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vbitclr_b, gvec_vvv, MO_8, do_vbitclr) -TRANS(vbitclr_h, gvec_vvv, MO_16, do_vbitclr) -TRANS(vbitclr_w, gvec_vvv, MO_32, do_vbitclr) -TRANS(vbitclr_d, gvec_vvv, MO_64, do_vbitclr) +TRANS(vbitclr_b, ALL, gvec_vvv, MO_8, do_vbitclr) +TRANS(vbitclr_h, ALL, gvec_vvv, MO_16, do_vbitclr) +TRANS(vbitclr_w, ALL, gvec_vvv, MO_32, do_vbitclr) +TRANS(vbitclr_d, ALL, gvec_vvv, MO_64, do_vbitclr) static void do_vbiti(unsigned vece, TCGv_vec t, TCGv_vec a, int64_t imm, void (*func)(unsigned, TCGv_vec, TCGv_vec, TCGv_vec)) @@ -3410,10 +3410,10 @@ static void do_vbitclri(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_2i(vd_ofs, vj_ofs, oprsz, maxsz, imm, &op[vece]); } -TRANS(vbitclri_b, gvec_vv_i, MO_8, do_vbitclri) -TRANS(vbitclri_h, gvec_vv_i, MO_16, do_vbitclri) -TRANS(vbitclri_w, gvec_vv_i, MO_32, do_vbitclri) -TRANS(vbitclri_d, gvec_vv_i, MO_64, do_vbitclri) +TRANS(vbitclri_b, ALL, gvec_vv_i, MO_8, do_vbitclri) +TRANS(vbitclri_h, ALL, gvec_vv_i, MO_16, do_vbitclri) +TRANS(vbitclri_w, ALL, gvec_vv_i, MO_32, do_vbitclri) +TRANS(vbitclri_d, ALL, gvec_vv_i, MO_64, do_vbitclri) static void do_vbitset(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, uint32_t vk_ofs, uint32_t oprsz, uint32_t maxsz) @@ -3451,10 +3451,10 @@ static void do_vbitset(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vbitset_b, gvec_vvv, MO_8, do_vbitset) -TRANS(vbitset_h, gvec_vvv, MO_16, do_vbitset) -TRANS(vbitset_w, gvec_vvv, MO_32, do_vbitset) -TRANS(vbitset_d, gvec_vvv, MO_64, do_vbitset) +TRANS(vbitset_b, ALL, gvec_vvv, MO_8, do_vbitset) +TRANS(vbitset_h, ALL, gvec_vvv, MO_16, do_vbitset) +TRANS(vbitset_w, ALL, gvec_vvv, MO_32, do_vbitset) +TRANS(vbitset_d, ALL, gvec_vvv, MO_64, do_vbitset) static void do_vbitseti(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, int64_t imm, uint32_t oprsz, uint32_t maxsz) @@ -3492,10 +3492,10 @@ static void do_vbitseti(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_2i(vd_ofs, vj_ofs, oprsz, maxsz, imm, &op[vece]); } -TRANS(vbitseti_b, gvec_vv_i, MO_8, do_vbitseti) -TRANS(vbitseti_h, gvec_vv_i, MO_16, do_vbitseti) -TRANS(vbitseti_w, gvec_vv_i, MO_32, do_vbitseti) -TRANS(vbitseti_d, gvec_vv_i, MO_64, do_vbitseti) +TRANS(vbitseti_b, ALL, gvec_vv_i, MO_8, do_vbitseti) +TRANS(vbitseti_h, ALL, gvec_vv_i, MO_16, do_vbitseti) +TRANS(vbitseti_w, ALL, gvec_vv_i, MO_32, do_vbitseti) +TRANS(vbitseti_d, ALL, gvec_vv_i, MO_64, do_vbitseti) static void do_vbitrev(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, uint32_t vk_ofs, uint32_t oprsz, uint32_t maxsz) @@ -3533,10 +3533,10 @@ static void do_vbitrev(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vbitrev_b, gvec_vvv, MO_8, do_vbitrev) -TRANS(vbitrev_h, gvec_vvv, MO_16, do_vbitrev) -TRANS(vbitrev_w, gvec_vvv, MO_32, do_vbitrev) -TRANS(vbitrev_d, gvec_vvv, MO_64, do_vbitrev) +TRANS(vbitrev_b, ALL, gvec_vvv, MO_8, do_vbitrev) +TRANS(vbitrev_h, ALL, gvec_vvv, MO_16, do_vbitrev) +TRANS(vbitrev_w, ALL, gvec_vvv, MO_32, do_vbitrev) +TRANS(vbitrev_d, ALL, gvec_vvv, MO_64, do_vbitrev) static void do_vbitrevi(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, int64_t imm, uint32_t oprsz, uint32_t maxsz) @@ -3574,112 +3574,112 @@ static void do_vbitrevi(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_2i(vd_ofs, vj_ofs, oprsz, maxsz, imm, &op[vece]); } -TRANS(vbitrevi_b, gvec_vv_i, MO_8, do_vbitrevi) -TRANS(vbitrevi_h, gvec_vv_i, MO_16, do_vbitrevi) -TRANS(vbitrevi_w, gvec_vv_i, MO_32, do_vbitrevi) -TRANS(vbitrevi_d, gvec_vv_i, MO_64, do_vbitrevi) +TRANS(vbitrevi_b, ALL, gvec_vv_i, MO_8, do_vbitrevi) +TRANS(vbitrevi_h, ALL, gvec_vv_i, MO_16, do_vbitrevi) +TRANS(vbitrevi_w, ALL, gvec_vv_i, MO_32, do_vbitrevi) +TRANS(vbitrevi_d, ALL, gvec_vv_i, MO_64, do_vbitrevi) -TRANS(vfrstp_b, gen_vvv, gen_helper_vfrstp_b) -TRANS(vfrstp_h, gen_vvv, gen_helper_vfrstp_h) -TRANS(vfrstpi_b, gen_vv_i, gen_helper_vfrstpi_b) -TRANS(vfrstpi_h, gen_vv_i, gen_helper_vfrstpi_h) +TRANS(vfrstp_b, ALL, gen_vvv, gen_helper_vfrstp_b) +TRANS(vfrstp_h, ALL, gen_vvv, gen_helper_vfrstp_h) +TRANS(vfrstpi_b, ALL, gen_vv_i, gen_helper_vfrstpi_b) +TRANS(vfrstpi_h, ALL, gen_vv_i, gen_helper_vfrstpi_h) -TRANS(vfadd_s, gen_vvv, gen_helper_vfadd_s) -TRANS(vfadd_d, gen_vvv, gen_helper_vfadd_d) -TRANS(vfsub_s, gen_vvv, gen_helper_vfsub_s) -TRANS(vfsub_d, gen_vvv, gen_helper_vfsub_d) -TRANS(vfmul_s, gen_vvv, gen_helper_vfmul_s) -TRANS(vfmul_d, gen_vvv, gen_helper_vfmul_d) -TRANS(vfdiv_s, gen_vvv, gen_helper_vfdiv_s) -TRANS(vfdiv_d, gen_vvv, gen_helper_vfdiv_d) +TRANS(vfadd_s, ALL, gen_vvv, gen_helper_vfadd_s) +TRANS(vfadd_d, ALL, gen_vvv, gen_helper_vfadd_d) +TRANS(vfsub_s, ALL, gen_vvv, gen_helper_vfsub_s) +TRANS(vfsub_d, ALL, gen_vvv, gen_helper_vfsub_d) +TRANS(vfmul_s, ALL, gen_vvv, gen_helper_vfmul_s) +TRANS(vfmul_d, ALL, gen_vvv, gen_helper_vfmul_d) +TRANS(vfdiv_s, ALL, gen_vvv, gen_helper_vfdiv_s) +TRANS(vfdiv_d, ALL, gen_vvv, gen_helper_vfdiv_d) -TRANS(vfmadd_s, gen_vvvv, gen_helper_vfmadd_s) -TRANS(vfmadd_d, gen_vvvv, gen_helper_vfmadd_d) -TRANS(vfmsub_s, gen_vvvv, gen_helper_vfmsub_s) -TRANS(vfmsub_d, gen_vvvv, gen_helper_vfmsub_d) -TRANS(vfnmadd_s, gen_vvvv, gen_helper_vfnmadd_s) -TRANS(vfnmadd_d, gen_vvvv, gen_helper_vfnmadd_d) -TRANS(vfnmsub_s, gen_vvvv, gen_helper_vfnmsub_s) -TRANS(vfnmsub_d, gen_vvvv, gen_helper_vfnmsub_d) +TRANS(vfmadd_s, ALL, gen_vvvv, gen_helper_vfmadd_s) +TRANS(vfmadd_d, ALL, gen_vvvv, gen_helper_vfmadd_d) +TRANS(vfmsub_s, ALL, gen_vvvv, gen_helper_vfmsub_s) +TRANS(vfmsub_d, ALL, gen_vvvv, gen_helper_vfmsub_d) +TRANS(vfnmadd_s, ALL, gen_vvvv, gen_helper_vfnmadd_s) +TRANS(vfnmadd_d, ALL, gen_vvvv, gen_helper_vfnmadd_d) +TRANS(vfnmsub_s, ALL, gen_vvvv, gen_helper_vfnmsub_s) +TRANS(vfnmsub_d, ALL, gen_vvvv, gen_helper_vfnmsub_d) -TRANS(vfmax_s, gen_vvv, gen_helper_vfmax_s) -TRANS(vfmax_d, gen_vvv, gen_helper_vfmax_d) -TRANS(vfmin_s, gen_vvv, gen_helper_vfmin_s) -TRANS(vfmin_d, gen_vvv, gen_helper_vfmin_d) +TRANS(vfmax_s, ALL, gen_vvv, gen_helper_vfmax_s) +TRANS(vfmax_d, ALL, gen_vvv, gen_helper_vfmax_d) +TRANS(vfmin_s, ALL, gen_vvv, gen_helper_vfmin_s) +TRANS(vfmin_d, ALL, gen_vvv, gen_helper_vfmin_d) -TRANS(vfmaxa_s, gen_vvv, gen_helper_vfmaxa_s) -TRANS(vfmaxa_d, gen_vvv, gen_helper_vfmaxa_d) -TRANS(vfmina_s, gen_vvv, gen_helper_vfmina_s) -TRANS(vfmina_d, gen_vvv, gen_helper_vfmina_d) +TRANS(vfmaxa_s, ALL, gen_vvv, gen_helper_vfmaxa_s) +TRANS(vfmaxa_d, ALL, gen_vvv, gen_helper_vfmaxa_d) +TRANS(vfmina_s, ALL, gen_vvv, gen_helper_vfmina_s) +TRANS(vfmina_d, ALL, gen_vvv, gen_helper_vfmina_d) -TRANS(vflogb_s, gen_vv, gen_helper_vflogb_s) -TRANS(vflogb_d, gen_vv, gen_helper_vflogb_d) +TRANS(vflogb_s, ALL, gen_vv, gen_helper_vflogb_s) +TRANS(vflogb_d, ALL, gen_vv, gen_helper_vflogb_d) -TRANS(vfclass_s, gen_vv, gen_helper_vfclass_s) -TRANS(vfclass_d, gen_vv, gen_helper_vfclass_d) +TRANS(vfclass_s, ALL, gen_vv, gen_helper_vfclass_s) +TRANS(vfclass_d, ALL, gen_vv, gen_helper_vfclass_d) -TRANS(vfsqrt_s, gen_vv, gen_helper_vfsqrt_s) -TRANS(vfsqrt_d, gen_vv, gen_helper_vfsqrt_d) -TRANS(vfrecip_s, gen_vv, gen_helper_vfrecip_s) -TRANS(vfrecip_d, gen_vv, gen_helper_vfrecip_d) -TRANS(vfrsqrt_s, gen_vv, gen_helper_vfrsqrt_s) -TRANS(vfrsqrt_d, gen_vv, gen_helper_vfrsqrt_d) +TRANS(vfsqrt_s, ALL, gen_vv, gen_helper_vfsqrt_s) +TRANS(vfsqrt_d, ALL, gen_vv, gen_helper_vfsqrt_d) +TRANS(vfrecip_s, ALL, gen_vv, gen_helper_vfrecip_s) +TRANS(vfrecip_d, ALL, gen_vv, gen_helper_vfrecip_d) +TRANS(vfrsqrt_s, ALL, gen_vv, gen_helper_vfrsqrt_s) +TRANS(vfrsqrt_d, ALL, gen_vv, gen_helper_vfrsqrt_d) -TRANS(vfcvtl_s_h, gen_vv, gen_helper_vfcvtl_s_h) -TRANS(vfcvth_s_h, gen_vv, gen_helper_vfcvth_s_h) -TRANS(vfcvtl_d_s, gen_vv, gen_helper_vfcvtl_d_s) -TRANS(vfcvth_d_s, gen_vv, gen_helper_vfcvth_d_s) -TRANS(vfcvt_h_s, gen_vvv, gen_helper_vfcvt_h_s) -TRANS(vfcvt_s_d, gen_vvv, gen_helper_vfcvt_s_d) +TRANS(vfcvtl_s_h, ALL, gen_vv, gen_helper_vfcvtl_s_h) +TRANS(vfcvth_s_h, ALL, gen_vv, gen_helper_vfcvth_s_h) +TRANS(vfcvtl_d_s, ALL, gen_vv, gen_helper_vfcvtl_d_s) +TRANS(vfcvth_d_s, ALL, gen_vv, gen_helper_vfcvth_d_s) +TRANS(vfcvt_h_s, ALL, gen_vvv, gen_helper_vfcvt_h_s) +TRANS(vfcvt_s_d, ALL, gen_vvv, gen_helper_vfcvt_s_d) -TRANS(vfrintrne_s, gen_vv, gen_helper_vfrintrne_s) -TRANS(vfrintrne_d, gen_vv, gen_helper_vfrintrne_d) -TRANS(vfrintrz_s, gen_vv, gen_helper_vfrintrz_s) -TRANS(vfrintrz_d, gen_vv, gen_helper_vfrintrz_d) -TRANS(vfrintrp_s, gen_vv, gen_helper_vfrintrp_s) -TRANS(vfrintrp_d, gen_vv, gen_helper_vfrintrp_d) -TRANS(vfrintrm_s, gen_vv, gen_helper_vfrintrm_s) -TRANS(vfrintrm_d, gen_vv, gen_helper_vfrintrm_d) -TRANS(vfrint_s, gen_vv, gen_helper_vfrint_s) -TRANS(vfrint_d, gen_vv, gen_helper_vfrint_d) +TRANS(vfrintrne_s, ALL, gen_vv, gen_helper_vfrintrne_s) +TRANS(vfrintrne_d, ALL, gen_vv, gen_helper_vfrintrne_d) +TRANS(vfrintrz_s, ALL, gen_vv, gen_helper_vfrintrz_s) +TRANS(vfrintrz_d, ALL, gen_vv, gen_helper_vfrintrz_d) +TRANS(vfrintrp_s, ALL, gen_vv, gen_helper_vfrintrp_s) +TRANS(vfrintrp_d, ALL, gen_vv, gen_helper_vfrintrp_d) +TRANS(vfrintrm_s, ALL, gen_vv, gen_helper_vfrintrm_s) +TRANS(vfrintrm_d, ALL, gen_vv, gen_helper_vfrintrm_d) +TRANS(vfrint_s, ALL, gen_vv, gen_helper_vfrint_s) +TRANS(vfrint_d, ALL, gen_vv, gen_helper_vfrint_d) -TRANS(vftintrne_w_s, gen_vv, gen_helper_vftintrne_w_s) -TRANS(vftintrne_l_d, gen_vv, gen_helper_vftintrne_l_d) -TRANS(vftintrz_w_s, gen_vv, gen_helper_vftintrz_w_s) -TRANS(vftintrz_l_d, gen_vv, gen_helper_vftintrz_l_d) -TRANS(vftintrp_w_s, gen_vv, gen_helper_vftintrp_w_s) -TRANS(vftintrp_l_d, gen_vv, gen_helper_vftintrp_l_d) -TRANS(vftintrm_w_s, gen_vv, gen_helper_vftintrm_w_s) -TRANS(vftintrm_l_d, gen_vv, gen_helper_vftintrm_l_d) -TRANS(vftint_w_s, gen_vv, gen_helper_vftint_w_s) -TRANS(vftint_l_d, gen_vv, gen_helper_vftint_l_d) -TRANS(vftintrz_wu_s, gen_vv, gen_helper_vftintrz_wu_s) -TRANS(vftintrz_lu_d, gen_vv, gen_helper_vftintrz_lu_d) -TRANS(vftint_wu_s, gen_vv, gen_helper_vftint_wu_s) -TRANS(vftint_lu_d, gen_vv, gen_helper_vftint_lu_d) -TRANS(vftintrne_w_d, gen_vvv, gen_helper_vftintrne_w_d) -TRANS(vftintrz_w_d, gen_vvv, gen_helper_vftintrz_w_d) -TRANS(vftintrp_w_d, gen_vvv, gen_helper_vftintrp_w_d) -TRANS(vftintrm_w_d, gen_vvv, gen_helper_vftintrm_w_d) -TRANS(vftint_w_d, gen_vvv, gen_helper_vftint_w_d) -TRANS(vftintrnel_l_s, gen_vv, gen_helper_vftintrnel_l_s) -TRANS(vftintrneh_l_s, gen_vv, gen_helper_vftintrneh_l_s) -TRANS(vftintrzl_l_s, gen_vv, gen_helper_vftintrzl_l_s) -TRANS(vftintrzh_l_s, gen_vv, gen_helper_vftintrzh_l_s) -TRANS(vftintrpl_l_s, gen_vv, gen_helper_vftintrpl_l_s) -TRANS(vftintrph_l_s, gen_vv, gen_helper_vftintrph_l_s) -TRANS(vftintrml_l_s, gen_vv, gen_helper_vftintrml_l_s) -TRANS(vftintrmh_l_s, gen_vv, gen_helper_vftintrmh_l_s) -TRANS(vftintl_l_s, gen_vv, gen_helper_vftintl_l_s) -TRANS(vftinth_l_s, gen_vv, gen_helper_vftinth_l_s) +TRANS(vftintrne_w_s, ALL, gen_vv, gen_helper_vftintrne_w_s) +TRANS(vftintrne_l_d, ALL, gen_vv, gen_helper_vftintrne_l_d) +TRANS(vftintrz_w_s, ALL, gen_vv, gen_helper_vftintrz_w_s) +TRANS(vftintrz_l_d, ALL, gen_vv, gen_helper_vftintrz_l_d) +TRANS(vftintrp_w_s, ALL, gen_vv, gen_helper_vftintrp_w_s) +TRANS(vftintrp_l_d, ALL, gen_vv, gen_helper_vftintrp_l_d) +TRANS(vftintrm_w_s, ALL, gen_vv, gen_helper_vftintrm_w_s) +TRANS(vftintrm_l_d, ALL, gen_vv, gen_helper_vftintrm_l_d) +TRANS(vftint_w_s, ALL, gen_vv, gen_helper_vftint_w_s) +TRANS(vftint_l_d, ALL, gen_vv, gen_helper_vftint_l_d) +TRANS(vftintrz_wu_s, ALL, gen_vv, gen_helper_vftintrz_wu_s) +TRANS(vftintrz_lu_d, ALL, gen_vv, gen_helper_vftintrz_lu_d) +TRANS(vftint_wu_s, ALL, gen_vv, gen_helper_vftint_wu_s) +TRANS(vftint_lu_d, ALL, gen_vv, gen_helper_vftint_lu_d) +TRANS(vftintrne_w_d, ALL, gen_vvv, gen_helper_vftintrne_w_d) +TRANS(vftintrz_w_d, ALL, gen_vvv, gen_helper_vftintrz_w_d) +TRANS(vftintrp_w_d, ALL, gen_vvv, gen_helper_vftintrp_w_d) +TRANS(vftintrm_w_d, ALL, gen_vvv, gen_helper_vftintrm_w_d) +TRANS(vftint_w_d, ALL, gen_vvv, gen_helper_vftint_w_d) +TRANS(vftintrnel_l_s, ALL, gen_vv, gen_helper_vftintrnel_l_s) +TRANS(vftintrneh_l_s, ALL, gen_vv, gen_helper_vftintrneh_l_s) +TRANS(vftintrzl_l_s, ALL, gen_vv, gen_helper_vftintrzl_l_s) +TRANS(vftintrzh_l_s, ALL, gen_vv, gen_helper_vftintrzh_l_s) +TRANS(vftintrpl_l_s, ALL, gen_vv, gen_helper_vftintrpl_l_s) +TRANS(vftintrph_l_s, ALL, gen_vv, gen_helper_vftintrph_l_s) +TRANS(vftintrml_l_s, ALL, gen_vv, gen_helper_vftintrml_l_s) +TRANS(vftintrmh_l_s, ALL, gen_vv, gen_helper_vftintrmh_l_s) +TRANS(vftintl_l_s, ALL, gen_vv, gen_helper_vftintl_l_s) +TRANS(vftinth_l_s, ALL, gen_vv, gen_helper_vftinth_l_s) -TRANS(vffint_s_w, gen_vv, gen_helper_vffint_s_w) -TRANS(vffint_d_l, gen_vv, gen_helper_vffint_d_l) -TRANS(vffint_s_wu, gen_vv, gen_helper_vffint_s_wu) -TRANS(vffint_d_lu, gen_vv, gen_helper_vffint_d_lu) -TRANS(vffintl_d_w, gen_vv, gen_helper_vffintl_d_w) -TRANS(vffinth_d_w, gen_vv, gen_helper_vffinth_d_w) -TRANS(vffint_s_l, gen_vvv, gen_helper_vffint_s_l) +TRANS(vffint_s_w, ALL, gen_vv, gen_helper_vffint_s_w) +TRANS(vffint_d_l, ALL, gen_vv, gen_helper_vffint_d_l) +TRANS(vffint_s_wu, ALL, gen_vv, gen_helper_vffint_s_wu) +TRANS(vffint_d_lu, ALL, gen_vv, gen_helper_vffint_d_lu) +TRANS(vffintl_d_w, ALL, gen_vv, gen_helper_vffintl_d_w) +TRANS(vffinth_d_w, ALL, gen_vv, gen_helper_vffinth_d_w) +TRANS(vffint_s_l, ALL, gen_vvv, gen_helper_vffint_s_l) static bool do_cmp(DisasContext *ctx, arg_vvv *a, MemOp mop, TCGCond cond) { @@ -3823,48 +3823,48 @@ static bool do_## NAME ##_u(DisasContext *ctx, arg_vv_i *a, MemOp mop) \ DO_CMPI_U(vslei) DO_CMPI_U(vslti) -TRANS(vseq_b, do_cmp, MO_8, TCG_COND_EQ) -TRANS(vseq_h, do_cmp, MO_16, TCG_COND_EQ) -TRANS(vseq_w, do_cmp, MO_32, TCG_COND_EQ) -TRANS(vseq_d, do_cmp, MO_64, TCG_COND_EQ) -TRANS(vseqi_b, do_vseqi_s, MO_8) -TRANS(vseqi_h, do_vseqi_s, MO_16) -TRANS(vseqi_w, do_vseqi_s, MO_32) -TRANS(vseqi_d, do_vseqi_s, MO_64) +TRANS(vseq_b, ALL, do_cmp, MO_8, TCG_COND_EQ) +TRANS(vseq_h, ALL, do_cmp, MO_16, TCG_COND_EQ) +TRANS(vseq_w, ALL, do_cmp, MO_32, TCG_COND_EQ) +TRANS(vseq_d, ALL, do_cmp, MO_64, TCG_COND_EQ) +TRANS(vseqi_b, ALL, do_vseqi_s, MO_8) +TRANS(vseqi_h, ALL, do_vseqi_s, MO_16) +TRANS(vseqi_w, ALL, do_vseqi_s, MO_32) +TRANS(vseqi_d, ALL, do_vseqi_s, MO_64) -TRANS(vsle_b, do_cmp, MO_8, TCG_COND_LE) -TRANS(vsle_h, do_cmp, MO_16, TCG_COND_LE) -TRANS(vsle_w, do_cmp, MO_32, TCG_COND_LE) -TRANS(vsle_d, do_cmp, MO_64, TCG_COND_LE) -TRANS(vslei_b, do_vslei_s, MO_8) -TRANS(vslei_h, do_vslei_s, MO_16) -TRANS(vslei_w, do_vslei_s, MO_32) -TRANS(vslei_d, do_vslei_s, MO_64) -TRANS(vsle_bu, do_cmp, MO_8, TCG_COND_LEU) -TRANS(vsle_hu, do_cmp, MO_16, TCG_COND_LEU) -TRANS(vsle_wu, do_cmp, MO_32, TCG_COND_LEU) -TRANS(vsle_du, do_cmp, MO_64, TCG_COND_LEU) -TRANS(vslei_bu, do_vslei_u, MO_8) -TRANS(vslei_hu, do_vslei_u, MO_16) -TRANS(vslei_wu, do_vslei_u, MO_32) -TRANS(vslei_du, do_vslei_u, MO_64) +TRANS(vsle_b, ALL, do_cmp, MO_8, TCG_COND_LE) +TRANS(vsle_h, ALL, do_cmp, MO_16, TCG_COND_LE) +TRANS(vsle_w, ALL, do_cmp, MO_32, TCG_COND_LE) +TRANS(vsle_d, ALL, do_cmp, MO_64, TCG_COND_LE) +TRANS(vslei_b, ALL, do_vslei_s, MO_8) +TRANS(vslei_h, ALL, do_vslei_s, MO_16) +TRANS(vslei_w, ALL, do_vslei_s, MO_32) +TRANS(vslei_d, ALL, do_vslei_s, MO_64) +TRANS(vsle_bu, ALL, do_cmp, MO_8, TCG_COND_LEU) +TRANS(vsle_hu, ALL, do_cmp, MO_16, TCG_COND_LEU) +TRANS(vsle_wu, ALL, do_cmp, MO_32, TCG_COND_LEU) +TRANS(vsle_du, ALL, do_cmp, MO_64, TCG_COND_LEU) +TRANS(vslei_bu, ALL, do_vslei_u, MO_8) +TRANS(vslei_hu, ALL, do_vslei_u, MO_16) +TRANS(vslei_wu, ALL, do_vslei_u, MO_32) +TRANS(vslei_du, ALL, do_vslei_u, MO_64) -TRANS(vslt_b, do_cmp, MO_8, TCG_COND_LT) -TRANS(vslt_h, do_cmp, MO_16, TCG_COND_LT) -TRANS(vslt_w, do_cmp, MO_32, TCG_COND_LT) -TRANS(vslt_d, do_cmp, MO_64, TCG_COND_LT) -TRANS(vslti_b, do_vslti_s, MO_8) -TRANS(vslti_h, do_vslti_s, MO_16) -TRANS(vslti_w, do_vslti_s, MO_32) -TRANS(vslti_d, do_vslti_s, MO_64) -TRANS(vslt_bu, do_cmp, MO_8, TCG_COND_LTU) -TRANS(vslt_hu, do_cmp, MO_16, TCG_COND_LTU) -TRANS(vslt_wu, do_cmp, MO_32, TCG_COND_LTU) -TRANS(vslt_du, do_cmp, MO_64, TCG_COND_LTU) -TRANS(vslti_bu, do_vslti_u, MO_8) -TRANS(vslti_hu, do_vslti_u, MO_16) -TRANS(vslti_wu, do_vslti_u, MO_32) -TRANS(vslti_du, do_vslti_u, MO_64) +TRANS(vslt_b, ALL, do_cmp, MO_8, TCG_COND_LT) +TRANS(vslt_h, ALL, do_cmp, MO_16, TCG_COND_LT) +TRANS(vslt_w, ALL, do_cmp, MO_32, TCG_COND_LT) +TRANS(vslt_d, ALL, do_cmp, MO_64, TCG_COND_LT) +TRANS(vslti_b, ALL, do_vslti_s, MO_8) +TRANS(vslti_h, ALL, do_vslti_s, MO_16) +TRANS(vslti_w, ALL, do_vslti_s, MO_32) +TRANS(vslti_d, ALL, do_vslti_s, MO_64) +TRANS(vslt_bu, ALL, do_cmp, MO_8, TCG_COND_LTU) +TRANS(vslt_hu, ALL, do_cmp, MO_16, TCG_COND_LTU) +TRANS(vslt_wu, ALL, do_cmp, MO_32, TCG_COND_LTU) +TRANS(vslt_du, ALL, do_cmp, MO_64, TCG_COND_LTU) +TRANS(vslti_bu, ALL, do_vslti_u, MO_8) +TRANS(vslti_hu, ALL, do_vslti_u, MO_16) +TRANS(vslti_wu, ALL, do_vslti_u, MO_32) +TRANS(vslti_du, ALL, do_vslti_u, MO_64) static bool trans_vfcmp_cond_s(DisasContext *ctx, arg_vvv_fcond *a) { @@ -3952,14 +3952,14 @@ static bool trans_## NAME (DisasContext *ctx, arg_cv *a) \ VSET(vseteqz_v, TCG_COND_EQ) VSET(vsetnez_v, TCG_COND_NE) -TRANS(vsetanyeqz_b, gen_cv, gen_helper_vsetanyeqz_b) -TRANS(vsetanyeqz_h, gen_cv, gen_helper_vsetanyeqz_h) -TRANS(vsetanyeqz_w, gen_cv, gen_helper_vsetanyeqz_w) -TRANS(vsetanyeqz_d, gen_cv, gen_helper_vsetanyeqz_d) -TRANS(vsetallnez_b, gen_cv, gen_helper_vsetallnez_b) -TRANS(vsetallnez_h, gen_cv, gen_helper_vsetallnez_h) -TRANS(vsetallnez_w, gen_cv, gen_helper_vsetallnez_w) -TRANS(vsetallnez_d, gen_cv, gen_helper_vsetallnez_d) +TRANS(vsetanyeqz_b, ALL, gen_cv, gen_helper_vsetanyeqz_b) +TRANS(vsetanyeqz_h, ALL, gen_cv, gen_helper_vsetanyeqz_h) +TRANS(vsetanyeqz_w, ALL, gen_cv, gen_helper_vsetanyeqz_w) +TRANS(vsetanyeqz_d, ALL, gen_cv, gen_helper_vsetanyeqz_d) +TRANS(vsetallnez_b, ALL, gen_cv, gen_helper_vsetallnez_b) +TRANS(vsetallnez_h, ALL, gen_cv, gen_helper_vsetallnez_h) +TRANS(vsetallnez_w, ALL, gen_cv, gen_helper_vsetallnez_w) +TRANS(vsetallnez_d, ALL, gen_cv, gen_helper_vsetallnez_d) static bool trans_vinsgr2vr_b(DisasContext *ctx, arg_vr_i *a) { @@ -4079,10 +4079,10 @@ static bool gvec_dup(DisasContext *ctx, arg_vr *a, MemOp mop) return true; } -TRANS(vreplgr2vr_b, gvec_dup, MO_8) -TRANS(vreplgr2vr_h, gvec_dup, MO_16) -TRANS(vreplgr2vr_w, gvec_dup, MO_32) -TRANS(vreplgr2vr_d, gvec_dup, MO_64) +TRANS(vreplgr2vr_b, ALL, gvec_dup, MO_8) +TRANS(vreplgr2vr_h, ALL, gvec_dup, MO_16) +TRANS(vreplgr2vr_w, ALL, gvec_dup, MO_32) +TRANS(vreplgr2vr_d, ALL, gvec_dup, MO_64) static bool trans_vreplvei_b(DisasContext *ctx, arg_vv_i *a) { @@ -4145,10 +4145,10 @@ static bool gen_vreplve(DisasContext *ctx, arg_vvr *a, int vece, int bit, return true; } -TRANS(vreplve_b, gen_vreplve, MO_8, 8, tcg_gen_ld8u_i64) -TRANS(vreplve_h, gen_vreplve, MO_16, 16, tcg_gen_ld16u_i64) -TRANS(vreplve_w, gen_vreplve, MO_32, 32, tcg_gen_ld32u_i64) -TRANS(vreplve_d, gen_vreplve, MO_64, 64, tcg_gen_ld_i64) +TRANS(vreplve_b, ALL, gen_vreplve, MO_8, 8, tcg_gen_ld8u_i64) +TRANS(vreplve_h, ALL, gen_vreplve, MO_16, 16, tcg_gen_ld16u_i64) +TRANS(vreplve_w, ALL, gen_vreplve, MO_32, 32, tcg_gen_ld32u_i64) +TRANS(vreplve_d, ALL, gen_vreplve, MO_64, 64, tcg_gen_ld_i64) static bool trans_vbsll_v(DisasContext *ctx, arg_vv_i *a) { @@ -4210,48 +4210,48 @@ static bool trans_vbsrl_v(DisasContext *ctx, arg_vv_i *a) return true; } -TRANS(vpackev_b, gen_vvv, gen_helper_vpackev_b) -TRANS(vpackev_h, gen_vvv, gen_helper_vpackev_h) -TRANS(vpackev_w, gen_vvv, gen_helper_vpackev_w) -TRANS(vpackev_d, gen_vvv, gen_helper_vpackev_d) -TRANS(vpackod_b, gen_vvv, gen_helper_vpackod_b) -TRANS(vpackod_h, gen_vvv, gen_helper_vpackod_h) -TRANS(vpackod_w, gen_vvv, gen_helper_vpackod_w) -TRANS(vpackod_d, gen_vvv, gen_helper_vpackod_d) +TRANS(vpackev_b, ALL, gen_vvv, gen_helper_vpackev_b) +TRANS(vpackev_h, ALL, gen_vvv, gen_helper_vpackev_h) +TRANS(vpackev_w, ALL, gen_vvv, gen_helper_vpackev_w) +TRANS(vpackev_d, ALL, gen_vvv, gen_helper_vpackev_d) +TRANS(vpackod_b, ALL, gen_vvv, gen_helper_vpackod_b) +TRANS(vpackod_h, ALL, gen_vvv, gen_helper_vpackod_h) +TRANS(vpackod_w, ALL, gen_vvv, gen_helper_vpackod_w) +TRANS(vpackod_d, ALL, gen_vvv, gen_helper_vpackod_d) -TRANS(vpickev_b, gen_vvv, gen_helper_vpickev_b) -TRANS(vpickev_h, gen_vvv, gen_helper_vpickev_h) -TRANS(vpickev_w, gen_vvv, gen_helper_vpickev_w) -TRANS(vpickev_d, gen_vvv, gen_helper_vpickev_d) -TRANS(vpickod_b, gen_vvv, gen_helper_vpickod_b) -TRANS(vpickod_h, gen_vvv, gen_helper_vpickod_h) -TRANS(vpickod_w, gen_vvv, gen_helper_vpickod_w) -TRANS(vpickod_d, gen_vvv, gen_helper_vpickod_d) +TRANS(vpickev_b, ALL, gen_vvv, gen_helper_vpickev_b) +TRANS(vpickev_h, ALL, gen_vvv, gen_helper_vpickev_h) +TRANS(vpickev_w, ALL, gen_vvv, gen_helper_vpickev_w) +TRANS(vpickev_d, ALL, gen_vvv, gen_helper_vpickev_d) +TRANS(vpickod_b, ALL, gen_vvv, gen_helper_vpickod_b) +TRANS(vpickod_h, ALL, gen_vvv, gen_helper_vpickod_h) +TRANS(vpickod_w, ALL, gen_vvv, gen_helper_vpickod_w) +TRANS(vpickod_d, ALL, gen_vvv, gen_helper_vpickod_d) -TRANS(vilvl_b, gen_vvv, gen_helper_vilvl_b) -TRANS(vilvl_h, gen_vvv, gen_helper_vilvl_h) -TRANS(vilvl_w, gen_vvv, gen_helper_vilvl_w) -TRANS(vilvl_d, gen_vvv, gen_helper_vilvl_d) -TRANS(vilvh_b, gen_vvv, gen_helper_vilvh_b) -TRANS(vilvh_h, gen_vvv, gen_helper_vilvh_h) -TRANS(vilvh_w, gen_vvv, gen_helper_vilvh_w) -TRANS(vilvh_d, gen_vvv, gen_helper_vilvh_d) +TRANS(vilvl_b, ALL, gen_vvv, gen_helper_vilvl_b) +TRANS(vilvl_h, ALL, gen_vvv, gen_helper_vilvl_h) +TRANS(vilvl_w, ALL, gen_vvv, gen_helper_vilvl_w) +TRANS(vilvl_d, ALL, gen_vvv, gen_helper_vilvl_d) +TRANS(vilvh_b, ALL, gen_vvv, gen_helper_vilvh_b) +TRANS(vilvh_h, ALL, gen_vvv, gen_helper_vilvh_h) +TRANS(vilvh_w, ALL, gen_vvv, gen_helper_vilvh_w) +TRANS(vilvh_d, ALL, gen_vvv, gen_helper_vilvh_d) -TRANS(vshuf_b, gen_vvvv, gen_helper_vshuf_b) -TRANS(vshuf_h, gen_vvv, gen_helper_vshuf_h) -TRANS(vshuf_w, gen_vvv, gen_helper_vshuf_w) -TRANS(vshuf_d, gen_vvv, gen_helper_vshuf_d) -TRANS(vshuf4i_b, gen_vv_i, gen_helper_vshuf4i_b) -TRANS(vshuf4i_h, gen_vv_i, gen_helper_vshuf4i_h) -TRANS(vshuf4i_w, gen_vv_i, gen_helper_vshuf4i_w) -TRANS(vshuf4i_d, gen_vv_i, gen_helper_vshuf4i_d) +TRANS(vshuf_b, ALL, gen_vvvv, gen_helper_vshuf_b) +TRANS(vshuf_h, ALL, gen_vvv, gen_helper_vshuf_h) +TRANS(vshuf_w, ALL, gen_vvv, gen_helper_vshuf_w) +TRANS(vshuf_d, ALL, gen_vvv, gen_helper_vshuf_d) +TRANS(vshuf4i_b, ALL, gen_vv_i, gen_helper_vshuf4i_b) +TRANS(vshuf4i_h, ALL, gen_vv_i, gen_helper_vshuf4i_h) +TRANS(vshuf4i_w, ALL, gen_vv_i, gen_helper_vshuf4i_w) +TRANS(vshuf4i_d, ALL, gen_vv_i, gen_helper_vshuf4i_d) -TRANS(vpermi_w, gen_vv_i, gen_helper_vpermi_w) +TRANS(vpermi_w, ALL, gen_vv_i, gen_helper_vpermi_w) -TRANS(vextrins_b, gen_vv_i, gen_helper_vextrins_b) -TRANS(vextrins_h, gen_vv_i, gen_helper_vextrins_h) -TRANS(vextrins_w, gen_vv_i, gen_helper_vextrins_w) -TRANS(vextrins_d, gen_vv_i, gen_helper_vextrins_d) +TRANS(vextrins_b, ALL, gen_vv_i, gen_helper_vextrins_b) +TRANS(vextrins_h, ALL, gen_vv_i, gen_helper_vextrins_h) +TRANS(vextrins_w, ALL, gen_vv_i, gen_helper_vextrins_w) +TRANS(vextrins_d, ALL, gen_vv_i, gen_helper_vextrins_d) static bool trans_vld(DisasContext *ctx, arg_vr_i *a) { diff --git a/target/loongarch/insn_trans/trans_memory.c.inc b/target/loongarch/insn_trans/trans_memory.c.inc index 88953f0ab0..ad6a4b006d 100644 --- a/target/loongarch/insn_trans/trans_memory.c.inc +++ b/target/loongarch/insn_trans/trans_memory.c.inc @@ -145,45 +145,45 @@ static bool gen_stptr(DisasContext *ctx, arg_rr_i *a, MemOp mop) return true; } -TRANS(ld_b, gen_load, MO_SB) -TRANS(ld_h, gen_load, MO_TESW) -TRANS(ld_w, gen_load, MO_TESL) -TRANS(ld_d, gen_load, MO_TEUQ) -TRANS(st_b, gen_store, MO_UB) -TRANS(st_h, gen_store, MO_TEUW) -TRANS(st_w, gen_store, MO_TEUL) -TRANS(st_d, gen_store, MO_TEUQ) -TRANS(ld_bu, gen_load, MO_UB) -TRANS(ld_hu, gen_load, MO_TEUW) -TRANS(ld_wu, gen_load, MO_TEUL) -TRANS(ldx_b, gen_loadx, MO_SB) -TRANS(ldx_h, gen_loadx, MO_TESW) -TRANS(ldx_w, gen_loadx, MO_TESL) -TRANS(ldx_d, gen_loadx, MO_TEUQ) -TRANS(stx_b, gen_storex, MO_UB) -TRANS(stx_h, gen_storex, MO_TEUW) -TRANS(stx_w, gen_storex, MO_TEUL) -TRANS(stx_d, gen_storex, MO_TEUQ) -TRANS(ldx_bu, gen_loadx, MO_UB) -TRANS(ldx_hu, gen_loadx, MO_TEUW) -TRANS(ldx_wu, gen_loadx, MO_TEUL) -TRANS(ldptr_w, gen_ldptr, MO_TESL) -TRANS(stptr_w, gen_stptr, MO_TEUL) -TRANS(ldptr_d, gen_ldptr, MO_TEUQ) -TRANS(stptr_d, gen_stptr, MO_TEUQ) -TRANS(ldgt_b, gen_load_gt, MO_SB) -TRANS(ldgt_h, gen_load_gt, MO_TESW) -TRANS(ldgt_w, gen_load_gt, MO_TESL) -TRANS(ldgt_d, gen_load_gt, MO_TEUQ) -TRANS(ldle_b, gen_load_le, MO_SB) -TRANS(ldle_h, gen_load_le, MO_TESW) -TRANS(ldle_w, gen_load_le, MO_TESL) -TRANS(ldle_d, gen_load_le, MO_TEUQ) -TRANS(stgt_b, gen_store_gt, MO_UB) -TRANS(stgt_h, gen_store_gt, MO_TEUW) -TRANS(stgt_w, gen_store_gt, MO_TEUL) -TRANS(stgt_d, gen_store_gt, MO_TEUQ) -TRANS(stle_b, gen_store_le, MO_UB) -TRANS(stle_h, gen_store_le, MO_TEUW) -TRANS(stle_w, gen_store_le, MO_TEUL) -TRANS(stle_d, gen_store_le, MO_TEUQ) +TRANS(ld_b, ALL, gen_load, MO_SB) +TRANS(ld_h, ALL, gen_load, MO_TESW) +TRANS(ld_w, ALL, gen_load, MO_TESL) +TRANS(ld_d, ALL, gen_load, MO_TEUQ) +TRANS(st_b, ALL, gen_store, MO_UB) +TRANS(st_h, ALL, gen_store, MO_TEUW) +TRANS(st_w, ALL, gen_store, MO_TEUL) +TRANS(st_d, ALL, gen_store, MO_TEUQ) +TRANS(ld_bu, ALL, gen_load, MO_UB) +TRANS(ld_hu, ALL, gen_load, MO_TEUW) +TRANS(ld_wu, ALL, gen_load, MO_TEUL) +TRANS(ldx_b, ALL, gen_loadx, MO_SB) +TRANS(ldx_h, ALL, gen_loadx, MO_TESW) +TRANS(ldx_w, ALL, gen_loadx, MO_TESL) +TRANS(ldx_d, ALL, gen_loadx, MO_TEUQ) +TRANS(stx_b, ALL, gen_storex, MO_UB) +TRANS(stx_h, ALL, gen_storex, MO_TEUW) +TRANS(stx_w, ALL, gen_storex, MO_TEUL) +TRANS(stx_d, ALL, gen_storex, MO_TEUQ) +TRANS(ldx_bu, ALL, gen_loadx, MO_UB) +TRANS(ldx_hu, ALL, gen_loadx, MO_TEUW) +TRANS(ldx_wu, ALL, gen_loadx, MO_TEUL) +TRANS(ldptr_w, ALL, gen_ldptr, MO_TESL) +TRANS(stptr_w, ALL, gen_stptr, MO_TEUL) +TRANS(ldptr_d, ALL, gen_ldptr, MO_TEUQ) +TRANS(stptr_d, ALL, gen_stptr, MO_TEUQ) +TRANS(ldgt_b, ALL, gen_load_gt, MO_SB) +TRANS(ldgt_h, ALL, gen_load_gt, MO_TESW) +TRANS(ldgt_w, ALL, gen_load_gt, MO_TESL) +TRANS(ldgt_d, ALL, gen_load_gt, MO_TEUQ) +TRANS(ldle_b, ALL, gen_load_le, MO_SB) +TRANS(ldle_h, ALL, gen_load_le, MO_TESW) +TRANS(ldle_w, ALL, gen_load_le, MO_TESL) +TRANS(ldle_d, ALL, gen_load_le, MO_TEUQ) +TRANS(stgt_b, ALL, gen_store_gt, MO_UB) +TRANS(stgt_h, ALL, gen_store_gt, MO_TEUW) +TRANS(stgt_w, ALL, gen_store_gt, MO_TEUL) +TRANS(stgt_d, ALL, gen_store_gt, MO_TEUQ) +TRANS(stle_b, ALL, gen_store_le, MO_UB) +TRANS(stle_h, ALL, gen_store_le, MO_TEUW) +TRANS(stle_w, ALL, gen_store_le, MO_TEUL) +TRANS(stle_d, ALL, gen_store_le, MO_TEUQ) diff --git a/target/loongarch/insn_trans/trans_privileged.c.inc b/target/loongarch/insn_trans/trans_privileged.c.inc index 9c9de090f0..684ff547a7 100644 --- a/target/loongarch/insn_trans/trans_privileged.c.inc +++ b/target/loongarch/insn_trans/trans_privileged.c.inc @@ -312,14 +312,14 @@ static bool gen_iocsrwr(DisasContext *ctx, arg_rr *a, return true; } -TRANS(iocsrrd_b, gen_iocsrrd, gen_helper_iocsrrd_b) -TRANS(iocsrrd_h, gen_iocsrrd, gen_helper_iocsrrd_h) -TRANS(iocsrrd_w, gen_iocsrrd, gen_helper_iocsrrd_w) -TRANS(iocsrrd_d, gen_iocsrrd, gen_helper_iocsrrd_d) -TRANS(iocsrwr_b, gen_iocsrwr, gen_helper_iocsrwr_b) -TRANS(iocsrwr_h, gen_iocsrwr, gen_helper_iocsrwr_h) -TRANS(iocsrwr_w, gen_iocsrwr, gen_helper_iocsrwr_w) -TRANS(iocsrwr_d, gen_iocsrwr, gen_helper_iocsrwr_d) +TRANS(iocsrrd_b, ALL, gen_iocsrrd, gen_helper_iocsrrd_b) +TRANS(iocsrrd_h, ALL, gen_iocsrrd, gen_helper_iocsrrd_h) +TRANS(iocsrrd_w, ALL, gen_iocsrrd, gen_helper_iocsrrd_w) +TRANS(iocsrrd_d, ALL, gen_iocsrrd, gen_helper_iocsrrd_d) +TRANS(iocsrwr_b, ALL, gen_iocsrwr, gen_helper_iocsrwr_b) +TRANS(iocsrwr_h, ALL, gen_iocsrwr, gen_helper_iocsrwr_h) +TRANS(iocsrwr_w, ALL, gen_iocsrwr, gen_helper_iocsrwr_w) +TRANS(iocsrwr_d, ALL, gen_iocsrwr, gen_helper_iocsrwr_d) static void check_mmu_idx(DisasContext *ctx) { diff --git a/target/loongarch/insn_trans/trans_shift.c.inc b/target/loongarch/insn_trans/trans_shift.c.inc index bf5428a2ba..849759b94b 100644 --- a/target/loongarch/insn_trans/trans_shift.c.inc +++ b/target/loongarch/insn_trans/trans_shift.c.inc @@ -78,18 +78,18 @@ static bool trans_srai_w(DisasContext *ctx, arg_srai_w *a) return true; } -TRANS(sll_w, gen_rrr, EXT_ZERO, EXT_NONE, EXT_SIGN, gen_sll_w) -TRANS(srl_w, gen_rrr, EXT_ZERO, EXT_NONE, EXT_SIGN, gen_srl_w) -TRANS(sra_w, gen_rrr, EXT_SIGN, EXT_NONE, EXT_SIGN, gen_sra_w) -TRANS(sll_d, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_sll_d) -TRANS(srl_d, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_srl_d) -TRANS(sra_d, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_sra_d) -TRANS(rotr_w, gen_rrr, EXT_ZERO, EXT_NONE, EXT_SIGN, gen_rotr_w) -TRANS(rotr_d, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_rotr_d) -TRANS(slli_w, gen_rri_c, EXT_NONE, EXT_SIGN, tcg_gen_shli_tl) -TRANS(slli_d, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_shli_tl) -TRANS(srli_w, gen_rri_c, EXT_ZERO, EXT_SIGN, tcg_gen_shri_tl) -TRANS(srli_d, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_shri_tl) -TRANS(srai_d, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_sari_tl) -TRANS(rotri_w, gen_rri_v, EXT_NONE, EXT_NONE, gen_rotr_w) -TRANS(rotri_d, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_rotri_tl) +TRANS(sll_w, ALL, gen_rrr, EXT_ZERO, EXT_NONE, EXT_SIGN, gen_sll_w) +TRANS(srl_w, ALL, gen_rrr, EXT_ZERO, EXT_NONE, EXT_SIGN, gen_srl_w) +TRANS(sra_w, ALL, gen_rrr, EXT_SIGN, EXT_NONE, EXT_SIGN, gen_sra_w) +TRANS(sll_d, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_sll_d) +TRANS(srl_d, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_srl_d) +TRANS(sra_d, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_sra_d) +TRANS(rotr_w, ALL, gen_rrr, EXT_ZERO, EXT_NONE, EXT_SIGN, gen_rotr_w) +TRANS(rotr_d, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_rotr_d) +TRANS(slli_w, ALL, gen_rri_c, EXT_NONE, EXT_SIGN, tcg_gen_shli_tl) +TRANS(slli_d, ALL, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_shli_tl) +TRANS(srli_w, ALL, gen_rri_c, EXT_ZERO, EXT_SIGN, tcg_gen_shri_tl) +TRANS(srli_d, ALL, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_shri_tl) +TRANS(srai_d, ALL, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_sari_tl) +TRANS(rotri_w, ALL, gen_rri_v, EXT_NONE, EXT_NONE, gen_rotr_w) +TRANS(rotri_d, ALL, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_rotri_tl) From patchwork Tue Aug 22 07:19:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 715706 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp120971wrp; Tue, 22 Aug 2023 00:21:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFYsc6nxjzb4j97u+CXQ2MdMKtPhm8gzXB1usKz+EH2eMdpjcpwqmaKiOyl+5lLrsVbbYRX X-Received: by 2002:ac8:5a8f:0:b0:400:aaa0:a4f9 with SMTP id c15-20020ac85a8f000000b00400aaa0a4f9mr10617524qtc.17.1692688915585; Tue, 22 Aug 2023 00:21:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692688915; cv=none; d=google.com; s=arc-20160816; b=HaTb7XX/BDcbane+5E3KkBWRBY3xs1+B4Ae+7qa/vslCajaLXcYBWzuqYeJMkeiUXQ z5hu76gqqkmeQTrK9IZdXgr+xDobPQOQkeZj0Z2JZTsWlJt3Ty6H/GYRoObR920IAV4+ iKG/smgOA9vG/bHrLvL7VzhWNgFyKqhuZNaVSmkWt5lCQrqq1qGrT8UYHmZEQ1uchBEx gI/MebXDoVQwiIcgozlnalNPWpZQkVvuonS+NKBEWFC92jI4g8ZHgCiN0A2OLyF0VbWV BjxJ1fNZrFcBXK7fe9StE/izhO2gth+7HLmppEgCsINCUwPho6rmkKIVejd2Cn1rdBej 2XpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=Xqq0w5rrWHPhUVZYkdQHqeUnw4FGgZvSQNCoNoAaM04=; fh=EgjsXW+L4Y5zRUQS7SIQdGNDJ+AtbUcRDS0IFIrVH6E=; b=W1P7Ql/MRwHOA3JI7mt2SdeGOpBxYiP1eo8OLcy7bARMmvUJ+d3hu0XWSnvMA4d5Zl G23Ukwq6TByKvxL9OLLYwIBPycOZ6J6NebYJuhdUbGbNQXzfFmLALPQqqjm4yLSB9MPs ig3YCINDSU1USBJSSrwwu4boTYvBNz0YKLDsVrhTThMZILnhdagLDxu+mxzUYDaHYs9U GhIHIQh/k+rL/1U6HMJvm4TF6U5WxY2K7KwpwBFCBZqe9VaIzHXViMtqejGJzGGG+6MA 0X7WHL0sjjj9F9NHmwBbDnG6uqfD+jTdzJhCrEYatQT6/qD7KLwvVt8S3+ASWgvRUOi2 Zyrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="H5jvlM4/"; 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 f9-20020ac859c9000000b00403b0f943easi844876qtf.728.2023.08.22.00.21.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 00:21:55 -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="H5jvlM4/"; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYLgs-00073F-6e; Tue, 22 Aug 2023 03:20:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYLgr-000733-9m for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:20:37 -0400 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYLgn-0004me-7B for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:20:37 -0400 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4fe2d152f62so6408999e87.0 for ; Tue, 22 Aug 2023 00:20:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692688831; x=1693293631; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Xqq0w5rrWHPhUVZYkdQHqeUnw4FGgZvSQNCoNoAaM04=; b=H5jvlM4/64usNewymBWaNSFKJV3Lm8hk+cR2L5PaobG6J6jfWXUbpdIOQM27wZbTMp HSjFCHYggutVF3jUVYlqwKKKhYh74FUG2GCjAx0PWIF2gGqDrY2+2hInOvXuWdfqZRIW GHSs2FBlTFLyqCebn+gCOuN9xKYen5XhFXMjsChtY9XeaV3BMwglHcaBiZc8VEAxDcC3 Zk3pcwDcW7Io+y6wKzSat1qXMXSCEbd3UP0TCl1X+rMfs6oNHuHdFc1lo9IsZnjPHcpM j4BBOBvo/e/LjB6Rcl4MP+XxoShIMsYDHIJRA2VIPz8P4AsJ4HD9LW8cEQBb8l7K06nS IBYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692688831; x=1693293631; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xqq0w5rrWHPhUVZYkdQHqeUnw4FGgZvSQNCoNoAaM04=; b=M1rOOSsTLE/QZlVRzCrArmb7iu/xN9BkyyqjPQ4GpMROHJUq21cPK4J4WMSgkwF50f AMj6bzBNjwqvso+YFFFF1gyMU7VIG53PEWTVn6d14x67khdYEXhBM/bz4Z3VHEeTy5pr 086JPC8/K3qUcC+1cVUnw3IKlspH/iTRrdAh3L3TNdHkLLMjH46HyoRz/6MbkABxFVMd lDMzct1J8TuAcsqdkJoAJDqqKOYsd09l4kY9JXvv9HJSWa/8qwu10U+a69cJD7RQcuM5 hrRmFD3noY3Par5C5AXoPubxBZVjEmyoVIzjugpWMOJGMda1ugiH4MLFDqxE8ZFGh2pF yyDQ== X-Gm-Message-State: AOJu0Yyw6UrAa1PKXQux4Osj6zf1UgngjBhQUWZkFdcUhZ57+9c0Ftj9 37CPvWhOD0ys+14OOtY4fjqOxqSWgM0oq+8/qHm2Iw== X-Received: by 2002:ac2:4e85:0:b0:500:80af:e199 with SMTP id o5-20020ac24e85000000b0050080afe199mr3698894lfr.55.1692688830885; Tue, 22 Aug 2023 00:20:30 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id eo4-20020a05600c82c400b003fe1a092925sm14884342wmb.19.2023.08.22.00.20.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 00:20:30 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Song Gao Cc: Jiajie Chen , Xiaojuan Yang , Huacai Chen , Richard Henderson Subject: [PATCH RESEND v5 12/19] target/loongarch: Add avail_64 to check la64-only instructions Date: Tue, 22 Aug 2023 09:19:52 +0200 Message-ID: <20230822071959.35620-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822071405.35386-1-philmd@linaro.org> References: <20230822071405.35386-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=philmd@linaro.org; helo=mail-lf1-x12b.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Song Gao The la32 instructions listed in Table 2 at https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#overview-of-basic-integer-instructions Co-authored-by: Jiajie Chen Signed-off-by: Song Gao Reviewed-by: Richard Henderson Message-ID: <20230822032724.1353391-9-gaosong@loongson.cn> --- target/loongarch/translate.h | 3 + target/loongarch/translate.c | 2 + target/loongarch/insn_trans/trans_arith.c.inc | 42 ++++++---- .../loongarch/insn_trans/trans_atomic.c.inc | 76 +++++++++---------- target/loongarch/insn_trans/trans_bit.c.inc | 28 +++---- .../loongarch/insn_trans/trans_branch.c.inc | 4 +- target/loongarch/insn_trans/trans_extra.c.inc | 24 ++++-- target/loongarch/insn_trans/trans_fmov.c.inc | 4 +- .../loongarch/insn_trans/trans_memory.c.inc | 68 ++++++++--------- target/loongarch/insn_trans/trans_shift.c.inc | 24 +++--- 10 files changed, 152 insertions(+), 123 deletions(-) diff --git a/target/loongarch/translate.h b/target/loongarch/translate.h index 3c5c746f30..1342446242 100644 --- a/target/loongarch/translate.h +++ b/target/loongarch/translate.h @@ -15,6 +15,8 @@ { return avail_##AVAIL(ctx) && FUNC(ctx, a, __VA_ARGS__); } #define avail_ALL(C) true +#define avail_64(C) (FIELD_EX32((C)->cpucfg1, CPUCFG1, ARCH) == \ + CPUCFG1_ARCH_LA64) /* * If an operation is being performed on less than TARGET_LONG_BITS, @@ -37,6 +39,7 @@ typedef struct DisasContext { TCGv zero; bool la64; /* LoongArch64 mode */ bool va32; /* 32-bit virtual address */ + uint32_t cpucfg1; } DisasContext; void generate_exception(DisasContext *ctx, int excp); diff --git a/target/loongarch/translate.c b/target/loongarch/translate.c index de7c1c5d1f..6967e12fc3 100644 --- a/target/loongarch/translate.c +++ b/target/loongarch/translate.c @@ -127,6 +127,8 @@ static void loongarch_tr_init_disas_context(DisasContextBase *dcbase, ctx->va32 = (ctx->base.tb->flags & HW_FLAGS_VA32) != 0; ctx->zero = tcg_constant_tl(0); + + ctx->cpucfg1 = env->cpucfg[1]; } static void loongarch_tr_tb_start(DisasContextBase *dcbase, CPUState *cs) diff --git a/target/loongarch/insn_trans/trans_arith.c.inc b/target/loongarch/insn_trans/trans_arith.c.inc index d7f69a7553..2be057e932 100644 --- a/target/loongarch/insn_trans/trans_arith.c.inc +++ b/target/loongarch/insn_trans/trans_arith.c.inc @@ -199,6 +199,10 @@ static bool trans_lu32i_d(DisasContext *ctx, arg_lu32i_d *a) TCGv src1 = gpr_src(ctx, a->rd, EXT_NONE); TCGv src2 = tcg_constant_tl(a->imm); + if (!avail_64(ctx)) { + return false; + } + tcg_gen_deposit_tl(dest, src1, src2, 32, 32); gen_set_gpr(a->rd, dest, EXT_NONE); @@ -211,6 +215,10 @@ static bool trans_lu52i_d(DisasContext *ctx, arg_lu52i_d *a) TCGv src1 = gpr_src(ctx, a->rj, EXT_NONE); TCGv src2 = tcg_constant_tl(a->imm); + if (!avail_64(ctx)) { + return false; + } + tcg_gen_deposit_tl(dest, src1, src2, 52, 12); gen_set_gpr(a->rd, dest, EXT_NONE); @@ -242,6 +250,10 @@ static bool trans_addu16i_d(DisasContext *ctx, arg_addu16i_d *a) TCGv dest = gpr_dst(ctx, a->rd, EXT_NONE); TCGv src1 = gpr_src(ctx, a->rj, EXT_NONE); + if (!avail_64(ctx)) { + return false; + } + tcg_gen_addi_tl(dest, src1, a->imm << 16); gen_set_gpr(a->rd, dest, EXT_NONE); @@ -249,9 +261,9 @@ static bool trans_addu16i_d(DisasContext *ctx, arg_addu16i_d *a) } TRANS(add_w, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_SIGN, tcg_gen_add_tl) -TRANS(add_d, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_add_tl) +TRANS(add_d, 64, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_add_tl) TRANS(sub_w, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_SIGN, tcg_gen_sub_tl) -TRANS(sub_d, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_sub_tl) +TRANS(sub_d, 64, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_sub_tl) TRANS(and, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_and_tl) TRANS(or, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_or_tl) TRANS(xor, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_xor_tl) @@ -261,32 +273,32 @@ TRANS(orn, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_orc_tl) TRANS(slt, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_slt) TRANS(sltu, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_sltu) TRANS(mul_w, ALL, gen_rrr, EXT_SIGN, EXT_SIGN, EXT_SIGN, tcg_gen_mul_tl) -TRANS(mul_d, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_mul_tl) +TRANS(mul_d, 64, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, tcg_gen_mul_tl) TRANS(mulh_w, ALL, gen_rrr, EXT_SIGN, EXT_SIGN, EXT_NONE, gen_mulh_w) TRANS(mulh_wu, ALL, gen_rrr, EXT_ZERO, EXT_ZERO, EXT_NONE, gen_mulh_w) -TRANS(mulh_d, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_mulh_d) -TRANS(mulh_du, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_mulh_du) -TRANS(mulw_d_w, ALL, gen_rrr, EXT_SIGN, EXT_SIGN, EXT_NONE, tcg_gen_mul_tl) -TRANS(mulw_d_wu, ALL, gen_rrr, EXT_ZERO, EXT_ZERO, EXT_NONE, tcg_gen_mul_tl) +TRANS(mulh_d, 64, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_mulh_d) +TRANS(mulh_du, 64, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_mulh_du) +TRANS(mulw_d_w, 64, gen_rrr, EXT_SIGN, EXT_SIGN, EXT_NONE, tcg_gen_mul_tl) +TRANS(mulw_d_wu, 64, gen_rrr, EXT_ZERO, EXT_ZERO, EXT_NONE, tcg_gen_mul_tl) TRANS(div_w, ALL, gen_rrr, EXT_SIGN, EXT_SIGN, EXT_SIGN, gen_div_w) TRANS(mod_w, ALL, gen_rrr, EXT_SIGN, EXT_SIGN, EXT_SIGN, gen_rem_w) TRANS(div_wu, ALL, gen_rrr, EXT_ZERO, EXT_ZERO, EXT_SIGN, gen_div_du) TRANS(mod_wu, ALL, gen_rrr, EXT_ZERO, EXT_ZERO, EXT_SIGN, gen_rem_du) -TRANS(div_d, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_div_d) -TRANS(mod_d, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_rem_d) -TRANS(div_du, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_div_du) -TRANS(mod_du, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_rem_du) +TRANS(div_d, 64, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_div_d) +TRANS(mod_d, 64, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_rem_d) +TRANS(div_du, 64, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_div_du) +TRANS(mod_du, 64, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_rem_du) TRANS(slti, ALL, gen_rri_v, EXT_NONE, EXT_NONE, gen_slt) TRANS(sltui, ALL, gen_rri_v, EXT_NONE, EXT_NONE, gen_sltu) TRANS(addi_w, ALL, gen_rri_c, EXT_NONE, EXT_SIGN, tcg_gen_addi_tl) -TRANS(addi_d, ALL, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_addi_tl) +TRANS(addi_d, 64, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_addi_tl) TRANS(alsl_w, ALL, gen_rrr_sa, EXT_NONE, EXT_SIGN, gen_alsl) -TRANS(alsl_wu, ALL, gen_rrr_sa, EXT_NONE, EXT_ZERO, gen_alsl) -TRANS(alsl_d, ALL, gen_rrr_sa, EXT_NONE, EXT_NONE, gen_alsl) +TRANS(alsl_wu, 64, gen_rrr_sa, EXT_NONE, EXT_ZERO, gen_alsl) +TRANS(alsl_d, 64, gen_rrr_sa, EXT_NONE, EXT_NONE, gen_alsl) TRANS(pcaddi, ALL, gen_pc, gen_pcaddi) TRANS(pcalau12i, ALL, gen_pc, gen_pcalau12i) TRANS(pcaddu12i, ALL, gen_pc, gen_pcaddu12i) -TRANS(pcaddu18i, ALL, gen_pc, gen_pcaddu18i) +TRANS(pcaddu18i, 64, gen_pc, gen_pcaddu18i) TRANS(andi, ALL, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_andi_tl) TRANS(ori, ALL, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_ori_tl) TRANS(xori, ALL, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_xori_tl) diff --git a/target/loongarch/insn_trans/trans_atomic.c.inc b/target/loongarch/insn_trans/trans_atomic.c.inc index 0a02f0dbf3..194818d74d 100644 --- a/target/loongarch/insn_trans/trans_atomic.c.inc +++ b/target/loongarch/insn_trans/trans_atomic.c.inc @@ -71,41 +71,41 @@ static bool gen_am(DisasContext *ctx, arg_rrr *a, TRANS(ll_w, ALL, gen_ll, MO_TESL) TRANS(sc_w, ALL, gen_sc, MO_TESL) -TRANS(ll_d, ALL, gen_ll, MO_TEUQ) -TRANS(sc_d, ALL, gen_sc, MO_TEUQ) -TRANS(amswap_w, ALL, gen_am, tcg_gen_atomic_xchg_tl, MO_TESL) -TRANS(amswap_d, ALL, gen_am, tcg_gen_atomic_xchg_tl, MO_TEUQ) -TRANS(amadd_w, ALL, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TESL) -TRANS(amadd_d, ALL, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TEUQ) -TRANS(amand_w, ALL, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TESL) -TRANS(amand_d, ALL, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TEUQ) -TRANS(amor_w, ALL, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TESL) -TRANS(amor_d, ALL, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TEUQ) -TRANS(amxor_w, ALL, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TESL) -TRANS(amxor_d, ALL, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TEUQ) -TRANS(ammax_w, ALL, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TESL) -TRANS(ammax_d, ALL, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TEUQ) -TRANS(ammin_w, ALL, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TESL) -TRANS(ammin_d, ALL, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TEUQ) -TRANS(ammax_wu, ALL, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TESL) -TRANS(ammax_du, ALL, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TEUQ) -TRANS(ammin_wu, ALL, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TESL) -TRANS(ammin_du, ALL, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TEUQ) -TRANS(amswap_db_w, ALL, gen_am, tcg_gen_atomic_xchg_tl, MO_TESL) -TRANS(amswap_db_d, ALL, gen_am, tcg_gen_atomic_xchg_tl, MO_TEUQ) -TRANS(amadd_db_w, ALL, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TESL) -TRANS(amadd_db_d, ALL, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TEUQ) -TRANS(amand_db_w, ALL, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TESL) -TRANS(amand_db_d, ALL, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TEUQ) -TRANS(amor_db_w, ALL, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TESL) -TRANS(amor_db_d, ALL, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TEUQ) -TRANS(amxor_db_w, ALL, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TESL) -TRANS(amxor_db_d, ALL, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TEUQ) -TRANS(ammax_db_w, ALL, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TESL) -TRANS(ammax_db_d, ALL, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TEUQ) -TRANS(ammin_db_w, ALL, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TESL) -TRANS(ammin_db_d, ALL, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TEUQ) -TRANS(ammax_db_wu, ALL, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TESL) -TRANS(ammax_db_du, ALL, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TEUQ) -TRANS(ammin_db_wu, ALL, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TESL) -TRANS(ammin_db_du, ALL, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TEUQ) +TRANS(ll_d, 64, gen_ll, MO_TEUQ) +TRANS(sc_d, 64, gen_sc, MO_TEUQ) +TRANS(amswap_w, 64, gen_am, tcg_gen_atomic_xchg_tl, MO_TESL) +TRANS(amswap_d, 64, gen_am, tcg_gen_atomic_xchg_tl, MO_TEUQ) +TRANS(amadd_w, 64, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TESL) +TRANS(amadd_d, 64, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TEUQ) +TRANS(amand_w, 64, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TESL) +TRANS(amand_d, 64, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TEUQ) +TRANS(amor_w, 64, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TESL) +TRANS(amor_d, 64, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TEUQ) +TRANS(amxor_w, 64, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TESL) +TRANS(amxor_d, 64, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TEUQ) +TRANS(ammax_w, 64, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TESL) +TRANS(ammax_d, 64, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TEUQ) +TRANS(ammin_w, 64, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TESL) +TRANS(ammin_d, 64, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TEUQ) +TRANS(ammax_wu, 64, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TESL) +TRANS(ammax_du, 64, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TEUQ) +TRANS(ammin_wu, 64, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TESL) +TRANS(ammin_du, 64, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TEUQ) +TRANS(amswap_db_w, 64, gen_am, tcg_gen_atomic_xchg_tl, MO_TESL) +TRANS(amswap_db_d, 64, gen_am, tcg_gen_atomic_xchg_tl, MO_TEUQ) +TRANS(amadd_db_w, 64, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TESL) +TRANS(amadd_db_d, 64, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TEUQ) +TRANS(amand_db_w, 64, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TESL) +TRANS(amand_db_d, 64, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TEUQ) +TRANS(amor_db_w, 64, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TESL) +TRANS(amor_db_d, 64, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TEUQ) +TRANS(amxor_db_w, 64, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TESL) +TRANS(amxor_db_d, 64, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TEUQ) +TRANS(ammax_db_w, 64, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TESL) +TRANS(ammax_db_d, 64, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TEUQ) +TRANS(ammin_db_w, 64, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TESL) +TRANS(ammin_db_d, 64, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TEUQ) +TRANS(ammax_db_wu, 64, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TESL) +TRANS(ammax_db_du, 64, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TEUQ) +TRANS(ammin_db_wu, 64, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TESL) +TRANS(ammin_db_du, 64, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TEUQ) diff --git a/target/loongarch/insn_trans/trans_bit.c.inc b/target/loongarch/insn_trans/trans_bit.c.inc index d2a7ac28f7..ee5fa003ce 100644 --- a/target/loongarch/insn_trans/trans_bit.c.inc +++ b/target/loongarch/insn_trans/trans_bit.c.inc @@ -184,25 +184,25 @@ TRANS(clo_w, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_clo_w) TRANS(clz_w, ALL, gen_rr, EXT_ZERO, EXT_NONE, gen_clz_w) TRANS(cto_w, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_cto_w) TRANS(ctz_w, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_ctz_w) -TRANS(clo_d, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_clo_d) -TRANS(clz_d, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_clz_d) -TRANS(cto_d, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_cto_d) -TRANS(ctz_d, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_ctz_d) +TRANS(clo_d, 64, gen_rr, EXT_NONE, EXT_NONE, gen_clo_d) +TRANS(clz_d, 64, gen_rr, EXT_NONE, EXT_NONE, gen_clz_d) +TRANS(cto_d, 64, gen_rr, EXT_NONE, EXT_NONE, gen_cto_d) +TRANS(ctz_d, 64, gen_rr, EXT_NONE, EXT_NONE, gen_ctz_d) TRANS(revb_2h, ALL, gen_rr, EXT_NONE, EXT_SIGN, gen_revb_2h) -TRANS(revb_4h, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_revb_4h) -TRANS(revb_2w, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_revb_2w) -TRANS(revb_d, ALL, gen_rr, EXT_NONE, EXT_NONE, tcg_gen_bswap64_i64) -TRANS(revh_2w, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_revh_2w) -TRANS(revh_d, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_revh_d) +TRANS(revb_4h, 64, gen_rr, EXT_NONE, EXT_NONE, gen_revb_4h) +TRANS(revb_2w, 64, gen_rr, EXT_NONE, EXT_NONE, gen_revb_2w) +TRANS(revb_d, 64, gen_rr, EXT_NONE, EXT_NONE, tcg_gen_bswap64_i64) +TRANS(revh_2w, 64, gen_rr, EXT_NONE, EXT_NONE, gen_revh_2w) +TRANS(revh_d, 64, gen_rr, EXT_NONE, EXT_NONE, gen_revh_d) TRANS(bitrev_4b, ALL, gen_rr, EXT_ZERO, EXT_SIGN, gen_helper_bitswap) -TRANS(bitrev_8b, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_helper_bitswap) +TRANS(bitrev_8b, 64, gen_rr, EXT_NONE, EXT_NONE, gen_helper_bitswap) TRANS(bitrev_w, ALL, gen_rr, EXT_NONE, EXT_SIGN, gen_helper_bitrev_w) -TRANS(bitrev_d, ALL, gen_rr, EXT_NONE, EXT_NONE, gen_helper_bitrev_d) +TRANS(bitrev_d, 64, gen_rr, EXT_NONE, EXT_NONE, gen_helper_bitrev_d) TRANS(maskeqz, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_maskeqz) TRANS(masknez, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_masknez) TRANS(bytepick_w, ALL, gen_rrr_sa, EXT_NONE, EXT_NONE, gen_bytepick_w) -TRANS(bytepick_d, ALL, gen_rrr_sa, EXT_NONE, EXT_NONE, gen_bytepick_d) +TRANS(bytepick_d, 64, gen_rrr_sa, EXT_NONE, EXT_NONE, gen_bytepick_d) TRANS(bstrins_w, ALL, gen_bstrins, EXT_SIGN) -TRANS(bstrins_d, ALL, gen_bstrins, EXT_NONE) +TRANS(bstrins_d, 64, gen_bstrins, EXT_NONE) TRANS(bstrpick_w, ALL, gen_bstrpick, EXT_SIGN) -TRANS(bstrpick_d, ALL, gen_bstrpick, EXT_NONE) +TRANS(bstrpick_d, 64, gen_bstrpick, EXT_NONE) diff --git a/target/loongarch/insn_trans/trans_branch.c.inc b/target/loongarch/insn_trans/trans_branch.c.inc index 50f7eb640a..a4fd2092e5 100644 --- a/target/loongarch/insn_trans/trans_branch.c.inc +++ b/target/loongarch/insn_trans/trans_branch.c.inc @@ -80,5 +80,5 @@ TRANS(bltu, ALL, gen_rr_bc, TCG_COND_LTU) TRANS(bgeu, ALL, gen_rr_bc, TCG_COND_GEU) TRANS(beqz, ALL, gen_rz_bc, TCG_COND_EQ) TRANS(bnez, ALL, gen_rz_bc, TCG_COND_NE) -TRANS(bceqz, ALL, gen_cz_bc, TCG_COND_EQ) -TRANS(bcnez, ALL, gen_cz_bc, TCG_COND_NE) +TRANS(bceqz, 64, gen_cz_bc, TCG_COND_EQ) +TRANS(bcnez, 64, gen_cz_bc, TCG_COND_NE) diff --git a/target/loongarch/insn_trans/trans_extra.c.inc b/target/loongarch/insn_trans/trans_extra.c.inc index b354ca0f86..dd5d02e88c 100644 --- a/target/loongarch/insn_trans/trans_extra.c.inc +++ b/target/loongarch/insn_trans/trans_extra.c.inc @@ -20,6 +20,10 @@ static bool trans_asrtle_d(DisasContext *ctx, arg_asrtle_d * a) TCGv src1 = gpr_src(ctx, a->rj, EXT_NONE); TCGv src2 = gpr_src(ctx, a->rk, EXT_NONE); + if (!avail_64(ctx)) { + return false; + } + gen_helper_asrtle_d(cpu_env, src1, src2); return true; } @@ -29,6 +33,10 @@ static bool trans_asrtgt_d(DisasContext *ctx, arg_asrtgt_d * a) TCGv src1 = gpr_src(ctx, a->rj, EXT_NONE); TCGv src2 = gpr_src(ctx, a->rk, EXT_NONE); + if (!avail_64(ctx)) { + return false; + } + gen_helper_asrtgt_d(cpu_env, src1, src2); return true; } @@ -89,11 +97,11 @@ static bool gen_crc(DisasContext *ctx, arg_rrr *a, return true; } -TRANS(crc_w_b_w, ALL, gen_crc, gen_helper_crc32, tcg_constant_tl(1)) -TRANS(crc_w_h_w, ALL, gen_crc, gen_helper_crc32, tcg_constant_tl(2)) -TRANS(crc_w_w_w, ALL, gen_crc, gen_helper_crc32, tcg_constant_tl(4)) -TRANS(crc_w_d_w, ALL, gen_crc, gen_helper_crc32, tcg_constant_tl(8)) -TRANS(crcc_w_b_w, ALL, gen_crc, gen_helper_crc32c, tcg_constant_tl(1)) -TRANS(crcc_w_h_w, ALL, gen_crc, gen_helper_crc32c, tcg_constant_tl(2)) -TRANS(crcc_w_w_w, ALL, gen_crc, gen_helper_crc32c, tcg_constant_tl(4)) -TRANS(crcc_w_d_w, ALL, gen_crc, gen_helper_crc32c, tcg_constant_tl(8)) +TRANS(crc_w_b_w, 64, gen_crc, gen_helper_crc32, tcg_constant_tl(1)) +TRANS(crc_w_h_w, 64, gen_crc, gen_helper_crc32, tcg_constant_tl(2)) +TRANS(crc_w_w_w, 64, gen_crc, gen_helper_crc32, tcg_constant_tl(4)) +TRANS(crc_w_d_w, 64, gen_crc, gen_helper_crc32, tcg_constant_tl(8)) +TRANS(crcc_w_b_w, 64, gen_crc, gen_helper_crc32c, tcg_constant_tl(1)) +TRANS(crcc_w_h_w, 64, gen_crc, gen_helper_crc32c, tcg_constant_tl(2)) +TRANS(crcc_w_w_w, 64, gen_crc, gen_helper_crc32c, tcg_constant_tl(4)) +TRANS(crcc_w_d_w, 64, gen_crc, gen_helper_crc32c, tcg_constant_tl(8)) diff --git a/target/loongarch/insn_trans/trans_fmov.c.inc b/target/loongarch/insn_trans/trans_fmov.c.inc index aa7fea67b5..385bbb7929 100644 --- a/target/loongarch/insn_trans/trans_fmov.c.inc +++ b/target/loongarch/insn_trans/trans_fmov.c.inc @@ -181,8 +181,8 @@ static bool trans_movcf2gr(DisasContext *ctx, arg_movcf2gr *a) TRANS(fmov_s, ALL, gen_f2f, tcg_gen_mov_tl, true) TRANS(fmov_d, ALL, gen_f2f, tcg_gen_mov_tl, false) TRANS(movgr2fr_w, ALL, gen_r2f, gen_movgr2fr_w) -TRANS(movgr2fr_d, ALL, gen_r2f, tcg_gen_mov_tl) +TRANS(movgr2fr_d, 64, gen_r2f, tcg_gen_mov_tl) TRANS(movgr2frh_w, ALL, gen_r2f, gen_movgr2frh_w) TRANS(movfr2gr_s, ALL, gen_f2r, tcg_gen_ext32s_tl) -TRANS(movfr2gr_d, ALL, gen_f2r, tcg_gen_mov_tl) +TRANS(movfr2gr_d, 64, gen_f2r, tcg_gen_mov_tl) TRANS(movfrh2gr_s, ALL, gen_f2r, gen_movfrh2gr_s) diff --git a/target/loongarch/insn_trans/trans_memory.c.inc b/target/loongarch/insn_trans/trans_memory.c.inc index ad6a4b006d..d9d062235a 100644 --- a/target/loongarch/insn_trans/trans_memory.c.inc +++ b/target/loongarch/insn_trans/trans_memory.c.inc @@ -148,42 +148,42 @@ static bool gen_stptr(DisasContext *ctx, arg_rr_i *a, MemOp mop) TRANS(ld_b, ALL, gen_load, MO_SB) TRANS(ld_h, ALL, gen_load, MO_TESW) TRANS(ld_w, ALL, gen_load, MO_TESL) -TRANS(ld_d, ALL, gen_load, MO_TEUQ) +TRANS(ld_d, 64, gen_load, MO_TEUQ) TRANS(st_b, ALL, gen_store, MO_UB) TRANS(st_h, ALL, gen_store, MO_TEUW) TRANS(st_w, ALL, gen_store, MO_TEUL) -TRANS(st_d, ALL, gen_store, MO_TEUQ) +TRANS(st_d, 64, gen_store, MO_TEUQ) TRANS(ld_bu, ALL, gen_load, MO_UB) TRANS(ld_hu, ALL, gen_load, MO_TEUW) -TRANS(ld_wu, ALL, gen_load, MO_TEUL) -TRANS(ldx_b, ALL, gen_loadx, MO_SB) -TRANS(ldx_h, ALL, gen_loadx, MO_TESW) -TRANS(ldx_w, ALL, gen_loadx, MO_TESL) -TRANS(ldx_d, ALL, gen_loadx, MO_TEUQ) -TRANS(stx_b, ALL, gen_storex, MO_UB) -TRANS(stx_h, ALL, gen_storex, MO_TEUW) -TRANS(stx_w, ALL, gen_storex, MO_TEUL) -TRANS(stx_d, ALL, gen_storex, MO_TEUQ) -TRANS(ldx_bu, ALL, gen_loadx, MO_UB) -TRANS(ldx_hu, ALL, gen_loadx, MO_TEUW) -TRANS(ldx_wu, ALL, gen_loadx, MO_TEUL) -TRANS(ldptr_w, ALL, gen_ldptr, MO_TESL) -TRANS(stptr_w, ALL, gen_stptr, MO_TEUL) -TRANS(ldptr_d, ALL, gen_ldptr, MO_TEUQ) -TRANS(stptr_d, ALL, gen_stptr, MO_TEUQ) -TRANS(ldgt_b, ALL, gen_load_gt, MO_SB) -TRANS(ldgt_h, ALL, gen_load_gt, MO_TESW) -TRANS(ldgt_w, ALL, gen_load_gt, MO_TESL) -TRANS(ldgt_d, ALL, gen_load_gt, MO_TEUQ) -TRANS(ldle_b, ALL, gen_load_le, MO_SB) -TRANS(ldle_h, ALL, gen_load_le, MO_TESW) -TRANS(ldle_w, ALL, gen_load_le, MO_TESL) -TRANS(ldle_d, ALL, gen_load_le, MO_TEUQ) -TRANS(stgt_b, ALL, gen_store_gt, MO_UB) -TRANS(stgt_h, ALL, gen_store_gt, MO_TEUW) -TRANS(stgt_w, ALL, gen_store_gt, MO_TEUL) -TRANS(stgt_d, ALL, gen_store_gt, MO_TEUQ) -TRANS(stle_b, ALL, gen_store_le, MO_UB) -TRANS(stle_h, ALL, gen_store_le, MO_TEUW) -TRANS(stle_w, ALL, gen_store_le, MO_TEUL) -TRANS(stle_d, ALL, gen_store_le, MO_TEUQ) +TRANS(ld_wu, 64, gen_load, MO_TEUL) +TRANS(ldx_b, 64, gen_loadx, MO_SB) +TRANS(ldx_h, 64, gen_loadx, MO_TESW) +TRANS(ldx_w, 64, gen_loadx, MO_TESL) +TRANS(ldx_d, 64, gen_loadx, MO_TEUQ) +TRANS(stx_b, 64, gen_storex, MO_UB) +TRANS(stx_h, 64, gen_storex, MO_TEUW) +TRANS(stx_w, 64, gen_storex, MO_TEUL) +TRANS(stx_d, 64, gen_storex, MO_TEUQ) +TRANS(ldx_bu, 64, gen_loadx, MO_UB) +TRANS(ldx_hu, 64, gen_loadx, MO_TEUW) +TRANS(ldx_wu, 64, gen_loadx, MO_TEUL) +TRANS(ldptr_w, 64, gen_ldptr, MO_TESL) +TRANS(stptr_w, 64, gen_stptr, MO_TEUL) +TRANS(ldptr_d, 64, gen_ldptr, MO_TEUQ) +TRANS(stptr_d, 64, gen_stptr, MO_TEUQ) +TRANS(ldgt_b, 64, gen_load_gt, MO_SB) +TRANS(ldgt_h, 64, gen_load_gt, MO_TESW) +TRANS(ldgt_w, 64, gen_load_gt, MO_TESL) +TRANS(ldgt_d, 64, gen_load_gt, MO_TEUQ) +TRANS(ldle_b, 64, gen_load_le, MO_SB) +TRANS(ldle_h, 64, gen_load_le, MO_TESW) +TRANS(ldle_w, 64, gen_load_le, MO_TESL) +TRANS(ldle_d, 64, gen_load_le, MO_TEUQ) +TRANS(stgt_b, 64, gen_store_gt, MO_UB) +TRANS(stgt_h, 64, gen_store_gt, MO_TEUW) +TRANS(stgt_w, 64, gen_store_gt, MO_TEUL) +TRANS(stgt_d, 64, gen_store_gt, MO_TEUQ) +TRANS(stle_b, 64, gen_store_le, MO_UB) +TRANS(stle_h, 64, gen_store_le, MO_TEUW) +TRANS(stle_w, 64, gen_store_le, MO_TEUL) +TRANS(stle_d, 64, gen_store_le, MO_TEUQ) diff --git a/target/loongarch/insn_trans/trans_shift.c.inc b/target/loongarch/insn_trans/trans_shift.c.inc index 849759b94b..2f4bd6ff28 100644 --- a/target/loongarch/insn_trans/trans_shift.c.inc +++ b/target/loongarch/insn_trans/trans_shift.c.inc @@ -72,6 +72,10 @@ static bool trans_srai_w(DisasContext *ctx, arg_srai_w *a) TCGv dest = gpr_dst(ctx, a->rd, EXT_NONE); TCGv src1 = gpr_src(ctx, a->rj, EXT_ZERO); + if (!avail_64(ctx)) { + return false; + } + tcg_gen_sextract_tl(dest, src1, a->imm, 32 - a->imm); gen_set_gpr(a->rd, dest, EXT_NONE); @@ -81,15 +85,15 @@ static bool trans_srai_w(DisasContext *ctx, arg_srai_w *a) TRANS(sll_w, ALL, gen_rrr, EXT_ZERO, EXT_NONE, EXT_SIGN, gen_sll_w) TRANS(srl_w, ALL, gen_rrr, EXT_ZERO, EXT_NONE, EXT_SIGN, gen_srl_w) TRANS(sra_w, ALL, gen_rrr, EXT_SIGN, EXT_NONE, EXT_SIGN, gen_sra_w) -TRANS(sll_d, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_sll_d) -TRANS(srl_d, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_srl_d) -TRANS(sra_d, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_sra_d) -TRANS(rotr_w, ALL, gen_rrr, EXT_ZERO, EXT_NONE, EXT_SIGN, gen_rotr_w) -TRANS(rotr_d, ALL, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_rotr_d) +TRANS(sll_d, 64, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_sll_d) +TRANS(srl_d, 64, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_srl_d) +TRANS(sra_d, 64, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_sra_d) +TRANS(rotr_w, 64, gen_rrr, EXT_ZERO, EXT_NONE, EXT_SIGN, gen_rotr_w) +TRANS(rotr_d, 64, gen_rrr, EXT_NONE, EXT_NONE, EXT_NONE, gen_rotr_d) TRANS(slli_w, ALL, gen_rri_c, EXT_NONE, EXT_SIGN, tcg_gen_shli_tl) -TRANS(slli_d, ALL, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_shli_tl) +TRANS(slli_d, 64, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_shli_tl) TRANS(srli_w, ALL, gen_rri_c, EXT_ZERO, EXT_SIGN, tcg_gen_shri_tl) -TRANS(srli_d, ALL, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_shri_tl) -TRANS(srai_d, ALL, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_sari_tl) -TRANS(rotri_w, ALL, gen_rri_v, EXT_NONE, EXT_NONE, gen_rotr_w) -TRANS(rotri_d, ALL, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_rotri_tl) +TRANS(srli_d, 64, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_shri_tl) +TRANS(srai_d, 64, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_sari_tl) +TRANS(rotri_w, 64, gen_rri_v, EXT_NONE, EXT_NONE, gen_rotr_w) +TRANS(rotri_d, 64, gen_rri_c, EXT_NONE, EXT_NONE, tcg_gen_rotri_tl) From patchwork Tue Aug 22 07:19:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 715700 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp120642wrp; Tue, 22 Aug 2023 00:20:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFqaMVBBsZO6TfEQnZposQHzBDCzWlCLTiwdC9/qRk2e2m7p4S87vCKpBcWg/kLB65qGSvC X-Received: by 2002:a0c:f704:0:b0:63c:f22b:7041 with SMTP id w4-20020a0cf704000000b0063cf22b7041mr9106881qvn.57.1692688849351; Tue, 22 Aug 2023 00:20:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692688849; cv=none; d=google.com; s=arc-20160816; b=kFXlDrlHSIIRWalMGoOIrUo6YEZanu3ZbPB/rtR8h6GOl8eJSvyi0CQA3K+VnZgNO0 AuqLu8V2QH0n5h0lrKoZ4PndkHqTdoE2EPGX8rJioTBxJ1kAUvzpyAPnss6f2O6FJyEB LGouE7zN5Rwr2CwTgg0w4GePGgWlngC8GTBJshySDVDWDTsozAB0TVABnCcx4m/UfV6P tTSkj1NIka7XTtk9b27jLBbSVDQhHoeowQNWFM4Yws/miAb8zP48HcMvZCWF6EKmKXP6 o6sEkdsyYBtm+PuZ26tOa4mAFmr5JAXQWgLBo4ECTGrbud89DWythTOXSpFEvT+PnMny wTZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=+BP3z9xxPaXPgNtP8/KZyJCiuXObaSTzuF1iDUtHzjk=; fh=IauHLtGdVi5m9rCNCDXgkBuY8q6wkaEoqBTGXQDGRRo=; b=jvVklUSSacaqRX/uddw3RZcMf3oMeQURJgxgjGRoJyfWmdle0ev9PlpzM3eDtxNcet dzkR4f98psDQnx3AkyCJk+A65xTtlpfkYJnfDpvQ98UjzoigC+qdgNAAN5r07WtJM2Lw xCS4C+ve283AmdKR8qvvbbe7pLeqKLrPU+OJYXV4xeZFWxV5k/DByY0izADK5PgZ/Nv8 5s1ZYlbBPmRd4Gkprt9f9Mala6xIjY+71xZgrP6BqU700fEk9zh6BhosYVQqEax6ryKK 3C6/ixBdBChc2ljB7J5j1jMb74MGgNYmABSF6dSu0bTyZ4pU0Xk7tis2JWT2ftfaoJlH 2stQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=i6VJ3pfp; 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 a4-20020a0ca984000000b00647199392d6si5862676qvb.581.2023.08.22.00.20.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 00:20:49 -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=i6VJ3pfp; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYLgw-0007MG-HE; Tue, 22 Aug 2023 03:20:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYLgv-0007HT-F0 for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:20:41 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYLgt-0004nN-00 for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:20:41 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3fed6c2a5cfso35448695e9.3 for ; Tue, 22 Aug 2023 00:20:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692688837; x=1693293637; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+BP3z9xxPaXPgNtP8/KZyJCiuXObaSTzuF1iDUtHzjk=; b=i6VJ3pfpx3d2eWYzgpTJqI6oujgCns3KiMAtVdxqmDedsyuQ2K7OUeslf8WBp7caAV yQ0Ps0yvBW+iRUT/kTf3VZXkXYD1IVYcbX9ZbbmGnJl+RmELD/ObD3RhMtYqz07frl0p W4PhCZDP0fT1344UQrbC31E9whNeNmriachTW1HkLr7FO/5EJo01r6FKKMFfmvMssrhW YFl2K1m3k8qNeiO8EFfnd7+c6tlAUi9H1Sa1Ax2BOD4MFf4umakZdznsreVEsFc21/8/ G0SHVY/jz9OfuRqmRbtmmckxRSkjUoajnSdU7ZEvI+Akuf7Hp3BBEpyjQJLdxx72IGw1 Qlzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692688837; x=1693293637; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+BP3z9xxPaXPgNtP8/KZyJCiuXObaSTzuF1iDUtHzjk=; b=jZc4MN1qCT8+r0wvH+yDVvtLYWebFdQkIp1UMkgHiTToUaXT0B86EQo1r/3GnCzTHU enQ/tOG2Wh28bPs1DwrHng8CHzK3FCZeCBPuJs8K3dHpBOmzsP5rNT6cQXl2Pq5OYEz4 Eiv+AWqEHjFHS2f4Njjf9l/carsxLvTQ+s0jRqxap7ub7f92D4pbhXwBQtQgwj7M/lTn U42bkwKi5FIKD+QYwKYjnNDWzJMqnIcOgOH2f8rXwX1iy2LZICgWYXuqaM9t2KT9qYwV cSDNCLALIeBY9x7Jaky2mx+5BQWF/wG9p9KtaIk0+ymmAdSiqboYaBriL1MCZz319JHZ 4SDA== X-Gm-Message-State: AOJu0YzPsGPUHtaeV3pIO1Gy81OUVzQ2vwDTdRLailHNGrScKv+MgKKz OME27vSOqGOspOFMnkQMu9MY0HAPWhmvpdyUYCMI1w== X-Received: by 2002:a1c:7205:0:b0:3fc:5606:c243 with SMTP id n5-20020a1c7205000000b003fc5606c243mr6625296wmc.13.1692688837186; Tue, 22 Aug 2023 00:20:37 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id m25-20020a7bcb99000000b003fee7b67f67sm9792873wmi.31.2023.08.22.00.20.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 00:20:36 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Song Gao Cc: Jiajie Chen , Xiaojuan Yang , Huacai Chen , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH RESEND v5 13/19] target/loongarch: Add LoongArch32 cpu la132 Date: Tue, 22 Aug 2023 09:19:53 +0200 Message-ID: <20230822071959.35620-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822071405.35386-1-philmd@linaro.org> References: <20230822071405.35386-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Jiajie Chen Add LoongArch32 cpu la132. Due to lack of public documentation of la132, it is currently a synthetic LoongArch32 cpu model. Details need to be added in the future. Signed-off-by: Jiajie Chen Signed-off-by: Song Gao Acked-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20230822032724.1353391-10-gaosong@loongson.cn> --- target/loongarch/cpu.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index 67eb6c3135..d3c3e0d8a1 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -440,6 +440,35 @@ static void loongarch_la464_initfn(Object *obj) env->CSR_ASID = FIELD_DP64(0, CSR_ASID, ASIDBITS, 0xa); } +static void loongarch_la132_initfn(Object *obj) +{ + LoongArchCPU *cpu = LOONGARCH_CPU(obj); + CPULoongArchState *env = &cpu->env; + + int i; + + for (i = 0; i < 21; i++) { + env->cpucfg[i] = 0x0; + } + + cpu->dtb_compatible = "loongarch,Loongson-1C103"; + env->cpucfg[0] = 0x148042; /* PRID */ + + uint32_t data = 0; + data = FIELD_DP32(data, CPUCFG1, ARCH, 1); /* LA32 */ + data = FIELD_DP32(data, CPUCFG1, PGMMU, 1); + data = FIELD_DP32(data, CPUCFG1, IOCSR, 1); + data = FIELD_DP32(data, CPUCFG1, PALEN, 0x1f); /* 32 bits */ + data = FIELD_DP32(data, CPUCFG1, VALEN, 0x1f); /* 32 bits */ + data = FIELD_DP32(data, CPUCFG1, UAL, 1); + data = FIELD_DP32(data, CPUCFG1, RI, 0); + data = FIELD_DP32(data, CPUCFG1, EP, 0); + data = FIELD_DP32(data, CPUCFG1, RPLV, 0); + data = FIELD_DP32(data, CPUCFG1, HP, 1); + data = FIELD_DP32(data, CPUCFG1, IOCSR_BRD, 1); + env->cpucfg[1] = data; +} + static void loongarch_cpu_list_entry(gpointer data, gpointer user_data) { const char *typename = object_class_get_name(OBJECT_CLASS(data)); @@ -787,6 +816,7 @@ static const TypeInfo loongarch_cpu_type_infos[] = { .class_init = loongarch64_cpu_class_init, }, DEFINE_LOONGARCH_CPU_TYPE(64, "la464", loongarch_la464_initfn), + DEFINE_LOONGARCH_CPU_TYPE(32, "la132", loongarch_la132_initfn), }; DEFINE_TYPES(loongarch_cpu_type_infos) From patchwork Tue Aug 22 07:19:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 715703 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp120921wrp; Tue, 22 Aug 2023 00:21:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH5hVCWghUs3W/UWqMHc9csDG3eOiSJyZXauQIOx3f6EwLEBTQA55I/c6bdpJ648Fn1uQ3i X-Received: by 2002:ac8:7fd4:0:b0:40f:da00:f075 with SMTP id b20-20020ac87fd4000000b0040fda00f075mr10490851qtk.66.1692688904687; Tue, 22 Aug 2023 00:21:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692688904; cv=none; d=google.com; s=arc-20160816; b=ZkrtPO3w5gFiLDxBQfAXqSTrmoIX9Dd8Kfl20AeB5+YhSDf5VGme1sEOf/FPbHxVOg wfJqZvJaJ63BP106B2vzDJ100JithBeID3RaX6RWem/V9mNX/41tcl9RJS5xykp44W6c ykN4T4b+tUJ6C+YXYcd2ukeZ0Cr3HfGZBxpOna3EbfNCAP4FegpOti9GZGt2D0GMTnEh S0KRDa611I3JM85voJ5lOs0sNR3s5kS2/36Kpv4S3MlUqJk07B8xH4ZCNxE4qSon50+I i99WzWySeOxAixo3y897U9FxrSvNA7iBg6lDxudvJ1geVDjlqSHkpqEZt51KxvHhdXNT dNhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=ONpA0UFQdSnkRLzqiVi2DjQGuL0JxDlhUKCdcQf7dH4=; fh=IauHLtGdVi5m9rCNCDXgkBuY8q6wkaEoqBTGXQDGRRo=; b=I8TaCMrvQvE+iT9WR+LUY4s/8A+/W0ZPPFObf8I7ld7m90MfJ3vTFaYiCh2sliy31p R/fM0b+12wmNWSeu4kVSiC/83WCym2avB1s5vlJhVWIrOHPNNqy21qicplx7Ys8h2UuD aU3Pm69zWfyTffwFalu4tYNUHU+jYvENX3MA/F59OwXQnGsPE3bw0c+QWD+fQxei5x8o lyA2gnSlHKG0P1sTOCW3cvGpuVSBwVzzfHB/GyrHFGismMK7JbyIq7xt9iWQ4Csr1s+2 igyeV+fra3ZDXYqxvpwCxqFdohDBKkcy+7AAdnpc+aktm6aBSr5Bx1iiJbyFsUNrTEmV zH2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yaDIFFJA; 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 g21-20020ac87d15000000b00403a8e58423si4446201qtb.448.2023.08.22.00.21.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 00:21:44 -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=yaDIFFJA; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYLh3-0007ac-Pf; Tue, 22 Aug 2023 03:20:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYLh1-0007Xs-Rx for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:20:47 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYLgz-0004qj-AE for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:20:47 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-31c5cac3ae2so1015513f8f.3 for ; Tue, 22 Aug 2023 00:20:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692688843; x=1693293643; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ONpA0UFQdSnkRLzqiVi2DjQGuL0JxDlhUKCdcQf7dH4=; b=yaDIFFJAldzZTa5bsVNpRAc6ZCFtVdkTBmhlJ4OeNC0opQPAL42/pHyS9KdncTlGKV IE5i5cr7lVb1saZxicUEn9mLjUQviKieWV7BGKCI+ZZzBgPE5z0dE6wGLQSvh7T9bSWx s7t3qaUd/dWLogFc31ISwaoIcrXRlspX4w+srSwybnyqYO1NwBi0H5x3Anpq78kugaPN f5sA6e/pf7T1VDLnCS1xc9YQ19h4v6Puw6jTa4KuwqiLhR1Hm1nV5CJPs0NE5IN2/mnl mhjSjzkRBDgQzKCblUKuSCZ8+NHllaaWpLTtxqNfFMDJ3p4k1xVdbpp2u0VaxWOW7zhY Mixg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692688843; x=1693293643; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ONpA0UFQdSnkRLzqiVi2DjQGuL0JxDlhUKCdcQf7dH4=; b=dDm+W+rRGRxDZKucyPEtu7I/VqekS0NhlbwNRCD4vMkikXWKjjijDs4lrWBeI7Rtto SaHgNW8a6SZ0kEmfhjbhygPlWOgN/ngyyLs4UL07Y1UzcDWW1Qk5hrBb5VTzA0DjriEh OEXqMcQFLZgg+kW2uDuLCrlH29bj+Eb+c149XEQXkHC5fV9WPx7IV2wWWjNOBsVgEINm zgMNgvharpm08cXN2NxXYicFyzR3tOeR5gYM0VCkA71Ss0un35sGbpNR3o3eyAcwxoFI BXwWyz30Hdpa2oz4WQu6jYVgAzYdvr4J7LSSjMfWSyc2NJXaCQ15VUJoX6Wokk+S1/Q0 Md8w== X-Gm-Message-State: AOJu0YzncNX9TCTgWOGg5xd+aIl0QgwJBcirEVpPFifWJrEg4wDesSRL eBwMlUlXklpPoq4EhhHxT1aqODRj5Hdht5AftcezZg== X-Received: by 2002:a5d:4531:0:b0:317:ed01:dc48 with SMTP id j17-20020a5d4531000000b00317ed01dc48mr6518084wra.9.1692688843664; Tue, 22 Aug 2023 00:20:43 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id a1-20020a056000100100b003141a3c4353sm14933500wrx.30.2023.08.22.00.20.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 00:20:43 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Song Gao Cc: Jiajie Chen , Xiaojuan Yang , Huacai Chen , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH RESEND v5 14/19] hw/loongarch: Remove restriction of la464 cores in the virt machine Date: Tue, 22 Aug 2023 09:19:54 +0200 Message-ID: <20230822071959.35620-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822071405.35386-1-philmd@linaro.org> References: <20230822071405.35386-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Song Gao Allow virt machine to be used with la132 instead of la464. Co-authored-by: Jiajie Chen Signed-off-by: Song Gao Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20230822032724.1353391-11-gaosong@loongson.cn> --- hw/loongarch/virt.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index e19b042ce8..af15bf5aaa 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -798,11 +798,6 @@ static void loongarch_init(MachineState *machine) cpu_model = LOONGARCH_CPU_TYPE_NAME("la464"); } - if (!strstr(cpu_model, "la464")) { - error_report("LoongArch/TCG needs cpu type la464"); - exit(1); - } - if (ram_size < 1 * GiB) { error_report("ram_size must be greater than 1G."); exit(1); From patchwork Tue Aug 22 07:19:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 715702 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp120783wrp; Tue, 22 Aug 2023 00:21:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGZraTR26XBrsTp7Cxzn8/YxNhTYPmYMG/tFLWsGE1dMLa/Y5Lr0/I7CxTMF7TqOeDl8Cme X-Received: by 2002:a0c:e246:0:b0:647:2653:bcc with SMTP id x6-20020a0ce246000000b0064726530bccmr10903450qvl.13.1692688879548; Tue, 22 Aug 2023 00:21:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692688879; cv=none; d=google.com; s=arc-20160816; b=beI+fpHM3qXqtlkbM+n0VWgySS7sGANMTza3FgkS9HYS9P2QuydbTZ5Zqbf/TSchbU WhSZxqg+GOUmX7J3lteM9d2/ZDwE0+YS9+ZoDI4jtDC8wHd4RSKDMbZv/JPt7W6Art9a yuSNYsOp2gcBdnOzztqS69p1sKtIoQ1gX/HoPXWXEbyWOoYduYqdfu4QNAqRmWlUKp1Q LtffCMa3O/JZsXOEKmV8UlVOSUQFeTQ2XL4/KnpIP/gBlqHmW8lNtzMSaYoLi2+ZuZu9 RI0HTtJazW1Pr6IwNn1O7RcZBwNcrKtnvSrDs1kNsk+W4XnlC9f4yL5vJSOZuNXoFZc4 ALGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=+KnPndFGWPKyJgKZYwj/NrXHvzc48jUGPmLniULjVdE=; fh=EgjsXW+L4Y5zRUQS7SIQdGNDJ+AtbUcRDS0IFIrVH6E=; b=CJDt8NEW+F333mFSBiKvHXIXcfg9rcdAkBgE6hojReePLou/9MAIHk8FTJu2VTVxUy EWIsIMlHpqNp4KkrYarCP1sQSNqDOo0jJd0tgjjJ7AJJ0xCmfLUGd97Nj/NFEmeShuUW d9T24A7Ohvjr3gWL80NgSkRZFyhBWjvSeyb/KgyD+om4q2oQPB7CwBMioklgVNKRdM52 OH5bz1TKHbkGUJahCKq7wjd2I4dZvxvHIe5zXh7Q+iwKke2QsQtNJgHAEmPKksA0KCpt pOY2Iul1PQuyhE2VPiAXUabZklg7rMsYgGEfk3f+6uyM+KsFczUrZiLeOLUmVJEyc0sj ELQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Z7FJhZ/h"; 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 qp28-20020a05620a389c00b00765e579f0fesi5674364qkn.69.2023.08.22.00.21.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 00:21:19 -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="Z7FJhZ/h"; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYLhF-0007tU-SW; Tue, 22 Aug 2023 03:21:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYLh9-0007lU-39 for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:20:55 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYLh5-0004ub-N8 for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:20:54 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-31781e15a0cso3755142f8f.3 for ; Tue, 22 Aug 2023 00:20:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692688850; x=1693293650; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+KnPndFGWPKyJgKZYwj/NrXHvzc48jUGPmLniULjVdE=; b=Z7FJhZ/hbFgD6QmuldEiGScPjdAHnYyXgfgfvhMaiEPcqVJeq8EX6D6MnLIydJqx93 58oTCF2obgytEQ5nzH6e6JIXit9wwvnCn8VpxKqRXdfkRb196mebadAICuQBrWBchqKu hxWhXF3ormn6bS8QXdEquZuqx+guuoCxSVcxcufL37pI+ZpJYktNZbTIAd48vZ2ikEAo eLfv0tUolZeYb9Xuc+40j8x/YV5M3WyIEd10SYrYVIzSIoA19cP78e03rGTUwDc1Nmjf phIcfdr4/+tIB1NlEyLMscVY1Bl1Nj6X1o9MSbnR0ORHbqotbFZzq2ox6djKN0frnwSP zdoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692688850; x=1693293650; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+KnPndFGWPKyJgKZYwj/NrXHvzc48jUGPmLniULjVdE=; b=eg41vgAQHjeGxbeck3WZz0+tcabE8PiMZfr44VBJOrOEp7chqMgOpypqEcTKoSDCWD usRPk+Rx9IftUgpOVgJy+iP/cFNdAbfrbDl74unAIUh7Bg/L6Dwr8EiM9ghZYgbVB1Zo 5mA/lmizNuGBGyunj6VEEB5NEcqwdB2zGytRB22GQKCncIIo/FbWJPghAaB1duUCCmU9 YOgHITDEIK2j/mer7O7iBOzodI29KRpKI+YJpfDGuPKuhzOfrwzo1eNyr4UyKMgxmzvF CmNBr+UBgzdyTFEhidVIN3YxHR1LtYbad/YxVHGOH4h2tZ0jzoEfHJasZRZ2c8Tu6+dE ZsfA== X-Gm-Message-State: AOJu0Yy8H6CIHbhiIn8PZrhQ4P+kzE6tX78uqMTwxIhqVElgrnx3n1C4 Ra3RTGkmYJRiz33te+prCbiTBRQp8JeH7Jn/3/nvcQ== X-Received: by 2002:a5d:510e:0:b0:31c:5c77:48ec with SMTP id s14-20020a5d510e000000b0031c5c7748ecmr2646512wrt.62.1692688849864; Tue, 22 Aug 2023 00:20:49 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id l23-20020a1ced17000000b003fe2de3f94fsm14802811wmh.12.2023.08.22.00.20.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 00:20:49 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Song Gao Cc: Jiajie Chen , Xiaojuan Yang , Huacai Chen , Richard Henderson Subject: [PATCH RESEND v5 15/19] target/loongarch: Add avail_FP/FP_SP/FP_DP to check fpu instructions Date: Tue, 22 Aug 2023 09:19:55 +0200 Message-ID: <20230822071959.35620-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822071405.35386-1-philmd@linaro.org> References: <20230822071405.35386-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Song Gao Signed-off-by: Song Gao Acked-by: Richard Henderson Message-ID: <20230822032724.1353391-12-gaosong@loongson.cn> --- target/loongarch/translate.h | 4 + target/loongarch/translate.c | 1 + .../loongarch/insn_trans/trans_farith.c.inc | 96 ++++++++++++------- target/loongarch/insn_trans/trans_fcmp.c.inc | 8 ++ target/loongarch/insn_trans/trans_fcnv.c.inc | 56 +++++------ .../loongarch/insn_trans/trans_fmemory.c.inc | 32 +++---- target/loongarch/insn_trans/trans_fmov.c.inc | 48 ++++++++-- 7 files changed, 159 insertions(+), 86 deletions(-) diff --git a/target/loongarch/translate.h b/target/loongarch/translate.h index 1342446242..0f244cd83b 100644 --- a/target/loongarch/translate.h +++ b/target/loongarch/translate.h @@ -17,6 +17,9 @@ #define avail_ALL(C) true #define avail_64(C) (FIELD_EX32((C)->cpucfg1, CPUCFG1, ARCH) == \ CPUCFG1_ARCH_LA64) +#define avail_FP(C) (FIELD_EX32((C)->cpucfg2, CPUCFG2, FP)) +#define avail_FP_SP(C) (FIELD_EX32((C)->cpucfg2, CPUCFG2, FP_SP)) +#define avail_FP_DP(C) (FIELD_EX32((C)->cpucfg2, CPUCFG2, FP_DP)) /* * If an operation is being performed on less than TARGET_LONG_BITS, @@ -40,6 +43,7 @@ typedef struct DisasContext { bool la64; /* LoongArch64 mode */ bool va32; /* 32-bit virtual address */ uint32_t cpucfg1; + uint32_t cpucfg2; } DisasContext; void generate_exception(DisasContext *ctx, int excp); diff --git a/target/loongarch/translate.c b/target/loongarch/translate.c index 6967e12fc3..fd393ed76d 100644 --- a/target/loongarch/translate.c +++ b/target/loongarch/translate.c @@ -129,6 +129,7 @@ static void loongarch_tr_init_disas_context(DisasContextBase *dcbase, ctx->zero = tcg_constant_tl(0); ctx->cpucfg1 = env->cpucfg[1]; + ctx->cpucfg2 = env->cpucfg[2]; } static void loongarch_tr_tb_start(DisasContextBase *dcbase, CPUState *cs) diff --git a/target/loongarch/insn_trans/trans_farith.c.inc b/target/loongarch/insn_trans/trans_farith.c.inc index b1a1dc7b01..a7ced99fd3 100644 --- a/target/loongarch/insn_trans/trans_farith.c.inc +++ b/target/loongarch/insn_trans/trans_farith.c.inc @@ -67,6 +67,10 @@ static bool trans_fcopysign_s(DisasContext *ctx, arg_fcopysign_s *a) TCGv src1 = get_fpr(ctx, a->fk); TCGv src2 = get_fpr(ctx, a->fj); + if (!avail_FP_SP(ctx)) { + return false; + } + CHECK_FPE; tcg_gen_deposit_i64(dest, src1, src2, 0, 31); @@ -81,6 +85,10 @@ static bool trans_fcopysign_d(DisasContext *ctx, arg_fcopysign_d *a) TCGv src1 = get_fpr(ctx, a->fk); TCGv src2 = get_fpr(ctx, a->fj); + if (!avail_FP_DP(ctx)) { + return false; + } + CHECK_FPE; tcg_gen_deposit_i64(dest, src1, src2, 0, 63); @@ -94,6 +102,10 @@ static bool trans_fabs_s(DisasContext *ctx, arg_fabs_s *a) TCGv dest = get_fpr(ctx, a->fd); TCGv src = get_fpr(ctx, a->fj); + if (!avail_FP_SP(ctx)) { + return false; + } + CHECK_FPE; tcg_gen_andi_i64(dest, src, MAKE_64BIT_MASK(0, 31)); @@ -108,6 +120,10 @@ static bool trans_fabs_d(DisasContext *ctx, arg_fabs_d *a) TCGv dest = get_fpr(ctx, a->fd); TCGv src = get_fpr(ctx, a->fj); + if (!avail_FP_DP(ctx)) { + return false; + } + CHECK_FPE; tcg_gen_andi_i64(dest, src, MAKE_64BIT_MASK(0, 63)); @@ -121,6 +137,10 @@ static bool trans_fneg_s(DisasContext *ctx, arg_fneg_s *a) TCGv dest = get_fpr(ctx, a->fd); TCGv src = get_fpr(ctx, a->fj); + if (!avail_FP_SP(ctx)) { + return false; + } + CHECK_FPE; tcg_gen_xori_i64(dest, src, 0x80000000); @@ -135,6 +155,10 @@ static bool trans_fneg_d(DisasContext *ctx, arg_fneg_d *a) TCGv dest = get_fpr(ctx, a->fd); TCGv src = get_fpr(ctx, a->fj); + if (!avail_FP_DP(ctx)) { + return false; + } + CHECK_FPE; tcg_gen_xori_i64(dest, src, 0x8000000000000000LL); @@ -143,41 +167,41 @@ static bool trans_fneg_d(DisasContext *ctx, arg_fneg_d *a) return true; } -TRANS(fadd_s, ALL, gen_fff, gen_helper_fadd_s) -TRANS(fadd_d, ALL, gen_fff, gen_helper_fadd_d) -TRANS(fsub_s, ALL, gen_fff, gen_helper_fsub_s) -TRANS(fsub_d, ALL, gen_fff, gen_helper_fsub_d) -TRANS(fmul_s, ALL, gen_fff, gen_helper_fmul_s) -TRANS(fmul_d, ALL, gen_fff, gen_helper_fmul_d) -TRANS(fdiv_s, ALL, gen_fff, gen_helper_fdiv_s) -TRANS(fdiv_d, ALL, gen_fff, gen_helper_fdiv_d) -TRANS(fmax_s, ALL, gen_fff, gen_helper_fmax_s) -TRANS(fmax_d, ALL, gen_fff, gen_helper_fmax_d) -TRANS(fmin_s, ALL, gen_fff, gen_helper_fmin_s) -TRANS(fmin_d, ALL, gen_fff, gen_helper_fmin_d) -TRANS(fmaxa_s, ALL, gen_fff, gen_helper_fmaxa_s) -TRANS(fmaxa_d, ALL, gen_fff, gen_helper_fmaxa_d) -TRANS(fmina_s, ALL, gen_fff, gen_helper_fmina_s) -TRANS(fmina_d, ALL, gen_fff, gen_helper_fmina_d) -TRANS(fscaleb_s, ALL, gen_fff, gen_helper_fscaleb_s) -TRANS(fscaleb_d, ALL, gen_fff, gen_helper_fscaleb_d) -TRANS(fsqrt_s, ALL, gen_ff, gen_helper_fsqrt_s) -TRANS(fsqrt_d, ALL, gen_ff, gen_helper_fsqrt_d) -TRANS(frecip_s, ALL, gen_ff, gen_helper_frecip_s) -TRANS(frecip_d, ALL, gen_ff, gen_helper_frecip_d) -TRANS(frsqrt_s, ALL, gen_ff, gen_helper_frsqrt_s) -TRANS(frsqrt_d, ALL, gen_ff, gen_helper_frsqrt_d) -TRANS(flogb_s, ALL, gen_ff, gen_helper_flogb_s) -TRANS(flogb_d, ALL, gen_ff, gen_helper_flogb_d) -TRANS(fclass_s, ALL, gen_ff, gen_helper_fclass_s) -TRANS(fclass_d, ALL, gen_ff, gen_helper_fclass_d) -TRANS(fmadd_s, ALL, gen_muladd, gen_helper_fmuladd_s, 0) -TRANS(fmadd_d, ALL, gen_muladd, gen_helper_fmuladd_d, 0) -TRANS(fmsub_s, ALL, gen_muladd, gen_helper_fmuladd_s, float_muladd_negate_c) -TRANS(fmsub_d, ALL, gen_muladd, gen_helper_fmuladd_d, float_muladd_negate_c) -TRANS(fnmadd_s, ALL, gen_muladd, gen_helper_fmuladd_s, float_muladd_negate_result) -TRANS(fnmadd_d, ALL, gen_muladd, gen_helper_fmuladd_d, float_muladd_negate_result) -TRANS(fnmsub_s, ALL, gen_muladd, gen_helper_fmuladd_s, +TRANS(fadd_s, FP_SP, gen_fff, gen_helper_fadd_s) +TRANS(fadd_d, FP_DP, gen_fff, gen_helper_fadd_d) +TRANS(fsub_s, FP_SP, gen_fff, gen_helper_fsub_s) +TRANS(fsub_d, FP_DP, gen_fff, gen_helper_fsub_d) +TRANS(fmul_s, FP_SP, gen_fff, gen_helper_fmul_s) +TRANS(fmul_d, FP_DP, gen_fff, gen_helper_fmul_d) +TRANS(fdiv_s, FP_SP, gen_fff, gen_helper_fdiv_s) +TRANS(fdiv_d, FP_DP, gen_fff, gen_helper_fdiv_d) +TRANS(fmax_s, FP_SP, gen_fff, gen_helper_fmax_s) +TRANS(fmax_d, FP_DP, gen_fff, gen_helper_fmax_d) +TRANS(fmin_s, FP_SP, gen_fff, gen_helper_fmin_s) +TRANS(fmin_d, FP_DP, gen_fff, gen_helper_fmin_d) +TRANS(fmaxa_s, FP_SP, gen_fff, gen_helper_fmaxa_s) +TRANS(fmaxa_d, FP_DP, gen_fff, gen_helper_fmaxa_d) +TRANS(fmina_s, FP_SP, gen_fff, gen_helper_fmina_s) +TRANS(fmina_d, FP_DP, gen_fff, gen_helper_fmina_d) +TRANS(fscaleb_s, FP_SP, gen_fff, gen_helper_fscaleb_s) +TRANS(fscaleb_d, FP_DP, gen_fff, gen_helper_fscaleb_d) +TRANS(fsqrt_s, FP_SP, gen_ff, gen_helper_fsqrt_s) +TRANS(fsqrt_d, FP_DP, gen_ff, gen_helper_fsqrt_d) +TRANS(frecip_s, FP_SP, gen_ff, gen_helper_frecip_s) +TRANS(frecip_d, FP_DP, gen_ff, gen_helper_frecip_d) +TRANS(frsqrt_s, FP_SP, gen_ff, gen_helper_frsqrt_s) +TRANS(frsqrt_d, FP_DP, gen_ff, gen_helper_frsqrt_d) +TRANS(flogb_s, FP_SP, gen_ff, gen_helper_flogb_s) +TRANS(flogb_d, FP_DP, gen_ff, gen_helper_flogb_d) +TRANS(fclass_s, FP_SP, gen_ff, gen_helper_fclass_s) +TRANS(fclass_d, FP_DP, gen_ff, gen_helper_fclass_d) +TRANS(fmadd_s, FP_SP, gen_muladd, gen_helper_fmuladd_s, 0) +TRANS(fmadd_d, FP_DP, gen_muladd, gen_helper_fmuladd_d, 0) +TRANS(fmsub_s, FP_SP, gen_muladd, gen_helper_fmuladd_s, float_muladd_negate_c) +TRANS(fmsub_d, FP_DP, gen_muladd, gen_helper_fmuladd_d, float_muladd_negate_c) +TRANS(fnmadd_s, FP_SP, gen_muladd, gen_helper_fmuladd_s, float_muladd_negate_result) +TRANS(fnmadd_d, FP_DP, gen_muladd, gen_helper_fmuladd_d, float_muladd_negate_result) +TRANS(fnmsub_s, FP_SP, gen_muladd, gen_helper_fmuladd_s, float_muladd_negate_c | float_muladd_negate_result) -TRANS(fnmsub_d, ALL, gen_muladd, gen_helper_fmuladd_d, +TRANS(fnmsub_d, FP_DP, gen_muladd, gen_helper_fmuladd_d, float_muladd_negate_c | float_muladd_negate_result) diff --git a/target/loongarch/insn_trans/trans_fcmp.c.inc b/target/loongarch/insn_trans/trans_fcmp.c.inc index a78868dbc4..43d5866a67 100644 --- a/target/loongarch/insn_trans/trans_fcmp.c.inc +++ b/target/loongarch/insn_trans/trans_fcmp.c.inc @@ -29,6 +29,10 @@ static bool trans_fcmp_cond_s(DisasContext *ctx, arg_fcmp_cond_s *a) uint32_t flags; void (*fn)(TCGv, TCGv_env, TCGv, TCGv, TCGv_i32); + if (!avail_FP_SP(ctx)) { + return false; + } + CHECK_FPE; var = tcg_temp_new(); @@ -49,6 +53,10 @@ static bool trans_fcmp_cond_d(DisasContext *ctx, arg_fcmp_cond_d *a) uint32_t flags; void (*fn)(TCGv, TCGv_env, TCGv, TCGv, TCGv_i32); + if (!avail_FP_DP(ctx)) { + return false; + } + CHECK_FPE; var = tcg_temp_new(); diff --git a/target/loongarch/insn_trans/trans_fcnv.c.inc b/target/loongarch/insn_trans/trans_fcnv.c.inc index 329a2d6872..833c059d6d 100644 --- a/target/loongarch/insn_trans/trans_fcnv.c.inc +++ b/target/loongarch/insn_trans/trans_fcnv.c.inc @@ -3,31 +3,31 @@ * Copyright (c) 2021 Loongson Technology Corporation Limited */ -TRANS(fcvt_s_d, ALL, gen_ff, gen_helper_fcvt_s_d) -TRANS(fcvt_d_s, ALL, gen_ff, gen_helper_fcvt_d_s) -TRANS(ftintrm_w_s, ALL, gen_ff, gen_helper_ftintrm_w_s) -TRANS(ftintrm_w_d, ALL, gen_ff, gen_helper_ftintrm_w_d) -TRANS(ftintrm_l_s, ALL, gen_ff, gen_helper_ftintrm_l_s) -TRANS(ftintrm_l_d, ALL, gen_ff, gen_helper_ftintrm_l_d) -TRANS(ftintrp_w_s, ALL, gen_ff, gen_helper_ftintrp_w_s) -TRANS(ftintrp_w_d, ALL, gen_ff, gen_helper_ftintrp_w_d) -TRANS(ftintrp_l_s, ALL, gen_ff, gen_helper_ftintrp_l_s) -TRANS(ftintrp_l_d, ALL, gen_ff, gen_helper_ftintrp_l_d) -TRANS(ftintrz_w_s, ALL, gen_ff, gen_helper_ftintrz_w_s) -TRANS(ftintrz_w_d, ALL, gen_ff, gen_helper_ftintrz_w_d) -TRANS(ftintrz_l_s, ALL, gen_ff, gen_helper_ftintrz_l_s) -TRANS(ftintrz_l_d, ALL, gen_ff, gen_helper_ftintrz_l_d) -TRANS(ftintrne_w_s, ALL, gen_ff, gen_helper_ftintrne_w_s) -TRANS(ftintrne_w_d, ALL, gen_ff, gen_helper_ftintrne_w_d) -TRANS(ftintrne_l_s, ALL, gen_ff, gen_helper_ftintrne_l_s) -TRANS(ftintrne_l_d, ALL, gen_ff, gen_helper_ftintrne_l_d) -TRANS(ftint_w_s, ALL, gen_ff, gen_helper_ftint_w_s) -TRANS(ftint_w_d, ALL, gen_ff, gen_helper_ftint_w_d) -TRANS(ftint_l_s, ALL, gen_ff, gen_helper_ftint_l_s) -TRANS(ftint_l_d, ALL, gen_ff, gen_helper_ftint_l_d) -TRANS(ffint_s_w, ALL, gen_ff, gen_helper_ffint_s_w) -TRANS(ffint_s_l, ALL, gen_ff, gen_helper_ffint_s_l) -TRANS(ffint_d_w, ALL, gen_ff, gen_helper_ffint_d_w) -TRANS(ffint_d_l, ALL, gen_ff, gen_helper_ffint_d_l) -TRANS(frint_s, ALL, gen_ff, gen_helper_frint_s) -TRANS(frint_d, ALL, gen_ff, gen_helper_frint_d) +TRANS(fcvt_s_d, FP_DP, gen_ff, gen_helper_fcvt_s_d) +TRANS(fcvt_d_s, FP_DP, gen_ff, gen_helper_fcvt_d_s) +TRANS(ftintrm_w_s, FP_SP, gen_ff, gen_helper_ftintrm_w_s) +TRANS(ftintrm_w_d, FP_DP, gen_ff, gen_helper_ftintrm_w_d) +TRANS(ftintrm_l_s, FP_SP, gen_ff, gen_helper_ftintrm_l_s) +TRANS(ftintrm_l_d, FP_DP, gen_ff, gen_helper_ftintrm_l_d) +TRANS(ftintrp_w_s, FP_SP, gen_ff, gen_helper_ftintrp_w_s) +TRANS(ftintrp_w_d, FP_DP, gen_ff, gen_helper_ftintrp_w_d) +TRANS(ftintrp_l_s, FP_SP, gen_ff, gen_helper_ftintrp_l_s) +TRANS(ftintrp_l_d, FP_DP, gen_ff, gen_helper_ftintrp_l_d) +TRANS(ftintrz_w_s, FP_SP, gen_ff, gen_helper_ftintrz_w_s) +TRANS(ftintrz_w_d, FP_DP, gen_ff, gen_helper_ftintrz_w_d) +TRANS(ftintrz_l_s, FP_SP, gen_ff, gen_helper_ftintrz_l_s) +TRANS(ftintrz_l_d, FP_DP, gen_ff, gen_helper_ftintrz_l_d) +TRANS(ftintrne_w_s, FP_SP, gen_ff, gen_helper_ftintrne_w_s) +TRANS(ftintrne_w_d, FP_DP, gen_ff, gen_helper_ftintrne_w_d) +TRANS(ftintrne_l_s, FP_SP, gen_ff, gen_helper_ftintrne_l_s) +TRANS(ftintrne_l_d, FP_DP, gen_ff, gen_helper_ftintrne_l_d) +TRANS(ftint_w_s, FP_SP, gen_ff, gen_helper_ftint_w_s) +TRANS(ftint_w_d, FP_DP, gen_ff, gen_helper_ftint_w_d) +TRANS(ftint_l_s, FP_SP, gen_ff, gen_helper_ftint_l_s) +TRANS(ftint_l_d, FP_DP, gen_ff, gen_helper_ftint_l_d) +TRANS(ffint_s_w, FP_SP, gen_ff, gen_helper_ffint_s_w) +TRANS(ffint_s_l, FP_SP, gen_ff, gen_helper_ffint_s_l) +TRANS(ffint_d_w, FP_DP, gen_ff, gen_helper_ffint_d_w) +TRANS(ffint_d_l, FP_DP, gen_ff, gen_helper_ffint_d_l) +TRANS(frint_s, FP_SP, gen_ff, gen_helper_frint_s) +TRANS(frint_d, FP_DP, gen_ff, gen_helper_frint_d) diff --git a/target/loongarch/insn_trans/trans_fmemory.c.inc b/target/loongarch/insn_trans/trans_fmemory.c.inc index 8e3b4522c9..5ddb8a473b 100644 --- a/target/loongarch/insn_trans/trans_fmemory.c.inc +++ b/target/loongarch/insn_trans/trans_fmemory.c.inc @@ -140,19 +140,19 @@ static bool gen_fstore_le(DisasContext *ctx, arg_frr *a, MemOp mop) return true; } -TRANS(fld_s, ALL, gen_fload_i, MO_TEUL) -TRANS(fst_s, ALL, gen_fstore_i, MO_TEUL) -TRANS(fld_d, ALL, gen_fload_i, MO_TEUQ) -TRANS(fst_d, ALL, gen_fstore_i, MO_TEUQ) -TRANS(fldx_s, ALL, gen_floadx, MO_TEUL) -TRANS(fldx_d, ALL, gen_floadx, MO_TEUQ) -TRANS(fstx_s, ALL, gen_fstorex, MO_TEUL) -TRANS(fstx_d, ALL, gen_fstorex, MO_TEUQ) -TRANS(fldgt_s, ALL, gen_fload_gt, MO_TEUL) -TRANS(fldgt_d, ALL, gen_fload_gt, MO_TEUQ) -TRANS(fldle_s, ALL, gen_fload_le, MO_TEUL) -TRANS(fldle_d, ALL, gen_fload_le, MO_TEUQ) -TRANS(fstgt_s, ALL, gen_fstore_gt, MO_TEUL) -TRANS(fstgt_d, ALL, gen_fstore_gt, MO_TEUQ) -TRANS(fstle_s, ALL, gen_fstore_le, MO_TEUL) -TRANS(fstle_d, ALL, gen_fstore_le, MO_TEUQ) +TRANS(fld_s, FP_SP, gen_fload_i, MO_TEUL) +TRANS(fst_s, FP_SP, gen_fstore_i, MO_TEUL) +TRANS(fld_d, FP_DP, gen_fload_i, MO_TEUQ) +TRANS(fst_d, FP_DP, gen_fstore_i, MO_TEUQ) +TRANS(fldx_s, FP_SP, gen_floadx, MO_TEUL) +TRANS(fldx_d, FP_DP, gen_floadx, MO_TEUQ) +TRANS(fstx_s, FP_SP, gen_fstorex, MO_TEUL) +TRANS(fstx_d, FP_DP, gen_fstorex, MO_TEUQ) +TRANS(fldgt_s, FP_SP, gen_fload_gt, MO_TEUL) +TRANS(fldgt_d, FP_DP, gen_fload_gt, MO_TEUQ) +TRANS(fldle_s, FP_SP, gen_fload_le, MO_TEUL) +TRANS(fldle_d, FP_DP, gen_fload_le, MO_TEUQ) +TRANS(fstgt_s, FP_SP, gen_fstore_gt, MO_TEUL) +TRANS(fstgt_d, FP_DP, gen_fstore_gt, MO_TEUQ) +TRANS(fstle_s, FP_SP, gen_fstore_le, MO_TEUL) +TRANS(fstle_d, FP_DP, gen_fstore_le, MO_TEUQ) diff --git a/target/loongarch/insn_trans/trans_fmov.c.inc b/target/loongarch/insn_trans/trans_fmov.c.inc index 385bbb7929..928e127820 100644 --- a/target/loongarch/insn_trans/trans_fmov.c.inc +++ b/target/loongarch/insn_trans/trans_fmov.c.inc @@ -15,6 +15,10 @@ static bool trans_fsel(DisasContext *ctx, arg_fsel *a) TCGv src2 = get_fpr(ctx, a->fk); TCGv cond; + if (!avail_FP(ctx)) { + return false; + } + CHECK_FPE; cond = tcg_temp_new(); @@ -48,6 +52,10 @@ static bool gen_r2f(DisasContext *ctx, arg_fr *a, TCGv src = gpr_src(ctx, a->rj, EXT_NONE); TCGv dest = get_fpr(ctx, a->fd); + if (!avail_FP(ctx)) { + return false; + } + CHECK_FPE; func(dest, src); @@ -62,6 +70,10 @@ static bool gen_f2r(DisasContext *ctx, arg_rf *a, TCGv dest = gpr_dst(ctx, a->rd, EXT_NONE); TCGv src = get_fpr(ctx, a->fj); + if (!avail_FP(ctx)) { + return false; + } + CHECK_FPE; func(dest, src); @@ -75,6 +87,10 @@ static bool trans_movgr2fcsr(DisasContext *ctx, arg_movgr2fcsr *a) uint32_t mask = fcsr_mask[a->fcsrd]; TCGv Rj = gpr_src(ctx, a->rj, EXT_NONE); + if (!avail_FP(ctx)) { + return false; + } + CHECK_FPE; if (mask == UINT32_MAX) { @@ -105,6 +121,10 @@ static bool trans_movfcsr2gr(DisasContext *ctx, arg_movfcsr2gr *a) { TCGv dest = gpr_dst(ctx, a->rd, EXT_NONE); + if (!avail_FP(ctx)) { + return false; + } + CHECK_FPE; tcg_gen_ld32u_i64(dest, cpu_env, offsetof(CPULoongArchState, fcsr0)); @@ -134,6 +154,10 @@ static bool trans_movfr2cf(DisasContext *ctx, arg_movfr2cf *a) TCGv t0; TCGv src = get_fpr(ctx, a->fj); + if (!avail_FP(ctx)) { + return false; + } + CHECK_FPE; t0 = tcg_temp_new(); @@ -147,6 +171,10 @@ static bool trans_movcf2fr(DisasContext *ctx, arg_movcf2fr *a) { TCGv dest = get_fpr(ctx, a->fd); + if (!avail_FP(ctx)) { + return false; + } + CHECK_FPE; tcg_gen_ld8u_tl(dest, cpu_env, @@ -160,6 +188,10 @@ static bool trans_movgr2cf(DisasContext *ctx, arg_movgr2cf *a) { TCGv t0; + if (!avail_FP(ctx)) { + return false; + } + CHECK_FPE; t0 = tcg_temp_new(); @@ -171,6 +203,10 @@ static bool trans_movgr2cf(DisasContext *ctx, arg_movgr2cf *a) static bool trans_movcf2gr(DisasContext *ctx, arg_movcf2gr *a) { + if (!avail_FP(ctx)) { + return false; + } + CHECK_FPE; tcg_gen_ld8u_tl(gpr_dst(ctx, a->rd, EXT_NONE), cpu_env, @@ -178,11 +214,11 @@ static bool trans_movcf2gr(DisasContext *ctx, arg_movcf2gr *a) return true; } -TRANS(fmov_s, ALL, gen_f2f, tcg_gen_mov_tl, true) -TRANS(fmov_d, ALL, gen_f2f, tcg_gen_mov_tl, false) -TRANS(movgr2fr_w, ALL, gen_r2f, gen_movgr2fr_w) +TRANS(fmov_s, FP_SP, gen_f2f, tcg_gen_mov_tl, true) +TRANS(fmov_d, FP_DP, gen_f2f, tcg_gen_mov_tl, false) +TRANS(movgr2fr_w, FP_SP, gen_r2f, gen_movgr2fr_w) TRANS(movgr2fr_d, 64, gen_r2f, tcg_gen_mov_tl) -TRANS(movgr2frh_w, ALL, gen_r2f, gen_movgr2frh_w) -TRANS(movfr2gr_s, ALL, gen_f2r, tcg_gen_ext32s_tl) +TRANS(movgr2frh_w, FP_DP, gen_r2f, gen_movgr2frh_w) +TRANS(movfr2gr_s, FP_SP, gen_f2r, tcg_gen_ext32s_tl) TRANS(movfr2gr_d, 64, gen_f2r, tcg_gen_mov_tl) -TRANS(movfrh2gr_s, ALL, gen_f2r, gen_movfrh2gr_s) +TRANS(movfrh2gr_s, FP_DP, gen_f2r, gen_movfrh2gr_s) From patchwork Tue Aug 22 07:19:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 715704 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp120929wrp; Tue, 22 Aug 2023 00:21:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGvA3bnv1C+tsruQVju60RJgxUGxquUgc3eIh/u5NxyHZQidDUbQvcyibHDHjr4XJDQF+fQ X-Received: by 2002:a05:620a:c4d:b0:76c:9769:9e1a with SMTP id u13-20020a05620a0c4d00b0076c97699e1amr10520358qki.17.1692688906437; Tue, 22 Aug 2023 00:21:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692688906; cv=none; d=google.com; s=arc-20160816; b=jOpPknBO6pJ4L1F/fG+JHeE5e3AAFEwilZBm5jkO5hqEsoEpsrRSABKuk0K3GnpSH/ F1OFt+ffQylyBtpqck7or3yo7/Ij4vqDxgpoAmZpuaY0MnKTS4bvrAHowwxQ0PtaFAQn BAKDwuxnm0WJEf916amxZv3kL/6rFMTPcZUCJj+/xAIKm/7fELq1eBBHwQBYrTLchtm+ FT6T2xC96Z8pyoG4eO9FZkmjt/6TAxSl3Sf49JRd46hKtL1MnAYVatGcXsSO0gwmX4pL d5ZGGurcOZR2s1QHp2DI2pwOz5D0jTod5nTbwz2qUCVVBJFcZgyidbrPjjZMLnYgqTGw HVtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=whZhTEDPMBELkFvMwjXWXlrIichDByDyvyD7joRcNmA=; fh=EgjsXW+L4Y5zRUQS7SIQdGNDJ+AtbUcRDS0IFIrVH6E=; b=u3qzQ74fUcsNzaFUkpDf7EQ2UCgO0SIQ6lOj9qpJzLCtrI0l0ueDOAXIh4/xL5vNKv MtqfJoXyd8F8nlUG2fzS2gFSnoZwEQRpJyB0pp2+babWm5ZQcjMSUyHlFsO2SkV/4ZrS BT6n3i73vNn4d86ddllAsPs8PbSqApL7y8nX8CuOc8TZALz/5AYP5yMhGM4Pkpzd1GsW ZaPRd8aBRio3Kqk7IDnEspDYr+UdnikZBVaK31AwD/IQonVZ4AThX0ofWynh4MKcehBi kPgW39g17k8TTZZ5DFeqiWbCOIEq4Cpb7ZsKQbZMaTVisdfohI+rY8q6I4OHI1oCccaI AKrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pu0t1jQg; 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 bk4-20020a05620a1a0400b0076546589998si878715qkb.347.2023.08.22.00.21.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 00:21:46 -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=pu0t1jQg; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYLhj-0008Sb-Jn; Tue, 22 Aug 2023 03:21:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYLhR-0008Hm-Cs for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:21:14 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYLhL-0004vI-KL for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:21:12 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3fee8b78097so22832705e9.0 for ; Tue, 22 Aug 2023 00:20:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692688856; x=1693293656; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=whZhTEDPMBELkFvMwjXWXlrIichDByDyvyD7joRcNmA=; b=pu0t1jQgh7SGDf97nWrMoezLrknqeQzfIuFj0qufwXJjLT4wOaO19V7FDy+WitoPiT aN56btRnn8kVQhtR5/xC8MhvP2E2PnNWY5ZiGsYg7+B73S5xZJKsrDFeofvunIrmQ283 utma7MAxJe6wAuLUxrZFftPu9RCMK31xh+T81l1Vc/0jJpm1GvgSsWkilZJdgeOxhe7w Tle8PoT2U093OWGoVYxR568c0DyMgYiBDwhpWQxYasDBzau2jhLxAUv6aLh9Svr4XoZu Ww5GKxELu76Jn6/QSHb684bcWclT8p+JjAmi07V2VLbXMS68Px3ronV4C88Oy6lsQ/h+ 9V6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692688856; x=1693293656; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=whZhTEDPMBELkFvMwjXWXlrIichDByDyvyD7joRcNmA=; b=jt+VzfmEbno2L7J+KT0pHkFCMEg4kK/8vvmNABMkPKtrFzkaNzLvBd7zdSUwDmRlF3 Fhv3xS4xoQGlnpspkC2CpWLCdwxrWCP768I34tGwyythgaS+UXJFvDSQAhf/EOVOSlCD 7HhnzEKUw2Dff/Tgj9xsPesisAhRmGIf76mq5Z6PXX++UnI0v9uViesYkVirS5txuD3/ kbHzLM1MXjTbcvx88utV8UMZHaDujcunWLJ4KP/6BymvZM2cKBf9bGDfcCVJnEwu6ZVv 62FxI+/Q+8Kpm5a3QXi/dvmGh+e73RGTRt9cdSoJvLbJHzlQprKxvwRWDvlOs9WtnhSo gwKQ== X-Gm-Message-State: AOJu0YyxVPTpkPY73pRxm10Mf1oInV/fcqLDbGceA7mJDXXhfo7Z+5ii pAmE+OuSXZz/oA+h/TuRyaISUbq0G19g9fZa1vrqPg== X-Received: by 2002:a05:600c:d8:b0:3fe:e812:4709 with SMTP id u24-20020a05600c00d800b003fee8124709mr5585408wmm.12.1692688855889; Tue, 22 Aug 2023 00:20:55 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id a19-20020a5d4573000000b003143add4396sm14855820wrc.22.2023.08.22.00.20.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 00:20:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Song Gao Cc: Jiajie Chen , Xiaojuan Yang , Huacai Chen , Richard Henderson Subject: [PATCH RESEND v5 16/19] target/loongarch: Add avail_LSPW to check LSPW instructions Date: Tue, 22 Aug 2023 09:19:56 +0200 Message-ID: <20230822071959.35620-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822071405.35386-1-philmd@linaro.org> References: <20230822071405.35386-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Song Gao Signed-off-by: Song Gao Reviewed-by: Richard Henderson Message-ID: <20230822032724.1353391-13-gaosong@loongson.cn> --- target/loongarch/translate.h | 1 + target/loongarch/insn_trans/trans_privileged.c.inc | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/target/loongarch/translate.h b/target/loongarch/translate.h index 0f244cd83b..f0d7b82932 100644 --- a/target/loongarch/translate.h +++ b/target/loongarch/translate.h @@ -20,6 +20,7 @@ #define avail_FP(C) (FIELD_EX32((C)->cpucfg2, CPUCFG2, FP)) #define avail_FP_SP(C) (FIELD_EX32((C)->cpucfg2, CPUCFG2, FP_SP)) #define avail_FP_DP(C) (FIELD_EX32((C)->cpucfg2, CPUCFG2, FP_DP)) +#define avail_LSPW(C) (FIELD_EX32((C)->cpucfg2, CPUCFG2, LSPW)) /* * If an operation is being performed on less than TARGET_LONG_BITS, diff --git a/target/loongarch/insn_trans/trans_privileged.c.inc b/target/loongarch/insn_trans/trans_privileged.c.inc index 684ff547a7..099cd871f0 100644 --- a/target/loongarch/insn_trans/trans_privileged.c.inc +++ b/target/loongarch/insn_trans/trans_privileged.c.inc @@ -437,6 +437,10 @@ static bool trans_ldpte(DisasContext *ctx, arg_ldpte *a) TCGv_i32 mem_idx = tcg_constant_i32(ctx->mem_idx); TCGv src1 = gpr_src(ctx, a->rj, EXT_NONE); + if (!avail_LSPW(ctx)) { + return true; + } + if (check_plv(ctx)) { return false; } @@ -450,6 +454,10 @@ static bool trans_lddir(DisasContext *ctx, arg_lddir *a) TCGv src = gpr_src(ctx, a->rj, EXT_NONE); TCGv dest = gpr_dst(ctx, a->rd, EXT_NONE); + if (!avail_LSPW(ctx)) { + return true; + } + if (check_plv(ctx)) { return false; } From patchwork Tue Aug 22 07:19:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 715705 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp120970wrp; Tue, 22 Aug 2023 00:21:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFzkPj/7b7Hn4rIk/73bh6QnDss94zU39LQqqi6g81uagB89WpWeNMjTVJUEiXDxgz4szeZ X-Received: by 2002:ad4:574e:0:b0:636:3f18:4c2b with SMTP id q14-20020ad4574e000000b006363f184c2bmr7077818qvx.29.1692688915551; Tue, 22 Aug 2023 00:21:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692688915; cv=none; d=google.com; s=arc-20160816; b=p09i1ba7cLxHoKvDJjDO6YFR9a9fqY4UB9VxE53tU9cjGByGHDr702rnXSllqyhQlX sSG26bE5BIrKnq7bbLASnK/KlrvDh23NaDXH99kGxMNkb8y9A5fhTEfl+BhIjs7EbpCg IY4zn4l7Zz4MfNvNw2LtV2fafw+v5QRTw4KdCce2sDh5aCChpv7ep9A4r5OzAfVq2dUt iEW8K58xSH3yhsXaAabcpL9SQEgUJu5+ToLPGv88WdUZikKqfYFYX8SZejkG9XXJD+OE WUQ5EwmJR3fQSV0Sf2zd0oVJGgMgwplzzkQHxIJ0Unm5wa42loLLkuojcwCCLI9CSs6W RSkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=GAyHO/pa2jDR5RbcTcrgjo8SGOZ1fzlP8kfH4UEF2HY=; fh=EgjsXW+L4Y5zRUQS7SIQdGNDJ+AtbUcRDS0IFIrVH6E=; b=DiYlCseJY2nb7PYisq/4XE4BOD8Eq0mONKlva/qWwGqzbWPk66nP63z1KnDY9cB86i TsZ+bs06ESUtebXBvivyAtG/eyOOlv+tU1ZWKyjRhWaCJc2QWa7vqYRHd1jugLNmLicx lP8pL8yYqIHsNfjQF4wxqbBTaYOG4AT/fvVfRiXbCyOFMKF691RRxp9VLS3rjRixd4m7 BP7ik0LDyDotFNkSjfo0apgImE9TlYxdok8moKdy9hl0L8jmBYNAqvx548rqiwELdyTS g4AQK2XvAoA8vRZS4pEA4RAZhNzJNV67we3LFZK9RkwdqBaAejLXopoeGg10lAR441mH lyMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RxUnpz6z; 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 b14-20020a0ccd0e000000b006490a5f98c8si5917039qvm.522.2023.08.22.00.21.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 00:21:55 -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=RxUnpz6z; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYLho-0000I1-AT; Tue, 22 Aug 2023 03:21:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYLhT-0008JO-LY for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:21:18 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYLhL-0004vp-Md for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:21:15 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-31963263938so3679920f8f.2 for ; Tue, 22 Aug 2023 00:21:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692688862; x=1693293662; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GAyHO/pa2jDR5RbcTcrgjo8SGOZ1fzlP8kfH4UEF2HY=; b=RxUnpz6zon7HNhh58yEi69pIo/wnYgh92zY4slEwXXUWzMSQT4GEW+45nkPcXTEG3r 8vIUdzFx8Ij04ln/J4XewqdoM+7ZrsKX9B+MdOXv2CPZfa4fGbId+ANawFNY/PG4prP3 Bxn2TdSpwQbpxiTyANidrD5w6ARDIcjybHgRQhdRPsHgqPDmNL0+lONdpMqey2xx0xfA BK/J/YWugFZStOYAkF6CugUXphgIyHihVeIsy2wFk9YAWIJA3RfXVZUIiP6El2cy5xqy A+mt4TmyhcJEqkgY3FmkczyC7bW9EdAAoEpbyF8hFy5MHjLWpPOVWTZ9Df0zb01ni3FZ nBwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692688862; x=1693293662; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GAyHO/pa2jDR5RbcTcrgjo8SGOZ1fzlP8kfH4UEF2HY=; b=f97GnkAXVHBe561OS8D0GHGduWMjTzLl9C3cXB5XKSiqD5pGQoBbRfaV67c3o4BwtC LU5pbC04A3kt82vCJb/Kvz+1g0vQNvorgf6iUVYEwQQWgw0YHAhOeb9hI3ZKW0KKNpRm C8ySepO5YwpO/98W/B+5xS2YeiekzRgYb0Mr3ho8Bx7cy/DEfuAuXL7dEWOjlDapA1k/ 2xEG+5NEGAy+F8nF/OavO2vh6cz24dOdGqWHsunfLUjSYZFvWF+XHKNgK0bW8lVbnYK7 tIqjTs4HSZWDFqyBUlaapx9YUUhEnPuJ+Wu75lq6QMMX3G3/I/Kc1W8DbIXd8LWNT9GC xnRQ== X-Gm-Message-State: AOJu0Yy0Ouq0cnXdGK47voGFid6fMQKmBub7rPV52ZVadI2V3jgEdHaC 2XM3AGR/Rxqs5VqtuvBYztR6A50fcCp/k4lIb38XHw== X-Received: by 2002:a5d:560a:0:b0:314:3b02:a8a8 with SMTP id l10-20020a5d560a000000b003143b02a8a8mr5702430wrv.55.1692688862416; Tue, 22 Aug 2023 00:21:02 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id z1-20020adfd0c1000000b003143c9beeaesm14871841wrh.44.2023.08.22.00.21.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 00:21:01 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Song Gao Cc: Jiajie Chen , Xiaojuan Yang , Huacai Chen , Richard Henderson Subject: [PATCH RESEND v5 17/19] target/loongarch: Add avail_LAM to check atomic instructions Date: Tue, 22 Aug 2023 09:19:57 +0200 Message-ID: <20230822071959.35620-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822071405.35386-1-philmd@linaro.org> References: <20230822071405.35386-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Song Gao Signed-off-by: Song Gao Reviewed-by: Richard Henderson Message-ID: <20230822032724.1353391-14-gaosong@loongson.cn> --- target/loongarch/translate.h | 1 + .../loongarch/insn_trans/trans_atomic.c.inc | 72 +++++++++---------- 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/target/loongarch/translate.h b/target/loongarch/translate.h index f0d7b82932..faf4ce87f9 100644 --- a/target/loongarch/translate.h +++ b/target/loongarch/translate.h @@ -21,6 +21,7 @@ #define avail_FP_SP(C) (FIELD_EX32((C)->cpucfg2, CPUCFG2, FP_SP)) #define avail_FP_DP(C) (FIELD_EX32((C)->cpucfg2, CPUCFG2, FP_DP)) #define avail_LSPW(C) (FIELD_EX32((C)->cpucfg2, CPUCFG2, LSPW)) +#define avail_LAM(C) (FIELD_EX32((C)->cpucfg2, CPUCFG2, LAM)) /* * If an operation is being performed on less than TARGET_LONG_BITS, diff --git a/target/loongarch/insn_trans/trans_atomic.c.inc b/target/loongarch/insn_trans/trans_atomic.c.inc index 194818d74d..40085190f6 100644 --- a/target/loongarch/insn_trans/trans_atomic.c.inc +++ b/target/loongarch/insn_trans/trans_atomic.c.inc @@ -73,39 +73,39 @@ TRANS(ll_w, ALL, gen_ll, MO_TESL) TRANS(sc_w, ALL, gen_sc, MO_TESL) TRANS(ll_d, 64, gen_ll, MO_TEUQ) TRANS(sc_d, 64, gen_sc, MO_TEUQ) -TRANS(amswap_w, 64, gen_am, tcg_gen_atomic_xchg_tl, MO_TESL) -TRANS(amswap_d, 64, gen_am, tcg_gen_atomic_xchg_tl, MO_TEUQ) -TRANS(amadd_w, 64, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TESL) -TRANS(amadd_d, 64, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TEUQ) -TRANS(amand_w, 64, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TESL) -TRANS(amand_d, 64, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TEUQ) -TRANS(amor_w, 64, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TESL) -TRANS(amor_d, 64, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TEUQ) -TRANS(amxor_w, 64, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TESL) -TRANS(amxor_d, 64, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TEUQ) -TRANS(ammax_w, 64, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TESL) -TRANS(ammax_d, 64, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TEUQ) -TRANS(ammin_w, 64, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TESL) -TRANS(ammin_d, 64, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TEUQ) -TRANS(ammax_wu, 64, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TESL) -TRANS(ammax_du, 64, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TEUQ) -TRANS(ammin_wu, 64, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TESL) -TRANS(ammin_du, 64, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TEUQ) -TRANS(amswap_db_w, 64, gen_am, tcg_gen_atomic_xchg_tl, MO_TESL) -TRANS(amswap_db_d, 64, gen_am, tcg_gen_atomic_xchg_tl, MO_TEUQ) -TRANS(amadd_db_w, 64, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TESL) -TRANS(amadd_db_d, 64, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TEUQ) -TRANS(amand_db_w, 64, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TESL) -TRANS(amand_db_d, 64, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TEUQ) -TRANS(amor_db_w, 64, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TESL) -TRANS(amor_db_d, 64, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TEUQ) -TRANS(amxor_db_w, 64, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TESL) -TRANS(amxor_db_d, 64, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TEUQ) -TRANS(ammax_db_w, 64, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TESL) -TRANS(ammax_db_d, 64, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TEUQ) -TRANS(ammin_db_w, 64, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TESL) -TRANS(ammin_db_d, 64, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TEUQ) -TRANS(ammax_db_wu, 64, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TESL) -TRANS(ammax_db_du, 64, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TEUQ) -TRANS(ammin_db_wu, 64, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TESL) -TRANS(ammin_db_du, 64, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TEUQ) +TRANS(amswap_w, LAM, gen_am, tcg_gen_atomic_xchg_tl, MO_TESL) +TRANS(amswap_d, LAM, gen_am, tcg_gen_atomic_xchg_tl, MO_TEUQ) +TRANS(amadd_w, LAM, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TESL) +TRANS(amadd_d, LAM, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TEUQ) +TRANS(amand_w, LAM, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TESL) +TRANS(amand_d, LAM, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TEUQ) +TRANS(amor_w, LAM, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TESL) +TRANS(amor_d, LAM, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TEUQ) +TRANS(amxor_w, LAM, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TESL) +TRANS(amxor_d, LAM, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TEUQ) +TRANS(ammax_w, LAM, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TESL) +TRANS(ammax_d, LAM, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TEUQ) +TRANS(ammin_w, LAM, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TESL) +TRANS(ammin_d, LAM, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TEUQ) +TRANS(ammax_wu, LAM, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TESL) +TRANS(ammax_du, LAM, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TEUQ) +TRANS(ammin_wu, LAM, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TESL) +TRANS(ammin_du, LAM, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TEUQ) +TRANS(amswap_db_w, LAM, gen_am, tcg_gen_atomic_xchg_tl, MO_TESL) +TRANS(amswap_db_d, LAM, gen_am, tcg_gen_atomic_xchg_tl, MO_TEUQ) +TRANS(amadd_db_w, LAM, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TESL) +TRANS(amadd_db_d, LAM, gen_am, tcg_gen_atomic_fetch_add_tl, MO_TEUQ) +TRANS(amand_db_w, LAM, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TESL) +TRANS(amand_db_d, LAM, gen_am, tcg_gen_atomic_fetch_and_tl, MO_TEUQ) +TRANS(amor_db_w, LAM, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TESL) +TRANS(amor_db_d, LAM, gen_am, tcg_gen_atomic_fetch_or_tl, MO_TEUQ) +TRANS(amxor_db_w, LAM, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TESL) +TRANS(amxor_db_d, LAM, gen_am, tcg_gen_atomic_fetch_xor_tl, MO_TEUQ) +TRANS(ammax_db_w, LAM, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TESL) +TRANS(ammax_db_d, LAM, gen_am, tcg_gen_atomic_fetch_smax_tl, MO_TEUQ) +TRANS(ammin_db_w, LAM, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TESL) +TRANS(ammin_db_d, LAM, gen_am, tcg_gen_atomic_fetch_smin_tl, MO_TEUQ) +TRANS(ammax_db_wu, LAM, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TESL) +TRANS(ammax_db_du, LAM, gen_am, tcg_gen_atomic_fetch_umax_tl, MO_TEUQ) +TRANS(ammin_db_wu, LAM, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TESL) +TRANS(ammin_db_du, LAM, gen_am, tcg_gen_atomic_fetch_umin_tl, MO_TEUQ) From patchwork Tue Aug 22 07:30:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 715708 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp123793wrp; Tue, 22 Aug 2023 00:31:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFWRpfoxaLWp12s7OF+fW33edr6im3++mNkp6eTNuhd9KrsW2+HaAhm8UU0OppQ3zaIOkIL X-Received: by 2002:a0c:f18a:0:b0:64c:60b3:2709 with SMTP id m10-20020a0cf18a000000b0064c60b32709mr10000343qvl.12.1692689471009; Tue, 22 Aug 2023 00:31:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692689470; cv=none; d=google.com; s=arc-20160816; b=ZH80aHNoCPkIwGT3eYOkBtv7m+Fo4MUiIO52r0jP8WkVNdGOsxcvIbfm9Ai18Fh7Jl hHFA6UOw1oqi6wauvPQMt/u9BnCYUmhxlcp6TwpK6kJAuDBiECfjV0x2Rww2j4kz/Rrb 8BV0+C1V09pt2aOcdI95vBjKaZ1QZstH7HwpEQLip/mB5EQKkXOyI1oi+HVGKaitKZTw ssx/YuHG3AwjY5iV9cZSRkK34MheWxm7Qf8rtElTL7dlaGPR26Ao/Yiqx9RBQZyKSwft XVK6AIZ6yVviAtRJ4JUMrLVmkVWmdpwM3lGHQHvF3fowf2U+fVtwZNICMVDzNM+QvyJL IH4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=27NFgPnAGE9uncNa8MaCSuySYuUq76sG6ud7jGLz6eE=; fh=EgjsXW+L4Y5zRUQS7SIQdGNDJ+AtbUcRDS0IFIrVH6E=; b=kWcb2wKNiv9mjZw0ODSujI4vB4l146C0m4OwNcpfZyyJpWwXgnfIifdMeZQor6c8Im G1FpZSzoKqLnV18p3J8NLCKaTGAf/4Kacng+2NjbnQ3z42pudBlvXGYB4Aa1nmiNwYg2 DU9aJiZujMLPmYPuO4uljCqkDKOBS/e3WjgWFPtv7xLqFeDmmKegMpeRzgpejg6JHT5a zSQ2JfHBuPfl/pu+p502qIs2Zc1Ik8smWi7NBaiM1Osw+24eL0LdUDic6Ibb4IHEXRJj GNExHuSmOhtDoTW3R9xSQ52Gaul87TR7Efqigic3e5iwTYwkDwd66jsMylFVJqN+oxAn U1YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v0utyXYG; 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 h18-20020a0cf452000000b0064f397f5afasi633549qvm.342.2023.08.22.00.31.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 00:31:10 -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=v0utyXYG; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYLqx-0006q5-25; Tue, 22 Aug 2023 03:31:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYLqi-0006WF-Fj for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:30:50 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYLqZ-00073Z-9r for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:30:44 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-317f1c480eeso3763605f8f.2 for ; Tue, 22 Aug 2023 00:30:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692689437; x=1693294237; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=27NFgPnAGE9uncNa8MaCSuySYuUq76sG6ud7jGLz6eE=; b=v0utyXYGIhviuKy/xuUFqUAtl+OIteBiZULlt3UhF8L2mcHvd5sTVAvLRALI6he9q+ ILBJQwetwusQi37wAg3IKaolVhrKfkvtTspwXcEOR4hfQw3dZFHySWBj7ckUlPmxKlNa rozXM7pyhiUGNol8+v2eMIY29KWs9SRsCAavd/TN6Brinkz5msBh43ks93SBvnTHhbgL zv/l9tEuD2vqmJD7fpm2mN197dzr7x1QktrORyCr087oo5ssKM7PozbIrj1254NL/kCS ddneTr0rLyWzBCeO7FstiAKAA65Z9ZJEII1AzrmZotqS0xlYGI6Edj+LHPwhLXZ+JcWE sybg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692689437; x=1693294237; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=27NFgPnAGE9uncNa8MaCSuySYuUq76sG6ud7jGLz6eE=; b=ZPLxsu39rZuR3IZDA135EDC9O1bh1uGuU1z2tDw3P234XS7MgVxGNxQppo/rarOBqh /oyT+q4sdqtVgpg6U0XldN8SVw+6hMCfJVlGXNWmglN/AlhDSa3I4IZ1iGuX+Yvm7mpg p9vKSPWnKXPVsF/kCIZTlgS7zG0TVP8jxmwJPxg/6T6mwrMX2dYLjzoGUDXYWzSymJJ5 hwB9JlyLcD8h+qv5JfJQ5OUItbP26OZZV4JlutsNymiCTaAF6XtATPj5BR2I4D3/BeId iE1ZRzX4RoSnEmnCjWDP3ycfOzYIBUnMEGBTGoY7wSRKv8/84AHPVNDM2W+VEB05TpaH nTnw== X-Gm-Message-State: AOJu0YyammzV5KmiSBb8f2ykWScw/rxUfRRcBvm+zPU+AcQeI0jifWaj Dmz63RXtfc8rtVXL64KDcV/gjF9cDMdYIpuYsejdzg== X-Received: by 2002:a5d:5946:0:b0:317:49e9:c57 with SMTP id e6-20020a5d5946000000b0031749e90c57mr6338084wri.43.1692689434002; Tue, 22 Aug 2023 00:30:34 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id j16-20020a056000125000b00317e6f06e22sm14983724wrx.77.2023.08.22.00.30.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 00:30:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Song Gao Cc: Jiajie Chen , Xiaojuan Yang , Huacai Chen , Richard Henderson Subject: [PATCH RESEND v5 18/19] target/loongarch: Add avail_LSX to check LSX instructions Date: Tue, 22 Aug 2023 09:30:26 +0200 Message-ID: <20230822073026.35776-1-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822071405.35386-1-philmd@linaro.org> References: <20230822071405.35386-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Song Gao Signed-off-by: Song Gao Reviewed-by: Richard Henderson Message-ID: <20230822032724.1353391-15-gaosong@loongson.cn> --- target/loongarch/translate.h | 2 + target/loongarch/insn_trans/trans_lsx.c.inc | 1396 +++++++++++-------- 2 files changed, 780 insertions(+), 618 deletions(-) diff --git a/target/loongarch/translate.h b/target/loongarch/translate.h index faf4ce87f9..db46e9aa0f 100644 --- a/target/loongarch/translate.h +++ b/target/loongarch/translate.h @@ -22,6 +22,8 @@ #define avail_FP_DP(C) (FIELD_EX32((C)->cpucfg2, CPUCFG2, FP_DP)) #define avail_LSPW(C) (FIELD_EX32((C)->cpucfg2, CPUCFG2, LSPW)) #define avail_LAM(C) (FIELD_EX32((C)->cpucfg2, CPUCFG2, LAM)) +#define avail_LSX(C) (FIELD_EX32((C)->cpucfg2, CPUCFG2, LSX)) + /* * If an operation is being performed on less than TARGET_LONG_BITS, diff --git a/target/loongarch/insn_trans/trans_lsx.c.inc b/target/loongarch/insn_trans/trans_lsx.c.inc index 45e0e738ad..5fbf2718f7 100644 --- a/target/loongarch/insn_trans/trans_lsx.c.inc +++ b/target/loongarch/insn_trans/trans_lsx.c.inc @@ -135,16 +135,20 @@ static bool gvec_subi(DisasContext *ctx, arg_vv_i *a, MemOp mop) return true; } -TRANS(vadd_b, ALL, gvec_vvv, MO_8, tcg_gen_gvec_add) -TRANS(vadd_h, ALL, gvec_vvv, MO_16, tcg_gen_gvec_add) -TRANS(vadd_w, ALL, gvec_vvv, MO_32, tcg_gen_gvec_add) -TRANS(vadd_d, ALL, gvec_vvv, MO_64, tcg_gen_gvec_add) +TRANS(vadd_b, LSX, gvec_vvv, MO_8, tcg_gen_gvec_add) +TRANS(vadd_h, LSX, gvec_vvv, MO_16, tcg_gen_gvec_add) +TRANS(vadd_w, LSX, gvec_vvv, MO_32, tcg_gen_gvec_add) +TRANS(vadd_d, LSX, gvec_vvv, MO_64, tcg_gen_gvec_add) #define VADDSUB_Q(NAME) \ static bool trans_v## NAME ##_q(DisasContext *ctx, arg_vvv *a) \ { \ TCGv_i64 rh, rl, ah, al, bh, bl; \ \ + if (!avail_LSX(ctx)) { \ + return false; \ + } \ + \ CHECK_SXE; \ \ rh = tcg_temp_new_i64(); \ @@ -170,58 +174,58 @@ static bool trans_v## NAME ##_q(DisasContext *ctx, arg_vvv *a) \ VADDSUB_Q(add) VADDSUB_Q(sub) -TRANS(vsub_b, ALL, gvec_vvv, MO_8, tcg_gen_gvec_sub) -TRANS(vsub_h, ALL, gvec_vvv, MO_16, tcg_gen_gvec_sub) -TRANS(vsub_w, ALL, gvec_vvv, MO_32, tcg_gen_gvec_sub) -TRANS(vsub_d, ALL, gvec_vvv, MO_64, tcg_gen_gvec_sub) +TRANS(vsub_b, LSX, gvec_vvv, MO_8, tcg_gen_gvec_sub) +TRANS(vsub_h, LSX, gvec_vvv, MO_16, tcg_gen_gvec_sub) +TRANS(vsub_w, LSX, gvec_vvv, MO_32, tcg_gen_gvec_sub) +TRANS(vsub_d, LSX, gvec_vvv, MO_64, tcg_gen_gvec_sub) -TRANS(vaddi_bu, ALL, gvec_vv_i, MO_8, tcg_gen_gvec_addi) -TRANS(vaddi_hu, ALL, gvec_vv_i, MO_16, tcg_gen_gvec_addi) -TRANS(vaddi_wu, ALL, gvec_vv_i, MO_32, tcg_gen_gvec_addi) -TRANS(vaddi_du, ALL, gvec_vv_i, MO_64, tcg_gen_gvec_addi) -TRANS(vsubi_bu, ALL, gvec_subi, MO_8) -TRANS(vsubi_hu, ALL, gvec_subi, MO_16) -TRANS(vsubi_wu, ALL, gvec_subi, MO_32) -TRANS(vsubi_du, ALL, gvec_subi, MO_64) +TRANS(vaddi_bu, LSX, gvec_vv_i, MO_8, tcg_gen_gvec_addi) +TRANS(vaddi_hu, LSX, gvec_vv_i, MO_16, tcg_gen_gvec_addi) +TRANS(vaddi_wu, LSX, gvec_vv_i, MO_32, tcg_gen_gvec_addi) +TRANS(vaddi_du, LSX, gvec_vv_i, MO_64, tcg_gen_gvec_addi) +TRANS(vsubi_bu, LSX, gvec_subi, MO_8) +TRANS(vsubi_hu, LSX, gvec_subi, MO_16) +TRANS(vsubi_wu, LSX, gvec_subi, MO_32) +TRANS(vsubi_du, LSX, gvec_subi, MO_64) -TRANS(vneg_b, ALL, gvec_vv, MO_8, tcg_gen_gvec_neg) -TRANS(vneg_h, ALL, gvec_vv, MO_16, tcg_gen_gvec_neg) -TRANS(vneg_w, ALL, gvec_vv, MO_32, tcg_gen_gvec_neg) -TRANS(vneg_d, ALL, gvec_vv, MO_64, tcg_gen_gvec_neg) +TRANS(vneg_b, LSX, gvec_vv, MO_8, tcg_gen_gvec_neg) +TRANS(vneg_h, LSX, gvec_vv, MO_16, tcg_gen_gvec_neg) +TRANS(vneg_w, LSX, gvec_vv, MO_32, tcg_gen_gvec_neg) +TRANS(vneg_d, LSX, gvec_vv, MO_64, tcg_gen_gvec_neg) -TRANS(vsadd_b, ALL, gvec_vvv, MO_8, tcg_gen_gvec_ssadd) -TRANS(vsadd_h, ALL, gvec_vvv, MO_16, tcg_gen_gvec_ssadd) -TRANS(vsadd_w, ALL, gvec_vvv, MO_32, tcg_gen_gvec_ssadd) -TRANS(vsadd_d, ALL, gvec_vvv, MO_64, tcg_gen_gvec_ssadd) -TRANS(vsadd_bu, ALL, gvec_vvv, MO_8, tcg_gen_gvec_usadd) -TRANS(vsadd_hu, ALL, gvec_vvv, MO_16, tcg_gen_gvec_usadd) -TRANS(vsadd_wu, ALL, gvec_vvv, MO_32, tcg_gen_gvec_usadd) -TRANS(vsadd_du, ALL, gvec_vvv, MO_64, tcg_gen_gvec_usadd) -TRANS(vssub_b, ALL, gvec_vvv, MO_8, tcg_gen_gvec_sssub) -TRANS(vssub_h, ALL, gvec_vvv, MO_16, tcg_gen_gvec_sssub) -TRANS(vssub_w, ALL, gvec_vvv, MO_32, tcg_gen_gvec_sssub) -TRANS(vssub_d, ALL, gvec_vvv, MO_64, tcg_gen_gvec_sssub) -TRANS(vssub_bu, ALL, gvec_vvv, MO_8, tcg_gen_gvec_ussub) -TRANS(vssub_hu, ALL, gvec_vvv, MO_16, tcg_gen_gvec_ussub) -TRANS(vssub_wu, ALL, gvec_vvv, MO_32, tcg_gen_gvec_ussub) -TRANS(vssub_du, ALL, gvec_vvv, MO_64, tcg_gen_gvec_ussub) +TRANS(vsadd_b, LSX, gvec_vvv, MO_8, tcg_gen_gvec_ssadd) +TRANS(vsadd_h, LSX, gvec_vvv, MO_16, tcg_gen_gvec_ssadd) +TRANS(vsadd_w, LSX, gvec_vvv, MO_32, tcg_gen_gvec_ssadd) +TRANS(vsadd_d, LSX, gvec_vvv, MO_64, tcg_gen_gvec_ssadd) +TRANS(vsadd_bu, LSX, gvec_vvv, MO_8, tcg_gen_gvec_usadd) +TRANS(vsadd_hu, LSX, gvec_vvv, MO_16, tcg_gen_gvec_usadd) +TRANS(vsadd_wu, LSX, gvec_vvv, MO_32, tcg_gen_gvec_usadd) +TRANS(vsadd_du, LSX, gvec_vvv, MO_64, tcg_gen_gvec_usadd) +TRANS(vssub_b, LSX, gvec_vvv, MO_8, tcg_gen_gvec_sssub) +TRANS(vssub_h, LSX, gvec_vvv, MO_16, tcg_gen_gvec_sssub) +TRANS(vssub_w, LSX, gvec_vvv, MO_32, tcg_gen_gvec_sssub) +TRANS(vssub_d, LSX, gvec_vvv, MO_64, tcg_gen_gvec_sssub) +TRANS(vssub_bu, LSX, gvec_vvv, MO_8, tcg_gen_gvec_ussub) +TRANS(vssub_hu, LSX, gvec_vvv, MO_16, tcg_gen_gvec_ussub) +TRANS(vssub_wu, LSX, gvec_vvv, MO_32, tcg_gen_gvec_ussub) +TRANS(vssub_du, LSX, gvec_vvv, MO_64, tcg_gen_gvec_ussub) -TRANS(vhaddw_h_b, ALL, gen_vvv, gen_helper_vhaddw_h_b) -TRANS(vhaddw_w_h, ALL, gen_vvv, gen_helper_vhaddw_w_h) -TRANS(vhaddw_d_w, ALL, gen_vvv, gen_helper_vhaddw_d_w) -TRANS(vhaddw_q_d, ALL, gen_vvv, gen_helper_vhaddw_q_d) -TRANS(vhaddw_hu_bu, ALL, gen_vvv, gen_helper_vhaddw_hu_bu) -TRANS(vhaddw_wu_hu, ALL, gen_vvv, gen_helper_vhaddw_wu_hu) -TRANS(vhaddw_du_wu, ALL, gen_vvv, gen_helper_vhaddw_du_wu) -TRANS(vhaddw_qu_du, ALL, gen_vvv, gen_helper_vhaddw_qu_du) -TRANS(vhsubw_h_b, ALL, gen_vvv, gen_helper_vhsubw_h_b) -TRANS(vhsubw_w_h, ALL, gen_vvv, gen_helper_vhsubw_w_h) -TRANS(vhsubw_d_w, ALL, gen_vvv, gen_helper_vhsubw_d_w) -TRANS(vhsubw_q_d, ALL, gen_vvv, gen_helper_vhsubw_q_d) -TRANS(vhsubw_hu_bu, ALL, gen_vvv, gen_helper_vhsubw_hu_bu) -TRANS(vhsubw_wu_hu, ALL, gen_vvv, gen_helper_vhsubw_wu_hu) -TRANS(vhsubw_du_wu, ALL, gen_vvv, gen_helper_vhsubw_du_wu) -TRANS(vhsubw_qu_du, ALL, gen_vvv, gen_helper_vhsubw_qu_du) +TRANS(vhaddw_h_b, LSX, gen_vvv, gen_helper_vhaddw_h_b) +TRANS(vhaddw_w_h, LSX, gen_vvv, gen_helper_vhaddw_w_h) +TRANS(vhaddw_d_w, LSX, gen_vvv, gen_helper_vhaddw_d_w) +TRANS(vhaddw_q_d, LSX, gen_vvv, gen_helper_vhaddw_q_d) +TRANS(vhaddw_hu_bu, LSX, gen_vvv, gen_helper_vhaddw_hu_bu) +TRANS(vhaddw_wu_hu, LSX, gen_vvv, gen_helper_vhaddw_wu_hu) +TRANS(vhaddw_du_wu, LSX, gen_vvv, gen_helper_vhaddw_du_wu) +TRANS(vhaddw_qu_du, LSX, gen_vvv, gen_helper_vhaddw_qu_du) +TRANS(vhsubw_h_b, LSX, gen_vvv, gen_helper_vhsubw_h_b) +TRANS(vhsubw_w_h, LSX, gen_vvv, gen_helper_vhsubw_w_h) +TRANS(vhsubw_d_w, LSX, gen_vvv, gen_helper_vhsubw_d_w) +TRANS(vhsubw_q_d, LSX, gen_vvv, gen_helper_vhsubw_q_d) +TRANS(vhsubw_hu_bu, LSX, gen_vvv, gen_helper_vhsubw_hu_bu) +TRANS(vhsubw_wu_hu, LSX, gen_vvv, gen_helper_vhsubw_wu_hu) +TRANS(vhsubw_du_wu, LSX, gen_vvv, gen_helper_vhsubw_du_wu) +TRANS(vhsubw_qu_du, LSX, gen_vvv, gen_helper_vhsubw_qu_du) static void gen_vaddwev_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -301,10 +305,10 @@ static void do_vaddwev_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vaddwev_h_b, ALL, gvec_vvv, MO_8, do_vaddwev_s) -TRANS(vaddwev_w_h, ALL, gvec_vvv, MO_16, do_vaddwev_s) -TRANS(vaddwev_d_w, ALL, gvec_vvv, MO_32, do_vaddwev_s) -TRANS(vaddwev_q_d, ALL, gvec_vvv, MO_64, do_vaddwev_s) +TRANS(vaddwev_h_b, LSX, gvec_vvv, MO_8, do_vaddwev_s) +TRANS(vaddwev_w_h, LSX, gvec_vvv, MO_16, do_vaddwev_s) +TRANS(vaddwev_d_w, LSX, gvec_vvv, MO_32, do_vaddwev_s) +TRANS(vaddwev_q_d, LSX, gvec_vvv, MO_64, do_vaddwev_s) static void gen_vaddwod_w_h(TCGv_i32 t, TCGv_i32 a, TCGv_i32 b) { @@ -380,10 +384,10 @@ static void do_vaddwod_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vaddwod_h_b, ALL, gvec_vvv, MO_8, do_vaddwod_s) -TRANS(vaddwod_w_h, ALL, gvec_vvv, MO_16, do_vaddwod_s) -TRANS(vaddwod_d_w, ALL, gvec_vvv, MO_32, do_vaddwod_s) -TRANS(vaddwod_q_d, ALL, gvec_vvv, MO_64, do_vaddwod_s) +TRANS(vaddwod_h_b, LSX, gvec_vvv, MO_8, do_vaddwod_s) +TRANS(vaddwod_w_h, LSX, gvec_vvv, MO_16, do_vaddwod_s) +TRANS(vaddwod_d_w, LSX, gvec_vvv, MO_32, do_vaddwod_s) +TRANS(vaddwod_q_d, LSX, gvec_vvv, MO_64, do_vaddwod_s) static void gen_vsubwev_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -463,10 +467,10 @@ static void do_vsubwev_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vsubwev_h_b, ALL, gvec_vvv, MO_8, do_vsubwev_s) -TRANS(vsubwev_w_h, ALL, gvec_vvv, MO_16, do_vsubwev_s) -TRANS(vsubwev_d_w, ALL, gvec_vvv, MO_32, do_vsubwev_s) -TRANS(vsubwev_q_d, ALL, gvec_vvv, MO_64, do_vsubwev_s) +TRANS(vsubwev_h_b, LSX, gvec_vvv, MO_8, do_vsubwev_s) +TRANS(vsubwev_w_h, LSX, gvec_vvv, MO_16, do_vsubwev_s) +TRANS(vsubwev_d_w, LSX, gvec_vvv, MO_32, do_vsubwev_s) +TRANS(vsubwev_q_d, LSX, gvec_vvv, MO_64, do_vsubwev_s) static void gen_vsubwod_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -542,10 +546,10 @@ static void do_vsubwod_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vsubwod_h_b, ALL, gvec_vvv, MO_8, do_vsubwod_s) -TRANS(vsubwod_w_h, ALL, gvec_vvv, MO_16, do_vsubwod_s) -TRANS(vsubwod_d_w, ALL, gvec_vvv, MO_32, do_vsubwod_s) -TRANS(vsubwod_q_d, ALL, gvec_vvv, MO_64, do_vsubwod_s) +TRANS(vsubwod_h_b, LSX, gvec_vvv, MO_8, do_vsubwod_s) +TRANS(vsubwod_w_h, LSX, gvec_vvv, MO_16, do_vsubwod_s) +TRANS(vsubwod_d_w, LSX, gvec_vvv, MO_32, do_vsubwod_s) +TRANS(vsubwod_q_d, LSX, gvec_vvv, MO_64, do_vsubwod_s) static void gen_vaddwev_u(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -617,10 +621,10 @@ static void do_vaddwev_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vaddwev_h_bu, ALL, gvec_vvv, MO_8, do_vaddwev_u) -TRANS(vaddwev_w_hu, ALL, gvec_vvv, MO_16, do_vaddwev_u) -TRANS(vaddwev_d_wu, ALL, gvec_vvv, MO_32, do_vaddwev_u) -TRANS(vaddwev_q_du, ALL, gvec_vvv, MO_64, do_vaddwev_u) +TRANS(vaddwev_h_bu, LSX, gvec_vvv, MO_8, do_vaddwev_u) +TRANS(vaddwev_w_hu, LSX, gvec_vvv, MO_16, do_vaddwev_u) +TRANS(vaddwev_d_wu, LSX, gvec_vvv, MO_32, do_vaddwev_u) +TRANS(vaddwev_q_du, LSX, gvec_vvv, MO_64, do_vaddwev_u) static void gen_vaddwod_u(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -696,10 +700,10 @@ static void do_vaddwod_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vaddwod_h_bu, ALL, gvec_vvv, MO_8, do_vaddwod_u) -TRANS(vaddwod_w_hu, ALL, gvec_vvv, MO_16, do_vaddwod_u) -TRANS(vaddwod_d_wu, ALL, gvec_vvv, MO_32, do_vaddwod_u) -TRANS(vaddwod_q_du, ALL, gvec_vvv, MO_64, do_vaddwod_u) +TRANS(vaddwod_h_bu, LSX, gvec_vvv, MO_8, do_vaddwod_u) +TRANS(vaddwod_w_hu, LSX, gvec_vvv, MO_16, do_vaddwod_u) +TRANS(vaddwod_d_wu, LSX, gvec_vvv, MO_32, do_vaddwod_u) +TRANS(vaddwod_q_du, LSX, gvec_vvv, MO_64, do_vaddwod_u) static void gen_vsubwev_u(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -771,10 +775,10 @@ static void do_vsubwev_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vsubwev_h_bu, ALL, gvec_vvv, MO_8, do_vsubwev_u) -TRANS(vsubwev_w_hu, ALL, gvec_vvv, MO_16, do_vsubwev_u) -TRANS(vsubwev_d_wu, ALL, gvec_vvv, MO_32, do_vsubwev_u) -TRANS(vsubwev_q_du, ALL, gvec_vvv, MO_64, do_vsubwev_u) +TRANS(vsubwev_h_bu, LSX, gvec_vvv, MO_8, do_vsubwev_u) +TRANS(vsubwev_w_hu, LSX, gvec_vvv, MO_16, do_vsubwev_u) +TRANS(vsubwev_d_wu, LSX, gvec_vvv, MO_32, do_vsubwev_u) +TRANS(vsubwev_q_du, LSX, gvec_vvv, MO_64, do_vsubwev_u) static void gen_vsubwod_u(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -850,10 +854,10 @@ static void do_vsubwod_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vsubwod_h_bu, ALL, gvec_vvv, MO_8, do_vsubwod_u) -TRANS(vsubwod_w_hu, ALL, gvec_vvv, MO_16, do_vsubwod_u) -TRANS(vsubwod_d_wu, ALL, gvec_vvv, MO_32, do_vsubwod_u) -TRANS(vsubwod_q_du, ALL, gvec_vvv, MO_64, do_vsubwod_u) +TRANS(vsubwod_h_bu, LSX, gvec_vvv, MO_8, do_vsubwod_u) +TRANS(vsubwod_w_hu, LSX, gvec_vvv, MO_16, do_vsubwod_u) +TRANS(vsubwod_d_wu, LSX, gvec_vvv, MO_32, do_vsubwod_u) +TRANS(vsubwod_q_du, LSX, gvec_vvv, MO_64, do_vsubwod_u) static void gen_vaddwev_u_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -933,10 +937,10 @@ static void do_vaddwev_u_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vaddwev_h_bu_b, ALL, gvec_vvv, MO_8, do_vaddwev_u_s) -TRANS(vaddwev_w_hu_h, ALL, gvec_vvv, MO_16, do_vaddwev_u_s) -TRANS(vaddwev_d_wu_w, ALL, gvec_vvv, MO_32, do_vaddwev_u_s) -TRANS(vaddwev_q_du_d, ALL, gvec_vvv, MO_64, do_vaddwev_u_s) +TRANS(vaddwev_h_bu_b, LSX, gvec_vvv, MO_8, do_vaddwev_u_s) +TRANS(vaddwev_w_hu_h, LSX, gvec_vvv, MO_16, do_vaddwev_u_s) +TRANS(vaddwev_d_wu_w, LSX, gvec_vvv, MO_32, do_vaddwev_u_s) +TRANS(vaddwev_q_du_d, LSX, gvec_vvv, MO_64, do_vaddwev_u_s) static void gen_vaddwod_u_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -1013,10 +1017,10 @@ static void do_vaddwod_u_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vaddwod_h_bu_b, ALL, gvec_vvv, MO_8, do_vaddwod_u_s) -TRANS(vaddwod_w_hu_h, ALL, gvec_vvv, MO_16, do_vaddwod_u_s) -TRANS(vaddwod_d_wu_w, ALL, gvec_vvv, MO_32, do_vaddwod_u_s) -TRANS(vaddwod_q_du_d, ALL, gvec_vvv, MO_64, do_vaddwod_u_s) +TRANS(vaddwod_h_bu_b, LSX, gvec_vvv, MO_8, do_vaddwod_u_s) +TRANS(vaddwod_w_hu_h, LSX, gvec_vvv, MO_16, do_vaddwod_u_s) +TRANS(vaddwod_d_wu_w, LSX, gvec_vvv, MO_32, do_vaddwod_u_s) +TRANS(vaddwod_q_du_d, LSX, gvec_vvv, MO_64, do_vaddwod_u_s) static void do_vavg(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b, void (*gen_shr_vec)(unsigned, TCGv_vec, @@ -1125,14 +1129,14 @@ static void do_vavg_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vavg_b, ALL, gvec_vvv, MO_8, do_vavg_s) -TRANS(vavg_h, ALL, gvec_vvv, MO_16, do_vavg_s) -TRANS(vavg_w, ALL, gvec_vvv, MO_32, do_vavg_s) -TRANS(vavg_d, ALL, gvec_vvv, MO_64, do_vavg_s) -TRANS(vavg_bu, ALL, gvec_vvv, MO_8, do_vavg_u) -TRANS(vavg_hu, ALL, gvec_vvv, MO_16, do_vavg_u) -TRANS(vavg_wu, ALL, gvec_vvv, MO_32, do_vavg_u) -TRANS(vavg_du, ALL, gvec_vvv, MO_64, do_vavg_u) +TRANS(vavg_b, LSX, gvec_vvv, MO_8, do_vavg_s) +TRANS(vavg_h, LSX, gvec_vvv, MO_16, do_vavg_s) +TRANS(vavg_w, LSX, gvec_vvv, MO_32, do_vavg_s) +TRANS(vavg_d, LSX, gvec_vvv, MO_64, do_vavg_s) +TRANS(vavg_bu, LSX, gvec_vvv, MO_8, do_vavg_u) +TRANS(vavg_hu, LSX, gvec_vvv, MO_16, do_vavg_u) +TRANS(vavg_wu, LSX, gvec_vvv, MO_32, do_vavg_u) +TRANS(vavg_du, LSX, gvec_vvv, MO_64, do_vavg_u) static void do_vavgr_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, uint32_t vk_ofs, uint32_t oprsz, uint32_t maxsz) @@ -1206,14 +1210,14 @@ static void do_vavgr_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vavgr_b, ALL, gvec_vvv, MO_8, do_vavgr_s) -TRANS(vavgr_h, ALL, gvec_vvv, MO_16, do_vavgr_s) -TRANS(vavgr_w, ALL, gvec_vvv, MO_32, do_vavgr_s) -TRANS(vavgr_d, ALL, gvec_vvv, MO_64, do_vavgr_s) -TRANS(vavgr_bu, ALL, gvec_vvv, MO_8, do_vavgr_u) -TRANS(vavgr_hu, ALL, gvec_vvv, MO_16, do_vavgr_u) -TRANS(vavgr_wu, ALL, gvec_vvv, MO_32, do_vavgr_u) -TRANS(vavgr_du, ALL, gvec_vvv, MO_64, do_vavgr_u) +TRANS(vavgr_b, LSX, gvec_vvv, MO_8, do_vavgr_s) +TRANS(vavgr_h, LSX, gvec_vvv, MO_16, do_vavgr_s) +TRANS(vavgr_w, LSX, gvec_vvv, MO_32, do_vavgr_s) +TRANS(vavgr_d, LSX, gvec_vvv, MO_64, do_vavgr_s) +TRANS(vavgr_bu, LSX, gvec_vvv, MO_8, do_vavgr_u) +TRANS(vavgr_hu, LSX, gvec_vvv, MO_16, do_vavgr_u) +TRANS(vavgr_wu, LSX, gvec_vvv, MO_32, do_vavgr_u) +TRANS(vavgr_du, LSX, gvec_vvv, MO_64, do_vavgr_u) static void gen_vabsd_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -1301,14 +1305,14 @@ static void do_vabsd_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vabsd_b, ALL, gvec_vvv, MO_8, do_vabsd_s) -TRANS(vabsd_h, ALL, gvec_vvv, MO_16, do_vabsd_s) -TRANS(vabsd_w, ALL, gvec_vvv, MO_32, do_vabsd_s) -TRANS(vabsd_d, ALL, gvec_vvv, MO_64, do_vabsd_s) -TRANS(vabsd_bu, ALL, gvec_vvv, MO_8, do_vabsd_u) -TRANS(vabsd_hu, ALL, gvec_vvv, MO_16, do_vabsd_u) -TRANS(vabsd_wu, ALL, gvec_vvv, MO_32, do_vabsd_u) -TRANS(vabsd_du, ALL, gvec_vvv, MO_64, do_vabsd_u) +TRANS(vabsd_b, LSX, gvec_vvv, MO_8, do_vabsd_s) +TRANS(vabsd_h, LSX, gvec_vvv, MO_16, do_vabsd_s) +TRANS(vabsd_w, LSX, gvec_vvv, MO_32, do_vabsd_s) +TRANS(vabsd_d, LSX, gvec_vvv, MO_64, do_vabsd_s) +TRANS(vabsd_bu, LSX, gvec_vvv, MO_8, do_vabsd_u) +TRANS(vabsd_hu, LSX, gvec_vvv, MO_16, do_vabsd_u) +TRANS(vabsd_wu, LSX, gvec_vvv, MO_32, do_vabsd_u) +TRANS(vabsd_du, LSX, gvec_vvv, MO_64, do_vabsd_u) static void gen_vadda(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -1358,28 +1362,28 @@ static void do_vadda(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vadda_b, ALL, gvec_vvv, MO_8, do_vadda) -TRANS(vadda_h, ALL, gvec_vvv, MO_16, do_vadda) -TRANS(vadda_w, ALL, gvec_vvv, MO_32, do_vadda) -TRANS(vadda_d, ALL, gvec_vvv, MO_64, do_vadda) +TRANS(vadda_b, LSX, gvec_vvv, MO_8, do_vadda) +TRANS(vadda_h, LSX, gvec_vvv, MO_16, do_vadda) +TRANS(vadda_w, LSX, gvec_vvv, MO_32, do_vadda) +TRANS(vadda_d, LSX, gvec_vvv, MO_64, do_vadda) -TRANS(vmax_b, ALL, gvec_vvv, MO_8, tcg_gen_gvec_smax) -TRANS(vmax_h, ALL, gvec_vvv, MO_16, tcg_gen_gvec_smax) -TRANS(vmax_w, ALL, gvec_vvv, MO_32, tcg_gen_gvec_smax) -TRANS(vmax_d, ALL, gvec_vvv, MO_64, tcg_gen_gvec_smax) -TRANS(vmax_bu, ALL, gvec_vvv, MO_8, tcg_gen_gvec_umax) -TRANS(vmax_hu, ALL, gvec_vvv, MO_16, tcg_gen_gvec_umax) -TRANS(vmax_wu, ALL, gvec_vvv, MO_32, tcg_gen_gvec_umax) -TRANS(vmax_du, ALL, gvec_vvv, MO_64, tcg_gen_gvec_umax) +TRANS(vmax_b, LSX, gvec_vvv, MO_8, tcg_gen_gvec_smax) +TRANS(vmax_h, LSX, gvec_vvv, MO_16, tcg_gen_gvec_smax) +TRANS(vmax_w, LSX, gvec_vvv, MO_32, tcg_gen_gvec_smax) +TRANS(vmax_d, LSX, gvec_vvv, MO_64, tcg_gen_gvec_smax) +TRANS(vmax_bu, LSX, gvec_vvv, MO_8, tcg_gen_gvec_umax) +TRANS(vmax_hu, LSX, gvec_vvv, MO_16, tcg_gen_gvec_umax) +TRANS(vmax_wu, LSX, gvec_vvv, MO_32, tcg_gen_gvec_umax) +TRANS(vmax_du, LSX, gvec_vvv, MO_64, tcg_gen_gvec_umax) -TRANS(vmin_b, ALL, gvec_vvv, MO_8, tcg_gen_gvec_smin) -TRANS(vmin_h, ALL, gvec_vvv, MO_16, tcg_gen_gvec_smin) -TRANS(vmin_w, ALL, gvec_vvv, MO_32, tcg_gen_gvec_smin) -TRANS(vmin_d, ALL, gvec_vvv, MO_64, tcg_gen_gvec_smin) -TRANS(vmin_bu, ALL, gvec_vvv, MO_8, tcg_gen_gvec_umin) -TRANS(vmin_hu, ALL, gvec_vvv, MO_16, tcg_gen_gvec_umin) -TRANS(vmin_wu, ALL, gvec_vvv, MO_32, tcg_gen_gvec_umin) -TRANS(vmin_du, ALL, gvec_vvv, MO_64, tcg_gen_gvec_umin) +TRANS(vmin_b, LSX, gvec_vvv, MO_8, tcg_gen_gvec_smin) +TRANS(vmin_h, LSX, gvec_vvv, MO_16, tcg_gen_gvec_smin) +TRANS(vmin_w, LSX, gvec_vvv, MO_32, tcg_gen_gvec_smin) +TRANS(vmin_d, LSX, gvec_vvv, MO_64, tcg_gen_gvec_smin) +TRANS(vmin_bu, LSX, gvec_vvv, MO_8, tcg_gen_gvec_umin) +TRANS(vmin_hu, LSX, gvec_vvv, MO_16, tcg_gen_gvec_umin) +TRANS(vmin_wu, LSX, gvec_vvv, MO_32, tcg_gen_gvec_umin) +TRANS(vmin_du, LSX, gvec_vvv, MO_64, tcg_gen_gvec_umin) static void gen_vmini_s(unsigned vece, TCGv_vec t, TCGv_vec a, int64_t imm) { @@ -1473,14 +1477,14 @@ static void do_vmini_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_2i(vd_ofs, vj_ofs, oprsz, maxsz, imm, &op[vece]); } -TRANS(vmini_b, ALL, gvec_vv_i, MO_8, do_vmini_s) -TRANS(vmini_h, ALL, gvec_vv_i, MO_16, do_vmini_s) -TRANS(vmini_w, ALL, gvec_vv_i, MO_32, do_vmini_s) -TRANS(vmini_d, ALL, gvec_vv_i, MO_64, do_vmini_s) -TRANS(vmini_bu, ALL, gvec_vv_i, MO_8, do_vmini_u) -TRANS(vmini_hu, ALL, gvec_vv_i, MO_16, do_vmini_u) -TRANS(vmini_wu, ALL, gvec_vv_i, MO_32, do_vmini_u) -TRANS(vmini_du, ALL, gvec_vv_i, MO_64, do_vmini_u) +TRANS(vmini_b, LSX, gvec_vv_i, MO_8, do_vmini_s) +TRANS(vmini_h, LSX, gvec_vv_i, MO_16, do_vmini_s) +TRANS(vmini_w, LSX, gvec_vv_i, MO_32, do_vmini_s) +TRANS(vmini_d, LSX, gvec_vv_i, MO_64, do_vmini_s) +TRANS(vmini_bu, LSX, gvec_vv_i, MO_8, do_vmini_u) +TRANS(vmini_hu, LSX, gvec_vv_i, MO_16, do_vmini_u) +TRANS(vmini_wu, LSX, gvec_vv_i, MO_32, do_vmini_u) +TRANS(vmini_du, LSX, gvec_vv_i, MO_64, do_vmini_u) static void do_vmaxi_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, int64_t imm, uint32_t oprsz, uint32_t maxsz) @@ -1554,19 +1558,19 @@ static void do_vmaxi_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_2i(vd_ofs, vj_ofs, oprsz, maxsz, imm, &op[vece]); } -TRANS(vmaxi_b, ALL, gvec_vv_i, MO_8, do_vmaxi_s) -TRANS(vmaxi_h, ALL, gvec_vv_i, MO_16, do_vmaxi_s) -TRANS(vmaxi_w, ALL, gvec_vv_i, MO_32, do_vmaxi_s) -TRANS(vmaxi_d, ALL, gvec_vv_i, MO_64, do_vmaxi_s) -TRANS(vmaxi_bu, ALL, gvec_vv_i, MO_8, do_vmaxi_u) -TRANS(vmaxi_hu, ALL, gvec_vv_i, MO_16, do_vmaxi_u) -TRANS(vmaxi_wu, ALL, gvec_vv_i, MO_32, do_vmaxi_u) -TRANS(vmaxi_du, ALL, gvec_vv_i, MO_64, do_vmaxi_u) +TRANS(vmaxi_b, LSX, gvec_vv_i, MO_8, do_vmaxi_s) +TRANS(vmaxi_h, LSX, gvec_vv_i, MO_16, do_vmaxi_s) +TRANS(vmaxi_w, LSX, gvec_vv_i, MO_32, do_vmaxi_s) +TRANS(vmaxi_d, LSX, gvec_vv_i, MO_64, do_vmaxi_s) +TRANS(vmaxi_bu, LSX, gvec_vv_i, MO_8, do_vmaxi_u) +TRANS(vmaxi_hu, LSX, gvec_vv_i, MO_16, do_vmaxi_u) +TRANS(vmaxi_wu, LSX, gvec_vv_i, MO_32, do_vmaxi_u) +TRANS(vmaxi_du, LSX, gvec_vv_i, MO_64, do_vmaxi_u) -TRANS(vmul_b, ALL, gvec_vvv, MO_8, tcg_gen_gvec_mul) -TRANS(vmul_h, ALL, gvec_vvv, MO_16, tcg_gen_gvec_mul) -TRANS(vmul_w, ALL, gvec_vvv, MO_32, tcg_gen_gvec_mul) -TRANS(vmul_d, ALL, gvec_vvv, MO_64, tcg_gen_gvec_mul) +TRANS(vmul_b, LSX, gvec_vvv, MO_8, tcg_gen_gvec_mul) +TRANS(vmul_h, LSX, gvec_vvv, MO_16, tcg_gen_gvec_mul) +TRANS(vmul_w, LSX, gvec_vvv, MO_32, tcg_gen_gvec_mul) +TRANS(vmul_d, LSX, gvec_vvv, MO_64, tcg_gen_gvec_mul) static void gen_vmuh_w(TCGv_i32 t, TCGv_i32 a, TCGv_i32 b) { @@ -1607,10 +1611,10 @@ static void do_vmuh_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmuh_b, ALL, gvec_vvv, MO_8, do_vmuh_s) -TRANS(vmuh_h, ALL, gvec_vvv, MO_16, do_vmuh_s) -TRANS(vmuh_w, ALL, gvec_vvv, MO_32, do_vmuh_s) -TRANS(vmuh_d, ALL, gvec_vvv, MO_64, do_vmuh_s) +TRANS(vmuh_b, LSX, gvec_vvv, MO_8, do_vmuh_s) +TRANS(vmuh_h, LSX, gvec_vvv, MO_16, do_vmuh_s) +TRANS(vmuh_w, LSX, gvec_vvv, MO_32, do_vmuh_s) +TRANS(vmuh_d, LSX, gvec_vvv, MO_64, do_vmuh_s) static void gen_vmuh_wu(TCGv_i32 t, TCGv_i32 a, TCGv_i32 b) { @@ -1651,10 +1655,10 @@ static void do_vmuh_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmuh_bu, ALL, gvec_vvv, MO_8, do_vmuh_u) -TRANS(vmuh_hu, ALL, gvec_vvv, MO_16, do_vmuh_u) -TRANS(vmuh_wu, ALL, gvec_vvv, MO_32, do_vmuh_u) -TRANS(vmuh_du, ALL, gvec_vvv, MO_64, do_vmuh_u) +TRANS(vmuh_bu, LSX, gvec_vvv, MO_8, do_vmuh_u) +TRANS(vmuh_hu, LSX, gvec_vvv, MO_16, do_vmuh_u) +TRANS(vmuh_wu, LSX, gvec_vvv, MO_32, do_vmuh_u) +TRANS(vmuh_du, LSX, gvec_vvv, MO_64, do_vmuh_u) static void gen_vmulwev_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -1724,9 +1728,9 @@ static void do_vmulwev_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmulwev_h_b, ALL, gvec_vvv, MO_8, do_vmulwev_s) -TRANS(vmulwev_w_h, ALL, gvec_vvv, MO_16, do_vmulwev_s) -TRANS(vmulwev_d_w, ALL, gvec_vvv, MO_32, do_vmulwev_s) +TRANS(vmulwev_h_b, LSX, gvec_vvv, MO_8, do_vmulwev_s) +TRANS(vmulwev_w_h, LSX, gvec_vvv, MO_16, do_vmulwev_s) +TRANS(vmulwev_d_w, LSX, gvec_vvv, MO_32, do_vmulwev_s) static void tcg_gen_mulus2_i64(TCGv_i64 rl, TCGv_i64 rh, TCGv_i64 arg1, TCGv_i64 arg2) @@ -1739,6 +1743,10 @@ static bool trans_## NAME (DisasContext *ctx, arg_vvv *a) \ { \ TCGv_i64 rh, rl, arg1, arg2; \ \ + if (!avail_LSX(ctx)) { \ + return false; \ + } \ + \ rh = tcg_temp_new_i64(); \ rl = tcg_temp_new_i64(); \ arg1 = tcg_temp_new_i64(); \ @@ -1828,9 +1836,9 @@ static void do_vmulwod_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmulwod_h_b, ALL, gvec_vvv, MO_8, do_vmulwod_s) -TRANS(vmulwod_w_h, ALL, gvec_vvv, MO_16, do_vmulwod_s) -TRANS(vmulwod_d_w, ALL, gvec_vvv, MO_32, do_vmulwod_s) +TRANS(vmulwod_h_b, LSX, gvec_vvv, MO_8, do_vmulwod_s) +TRANS(vmulwod_w_h, LSX, gvec_vvv, MO_16, do_vmulwod_s) +TRANS(vmulwod_d_w, LSX, gvec_vvv, MO_32, do_vmulwod_s) static void gen_vmulwev_u(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -1898,9 +1906,9 @@ static void do_vmulwev_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmulwev_h_bu, ALL, gvec_vvv, MO_8, do_vmulwev_u) -TRANS(vmulwev_w_hu, ALL, gvec_vvv, MO_16, do_vmulwev_u) -TRANS(vmulwev_d_wu, ALL, gvec_vvv, MO_32, do_vmulwev_u) +TRANS(vmulwev_h_bu, LSX, gvec_vvv, MO_8, do_vmulwev_u) +TRANS(vmulwev_w_hu, LSX, gvec_vvv, MO_16, do_vmulwev_u) +TRANS(vmulwev_d_wu, LSX, gvec_vvv, MO_32, do_vmulwev_u) static void gen_vmulwod_u(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -1968,9 +1976,9 @@ static void do_vmulwod_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmulwod_h_bu, ALL, gvec_vvv, MO_8, do_vmulwod_u) -TRANS(vmulwod_w_hu, ALL, gvec_vvv, MO_16, do_vmulwod_u) -TRANS(vmulwod_d_wu, ALL, gvec_vvv, MO_32, do_vmulwod_u) +TRANS(vmulwod_h_bu, LSX, gvec_vvv, MO_8, do_vmulwod_u) +TRANS(vmulwod_w_hu, LSX, gvec_vvv, MO_16, do_vmulwod_u) +TRANS(vmulwod_d_wu, LSX, gvec_vvv, MO_32, do_vmulwod_u) static void gen_vmulwev_u_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -2040,9 +2048,9 @@ static void do_vmulwev_u_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmulwev_h_bu_b, ALL, gvec_vvv, MO_8, do_vmulwev_u_s) -TRANS(vmulwev_w_hu_h, ALL, gvec_vvv, MO_16, do_vmulwev_u_s) -TRANS(vmulwev_d_wu_w, ALL, gvec_vvv, MO_32, do_vmulwev_u_s) +TRANS(vmulwev_h_bu_b, LSX, gvec_vvv, MO_8, do_vmulwev_u_s) +TRANS(vmulwev_w_hu_h, LSX, gvec_vvv, MO_16, do_vmulwev_u_s) +TRANS(vmulwev_d_wu_w, LSX, gvec_vvv, MO_32, do_vmulwev_u_s) static void gen_vmulwod_u_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -2109,9 +2117,9 @@ static void do_vmulwod_u_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmulwod_h_bu_b, ALL, gvec_vvv, MO_8, do_vmulwod_u_s) -TRANS(vmulwod_w_hu_h, ALL, gvec_vvv, MO_16, do_vmulwod_u_s) -TRANS(vmulwod_d_wu_w, ALL, gvec_vvv, MO_32, do_vmulwod_u_s) +TRANS(vmulwod_h_bu_b, LSX, gvec_vvv, MO_8, do_vmulwod_u_s) +TRANS(vmulwod_w_hu_h, LSX, gvec_vvv, MO_16, do_vmulwod_u_s) +TRANS(vmulwod_d_wu_w, LSX, gvec_vvv, MO_32, do_vmulwod_u_s) static void gen_vmadd(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -2182,10 +2190,10 @@ static void do_vmadd(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmadd_b, ALL, gvec_vvv, MO_8, do_vmadd) -TRANS(vmadd_h, ALL, gvec_vvv, MO_16, do_vmadd) -TRANS(vmadd_w, ALL, gvec_vvv, MO_32, do_vmadd) -TRANS(vmadd_d, ALL, gvec_vvv, MO_64, do_vmadd) +TRANS(vmadd_b, LSX, gvec_vvv, MO_8, do_vmadd) +TRANS(vmadd_h, LSX, gvec_vvv, MO_16, do_vmadd) +TRANS(vmadd_w, LSX, gvec_vvv, MO_32, do_vmadd) +TRANS(vmadd_d, LSX, gvec_vvv, MO_64, do_vmadd) static void gen_vmsub(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -2256,10 +2264,10 @@ static void do_vmsub(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmsub_b, ALL, gvec_vvv, MO_8, do_vmsub) -TRANS(vmsub_h, ALL, gvec_vvv, MO_16, do_vmsub) -TRANS(vmsub_w, ALL, gvec_vvv, MO_32, do_vmsub) -TRANS(vmsub_d, ALL, gvec_vvv, MO_64, do_vmsub) +TRANS(vmsub_b, LSX, gvec_vvv, MO_8, do_vmsub) +TRANS(vmsub_h, LSX, gvec_vvv, MO_16, do_vmsub) +TRANS(vmsub_w, LSX, gvec_vvv, MO_32, do_vmsub) +TRANS(vmsub_d, LSX, gvec_vvv, MO_64, do_vmsub) static void gen_vmaddwev_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -2331,15 +2339,19 @@ static void do_vmaddwev_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmaddwev_h_b, ALL, gvec_vvv, MO_8, do_vmaddwev_s) -TRANS(vmaddwev_w_h, ALL, gvec_vvv, MO_16, do_vmaddwev_s) -TRANS(vmaddwev_d_w, ALL, gvec_vvv, MO_32, do_vmaddwev_s) +TRANS(vmaddwev_h_b, LSX, gvec_vvv, MO_8, do_vmaddwev_s) +TRANS(vmaddwev_w_h, LSX, gvec_vvv, MO_16, do_vmaddwev_s) +TRANS(vmaddwev_d_w, LSX, gvec_vvv, MO_32, do_vmaddwev_s) #define VMADD_Q(NAME, FN, idx1, idx2) \ static bool trans_## NAME (DisasContext *ctx, arg_vvv *a) \ { \ TCGv_i64 rh, rl, arg1, arg2, th, tl; \ \ + if (!avail_LSX(ctx)) { \ + return false; \ + } \ + \ rh = tcg_temp_new_i64(); \ rl = tcg_temp_new_i64(); \ arg1 = tcg_temp_new_i64(); \ @@ -2435,9 +2447,9 @@ static void do_vmaddwod_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmaddwod_h_b, ALL, gvec_vvv, MO_8, do_vmaddwod_s) -TRANS(vmaddwod_w_h, ALL, gvec_vvv, MO_16, do_vmaddwod_s) -TRANS(vmaddwod_d_w, ALL, gvec_vvv, MO_32, do_vmaddwod_s) +TRANS(vmaddwod_h_b, LSX, gvec_vvv, MO_8, do_vmaddwod_s) +TRANS(vmaddwod_w_h, LSX, gvec_vvv, MO_16, do_vmaddwod_s) +TRANS(vmaddwod_d_w, LSX, gvec_vvv, MO_32, do_vmaddwod_s) static void gen_vmaddwev_u(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -2505,9 +2517,9 @@ static void do_vmaddwev_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmaddwev_h_bu, ALL, gvec_vvv, MO_8, do_vmaddwev_u) -TRANS(vmaddwev_w_hu, ALL, gvec_vvv, MO_16, do_vmaddwev_u) -TRANS(vmaddwev_d_wu, ALL, gvec_vvv, MO_32, do_vmaddwev_u) +TRANS(vmaddwev_h_bu, LSX, gvec_vvv, MO_8, do_vmaddwev_u) +TRANS(vmaddwev_w_hu, LSX, gvec_vvv, MO_16, do_vmaddwev_u) +TRANS(vmaddwev_d_wu, LSX, gvec_vvv, MO_32, do_vmaddwev_u) static void gen_vmaddwod_u(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -2576,9 +2588,9 @@ static void do_vmaddwod_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmaddwod_h_bu, ALL, gvec_vvv, MO_8, do_vmaddwod_u) -TRANS(vmaddwod_w_hu, ALL, gvec_vvv, MO_16, do_vmaddwod_u) -TRANS(vmaddwod_d_wu, ALL, gvec_vvv, MO_32, do_vmaddwod_u) +TRANS(vmaddwod_h_bu, LSX, gvec_vvv, MO_8, do_vmaddwod_u) +TRANS(vmaddwod_w_hu, LSX, gvec_vvv, MO_16, do_vmaddwod_u) +TRANS(vmaddwod_d_wu, LSX, gvec_vvv, MO_32, do_vmaddwod_u) static void gen_vmaddwev_u_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -2649,9 +2661,9 @@ static void do_vmaddwev_u_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmaddwev_h_bu_b, ALL, gvec_vvv, MO_8, do_vmaddwev_u_s) -TRANS(vmaddwev_w_hu_h, ALL, gvec_vvv, MO_16, do_vmaddwev_u_s) -TRANS(vmaddwev_d_wu_w, ALL, gvec_vvv, MO_32, do_vmaddwev_u_s) +TRANS(vmaddwev_h_bu_b, LSX, gvec_vvv, MO_8, do_vmaddwev_u_s) +TRANS(vmaddwev_w_hu_h, LSX, gvec_vvv, MO_16, do_vmaddwev_u_s) +TRANS(vmaddwev_d_wu_w, LSX, gvec_vvv, MO_32, do_vmaddwev_u_s) static void gen_vmaddwod_u_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -2721,26 +2733,26 @@ static void do_vmaddwod_u_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vmaddwod_h_bu_b, ALL, gvec_vvv, MO_8, do_vmaddwod_u_s) -TRANS(vmaddwod_w_hu_h, ALL, gvec_vvv, MO_16, do_vmaddwod_u_s) -TRANS(vmaddwod_d_wu_w, ALL, gvec_vvv, MO_32, do_vmaddwod_u_s) +TRANS(vmaddwod_h_bu_b, LSX, gvec_vvv, MO_8, do_vmaddwod_u_s) +TRANS(vmaddwod_w_hu_h, LSX, gvec_vvv, MO_16, do_vmaddwod_u_s) +TRANS(vmaddwod_d_wu_w, LSX, gvec_vvv, MO_32, do_vmaddwod_u_s) -TRANS(vdiv_b, ALL, gen_vvv, gen_helper_vdiv_b) -TRANS(vdiv_h, ALL, gen_vvv, gen_helper_vdiv_h) -TRANS(vdiv_w, ALL, gen_vvv, gen_helper_vdiv_w) -TRANS(vdiv_d, ALL, gen_vvv, gen_helper_vdiv_d) -TRANS(vdiv_bu, ALL, gen_vvv, gen_helper_vdiv_bu) -TRANS(vdiv_hu, ALL, gen_vvv, gen_helper_vdiv_hu) -TRANS(vdiv_wu, ALL, gen_vvv, gen_helper_vdiv_wu) -TRANS(vdiv_du, ALL, gen_vvv, gen_helper_vdiv_du) -TRANS(vmod_b, ALL, gen_vvv, gen_helper_vmod_b) -TRANS(vmod_h, ALL, gen_vvv, gen_helper_vmod_h) -TRANS(vmod_w, ALL, gen_vvv, gen_helper_vmod_w) -TRANS(vmod_d, ALL, gen_vvv, gen_helper_vmod_d) -TRANS(vmod_bu, ALL, gen_vvv, gen_helper_vmod_bu) -TRANS(vmod_hu, ALL, gen_vvv, gen_helper_vmod_hu) -TRANS(vmod_wu, ALL, gen_vvv, gen_helper_vmod_wu) -TRANS(vmod_du, ALL, gen_vvv, gen_helper_vmod_du) +TRANS(vdiv_b, LSX, gen_vvv, gen_helper_vdiv_b) +TRANS(vdiv_h, LSX, gen_vvv, gen_helper_vdiv_h) +TRANS(vdiv_w, LSX, gen_vvv, gen_helper_vdiv_w) +TRANS(vdiv_d, LSX, gen_vvv, gen_helper_vdiv_d) +TRANS(vdiv_bu, LSX, gen_vvv, gen_helper_vdiv_bu) +TRANS(vdiv_hu, LSX, gen_vvv, gen_helper_vdiv_hu) +TRANS(vdiv_wu, LSX, gen_vvv, gen_helper_vdiv_wu) +TRANS(vdiv_du, LSX, gen_vvv, gen_helper_vdiv_du) +TRANS(vmod_b, LSX, gen_vvv, gen_helper_vmod_b) +TRANS(vmod_h, LSX, gen_vvv, gen_helper_vmod_h) +TRANS(vmod_w, LSX, gen_vvv, gen_helper_vmod_w) +TRANS(vmod_d, LSX, gen_vvv, gen_helper_vmod_d) +TRANS(vmod_bu, LSX, gen_vvv, gen_helper_vmod_bu) +TRANS(vmod_hu, LSX, gen_vvv, gen_helper_vmod_hu) +TRANS(vmod_wu, LSX, gen_vvv, gen_helper_vmod_wu) +TRANS(vmod_du, LSX, gen_vvv, gen_helper_vmod_du) static void gen_vsat_s(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec max) { @@ -2789,10 +2801,10 @@ static void do_vsat_s(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_constant_i64((1ll<< imm) -1), &op[vece]); } -TRANS(vsat_b, ALL, gvec_vv_i, MO_8, do_vsat_s) -TRANS(vsat_h, ALL, gvec_vv_i, MO_16, do_vsat_s) -TRANS(vsat_w, ALL, gvec_vv_i, MO_32, do_vsat_s) -TRANS(vsat_d, ALL, gvec_vv_i, MO_64, do_vsat_s) +TRANS(vsat_b, LSX, gvec_vv_i, MO_8, do_vsat_s) +TRANS(vsat_h, LSX, gvec_vv_i, MO_16, do_vsat_s) +TRANS(vsat_w, LSX, gvec_vv_i, MO_32, do_vsat_s) +TRANS(vsat_d, LSX, gvec_vv_i, MO_64, do_vsat_s) static void gen_vsat_u(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec max) { @@ -2838,19 +2850,19 @@ static void do_vsat_u(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_constant_i64(max), &op[vece]); } -TRANS(vsat_bu, ALL, gvec_vv_i, MO_8, do_vsat_u) -TRANS(vsat_hu, ALL, gvec_vv_i, MO_16, do_vsat_u) -TRANS(vsat_wu, ALL, gvec_vv_i, MO_32, do_vsat_u) -TRANS(vsat_du, ALL, gvec_vv_i, MO_64, do_vsat_u) +TRANS(vsat_bu, LSX, gvec_vv_i, MO_8, do_vsat_u) +TRANS(vsat_hu, LSX, gvec_vv_i, MO_16, do_vsat_u) +TRANS(vsat_wu, LSX, gvec_vv_i, MO_32, do_vsat_u) +TRANS(vsat_du, LSX, gvec_vv_i, MO_64, do_vsat_u) -TRANS(vexth_h_b, ALL, gen_vv, gen_helper_vexth_h_b) -TRANS(vexth_w_h, ALL, gen_vv, gen_helper_vexth_w_h) -TRANS(vexth_d_w, ALL, gen_vv, gen_helper_vexth_d_w) -TRANS(vexth_q_d, ALL, gen_vv, gen_helper_vexth_q_d) -TRANS(vexth_hu_bu, ALL, gen_vv, gen_helper_vexth_hu_bu) -TRANS(vexth_wu_hu, ALL, gen_vv, gen_helper_vexth_wu_hu) -TRANS(vexth_du_wu, ALL, gen_vv, gen_helper_vexth_du_wu) -TRANS(vexth_qu_du, ALL, gen_vv, gen_helper_vexth_qu_du) +TRANS(vexth_h_b, LSX, gen_vv, gen_helper_vexth_h_b) +TRANS(vexth_w_h, LSX, gen_vv, gen_helper_vexth_w_h) +TRANS(vexth_d_w, LSX, gen_vv, gen_helper_vexth_d_w) +TRANS(vexth_q_d, LSX, gen_vv, gen_helper_vexth_q_d) +TRANS(vexth_hu_bu, LSX, gen_vv, gen_helper_vexth_hu_bu) +TRANS(vexth_wu_hu, LSX, gen_vv, gen_helper_vexth_wu_hu) +TRANS(vexth_du_wu, LSX, gen_vv, gen_helper_vexth_du_wu) +TRANS(vexth_qu_du, LSX, gen_vv, gen_helper_vexth_qu_du) static void gen_vsigncov(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b) { @@ -2900,17 +2912,17 @@ static void do_vsigncov(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vsigncov_b, ALL, gvec_vvv, MO_8, do_vsigncov) -TRANS(vsigncov_h, ALL, gvec_vvv, MO_16, do_vsigncov) -TRANS(vsigncov_w, ALL, gvec_vvv, MO_32, do_vsigncov) -TRANS(vsigncov_d, ALL, gvec_vvv, MO_64, do_vsigncov) +TRANS(vsigncov_b, LSX, gvec_vvv, MO_8, do_vsigncov) +TRANS(vsigncov_h, LSX, gvec_vvv, MO_16, do_vsigncov) +TRANS(vsigncov_w, LSX, gvec_vvv, MO_32, do_vsigncov) +TRANS(vsigncov_d, LSX, gvec_vvv, MO_64, do_vsigncov) -TRANS(vmskltz_b, ALL, gen_vv, gen_helper_vmskltz_b) -TRANS(vmskltz_h, ALL, gen_vv, gen_helper_vmskltz_h) -TRANS(vmskltz_w, ALL, gen_vv, gen_helper_vmskltz_w) -TRANS(vmskltz_d, ALL, gen_vv, gen_helper_vmskltz_d) -TRANS(vmskgez_b, ALL, gen_vv, gen_helper_vmskgez_b) -TRANS(vmsknz_b, ALL, gen_vv, gen_helper_vmsknz_b) +TRANS(vmskltz_b, LSX, gen_vv, gen_helper_vmskltz_b) +TRANS(vmskltz_h, LSX, gen_vv, gen_helper_vmskltz_h) +TRANS(vmskltz_w, LSX, gen_vv, gen_helper_vmskltz_w) +TRANS(vmskltz_d, LSX, gen_vv, gen_helper_vmskltz_d) +TRANS(vmskgez_b, LSX, gen_vv, gen_helper_vmskgez_b) +TRANS(vmsknz_b, LSX, gen_vv, gen_helper_vmsknz_b) #define EXPAND_BYTE(bit) ((uint64_t)(bit ? 0xff : 0)) @@ -3032,6 +3044,11 @@ static bool trans_vldi(DisasContext *ctx, arg_vldi *a) { int sel, vece; uint64_t value; + + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; sel = (a->imm >> 12) & 0x1; @@ -3049,15 +3066,19 @@ static bool trans_vldi(DisasContext *ctx, arg_vldi *a) return true; } -TRANS(vand_v, ALL, gvec_vvv, MO_64, tcg_gen_gvec_and) -TRANS(vor_v, ALL, gvec_vvv, MO_64, tcg_gen_gvec_or) -TRANS(vxor_v, ALL, gvec_vvv, MO_64, tcg_gen_gvec_xor) -TRANS(vnor_v, ALL, gvec_vvv, MO_64, tcg_gen_gvec_nor) +TRANS(vand_v, LSX, gvec_vvv, MO_64, tcg_gen_gvec_and) +TRANS(vor_v, LSX, gvec_vvv, MO_64, tcg_gen_gvec_or) +TRANS(vxor_v, LSX, gvec_vvv, MO_64, tcg_gen_gvec_xor) +TRANS(vnor_v, LSX, gvec_vvv, MO_64, tcg_gen_gvec_nor) static bool trans_vandn_v(DisasContext *ctx, arg_vvv *a) { uint32_t vd_ofs, vj_ofs, vk_ofs; + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; vd_ofs = vec_full_offset(a->vd); @@ -3067,10 +3088,10 @@ static bool trans_vandn_v(DisasContext *ctx, arg_vvv *a) tcg_gen_gvec_andc(MO_64, vd_ofs, vk_ofs, vj_ofs, 16, ctx->vl/8); return true; } -TRANS(vorn_v, ALL, gvec_vvv, MO_64, tcg_gen_gvec_orc) -TRANS(vandi_b, ALL, gvec_vv_i, MO_8, tcg_gen_gvec_andi) -TRANS(vori_b, ALL, gvec_vv_i, MO_8, tcg_gen_gvec_ori) -TRANS(vxori_b, ALL, gvec_vv_i, MO_8, tcg_gen_gvec_xori) +TRANS(vorn_v, LSX, gvec_vvv, MO_64, tcg_gen_gvec_orc) +TRANS(vandi_b, LSX, gvec_vv_i, MO_8, tcg_gen_gvec_andi) +TRANS(vori_b, LSX, gvec_vv_i, MO_8, tcg_gen_gvec_ori) +TRANS(vxori_b, LSX, gvec_vv_i, MO_8, tcg_gen_gvec_xori) static void gen_vnori(unsigned vece, TCGv_vec t, TCGv_vec a, int64_t imm) { @@ -3103,176 +3124,176 @@ static void do_vnori_b(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_2i(vd_ofs, vj_ofs, oprsz, maxsz, imm, &op); } -TRANS(vnori_b, ALL, gvec_vv_i, MO_8, do_vnori_b) +TRANS(vnori_b, LSX, gvec_vv_i, MO_8, do_vnori_b) -TRANS(vsll_b, ALL, gvec_vvv, MO_8, tcg_gen_gvec_shlv) -TRANS(vsll_h, ALL, gvec_vvv, MO_16, tcg_gen_gvec_shlv) -TRANS(vsll_w, ALL, gvec_vvv, MO_32, tcg_gen_gvec_shlv) -TRANS(vsll_d, ALL, gvec_vvv, MO_64, tcg_gen_gvec_shlv) -TRANS(vslli_b, ALL, gvec_vv_i, MO_8, tcg_gen_gvec_shli) -TRANS(vslli_h, ALL, gvec_vv_i, MO_16, tcg_gen_gvec_shli) -TRANS(vslli_w, ALL, gvec_vv_i, MO_32, tcg_gen_gvec_shli) -TRANS(vslli_d, ALL, gvec_vv_i, MO_64, tcg_gen_gvec_shli) +TRANS(vsll_b, LSX, gvec_vvv, MO_8, tcg_gen_gvec_shlv) +TRANS(vsll_h, LSX, gvec_vvv, MO_16, tcg_gen_gvec_shlv) +TRANS(vsll_w, LSX, gvec_vvv, MO_32, tcg_gen_gvec_shlv) +TRANS(vsll_d, LSX, gvec_vvv, MO_64, tcg_gen_gvec_shlv) +TRANS(vslli_b, LSX, gvec_vv_i, MO_8, tcg_gen_gvec_shli) +TRANS(vslli_h, LSX, gvec_vv_i, MO_16, tcg_gen_gvec_shli) +TRANS(vslli_w, LSX, gvec_vv_i, MO_32, tcg_gen_gvec_shli) +TRANS(vslli_d, LSX, gvec_vv_i, MO_64, tcg_gen_gvec_shli) -TRANS(vsrl_b, ALL, gvec_vvv, MO_8, tcg_gen_gvec_shrv) -TRANS(vsrl_h, ALL, gvec_vvv, MO_16, tcg_gen_gvec_shrv) -TRANS(vsrl_w, ALL, gvec_vvv, MO_32, tcg_gen_gvec_shrv) -TRANS(vsrl_d, ALL, gvec_vvv, MO_64, tcg_gen_gvec_shrv) -TRANS(vsrli_b, ALL, gvec_vv_i, MO_8, tcg_gen_gvec_shri) -TRANS(vsrli_h, ALL, gvec_vv_i, MO_16, tcg_gen_gvec_shri) -TRANS(vsrli_w, ALL, gvec_vv_i, MO_32, tcg_gen_gvec_shri) -TRANS(vsrli_d, ALL, gvec_vv_i, MO_64, tcg_gen_gvec_shri) +TRANS(vsrl_b, LSX, gvec_vvv, MO_8, tcg_gen_gvec_shrv) +TRANS(vsrl_h, LSX, gvec_vvv, MO_16, tcg_gen_gvec_shrv) +TRANS(vsrl_w, LSX, gvec_vvv, MO_32, tcg_gen_gvec_shrv) +TRANS(vsrl_d, LSX, gvec_vvv, MO_64, tcg_gen_gvec_shrv) +TRANS(vsrli_b, LSX, gvec_vv_i, MO_8, tcg_gen_gvec_shri) +TRANS(vsrli_h, LSX, gvec_vv_i, MO_16, tcg_gen_gvec_shri) +TRANS(vsrli_w, LSX, gvec_vv_i, MO_32, tcg_gen_gvec_shri) +TRANS(vsrli_d, LSX, gvec_vv_i, MO_64, tcg_gen_gvec_shri) -TRANS(vsra_b, ALL, gvec_vvv, MO_8, tcg_gen_gvec_sarv) -TRANS(vsra_h, ALL, gvec_vvv, MO_16, tcg_gen_gvec_sarv) -TRANS(vsra_w, ALL, gvec_vvv, MO_32, tcg_gen_gvec_sarv) -TRANS(vsra_d, ALL, gvec_vvv, MO_64, tcg_gen_gvec_sarv) -TRANS(vsrai_b, ALL, gvec_vv_i, MO_8, tcg_gen_gvec_sari) -TRANS(vsrai_h, ALL, gvec_vv_i, MO_16, tcg_gen_gvec_sari) -TRANS(vsrai_w, ALL, gvec_vv_i, MO_32, tcg_gen_gvec_sari) -TRANS(vsrai_d, ALL, gvec_vv_i, MO_64, tcg_gen_gvec_sari) +TRANS(vsra_b, LSX, gvec_vvv, MO_8, tcg_gen_gvec_sarv) +TRANS(vsra_h, LSX, gvec_vvv, MO_16, tcg_gen_gvec_sarv) +TRANS(vsra_w, LSX, gvec_vvv, MO_32, tcg_gen_gvec_sarv) +TRANS(vsra_d, LSX, gvec_vvv, MO_64, tcg_gen_gvec_sarv) +TRANS(vsrai_b, LSX, gvec_vv_i, MO_8, tcg_gen_gvec_sari) +TRANS(vsrai_h, LSX, gvec_vv_i, MO_16, tcg_gen_gvec_sari) +TRANS(vsrai_w, LSX, gvec_vv_i, MO_32, tcg_gen_gvec_sari) +TRANS(vsrai_d, LSX, gvec_vv_i, MO_64, tcg_gen_gvec_sari) -TRANS(vrotr_b, ALL, gvec_vvv, MO_8, tcg_gen_gvec_rotrv) -TRANS(vrotr_h, ALL, gvec_vvv, MO_16, tcg_gen_gvec_rotrv) -TRANS(vrotr_w, ALL, gvec_vvv, MO_32, tcg_gen_gvec_rotrv) -TRANS(vrotr_d, ALL, gvec_vvv, MO_64, tcg_gen_gvec_rotrv) -TRANS(vrotri_b, ALL, gvec_vv_i, MO_8, tcg_gen_gvec_rotri) -TRANS(vrotri_h, ALL, gvec_vv_i, MO_16, tcg_gen_gvec_rotri) -TRANS(vrotri_w, ALL, gvec_vv_i, MO_32, tcg_gen_gvec_rotri) -TRANS(vrotri_d, ALL, gvec_vv_i, MO_64, tcg_gen_gvec_rotri) +TRANS(vrotr_b, LSX, gvec_vvv, MO_8, tcg_gen_gvec_rotrv) +TRANS(vrotr_h, LSX, gvec_vvv, MO_16, tcg_gen_gvec_rotrv) +TRANS(vrotr_w, LSX, gvec_vvv, MO_32, tcg_gen_gvec_rotrv) +TRANS(vrotr_d, LSX, gvec_vvv, MO_64, tcg_gen_gvec_rotrv) +TRANS(vrotri_b, LSX, gvec_vv_i, MO_8, tcg_gen_gvec_rotri) +TRANS(vrotri_h, LSX, gvec_vv_i, MO_16, tcg_gen_gvec_rotri) +TRANS(vrotri_w, LSX, gvec_vv_i, MO_32, tcg_gen_gvec_rotri) +TRANS(vrotri_d, LSX, gvec_vv_i, MO_64, tcg_gen_gvec_rotri) -TRANS(vsllwil_h_b, ALL, gen_vv_i, gen_helper_vsllwil_h_b) -TRANS(vsllwil_w_h, ALL, gen_vv_i, gen_helper_vsllwil_w_h) -TRANS(vsllwil_d_w, ALL, gen_vv_i, gen_helper_vsllwil_d_w) -TRANS(vextl_q_d, ALL, gen_vv, gen_helper_vextl_q_d) -TRANS(vsllwil_hu_bu, ALL, gen_vv_i, gen_helper_vsllwil_hu_bu) -TRANS(vsllwil_wu_hu, ALL, gen_vv_i, gen_helper_vsllwil_wu_hu) -TRANS(vsllwil_du_wu, ALL, gen_vv_i, gen_helper_vsllwil_du_wu) -TRANS(vextl_qu_du, ALL, gen_vv, gen_helper_vextl_qu_du) +TRANS(vsllwil_h_b, LSX, gen_vv_i, gen_helper_vsllwil_h_b) +TRANS(vsllwil_w_h, LSX, gen_vv_i, gen_helper_vsllwil_w_h) +TRANS(vsllwil_d_w, LSX, gen_vv_i, gen_helper_vsllwil_d_w) +TRANS(vextl_q_d, LSX, gen_vv, gen_helper_vextl_q_d) +TRANS(vsllwil_hu_bu, LSX, gen_vv_i, gen_helper_vsllwil_hu_bu) +TRANS(vsllwil_wu_hu, LSX, gen_vv_i, gen_helper_vsllwil_wu_hu) +TRANS(vsllwil_du_wu, LSX, gen_vv_i, gen_helper_vsllwil_du_wu) +TRANS(vextl_qu_du, LSX, gen_vv, gen_helper_vextl_qu_du) -TRANS(vsrlr_b, ALL, gen_vvv, gen_helper_vsrlr_b) -TRANS(vsrlr_h, ALL, gen_vvv, gen_helper_vsrlr_h) -TRANS(vsrlr_w, ALL, gen_vvv, gen_helper_vsrlr_w) -TRANS(vsrlr_d, ALL, gen_vvv, gen_helper_vsrlr_d) -TRANS(vsrlri_b, ALL, gen_vv_i, gen_helper_vsrlri_b) -TRANS(vsrlri_h, ALL, gen_vv_i, gen_helper_vsrlri_h) -TRANS(vsrlri_w, ALL, gen_vv_i, gen_helper_vsrlri_w) -TRANS(vsrlri_d, ALL, gen_vv_i, gen_helper_vsrlri_d) +TRANS(vsrlr_b, LSX, gen_vvv, gen_helper_vsrlr_b) +TRANS(vsrlr_h, LSX, gen_vvv, gen_helper_vsrlr_h) +TRANS(vsrlr_w, LSX, gen_vvv, gen_helper_vsrlr_w) +TRANS(vsrlr_d, LSX, gen_vvv, gen_helper_vsrlr_d) +TRANS(vsrlri_b, LSX, gen_vv_i, gen_helper_vsrlri_b) +TRANS(vsrlri_h, LSX, gen_vv_i, gen_helper_vsrlri_h) +TRANS(vsrlri_w, LSX, gen_vv_i, gen_helper_vsrlri_w) +TRANS(vsrlri_d, LSX, gen_vv_i, gen_helper_vsrlri_d) -TRANS(vsrar_b, ALL, gen_vvv, gen_helper_vsrar_b) -TRANS(vsrar_h, ALL, gen_vvv, gen_helper_vsrar_h) -TRANS(vsrar_w, ALL, gen_vvv, gen_helper_vsrar_w) -TRANS(vsrar_d, ALL, gen_vvv, gen_helper_vsrar_d) -TRANS(vsrari_b, ALL, gen_vv_i, gen_helper_vsrari_b) -TRANS(vsrari_h, ALL, gen_vv_i, gen_helper_vsrari_h) -TRANS(vsrari_w, ALL, gen_vv_i, gen_helper_vsrari_w) -TRANS(vsrari_d, ALL, gen_vv_i, gen_helper_vsrari_d) +TRANS(vsrar_b, LSX, gen_vvv, gen_helper_vsrar_b) +TRANS(vsrar_h, LSX, gen_vvv, gen_helper_vsrar_h) +TRANS(vsrar_w, LSX, gen_vvv, gen_helper_vsrar_w) +TRANS(vsrar_d, LSX, gen_vvv, gen_helper_vsrar_d) +TRANS(vsrari_b, LSX, gen_vv_i, gen_helper_vsrari_b) +TRANS(vsrari_h, LSX, gen_vv_i, gen_helper_vsrari_h) +TRANS(vsrari_w, LSX, gen_vv_i, gen_helper_vsrari_w) +TRANS(vsrari_d, LSX, gen_vv_i, gen_helper_vsrari_d) -TRANS(vsrln_b_h, ALL, gen_vvv, gen_helper_vsrln_b_h) -TRANS(vsrln_h_w, ALL, gen_vvv, gen_helper_vsrln_h_w) -TRANS(vsrln_w_d, ALL, gen_vvv, gen_helper_vsrln_w_d) -TRANS(vsran_b_h, ALL, gen_vvv, gen_helper_vsran_b_h) -TRANS(vsran_h_w, ALL, gen_vvv, gen_helper_vsran_h_w) -TRANS(vsran_w_d, ALL, gen_vvv, gen_helper_vsran_w_d) +TRANS(vsrln_b_h, LSX, gen_vvv, gen_helper_vsrln_b_h) +TRANS(vsrln_h_w, LSX, gen_vvv, gen_helper_vsrln_h_w) +TRANS(vsrln_w_d, LSX, gen_vvv, gen_helper_vsrln_w_d) +TRANS(vsran_b_h, LSX, gen_vvv, gen_helper_vsran_b_h) +TRANS(vsran_h_w, LSX, gen_vvv, gen_helper_vsran_h_w) +TRANS(vsran_w_d, LSX, gen_vvv, gen_helper_vsran_w_d) -TRANS(vsrlni_b_h, ALL, gen_vv_i, gen_helper_vsrlni_b_h) -TRANS(vsrlni_h_w, ALL, gen_vv_i, gen_helper_vsrlni_h_w) -TRANS(vsrlni_w_d, ALL, gen_vv_i, gen_helper_vsrlni_w_d) -TRANS(vsrlni_d_q, ALL, gen_vv_i, gen_helper_vsrlni_d_q) -TRANS(vsrani_b_h, ALL, gen_vv_i, gen_helper_vsrani_b_h) -TRANS(vsrani_h_w, ALL, gen_vv_i, gen_helper_vsrani_h_w) -TRANS(vsrani_w_d, ALL, gen_vv_i, gen_helper_vsrani_w_d) -TRANS(vsrani_d_q, ALL, gen_vv_i, gen_helper_vsrani_d_q) +TRANS(vsrlni_b_h, LSX, gen_vv_i, gen_helper_vsrlni_b_h) +TRANS(vsrlni_h_w, LSX, gen_vv_i, gen_helper_vsrlni_h_w) +TRANS(vsrlni_w_d, LSX, gen_vv_i, gen_helper_vsrlni_w_d) +TRANS(vsrlni_d_q, LSX, gen_vv_i, gen_helper_vsrlni_d_q) +TRANS(vsrani_b_h, LSX, gen_vv_i, gen_helper_vsrani_b_h) +TRANS(vsrani_h_w, LSX, gen_vv_i, gen_helper_vsrani_h_w) +TRANS(vsrani_w_d, LSX, gen_vv_i, gen_helper_vsrani_w_d) +TRANS(vsrani_d_q, LSX, gen_vv_i, gen_helper_vsrani_d_q) -TRANS(vsrlrn_b_h, ALL, gen_vvv, gen_helper_vsrlrn_b_h) -TRANS(vsrlrn_h_w, ALL, gen_vvv, gen_helper_vsrlrn_h_w) -TRANS(vsrlrn_w_d, ALL, gen_vvv, gen_helper_vsrlrn_w_d) -TRANS(vsrarn_b_h, ALL, gen_vvv, gen_helper_vsrarn_b_h) -TRANS(vsrarn_h_w, ALL, gen_vvv, gen_helper_vsrarn_h_w) -TRANS(vsrarn_w_d, ALL, gen_vvv, gen_helper_vsrarn_w_d) +TRANS(vsrlrn_b_h, LSX, gen_vvv, gen_helper_vsrlrn_b_h) +TRANS(vsrlrn_h_w, LSX, gen_vvv, gen_helper_vsrlrn_h_w) +TRANS(vsrlrn_w_d, LSX, gen_vvv, gen_helper_vsrlrn_w_d) +TRANS(vsrarn_b_h, LSX, gen_vvv, gen_helper_vsrarn_b_h) +TRANS(vsrarn_h_w, LSX, gen_vvv, gen_helper_vsrarn_h_w) +TRANS(vsrarn_w_d, LSX, gen_vvv, gen_helper_vsrarn_w_d) -TRANS(vsrlrni_b_h, ALL, gen_vv_i, gen_helper_vsrlrni_b_h) -TRANS(vsrlrni_h_w, ALL, gen_vv_i, gen_helper_vsrlrni_h_w) -TRANS(vsrlrni_w_d, ALL, gen_vv_i, gen_helper_vsrlrni_w_d) -TRANS(vsrlrni_d_q, ALL, gen_vv_i, gen_helper_vsrlrni_d_q) -TRANS(vsrarni_b_h, ALL, gen_vv_i, gen_helper_vsrarni_b_h) -TRANS(vsrarni_h_w, ALL, gen_vv_i, gen_helper_vsrarni_h_w) -TRANS(vsrarni_w_d, ALL, gen_vv_i, gen_helper_vsrarni_w_d) -TRANS(vsrarni_d_q, ALL, gen_vv_i, gen_helper_vsrarni_d_q) +TRANS(vsrlrni_b_h, LSX, gen_vv_i, gen_helper_vsrlrni_b_h) +TRANS(vsrlrni_h_w, LSX, gen_vv_i, gen_helper_vsrlrni_h_w) +TRANS(vsrlrni_w_d, LSX, gen_vv_i, gen_helper_vsrlrni_w_d) +TRANS(vsrlrni_d_q, LSX, gen_vv_i, gen_helper_vsrlrni_d_q) +TRANS(vsrarni_b_h, LSX, gen_vv_i, gen_helper_vsrarni_b_h) +TRANS(vsrarni_h_w, LSX, gen_vv_i, gen_helper_vsrarni_h_w) +TRANS(vsrarni_w_d, LSX, gen_vv_i, gen_helper_vsrarni_w_d) +TRANS(vsrarni_d_q, LSX, gen_vv_i, gen_helper_vsrarni_d_q) -TRANS(vssrln_b_h, ALL, gen_vvv, gen_helper_vssrln_b_h) -TRANS(vssrln_h_w, ALL, gen_vvv, gen_helper_vssrln_h_w) -TRANS(vssrln_w_d, ALL, gen_vvv, gen_helper_vssrln_w_d) -TRANS(vssran_b_h, ALL, gen_vvv, gen_helper_vssran_b_h) -TRANS(vssran_h_w, ALL, gen_vvv, gen_helper_vssran_h_w) -TRANS(vssran_w_d, ALL, gen_vvv, gen_helper_vssran_w_d) -TRANS(vssrln_bu_h, ALL, gen_vvv, gen_helper_vssrln_bu_h) -TRANS(vssrln_hu_w, ALL, gen_vvv, gen_helper_vssrln_hu_w) -TRANS(vssrln_wu_d, ALL, gen_vvv, gen_helper_vssrln_wu_d) -TRANS(vssran_bu_h, ALL, gen_vvv, gen_helper_vssran_bu_h) -TRANS(vssran_hu_w, ALL, gen_vvv, gen_helper_vssran_hu_w) -TRANS(vssran_wu_d, ALL, gen_vvv, gen_helper_vssran_wu_d) +TRANS(vssrln_b_h, LSX, gen_vvv, gen_helper_vssrln_b_h) +TRANS(vssrln_h_w, LSX, gen_vvv, gen_helper_vssrln_h_w) +TRANS(vssrln_w_d, LSX, gen_vvv, gen_helper_vssrln_w_d) +TRANS(vssran_b_h, LSX, gen_vvv, gen_helper_vssran_b_h) +TRANS(vssran_h_w, LSX, gen_vvv, gen_helper_vssran_h_w) +TRANS(vssran_w_d, LSX, gen_vvv, gen_helper_vssran_w_d) +TRANS(vssrln_bu_h, LSX, gen_vvv, gen_helper_vssrln_bu_h) +TRANS(vssrln_hu_w, LSX, gen_vvv, gen_helper_vssrln_hu_w) +TRANS(vssrln_wu_d, LSX, gen_vvv, gen_helper_vssrln_wu_d) +TRANS(vssran_bu_h, LSX, gen_vvv, gen_helper_vssran_bu_h) +TRANS(vssran_hu_w, LSX, gen_vvv, gen_helper_vssran_hu_w) +TRANS(vssran_wu_d, LSX, gen_vvv, gen_helper_vssran_wu_d) -TRANS(vssrlni_b_h, ALL, gen_vv_i, gen_helper_vssrlni_b_h) -TRANS(vssrlni_h_w, ALL, gen_vv_i, gen_helper_vssrlni_h_w) -TRANS(vssrlni_w_d, ALL, gen_vv_i, gen_helper_vssrlni_w_d) -TRANS(vssrlni_d_q, ALL, gen_vv_i, gen_helper_vssrlni_d_q) -TRANS(vssrani_b_h, ALL, gen_vv_i, gen_helper_vssrani_b_h) -TRANS(vssrani_h_w, ALL, gen_vv_i, gen_helper_vssrani_h_w) -TRANS(vssrani_w_d, ALL, gen_vv_i, gen_helper_vssrani_w_d) -TRANS(vssrani_d_q, ALL, gen_vv_i, gen_helper_vssrani_d_q) -TRANS(vssrlni_bu_h, ALL, gen_vv_i, gen_helper_vssrlni_bu_h) -TRANS(vssrlni_hu_w, ALL, gen_vv_i, gen_helper_vssrlni_hu_w) -TRANS(vssrlni_wu_d, ALL, gen_vv_i, gen_helper_vssrlni_wu_d) -TRANS(vssrlni_du_q, ALL, gen_vv_i, gen_helper_vssrlni_du_q) -TRANS(vssrani_bu_h, ALL, gen_vv_i, gen_helper_vssrani_bu_h) -TRANS(vssrani_hu_w, ALL, gen_vv_i, gen_helper_vssrani_hu_w) -TRANS(vssrani_wu_d, ALL, gen_vv_i, gen_helper_vssrani_wu_d) -TRANS(vssrani_du_q, ALL, gen_vv_i, gen_helper_vssrani_du_q) +TRANS(vssrlni_b_h, LSX, gen_vv_i, gen_helper_vssrlni_b_h) +TRANS(vssrlni_h_w, LSX, gen_vv_i, gen_helper_vssrlni_h_w) +TRANS(vssrlni_w_d, LSX, gen_vv_i, gen_helper_vssrlni_w_d) +TRANS(vssrlni_d_q, LSX, gen_vv_i, gen_helper_vssrlni_d_q) +TRANS(vssrani_b_h, LSX, gen_vv_i, gen_helper_vssrani_b_h) +TRANS(vssrani_h_w, LSX, gen_vv_i, gen_helper_vssrani_h_w) +TRANS(vssrani_w_d, LSX, gen_vv_i, gen_helper_vssrani_w_d) +TRANS(vssrani_d_q, LSX, gen_vv_i, gen_helper_vssrani_d_q) +TRANS(vssrlni_bu_h, LSX, gen_vv_i, gen_helper_vssrlni_bu_h) +TRANS(vssrlni_hu_w, LSX, gen_vv_i, gen_helper_vssrlni_hu_w) +TRANS(vssrlni_wu_d, LSX, gen_vv_i, gen_helper_vssrlni_wu_d) +TRANS(vssrlni_du_q, LSX, gen_vv_i, gen_helper_vssrlni_du_q) +TRANS(vssrani_bu_h, LSX, gen_vv_i, gen_helper_vssrani_bu_h) +TRANS(vssrani_hu_w, LSX, gen_vv_i, gen_helper_vssrani_hu_w) +TRANS(vssrani_wu_d, LSX, gen_vv_i, gen_helper_vssrani_wu_d) +TRANS(vssrani_du_q, LSX, gen_vv_i, gen_helper_vssrani_du_q) -TRANS(vssrlrn_b_h, ALL, gen_vvv, gen_helper_vssrlrn_b_h) -TRANS(vssrlrn_h_w, ALL, gen_vvv, gen_helper_vssrlrn_h_w) -TRANS(vssrlrn_w_d, ALL, gen_vvv, gen_helper_vssrlrn_w_d) -TRANS(vssrarn_b_h, ALL, gen_vvv, gen_helper_vssrarn_b_h) -TRANS(vssrarn_h_w, ALL, gen_vvv, gen_helper_vssrarn_h_w) -TRANS(vssrarn_w_d, ALL, gen_vvv, gen_helper_vssrarn_w_d) -TRANS(vssrlrn_bu_h, ALL, gen_vvv, gen_helper_vssrlrn_bu_h) -TRANS(vssrlrn_hu_w, ALL, gen_vvv, gen_helper_vssrlrn_hu_w) -TRANS(vssrlrn_wu_d, ALL, gen_vvv, gen_helper_vssrlrn_wu_d) -TRANS(vssrarn_bu_h, ALL, gen_vvv, gen_helper_vssrarn_bu_h) -TRANS(vssrarn_hu_w, ALL, gen_vvv, gen_helper_vssrarn_hu_w) -TRANS(vssrarn_wu_d, ALL, gen_vvv, gen_helper_vssrarn_wu_d) +TRANS(vssrlrn_b_h, LSX, gen_vvv, gen_helper_vssrlrn_b_h) +TRANS(vssrlrn_h_w, LSX, gen_vvv, gen_helper_vssrlrn_h_w) +TRANS(vssrlrn_w_d, LSX, gen_vvv, gen_helper_vssrlrn_w_d) +TRANS(vssrarn_b_h, LSX, gen_vvv, gen_helper_vssrarn_b_h) +TRANS(vssrarn_h_w, LSX, gen_vvv, gen_helper_vssrarn_h_w) +TRANS(vssrarn_w_d, LSX, gen_vvv, gen_helper_vssrarn_w_d) +TRANS(vssrlrn_bu_h, LSX, gen_vvv, gen_helper_vssrlrn_bu_h) +TRANS(vssrlrn_hu_w, LSX, gen_vvv, gen_helper_vssrlrn_hu_w) +TRANS(vssrlrn_wu_d, LSX, gen_vvv, gen_helper_vssrlrn_wu_d) +TRANS(vssrarn_bu_h, LSX, gen_vvv, gen_helper_vssrarn_bu_h) +TRANS(vssrarn_hu_w, LSX, gen_vvv, gen_helper_vssrarn_hu_w) +TRANS(vssrarn_wu_d, LSX, gen_vvv, gen_helper_vssrarn_wu_d) -TRANS(vssrlrni_b_h, ALL, gen_vv_i, gen_helper_vssrlrni_b_h) -TRANS(vssrlrni_h_w, ALL, gen_vv_i, gen_helper_vssrlrni_h_w) -TRANS(vssrlrni_w_d, ALL, gen_vv_i, gen_helper_vssrlrni_w_d) -TRANS(vssrlrni_d_q, ALL, gen_vv_i, gen_helper_vssrlrni_d_q) -TRANS(vssrarni_b_h, ALL, gen_vv_i, gen_helper_vssrarni_b_h) -TRANS(vssrarni_h_w, ALL, gen_vv_i, gen_helper_vssrarni_h_w) -TRANS(vssrarni_w_d, ALL, gen_vv_i, gen_helper_vssrarni_w_d) -TRANS(vssrarni_d_q, ALL, gen_vv_i, gen_helper_vssrarni_d_q) -TRANS(vssrlrni_bu_h, ALL, gen_vv_i, gen_helper_vssrlrni_bu_h) -TRANS(vssrlrni_hu_w, ALL, gen_vv_i, gen_helper_vssrlrni_hu_w) -TRANS(vssrlrni_wu_d, ALL, gen_vv_i, gen_helper_vssrlrni_wu_d) -TRANS(vssrlrni_du_q, ALL, gen_vv_i, gen_helper_vssrlrni_du_q) -TRANS(vssrarni_bu_h, ALL, gen_vv_i, gen_helper_vssrarni_bu_h) -TRANS(vssrarni_hu_w, ALL, gen_vv_i, gen_helper_vssrarni_hu_w) -TRANS(vssrarni_wu_d, ALL, gen_vv_i, gen_helper_vssrarni_wu_d) -TRANS(vssrarni_du_q, ALL, gen_vv_i, gen_helper_vssrarni_du_q) +TRANS(vssrlrni_b_h, LSX, gen_vv_i, gen_helper_vssrlrni_b_h) +TRANS(vssrlrni_h_w, LSX, gen_vv_i, gen_helper_vssrlrni_h_w) +TRANS(vssrlrni_w_d, LSX, gen_vv_i, gen_helper_vssrlrni_w_d) +TRANS(vssrlrni_d_q, LSX, gen_vv_i, gen_helper_vssrlrni_d_q) +TRANS(vssrarni_b_h, LSX, gen_vv_i, gen_helper_vssrarni_b_h) +TRANS(vssrarni_h_w, LSX, gen_vv_i, gen_helper_vssrarni_h_w) +TRANS(vssrarni_w_d, LSX, gen_vv_i, gen_helper_vssrarni_w_d) +TRANS(vssrarni_d_q, LSX, gen_vv_i, gen_helper_vssrarni_d_q) +TRANS(vssrlrni_bu_h, LSX, gen_vv_i, gen_helper_vssrlrni_bu_h) +TRANS(vssrlrni_hu_w, LSX, gen_vv_i, gen_helper_vssrlrni_hu_w) +TRANS(vssrlrni_wu_d, LSX, gen_vv_i, gen_helper_vssrlrni_wu_d) +TRANS(vssrlrni_du_q, LSX, gen_vv_i, gen_helper_vssrlrni_du_q) +TRANS(vssrarni_bu_h, LSX, gen_vv_i, gen_helper_vssrarni_bu_h) +TRANS(vssrarni_hu_w, LSX, gen_vv_i, gen_helper_vssrarni_hu_w) +TRANS(vssrarni_wu_d, LSX, gen_vv_i, gen_helper_vssrarni_wu_d) +TRANS(vssrarni_du_q, LSX, gen_vv_i, gen_helper_vssrarni_du_q) -TRANS(vclo_b, ALL, gen_vv, gen_helper_vclo_b) -TRANS(vclo_h, ALL, gen_vv, gen_helper_vclo_h) -TRANS(vclo_w, ALL, gen_vv, gen_helper_vclo_w) -TRANS(vclo_d, ALL, gen_vv, gen_helper_vclo_d) -TRANS(vclz_b, ALL, gen_vv, gen_helper_vclz_b) -TRANS(vclz_h, ALL, gen_vv, gen_helper_vclz_h) -TRANS(vclz_w, ALL, gen_vv, gen_helper_vclz_w) -TRANS(vclz_d, ALL, gen_vv, gen_helper_vclz_d) +TRANS(vclo_b, LSX, gen_vv, gen_helper_vclo_b) +TRANS(vclo_h, LSX, gen_vv, gen_helper_vclo_h) +TRANS(vclo_w, LSX, gen_vv, gen_helper_vclo_w) +TRANS(vclo_d, LSX, gen_vv, gen_helper_vclo_d) +TRANS(vclz_b, LSX, gen_vv, gen_helper_vclz_b) +TRANS(vclz_h, LSX, gen_vv, gen_helper_vclz_h) +TRANS(vclz_w, LSX, gen_vv, gen_helper_vclz_w) +TRANS(vclz_d, LSX, gen_vv, gen_helper_vclz_d) -TRANS(vpcnt_b, ALL, gen_vv, gen_helper_vpcnt_b) -TRANS(vpcnt_h, ALL, gen_vv, gen_helper_vpcnt_h) -TRANS(vpcnt_w, ALL, gen_vv, gen_helper_vpcnt_w) -TRANS(vpcnt_d, ALL, gen_vv, gen_helper_vpcnt_d) +TRANS(vpcnt_b, LSX, gen_vv, gen_helper_vpcnt_b) +TRANS(vpcnt_h, LSX, gen_vv, gen_helper_vpcnt_h) +TRANS(vpcnt_w, LSX, gen_vv, gen_helper_vpcnt_w) +TRANS(vpcnt_d, LSX, gen_vv, gen_helper_vpcnt_d) static void do_vbit(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b, void (*func)(unsigned, TCGv_vec, TCGv_vec, TCGv_vec)) @@ -3340,10 +3361,10 @@ static void do_vbitclr(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vbitclr_b, ALL, gvec_vvv, MO_8, do_vbitclr) -TRANS(vbitclr_h, ALL, gvec_vvv, MO_16, do_vbitclr) -TRANS(vbitclr_w, ALL, gvec_vvv, MO_32, do_vbitclr) -TRANS(vbitclr_d, ALL, gvec_vvv, MO_64, do_vbitclr) +TRANS(vbitclr_b, LSX, gvec_vvv, MO_8, do_vbitclr) +TRANS(vbitclr_h, LSX, gvec_vvv, MO_16, do_vbitclr) +TRANS(vbitclr_w, LSX, gvec_vvv, MO_32, do_vbitclr) +TRANS(vbitclr_d, LSX, gvec_vvv, MO_64, do_vbitclr) static void do_vbiti(unsigned vece, TCGv_vec t, TCGv_vec a, int64_t imm, void (*func)(unsigned, TCGv_vec, TCGv_vec, TCGv_vec)) @@ -3410,10 +3431,10 @@ static void do_vbitclri(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_2i(vd_ofs, vj_ofs, oprsz, maxsz, imm, &op[vece]); } -TRANS(vbitclri_b, ALL, gvec_vv_i, MO_8, do_vbitclri) -TRANS(vbitclri_h, ALL, gvec_vv_i, MO_16, do_vbitclri) -TRANS(vbitclri_w, ALL, gvec_vv_i, MO_32, do_vbitclri) -TRANS(vbitclri_d, ALL, gvec_vv_i, MO_64, do_vbitclri) +TRANS(vbitclri_b, LSX, gvec_vv_i, MO_8, do_vbitclri) +TRANS(vbitclri_h, LSX, gvec_vv_i, MO_16, do_vbitclri) +TRANS(vbitclri_w, LSX, gvec_vv_i, MO_32, do_vbitclri) +TRANS(vbitclri_d, LSX, gvec_vv_i, MO_64, do_vbitclri) static void do_vbitset(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, uint32_t vk_ofs, uint32_t oprsz, uint32_t maxsz) @@ -3451,10 +3472,10 @@ static void do_vbitset(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vbitset_b, ALL, gvec_vvv, MO_8, do_vbitset) -TRANS(vbitset_h, ALL, gvec_vvv, MO_16, do_vbitset) -TRANS(vbitset_w, ALL, gvec_vvv, MO_32, do_vbitset) -TRANS(vbitset_d, ALL, gvec_vvv, MO_64, do_vbitset) +TRANS(vbitset_b, LSX, gvec_vvv, MO_8, do_vbitset) +TRANS(vbitset_h, LSX, gvec_vvv, MO_16, do_vbitset) +TRANS(vbitset_w, LSX, gvec_vvv, MO_32, do_vbitset) +TRANS(vbitset_d, LSX, gvec_vvv, MO_64, do_vbitset) static void do_vbitseti(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, int64_t imm, uint32_t oprsz, uint32_t maxsz) @@ -3492,10 +3513,10 @@ static void do_vbitseti(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_2i(vd_ofs, vj_ofs, oprsz, maxsz, imm, &op[vece]); } -TRANS(vbitseti_b, ALL, gvec_vv_i, MO_8, do_vbitseti) -TRANS(vbitseti_h, ALL, gvec_vv_i, MO_16, do_vbitseti) -TRANS(vbitseti_w, ALL, gvec_vv_i, MO_32, do_vbitseti) -TRANS(vbitseti_d, ALL, gvec_vv_i, MO_64, do_vbitseti) +TRANS(vbitseti_b, LSX, gvec_vv_i, MO_8, do_vbitseti) +TRANS(vbitseti_h, LSX, gvec_vv_i, MO_16, do_vbitseti) +TRANS(vbitseti_w, LSX, gvec_vv_i, MO_32, do_vbitseti) +TRANS(vbitseti_d, LSX, gvec_vv_i, MO_64, do_vbitseti) static void do_vbitrev(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, uint32_t vk_ofs, uint32_t oprsz, uint32_t maxsz) @@ -3533,10 +3554,10 @@ static void do_vbitrev(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_3(vd_ofs, vj_ofs, vk_ofs, oprsz, maxsz, &op[vece]); } -TRANS(vbitrev_b, ALL, gvec_vvv, MO_8, do_vbitrev) -TRANS(vbitrev_h, ALL, gvec_vvv, MO_16, do_vbitrev) -TRANS(vbitrev_w, ALL, gvec_vvv, MO_32, do_vbitrev) -TRANS(vbitrev_d, ALL, gvec_vvv, MO_64, do_vbitrev) +TRANS(vbitrev_b, LSX, gvec_vvv, MO_8, do_vbitrev) +TRANS(vbitrev_h, LSX, gvec_vvv, MO_16, do_vbitrev) +TRANS(vbitrev_w, LSX, gvec_vvv, MO_32, do_vbitrev) +TRANS(vbitrev_d, LSX, gvec_vvv, MO_64, do_vbitrev) static void do_vbitrevi(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, int64_t imm, uint32_t oprsz, uint32_t maxsz) @@ -3574,112 +3595,112 @@ static void do_vbitrevi(unsigned vece, uint32_t vd_ofs, uint32_t vj_ofs, tcg_gen_gvec_2i(vd_ofs, vj_ofs, oprsz, maxsz, imm, &op[vece]); } -TRANS(vbitrevi_b, ALL, gvec_vv_i, MO_8, do_vbitrevi) -TRANS(vbitrevi_h, ALL, gvec_vv_i, MO_16, do_vbitrevi) -TRANS(vbitrevi_w, ALL, gvec_vv_i, MO_32, do_vbitrevi) -TRANS(vbitrevi_d, ALL, gvec_vv_i, MO_64, do_vbitrevi) +TRANS(vbitrevi_b, LSX, gvec_vv_i, MO_8, do_vbitrevi) +TRANS(vbitrevi_h, LSX, gvec_vv_i, MO_16, do_vbitrevi) +TRANS(vbitrevi_w, LSX, gvec_vv_i, MO_32, do_vbitrevi) +TRANS(vbitrevi_d, LSX, gvec_vv_i, MO_64, do_vbitrevi) -TRANS(vfrstp_b, ALL, gen_vvv, gen_helper_vfrstp_b) -TRANS(vfrstp_h, ALL, gen_vvv, gen_helper_vfrstp_h) -TRANS(vfrstpi_b, ALL, gen_vv_i, gen_helper_vfrstpi_b) -TRANS(vfrstpi_h, ALL, gen_vv_i, gen_helper_vfrstpi_h) +TRANS(vfrstp_b, LSX, gen_vvv, gen_helper_vfrstp_b) +TRANS(vfrstp_h, LSX, gen_vvv, gen_helper_vfrstp_h) +TRANS(vfrstpi_b, LSX, gen_vv_i, gen_helper_vfrstpi_b) +TRANS(vfrstpi_h, LSX, gen_vv_i, gen_helper_vfrstpi_h) -TRANS(vfadd_s, ALL, gen_vvv, gen_helper_vfadd_s) -TRANS(vfadd_d, ALL, gen_vvv, gen_helper_vfadd_d) -TRANS(vfsub_s, ALL, gen_vvv, gen_helper_vfsub_s) -TRANS(vfsub_d, ALL, gen_vvv, gen_helper_vfsub_d) -TRANS(vfmul_s, ALL, gen_vvv, gen_helper_vfmul_s) -TRANS(vfmul_d, ALL, gen_vvv, gen_helper_vfmul_d) -TRANS(vfdiv_s, ALL, gen_vvv, gen_helper_vfdiv_s) -TRANS(vfdiv_d, ALL, gen_vvv, gen_helper_vfdiv_d) +TRANS(vfadd_s, LSX, gen_vvv, gen_helper_vfadd_s) +TRANS(vfadd_d, LSX, gen_vvv, gen_helper_vfadd_d) +TRANS(vfsub_s, LSX, gen_vvv, gen_helper_vfsub_s) +TRANS(vfsub_d, LSX, gen_vvv, gen_helper_vfsub_d) +TRANS(vfmul_s, LSX, gen_vvv, gen_helper_vfmul_s) +TRANS(vfmul_d, LSX, gen_vvv, gen_helper_vfmul_d) +TRANS(vfdiv_s, LSX, gen_vvv, gen_helper_vfdiv_s) +TRANS(vfdiv_d, LSX, gen_vvv, gen_helper_vfdiv_d) -TRANS(vfmadd_s, ALL, gen_vvvv, gen_helper_vfmadd_s) -TRANS(vfmadd_d, ALL, gen_vvvv, gen_helper_vfmadd_d) -TRANS(vfmsub_s, ALL, gen_vvvv, gen_helper_vfmsub_s) -TRANS(vfmsub_d, ALL, gen_vvvv, gen_helper_vfmsub_d) -TRANS(vfnmadd_s, ALL, gen_vvvv, gen_helper_vfnmadd_s) -TRANS(vfnmadd_d, ALL, gen_vvvv, gen_helper_vfnmadd_d) -TRANS(vfnmsub_s, ALL, gen_vvvv, gen_helper_vfnmsub_s) -TRANS(vfnmsub_d, ALL, gen_vvvv, gen_helper_vfnmsub_d) +TRANS(vfmadd_s, LSX, gen_vvvv, gen_helper_vfmadd_s) +TRANS(vfmadd_d, LSX, gen_vvvv, gen_helper_vfmadd_d) +TRANS(vfmsub_s, LSX, gen_vvvv, gen_helper_vfmsub_s) +TRANS(vfmsub_d, LSX, gen_vvvv, gen_helper_vfmsub_d) +TRANS(vfnmadd_s, LSX, gen_vvvv, gen_helper_vfnmadd_s) +TRANS(vfnmadd_d, LSX, gen_vvvv, gen_helper_vfnmadd_d) +TRANS(vfnmsub_s, LSX, gen_vvvv, gen_helper_vfnmsub_s) +TRANS(vfnmsub_d, LSX, gen_vvvv, gen_helper_vfnmsub_d) -TRANS(vfmax_s, ALL, gen_vvv, gen_helper_vfmax_s) -TRANS(vfmax_d, ALL, gen_vvv, gen_helper_vfmax_d) -TRANS(vfmin_s, ALL, gen_vvv, gen_helper_vfmin_s) -TRANS(vfmin_d, ALL, gen_vvv, gen_helper_vfmin_d) +TRANS(vfmax_s, LSX, gen_vvv, gen_helper_vfmax_s) +TRANS(vfmax_d, LSX, gen_vvv, gen_helper_vfmax_d) +TRANS(vfmin_s, LSX, gen_vvv, gen_helper_vfmin_s) +TRANS(vfmin_d, LSX, gen_vvv, gen_helper_vfmin_d) -TRANS(vfmaxa_s, ALL, gen_vvv, gen_helper_vfmaxa_s) -TRANS(vfmaxa_d, ALL, gen_vvv, gen_helper_vfmaxa_d) -TRANS(vfmina_s, ALL, gen_vvv, gen_helper_vfmina_s) -TRANS(vfmina_d, ALL, gen_vvv, gen_helper_vfmina_d) +TRANS(vfmaxa_s, LSX, gen_vvv, gen_helper_vfmaxa_s) +TRANS(vfmaxa_d, LSX, gen_vvv, gen_helper_vfmaxa_d) +TRANS(vfmina_s, LSX, gen_vvv, gen_helper_vfmina_s) +TRANS(vfmina_d, LSX, gen_vvv, gen_helper_vfmina_d) -TRANS(vflogb_s, ALL, gen_vv, gen_helper_vflogb_s) -TRANS(vflogb_d, ALL, gen_vv, gen_helper_vflogb_d) +TRANS(vflogb_s, LSX, gen_vv, gen_helper_vflogb_s) +TRANS(vflogb_d, LSX, gen_vv, gen_helper_vflogb_d) -TRANS(vfclass_s, ALL, gen_vv, gen_helper_vfclass_s) -TRANS(vfclass_d, ALL, gen_vv, gen_helper_vfclass_d) +TRANS(vfclass_s, LSX, gen_vv, gen_helper_vfclass_s) +TRANS(vfclass_d, LSX, gen_vv, gen_helper_vfclass_d) -TRANS(vfsqrt_s, ALL, gen_vv, gen_helper_vfsqrt_s) -TRANS(vfsqrt_d, ALL, gen_vv, gen_helper_vfsqrt_d) -TRANS(vfrecip_s, ALL, gen_vv, gen_helper_vfrecip_s) -TRANS(vfrecip_d, ALL, gen_vv, gen_helper_vfrecip_d) -TRANS(vfrsqrt_s, ALL, gen_vv, gen_helper_vfrsqrt_s) -TRANS(vfrsqrt_d, ALL, gen_vv, gen_helper_vfrsqrt_d) +TRANS(vfsqrt_s, LSX, gen_vv, gen_helper_vfsqrt_s) +TRANS(vfsqrt_d, LSX, gen_vv, gen_helper_vfsqrt_d) +TRANS(vfrecip_s, LSX, gen_vv, gen_helper_vfrecip_s) +TRANS(vfrecip_d, LSX, gen_vv, gen_helper_vfrecip_d) +TRANS(vfrsqrt_s, LSX, gen_vv, gen_helper_vfrsqrt_s) +TRANS(vfrsqrt_d, LSX, gen_vv, gen_helper_vfrsqrt_d) -TRANS(vfcvtl_s_h, ALL, gen_vv, gen_helper_vfcvtl_s_h) -TRANS(vfcvth_s_h, ALL, gen_vv, gen_helper_vfcvth_s_h) -TRANS(vfcvtl_d_s, ALL, gen_vv, gen_helper_vfcvtl_d_s) -TRANS(vfcvth_d_s, ALL, gen_vv, gen_helper_vfcvth_d_s) -TRANS(vfcvt_h_s, ALL, gen_vvv, gen_helper_vfcvt_h_s) -TRANS(vfcvt_s_d, ALL, gen_vvv, gen_helper_vfcvt_s_d) +TRANS(vfcvtl_s_h, LSX, gen_vv, gen_helper_vfcvtl_s_h) +TRANS(vfcvth_s_h, LSX, gen_vv, gen_helper_vfcvth_s_h) +TRANS(vfcvtl_d_s, LSX, gen_vv, gen_helper_vfcvtl_d_s) +TRANS(vfcvth_d_s, LSX, gen_vv, gen_helper_vfcvth_d_s) +TRANS(vfcvt_h_s, LSX, gen_vvv, gen_helper_vfcvt_h_s) +TRANS(vfcvt_s_d, LSX, gen_vvv, gen_helper_vfcvt_s_d) -TRANS(vfrintrne_s, ALL, gen_vv, gen_helper_vfrintrne_s) -TRANS(vfrintrne_d, ALL, gen_vv, gen_helper_vfrintrne_d) -TRANS(vfrintrz_s, ALL, gen_vv, gen_helper_vfrintrz_s) -TRANS(vfrintrz_d, ALL, gen_vv, gen_helper_vfrintrz_d) -TRANS(vfrintrp_s, ALL, gen_vv, gen_helper_vfrintrp_s) -TRANS(vfrintrp_d, ALL, gen_vv, gen_helper_vfrintrp_d) -TRANS(vfrintrm_s, ALL, gen_vv, gen_helper_vfrintrm_s) -TRANS(vfrintrm_d, ALL, gen_vv, gen_helper_vfrintrm_d) -TRANS(vfrint_s, ALL, gen_vv, gen_helper_vfrint_s) -TRANS(vfrint_d, ALL, gen_vv, gen_helper_vfrint_d) +TRANS(vfrintrne_s, LSX, gen_vv, gen_helper_vfrintrne_s) +TRANS(vfrintrne_d, LSX, gen_vv, gen_helper_vfrintrne_d) +TRANS(vfrintrz_s, LSX, gen_vv, gen_helper_vfrintrz_s) +TRANS(vfrintrz_d, LSX, gen_vv, gen_helper_vfrintrz_d) +TRANS(vfrintrp_s, LSX, gen_vv, gen_helper_vfrintrp_s) +TRANS(vfrintrp_d, LSX, gen_vv, gen_helper_vfrintrp_d) +TRANS(vfrintrm_s, LSX, gen_vv, gen_helper_vfrintrm_s) +TRANS(vfrintrm_d, LSX, gen_vv, gen_helper_vfrintrm_d) +TRANS(vfrint_s, LSX, gen_vv, gen_helper_vfrint_s) +TRANS(vfrint_d, LSX, gen_vv, gen_helper_vfrint_d) -TRANS(vftintrne_w_s, ALL, gen_vv, gen_helper_vftintrne_w_s) -TRANS(vftintrne_l_d, ALL, gen_vv, gen_helper_vftintrne_l_d) -TRANS(vftintrz_w_s, ALL, gen_vv, gen_helper_vftintrz_w_s) -TRANS(vftintrz_l_d, ALL, gen_vv, gen_helper_vftintrz_l_d) -TRANS(vftintrp_w_s, ALL, gen_vv, gen_helper_vftintrp_w_s) -TRANS(vftintrp_l_d, ALL, gen_vv, gen_helper_vftintrp_l_d) -TRANS(vftintrm_w_s, ALL, gen_vv, gen_helper_vftintrm_w_s) -TRANS(vftintrm_l_d, ALL, gen_vv, gen_helper_vftintrm_l_d) -TRANS(vftint_w_s, ALL, gen_vv, gen_helper_vftint_w_s) -TRANS(vftint_l_d, ALL, gen_vv, gen_helper_vftint_l_d) -TRANS(vftintrz_wu_s, ALL, gen_vv, gen_helper_vftintrz_wu_s) -TRANS(vftintrz_lu_d, ALL, gen_vv, gen_helper_vftintrz_lu_d) -TRANS(vftint_wu_s, ALL, gen_vv, gen_helper_vftint_wu_s) -TRANS(vftint_lu_d, ALL, gen_vv, gen_helper_vftint_lu_d) -TRANS(vftintrne_w_d, ALL, gen_vvv, gen_helper_vftintrne_w_d) -TRANS(vftintrz_w_d, ALL, gen_vvv, gen_helper_vftintrz_w_d) -TRANS(vftintrp_w_d, ALL, gen_vvv, gen_helper_vftintrp_w_d) -TRANS(vftintrm_w_d, ALL, gen_vvv, gen_helper_vftintrm_w_d) -TRANS(vftint_w_d, ALL, gen_vvv, gen_helper_vftint_w_d) -TRANS(vftintrnel_l_s, ALL, gen_vv, gen_helper_vftintrnel_l_s) -TRANS(vftintrneh_l_s, ALL, gen_vv, gen_helper_vftintrneh_l_s) -TRANS(vftintrzl_l_s, ALL, gen_vv, gen_helper_vftintrzl_l_s) -TRANS(vftintrzh_l_s, ALL, gen_vv, gen_helper_vftintrzh_l_s) -TRANS(vftintrpl_l_s, ALL, gen_vv, gen_helper_vftintrpl_l_s) -TRANS(vftintrph_l_s, ALL, gen_vv, gen_helper_vftintrph_l_s) -TRANS(vftintrml_l_s, ALL, gen_vv, gen_helper_vftintrml_l_s) -TRANS(vftintrmh_l_s, ALL, gen_vv, gen_helper_vftintrmh_l_s) -TRANS(vftintl_l_s, ALL, gen_vv, gen_helper_vftintl_l_s) -TRANS(vftinth_l_s, ALL, gen_vv, gen_helper_vftinth_l_s) +TRANS(vftintrne_w_s, LSX, gen_vv, gen_helper_vftintrne_w_s) +TRANS(vftintrne_l_d, LSX, gen_vv, gen_helper_vftintrne_l_d) +TRANS(vftintrz_w_s, LSX, gen_vv, gen_helper_vftintrz_w_s) +TRANS(vftintrz_l_d, LSX, gen_vv, gen_helper_vftintrz_l_d) +TRANS(vftintrp_w_s, LSX, gen_vv, gen_helper_vftintrp_w_s) +TRANS(vftintrp_l_d, LSX, gen_vv, gen_helper_vftintrp_l_d) +TRANS(vftintrm_w_s, LSX, gen_vv, gen_helper_vftintrm_w_s) +TRANS(vftintrm_l_d, LSX, gen_vv, gen_helper_vftintrm_l_d) +TRANS(vftint_w_s, LSX, gen_vv, gen_helper_vftint_w_s) +TRANS(vftint_l_d, LSX, gen_vv, gen_helper_vftint_l_d) +TRANS(vftintrz_wu_s, LSX, gen_vv, gen_helper_vftintrz_wu_s) +TRANS(vftintrz_lu_d, LSX, gen_vv, gen_helper_vftintrz_lu_d) +TRANS(vftint_wu_s, LSX, gen_vv, gen_helper_vftint_wu_s) +TRANS(vftint_lu_d, LSX, gen_vv, gen_helper_vftint_lu_d) +TRANS(vftintrne_w_d, LSX, gen_vvv, gen_helper_vftintrne_w_d) +TRANS(vftintrz_w_d, LSX, gen_vvv, gen_helper_vftintrz_w_d) +TRANS(vftintrp_w_d, LSX, gen_vvv, gen_helper_vftintrp_w_d) +TRANS(vftintrm_w_d, LSX, gen_vvv, gen_helper_vftintrm_w_d) +TRANS(vftint_w_d, LSX, gen_vvv, gen_helper_vftint_w_d) +TRANS(vftintrnel_l_s, LSX, gen_vv, gen_helper_vftintrnel_l_s) +TRANS(vftintrneh_l_s, LSX, gen_vv, gen_helper_vftintrneh_l_s) +TRANS(vftintrzl_l_s, LSX, gen_vv, gen_helper_vftintrzl_l_s) +TRANS(vftintrzh_l_s, LSX, gen_vv, gen_helper_vftintrzh_l_s) +TRANS(vftintrpl_l_s, LSX, gen_vv, gen_helper_vftintrpl_l_s) +TRANS(vftintrph_l_s, LSX, gen_vv, gen_helper_vftintrph_l_s) +TRANS(vftintrml_l_s, LSX, gen_vv, gen_helper_vftintrml_l_s) +TRANS(vftintrmh_l_s, LSX, gen_vv, gen_helper_vftintrmh_l_s) +TRANS(vftintl_l_s, LSX, gen_vv, gen_helper_vftintl_l_s) +TRANS(vftinth_l_s, LSX, gen_vv, gen_helper_vftinth_l_s) -TRANS(vffint_s_w, ALL, gen_vv, gen_helper_vffint_s_w) -TRANS(vffint_d_l, ALL, gen_vv, gen_helper_vffint_d_l) -TRANS(vffint_s_wu, ALL, gen_vv, gen_helper_vffint_s_wu) -TRANS(vffint_d_lu, ALL, gen_vv, gen_helper_vffint_d_lu) -TRANS(vffintl_d_w, ALL, gen_vv, gen_helper_vffintl_d_w) -TRANS(vffinth_d_w, ALL, gen_vv, gen_helper_vffinth_d_w) -TRANS(vffint_s_l, ALL, gen_vvv, gen_helper_vffint_s_l) +TRANS(vffint_s_w, LSX, gen_vv, gen_helper_vffint_s_w) +TRANS(vffint_d_l, LSX, gen_vv, gen_helper_vffint_d_l) +TRANS(vffint_s_wu, LSX, gen_vv, gen_helper_vffint_s_wu) +TRANS(vffint_d_lu, LSX, gen_vv, gen_helper_vffint_d_lu) +TRANS(vffintl_d_w, LSX, gen_vv, gen_helper_vffintl_d_w) +TRANS(vffinth_d_w, LSX, gen_vv, gen_helper_vffinth_d_w) +TRANS(vffint_s_l, LSX, gen_vvv, gen_helper_vffint_s_l) static bool do_cmp(DisasContext *ctx, arg_vvv *a, MemOp mop, TCGCond cond) { @@ -3823,48 +3844,48 @@ static bool do_## NAME ##_u(DisasContext *ctx, arg_vv_i *a, MemOp mop) \ DO_CMPI_U(vslei) DO_CMPI_U(vslti) -TRANS(vseq_b, ALL, do_cmp, MO_8, TCG_COND_EQ) -TRANS(vseq_h, ALL, do_cmp, MO_16, TCG_COND_EQ) -TRANS(vseq_w, ALL, do_cmp, MO_32, TCG_COND_EQ) -TRANS(vseq_d, ALL, do_cmp, MO_64, TCG_COND_EQ) -TRANS(vseqi_b, ALL, do_vseqi_s, MO_8) -TRANS(vseqi_h, ALL, do_vseqi_s, MO_16) -TRANS(vseqi_w, ALL, do_vseqi_s, MO_32) -TRANS(vseqi_d, ALL, do_vseqi_s, MO_64) +TRANS(vseq_b, LSX, do_cmp, MO_8, TCG_COND_EQ) +TRANS(vseq_h, LSX, do_cmp, MO_16, TCG_COND_EQ) +TRANS(vseq_w, LSX, do_cmp, MO_32, TCG_COND_EQ) +TRANS(vseq_d, LSX, do_cmp, MO_64, TCG_COND_EQ) +TRANS(vseqi_b, LSX, do_vseqi_s, MO_8) +TRANS(vseqi_h, LSX, do_vseqi_s, MO_16) +TRANS(vseqi_w, LSX, do_vseqi_s, MO_32) +TRANS(vseqi_d, LSX, do_vseqi_s, MO_64) -TRANS(vsle_b, ALL, do_cmp, MO_8, TCG_COND_LE) -TRANS(vsle_h, ALL, do_cmp, MO_16, TCG_COND_LE) -TRANS(vsle_w, ALL, do_cmp, MO_32, TCG_COND_LE) -TRANS(vsle_d, ALL, do_cmp, MO_64, TCG_COND_LE) -TRANS(vslei_b, ALL, do_vslei_s, MO_8) -TRANS(vslei_h, ALL, do_vslei_s, MO_16) -TRANS(vslei_w, ALL, do_vslei_s, MO_32) -TRANS(vslei_d, ALL, do_vslei_s, MO_64) -TRANS(vsle_bu, ALL, do_cmp, MO_8, TCG_COND_LEU) -TRANS(vsle_hu, ALL, do_cmp, MO_16, TCG_COND_LEU) -TRANS(vsle_wu, ALL, do_cmp, MO_32, TCG_COND_LEU) -TRANS(vsle_du, ALL, do_cmp, MO_64, TCG_COND_LEU) -TRANS(vslei_bu, ALL, do_vslei_u, MO_8) -TRANS(vslei_hu, ALL, do_vslei_u, MO_16) -TRANS(vslei_wu, ALL, do_vslei_u, MO_32) -TRANS(vslei_du, ALL, do_vslei_u, MO_64) +TRANS(vsle_b, LSX, do_cmp, MO_8, TCG_COND_LE) +TRANS(vsle_h, LSX, do_cmp, MO_16, TCG_COND_LE) +TRANS(vsle_w, LSX, do_cmp, MO_32, TCG_COND_LE) +TRANS(vsle_d, LSX, do_cmp, MO_64, TCG_COND_LE) +TRANS(vslei_b, LSX, do_vslei_s, MO_8) +TRANS(vslei_h, LSX, do_vslei_s, MO_16) +TRANS(vslei_w, LSX, do_vslei_s, MO_32) +TRANS(vslei_d, LSX, do_vslei_s, MO_64) +TRANS(vsle_bu, LSX, do_cmp, MO_8, TCG_COND_LEU) +TRANS(vsle_hu, LSX, do_cmp, MO_16, TCG_COND_LEU) +TRANS(vsle_wu, LSX, do_cmp, MO_32, TCG_COND_LEU) +TRANS(vsle_du, LSX, do_cmp, MO_64, TCG_COND_LEU) +TRANS(vslei_bu, LSX, do_vslei_u, MO_8) +TRANS(vslei_hu, LSX, do_vslei_u, MO_16) +TRANS(vslei_wu, LSX, do_vslei_u, MO_32) +TRANS(vslei_du, LSX, do_vslei_u, MO_64) -TRANS(vslt_b, ALL, do_cmp, MO_8, TCG_COND_LT) -TRANS(vslt_h, ALL, do_cmp, MO_16, TCG_COND_LT) -TRANS(vslt_w, ALL, do_cmp, MO_32, TCG_COND_LT) -TRANS(vslt_d, ALL, do_cmp, MO_64, TCG_COND_LT) -TRANS(vslti_b, ALL, do_vslti_s, MO_8) -TRANS(vslti_h, ALL, do_vslti_s, MO_16) -TRANS(vslti_w, ALL, do_vslti_s, MO_32) -TRANS(vslti_d, ALL, do_vslti_s, MO_64) -TRANS(vslt_bu, ALL, do_cmp, MO_8, TCG_COND_LTU) -TRANS(vslt_hu, ALL, do_cmp, MO_16, TCG_COND_LTU) -TRANS(vslt_wu, ALL, do_cmp, MO_32, TCG_COND_LTU) -TRANS(vslt_du, ALL, do_cmp, MO_64, TCG_COND_LTU) -TRANS(vslti_bu, ALL, do_vslti_u, MO_8) -TRANS(vslti_hu, ALL, do_vslti_u, MO_16) -TRANS(vslti_wu, ALL, do_vslti_u, MO_32) -TRANS(vslti_du, ALL, do_vslti_u, MO_64) +TRANS(vslt_b, LSX, do_cmp, MO_8, TCG_COND_LT) +TRANS(vslt_h, LSX, do_cmp, MO_16, TCG_COND_LT) +TRANS(vslt_w, LSX, do_cmp, MO_32, TCG_COND_LT) +TRANS(vslt_d, LSX, do_cmp, MO_64, TCG_COND_LT) +TRANS(vslti_b, LSX, do_vslti_s, MO_8) +TRANS(vslti_h, LSX, do_vslti_s, MO_16) +TRANS(vslti_w, LSX, do_vslti_s, MO_32) +TRANS(vslti_d, LSX, do_vslti_s, MO_64) +TRANS(vslt_bu, LSX, do_cmp, MO_8, TCG_COND_LTU) +TRANS(vslt_hu, LSX, do_cmp, MO_16, TCG_COND_LTU) +TRANS(vslt_wu, LSX, do_cmp, MO_32, TCG_COND_LTU) +TRANS(vslt_du, LSX, do_cmp, MO_64, TCG_COND_LTU) +TRANS(vslti_bu, LSX, do_vslti_u, MO_8) +TRANS(vslti_hu, LSX, do_vslti_u, MO_16) +TRANS(vslti_wu, LSX, do_vslti_u, MO_32) +TRANS(vslti_du, LSX, do_vslti_u, MO_64) static bool trans_vfcmp_cond_s(DisasContext *ctx, arg_vvv_fcond *a) { @@ -3874,6 +3895,10 @@ static bool trans_vfcmp_cond_s(DisasContext *ctx, arg_vvv_fcond *a) TCGv_i32 vj = tcg_constant_i32(a->vj); TCGv_i32 vk = tcg_constant_i32(a->vk); + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; fn = (a->fcond & 1 ? gen_helper_vfcmp_s_s : gen_helper_vfcmp_c_s); @@ -3891,6 +3916,12 @@ static bool trans_vfcmp_cond_d(DisasContext *ctx, arg_vvv_fcond *a) TCGv_i32 vj = tcg_constant_i32(a->vj); TCGv_i32 vk = tcg_constant_i32(a->vk); + if (!avail_LSX(ctx)) { + return false; + } + + CHECK_SXE; + fn = (a->fcond & 1 ? gen_helper_vfcmp_s_d : gen_helper_vfcmp_c_d); flags = get_fcmp_flags(a->fcond >> 1); fn(cpu_env, vd, vj, vk, tcg_constant_i32(flags)); @@ -3900,6 +3931,10 @@ static bool trans_vfcmp_cond_d(DisasContext *ctx, arg_vvv_fcond *a) static bool trans_vbitsel_v(DisasContext *ctx, arg_vvvv *a) { + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; tcg_gen_gvec_bitsel(MO_64, vec_full_offset(a->vd), vec_full_offset(a->va), @@ -3922,6 +3957,10 @@ static bool trans_vbitseli_b(DisasContext *ctx, arg_vv_i *a) .load_dest = true }; + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; tcg_gen_gvec_2i(vec_full_offset(a->vd), vec_full_offset(a->vj), @@ -3941,6 +3980,10 @@ static bool trans_## NAME (DisasContext *ctx, arg_cv *a) \ get_vreg64(ah, a->vj, 1); \ get_vreg64(al, a->vj, 0); \ \ + if (!avail_LSX(ctx)) { \ + return false; \ + } \ + \ CHECK_SXE; \ tcg_gen_or_i64(t1, al, ah); \ tcg_gen_setcondi_i64(COND, t1, t1, 0); \ @@ -3952,18 +3995,23 @@ static bool trans_## NAME (DisasContext *ctx, arg_cv *a) \ VSET(vseteqz_v, TCG_COND_EQ) VSET(vsetnez_v, TCG_COND_NE) -TRANS(vsetanyeqz_b, ALL, gen_cv, gen_helper_vsetanyeqz_b) -TRANS(vsetanyeqz_h, ALL, gen_cv, gen_helper_vsetanyeqz_h) -TRANS(vsetanyeqz_w, ALL, gen_cv, gen_helper_vsetanyeqz_w) -TRANS(vsetanyeqz_d, ALL, gen_cv, gen_helper_vsetanyeqz_d) -TRANS(vsetallnez_b, ALL, gen_cv, gen_helper_vsetallnez_b) -TRANS(vsetallnez_h, ALL, gen_cv, gen_helper_vsetallnez_h) -TRANS(vsetallnez_w, ALL, gen_cv, gen_helper_vsetallnez_w) -TRANS(vsetallnez_d, ALL, gen_cv, gen_helper_vsetallnez_d) +TRANS(vsetanyeqz_b, LSX, gen_cv, gen_helper_vsetanyeqz_b) +TRANS(vsetanyeqz_h, LSX, gen_cv, gen_helper_vsetanyeqz_h) +TRANS(vsetanyeqz_w, LSX, gen_cv, gen_helper_vsetanyeqz_w) +TRANS(vsetanyeqz_d, LSX, gen_cv, gen_helper_vsetanyeqz_d) +TRANS(vsetallnez_b, LSX, gen_cv, gen_helper_vsetallnez_b) +TRANS(vsetallnez_h, LSX, gen_cv, gen_helper_vsetallnez_h) +TRANS(vsetallnez_w, LSX, gen_cv, gen_helper_vsetallnez_w) +TRANS(vsetallnez_d, LSX, gen_cv, gen_helper_vsetallnez_d) static bool trans_vinsgr2vr_b(DisasContext *ctx, arg_vr_i *a) { TCGv src = gpr_src(ctx, a->rj, EXT_NONE); + + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; tcg_gen_st8_i64(src, cpu_env, offsetof(CPULoongArchState, fpr[a->vd].vreg.B(a->imm))); @@ -3973,6 +4021,11 @@ static bool trans_vinsgr2vr_b(DisasContext *ctx, arg_vr_i *a) static bool trans_vinsgr2vr_h(DisasContext *ctx, arg_vr_i *a) { TCGv src = gpr_src(ctx, a->rj, EXT_NONE); + + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; tcg_gen_st16_i64(src, cpu_env, offsetof(CPULoongArchState, fpr[a->vd].vreg.H(a->imm))); @@ -3982,6 +4035,11 @@ static bool trans_vinsgr2vr_h(DisasContext *ctx, arg_vr_i *a) static bool trans_vinsgr2vr_w(DisasContext *ctx, arg_vr_i *a) { TCGv src = gpr_src(ctx, a->rj, EXT_NONE); + + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; tcg_gen_st32_i64(src, cpu_env, offsetof(CPULoongArchState, fpr[a->vd].vreg.W(a->imm))); @@ -3991,6 +4049,11 @@ static bool trans_vinsgr2vr_w(DisasContext *ctx, arg_vr_i *a) static bool trans_vinsgr2vr_d(DisasContext *ctx, arg_vr_i *a) { TCGv src = gpr_src(ctx, a->rj, EXT_NONE); + + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; tcg_gen_st_i64(src, cpu_env, offsetof(CPULoongArchState, fpr[a->vd].vreg.D(a->imm))); @@ -4000,6 +4063,11 @@ static bool trans_vinsgr2vr_d(DisasContext *ctx, arg_vr_i *a) static bool trans_vpickve2gr_b(DisasContext *ctx, arg_rv_i *a) { TCGv dst = gpr_dst(ctx, a->rd, EXT_NONE); + + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; tcg_gen_ld8s_i64(dst, cpu_env, offsetof(CPULoongArchState, fpr[a->vj].vreg.B(a->imm))); @@ -4009,6 +4077,11 @@ static bool trans_vpickve2gr_b(DisasContext *ctx, arg_rv_i *a) static bool trans_vpickve2gr_h(DisasContext *ctx, arg_rv_i *a) { TCGv dst = gpr_dst(ctx, a->rd, EXT_NONE); + + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; tcg_gen_ld16s_i64(dst, cpu_env, offsetof(CPULoongArchState, fpr[a->vj].vreg.H(a->imm))); @@ -4018,6 +4091,11 @@ static bool trans_vpickve2gr_h(DisasContext *ctx, arg_rv_i *a) static bool trans_vpickve2gr_w(DisasContext *ctx, arg_rv_i *a) { TCGv dst = gpr_dst(ctx, a->rd, EXT_NONE); + + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; tcg_gen_ld32s_i64(dst, cpu_env, offsetof(CPULoongArchState, fpr[a->vj].vreg.W(a->imm))); @@ -4027,6 +4105,11 @@ static bool trans_vpickve2gr_w(DisasContext *ctx, arg_rv_i *a) static bool trans_vpickve2gr_d(DisasContext *ctx, arg_rv_i *a) { TCGv dst = gpr_dst(ctx, a->rd, EXT_NONE); + + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; tcg_gen_ld_i64(dst, cpu_env, offsetof(CPULoongArchState, fpr[a->vj].vreg.D(a->imm))); @@ -4036,6 +4119,11 @@ static bool trans_vpickve2gr_d(DisasContext *ctx, arg_rv_i *a) static bool trans_vpickve2gr_bu(DisasContext *ctx, arg_rv_i *a) { TCGv dst = gpr_dst(ctx, a->rd, EXT_NONE); + + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; tcg_gen_ld8u_i64(dst, cpu_env, offsetof(CPULoongArchState, fpr[a->vj].vreg.B(a->imm))); @@ -4045,6 +4133,11 @@ static bool trans_vpickve2gr_bu(DisasContext *ctx, arg_rv_i *a) static bool trans_vpickve2gr_hu(DisasContext *ctx, arg_rv_i *a) { TCGv dst = gpr_dst(ctx, a->rd, EXT_NONE); + + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; tcg_gen_ld16u_i64(dst, cpu_env, offsetof(CPULoongArchState, fpr[a->vj].vreg.H(a->imm))); @@ -4054,6 +4147,11 @@ static bool trans_vpickve2gr_hu(DisasContext *ctx, arg_rv_i *a) static bool trans_vpickve2gr_wu(DisasContext *ctx, arg_rv_i *a) { TCGv dst = gpr_dst(ctx, a->rd, EXT_NONE); + + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; tcg_gen_ld32u_i64(dst, cpu_env, offsetof(CPULoongArchState, fpr[a->vj].vreg.W(a->imm))); @@ -4063,6 +4161,11 @@ static bool trans_vpickve2gr_wu(DisasContext *ctx, arg_rv_i *a) static bool trans_vpickve2gr_du(DisasContext *ctx, arg_rv_i *a) { TCGv dst = gpr_dst(ctx, a->rd, EXT_NONE); + + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; tcg_gen_ld_i64(dst, cpu_env, offsetof(CPULoongArchState, fpr[a->vj].vreg.D(a->imm))); @@ -4072,6 +4175,11 @@ static bool trans_vpickve2gr_du(DisasContext *ctx, arg_rv_i *a) static bool gvec_dup(DisasContext *ctx, arg_vr *a, MemOp mop) { TCGv src = gpr_src(ctx, a->rj, EXT_NONE); + + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; tcg_gen_gvec_dup_i64(mop, vec_full_offset(a->vd), @@ -4079,13 +4187,17 @@ static bool gvec_dup(DisasContext *ctx, arg_vr *a, MemOp mop) return true; } -TRANS(vreplgr2vr_b, ALL, gvec_dup, MO_8) -TRANS(vreplgr2vr_h, ALL, gvec_dup, MO_16) -TRANS(vreplgr2vr_w, ALL, gvec_dup, MO_32) -TRANS(vreplgr2vr_d, ALL, gvec_dup, MO_64) +TRANS(vreplgr2vr_b, LSX, gvec_dup, MO_8) +TRANS(vreplgr2vr_h, LSX, gvec_dup, MO_16) +TRANS(vreplgr2vr_w, LSX, gvec_dup, MO_32) +TRANS(vreplgr2vr_d, LSX, gvec_dup, MO_64) static bool trans_vreplvei_b(DisasContext *ctx, arg_vv_i *a) { + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; tcg_gen_gvec_dup_mem(MO_8,vec_full_offset(a->vd), offsetof(CPULoongArchState, @@ -4096,6 +4208,10 @@ static bool trans_vreplvei_b(DisasContext *ctx, arg_vv_i *a) static bool trans_vreplvei_h(DisasContext *ctx, arg_vv_i *a) { + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; tcg_gen_gvec_dup_mem(MO_16, vec_full_offset(a->vd), offsetof(CPULoongArchState, @@ -4105,6 +4221,10 @@ static bool trans_vreplvei_h(DisasContext *ctx, arg_vv_i *a) } static bool trans_vreplvei_w(DisasContext *ctx, arg_vv_i *a) { + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; tcg_gen_gvec_dup_mem(MO_32, vec_full_offset(a->vd), offsetof(CPULoongArchState, @@ -4114,6 +4234,10 @@ static bool trans_vreplvei_w(DisasContext *ctx, arg_vv_i *a) } static bool trans_vreplvei_d(DisasContext *ctx, arg_vv_i *a) { + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; tcg_gen_gvec_dup_mem(MO_64, vec_full_offset(a->vd), offsetof(CPULoongArchState, @@ -4129,6 +4253,10 @@ static bool gen_vreplve(DisasContext *ctx, arg_vvr *a, int vece, int bit, TCGv_ptr t1 = tcg_temp_new_ptr(); TCGv_i64 t2 = tcg_temp_new_i64(); + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; tcg_gen_andi_i64(t0, gpr_src(ctx, a->rk, EXT_NONE), (LSX_LEN/bit) -1); @@ -4145,16 +4273,20 @@ static bool gen_vreplve(DisasContext *ctx, arg_vvr *a, int vece, int bit, return true; } -TRANS(vreplve_b, ALL, gen_vreplve, MO_8, 8, tcg_gen_ld8u_i64) -TRANS(vreplve_h, ALL, gen_vreplve, MO_16, 16, tcg_gen_ld16u_i64) -TRANS(vreplve_w, ALL, gen_vreplve, MO_32, 32, tcg_gen_ld32u_i64) -TRANS(vreplve_d, ALL, gen_vreplve, MO_64, 64, tcg_gen_ld_i64) +TRANS(vreplve_b, LSX, gen_vreplve, MO_8, 8, tcg_gen_ld8u_i64) +TRANS(vreplve_h, LSX, gen_vreplve, MO_16, 16, tcg_gen_ld16u_i64) +TRANS(vreplve_w, LSX, gen_vreplve, MO_32, 32, tcg_gen_ld32u_i64) +TRANS(vreplve_d, LSX, gen_vreplve, MO_64, 64, tcg_gen_ld_i64) static bool trans_vbsll_v(DisasContext *ctx, arg_vv_i *a) { int ofs; TCGv_i64 desthigh, destlow, high, low; + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; desthigh = tcg_temp_new_i64(); @@ -4185,6 +4317,10 @@ static bool trans_vbsrl_v(DisasContext *ctx, arg_vv_i *a) TCGv_i64 desthigh, destlow, high, low; int ofs; + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; desthigh = tcg_temp_new_i64(); @@ -4210,48 +4346,48 @@ static bool trans_vbsrl_v(DisasContext *ctx, arg_vv_i *a) return true; } -TRANS(vpackev_b, ALL, gen_vvv, gen_helper_vpackev_b) -TRANS(vpackev_h, ALL, gen_vvv, gen_helper_vpackev_h) -TRANS(vpackev_w, ALL, gen_vvv, gen_helper_vpackev_w) -TRANS(vpackev_d, ALL, gen_vvv, gen_helper_vpackev_d) -TRANS(vpackod_b, ALL, gen_vvv, gen_helper_vpackod_b) -TRANS(vpackod_h, ALL, gen_vvv, gen_helper_vpackod_h) -TRANS(vpackod_w, ALL, gen_vvv, gen_helper_vpackod_w) -TRANS(vpackod_d, ALL, gen_vvv, gen_helper_vpackod_d) +TRANS(vpackev_b, LSX, gen_vvv, gen_helper_vpackev_b) +TRANS(vpackev_h, LSX, gen_vvv, gen_helper_vpackev_h) +TRANS(vpackev_w, LSX, gen_vvv, gen_helper_vpackev_w) +TRANS(vpackev_d, LSX, gen_vvv, gen_helper_vpackev_d) +TRANS(vpackod_b, LSX, gen_vvv, gen_helper_vpackod_b) +TRANS(vpackod_h, LSX, gen_vvv, gen_helper_vpackod_h) +TRANS(vpackod_w, LSX, gen_vvv, gen_helper_vpackod_w) +TRANS(vpackod_d, LSX, gen_vvv, gen_helper_vpackod_d) -TRANS(vpickev_b, ALL, gen_vvv, gen_helper_vpickev_b) -TRANS(vpickev_h, ALL, gen_vvv, gen_helper_vpickev_h) -TRANS(vpickev_w, ALL, gen_vvv, gen_helper_vpickev_w) -TRANS(vpickev_d, ALL, gen_vvv, gen_helper_vpickev_d) -TRANS(vpickod_b, ALL, gen_vvv, gen_helper_vpickod_b) -TRANS(vpickod_h, ALL, gen_vvv, gen_helper_vpickod_h) -TRANS(vpickod_w, ALL, gen_vvv, gen_helper_vpickod_w) -TRANS(vpickod_d, ALL, gen_vvv, gen_helper_vpickod_d) +TRANS(vpickev_b, LSX, gen_vvv, gen_helper_vpickev_b) +TRANS(vpickev_h, LSX, gen_vvv, gen_helper_vpickev_h) +TRANS(vpickev_w, LSX, gen_vvv, gen_helper_vpickev_w) +TRANS(vpickev_d, LSX, gen_vvv, gen_helper_vpickev_d) +TRANS(vpickod_b, LSX, gen_vvv, gen_helper_vpickod_b) +TRANS(vpickod_h, LSX, gen_vvv, gen_helper_vpickod_h) +TRANS(vpickod_w, LSX, gen_vvv, gen_helper_vpickod_w) +TRANS(vpickod_d, LSX, gen_vvv, gen_helper_vpickod_d) -TRANS(vilvl_b, ALL, gen_vvv, gen_helper_vilvl_b) -TRANS(vilvl_h, ALL, gen_vvv, gen_helper_vilvl_h) -TRANS(vilvl_w, ALL, gen_vvv, gen_helper_vilvl_w) -TRANS(vilvl_d, ALL, gen_vvv, gen_helper_vilvl_d) -TRANS(vilvh_b, ALL, gen_vvv, gen_helper_vilvh_b) -TRANS(vilvh_h, ALL, gen_vvv, gen_helper_vilvh_h) -TRANS(vilvh_w, ALL, gen_vvv, gen_helper_vilvh_w) -TRANS(vilvh_d, ALL, gen_vvv, gen_helper_vilvh_d) +TRANS(vilvl_b, LSX, gen_vvv, gen_helper_vilvl_b) +TRANS(vilvl_h, LSX, gen_vvv, gen_helper_vilvl_h) +TRANS(vilvl_w, LSX, gen_vvv, gen_helper_vilvl_w) +TRANS(vilvl_d, LSX, gen_vvv, gen_helper_vilvl_d) +TRANS(vilvh_b, LSX, gen_vvv, gen_helper_vilvh_b) +TRANS(vilvh_h, LSX, gen_vvv, gen_helper_vilvh_h) +TRANS(vilvh_w, LSX, gen_vvv, gen_helper_vilvh_w) +TRANS(vilvh_d, LSX, gen_vvv, gen_helper_vilvh_d) -TRANS(vshuf_b, ALL, gen_vvvv, gen_helper_vshuf_b) -TRANS(vshuf_h, ALL, gen_vvv, gen_helper_vshuf_h) -TRANS(vshuf_w, ALL, gen_vvv, gen_helper_vshuf_w) -TRANS(vshuf_d, ALL, gen_vvv, gen_helper_vshuf_d) -TRANS(vshuf4i_b, ALL, gen_vv_i, gen_helper_vshuf4i_b) -TRANS(vshuf4i_h, ALL, gen_vv_i, gen_helper_vshuf4i_h) -TRANS(vshuf4i_w, ALL, gen_vv_i, gen_helper_vshuf4i_w) -TRANS(vshuf4i_d, ALL, gen_vv_i, gen_helper_vshuf4i_d) +TRANS(vshuf_b, LSX, gen_vvvv, gen_helper_vshuf_b) +TRANS(vshuf_h, LSX, gen_vvv, gen_helper_vshuf_h) +TRANS(vshuf_w, LSX, gen_vvv, gen_helper_vshuf_w) +TRANS(vshuf_d, LSX, gen_vvv, gen_helper_vshuf_d) +TRANS(vshuf4i_b, LSX, gen_vv_i, gen_helper_vshuf4i_b) +TRANS(vshuf4i_h, LSX, gen_vv_i, gen_helper_vshuf4i_h) +TRANS(vshuf4i_w, LSX, gen_vv_i, gen_helper_vshuf4i_w) +TRANS(vshuf4i_d, LSX, gen_vv_i, gen_helper_vshuf4i_d) -TRANS(vpermi_w, ALL, gen_vv_i, gen_helper_vpermi_w) +TRANS(vpermi_w, LSX, gen_vv_i, gen_helper_vpermi_w) -TRANS(vextrins_b, ALL, gen_vv_i, gen_helper_vextrins_b) -TRANS(vextrins_h, ALL, gen_vv_i, gen_helper_vextrins_h) -TRANS(vextrins_w, ALL, gen_vv_i, gen_helper_vextrins_w) -TRANS(vextrins_d, ALL, gen_vv_i, gen_helper_vextrins_d) +TRANS(vextrins_b, LSX, gen_vv_i, gen_helper_vextrins_b) +TRANS(vextrins_h, LSX, gen_vv_i, gen_helper_vextrins_h) +TRANS(vextrins_w, LSX, gen_vv_i, gen_helper_vextrins_w) +TRANS(vextrins_d, LSX, gen_vv_i, gen_helper_vextrins_d) static bool trans_vld(DisasContext *ctx, arg_vr_i *a) { @@ -4259,6 +4395,10 @@ static bool trans_vld(DisasContext *ctx, arg_vr_i *a) TCGv_i64 rl, rh; TCGv_i128 val; + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; addr = gpr_src(ctx, a->rj, EXT_NONE); @@ -4282,6 +4422,10 @@ static bool trans_vst(DisasContext *ctx, arg_vr_i *a) TCGv_i128 val; TCGv_i64 ah, al; + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; addr = gpr_src(ctx, a->rj, EXT_NONE); @@ -4305,6 +4449,10 @@ static bool trans_vldx(DisasContext *ctx, arg_vrr *a) TCGv_i64 rl, rh; TCGv_i128 val; + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; src1 = gpr_src(ctx, a->rj, EXT_NONE); @@ -4328,6 +4476,10 @@ static bool trans_vstx(DisasContext *ctx, arg_vrr *a) TCGv_i64 ah, al; TCGv_i128 val; + if (!avail_LSX(ctx)) { + return false; + } + CHECK_SXE; src1 = gpr_src(ctx, a->rj, EXT_NONE); @@ -4351,6 +4503,10 @@ static bool trans_## NAME (DisasContext *ctx, arg_vr_i *a) \ TCGv addr; \ TCGv_i64 val; \ \ + if (!avail_LSX(ctx)) { \ + return false; \ + } \ + \ CHECK_SXE; \ \ addr = gpr_src(ctx, a->rj, EXT_NONE); \ @@ -4375,6 +4531,10 @@ static bool trans_## NAME (DisasContext *ctx, arg_vr_ii *a) \ TCGv addr; \ TCGv_i64 val; \ \ + if (!avail_LSX(ctx)) { \ + return false; \ + } \ + \ CHECK_SXE; \ \ addr = gpr_src(ctx, a->rj, EXT_NONE); \ From patchwork Tue Aug 22 07:22:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 715707 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp121267wrp; Tue, 22 Aug 2023 00:22:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHpPHqsud2KyScn7/tj79lWjfhNwZIRpoYL4l041Cz4oFRTwGy0EOND+eR19WUu9tqhCr1i X-Received: by 2002:a05:620a:3915:b0:76c:a911:f74f with SMTP id qr21-20020a05620a391500b0076ca911f74fmr12103923qkn.27.1692688973521; Tue, 22 Aug 2023 00:22:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692688973; cv=none; d=google.com; s=arc-20160816; b=xqt0t09WgXlBZYOs6sAQzDD4BEo0NoXjmWNuc57A7gua4kjx802ddiDbQD6OPFjSD3 IGjGITZjmr8gBC1YgrOCt0iDAH7N9gijd3DvQd7IXL1NKH2huJTNI64gVru7w9yhPQ0N H/68qPmh8eph2DxrVT4rFz/HUNAc6ilo/9jjG0xMvJOJbcJXyyL3s7u593CjHBgFc0Gz ibSkhieyRMIeP+hF+YbPyJPb57ZKJwac8IKRbCGiB4RwqetBNJNATD0TyJcOb26M1jI2 XSf9HYQ8uM6djemIhXfHVZo/xyryAVl4HLcDUiOynzZqHOHKBnRfxh8rvKCiKM/iL3iL FLIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=lbOm492kfn2NnT5mbCpnVZcB+ILWfzeNs0XAfBSLLZg=; fh=EgjsXW+L4Y5zRUQS7SIQdGNDJ+AtbUcRDS0IFIrVH6E=; b=J4NiHDAeyFqg0X0mx/1DQt6zhPkGEEx9P4cz4za+LtqLK5ci53e3NXA7ni4zQeUN+2 JqY35n6bVOXRKTV3Qq03JRMHfOJvDVKX9sU13CoaQ+jLyXr5Jy4sPIFVRgv454I8+BI0 AR7Evh9O6DiR+4Y4zhB8uD3XdmTv5s2zeS4Dh9hZ6pGWUIeUs3MsscJ5WqcXA0cSNs28 tcSqfvRNTIpS43xA7pVL/YfEWjwmPbJdyyQD6mGBAuhEKz7BSgzz5bh9tZcHJ5v1uliU nQZkGUAEsb/DAJbQTR/UV46nJOiSlcHLso1bDCMF5UkJB1uKwW1Pr0EODOQ4Zj5RY9ER o0wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XUByU4zH; 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 qz9-20020a05620a8c0900b0076cafcc69aesi3644082qkn.453.2023.08.22.00.22.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 00:22:53 -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=XUByU4zH; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYLii-0003Sm-9n; Tue, 22 Aug 2023 03:22:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYLig-0003SL-AR for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:22:30 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYLid-0005CS-UF for qemu-devel@nongnu.org; Tue, 22 Aug 2023 03:22:30 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-31c5c06e8bbso1098676f8f.1 for ; Tue, 22 Aug 2023 00:22:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692688946; x=1693293746; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lbOm492kfn2NnT5mbCpnVZcB+ILWfzeNs0XAfBSLLZg=; b=XUByU4zHhcDU6XPAiVF7PcVa2Cb5MgwSyY+HIwEuIaGM4orcyidCEMB9BQeRBTP9n4 oj8NZSkpYD+kBddr2Jj1aOKE9A1P/04wGbTbMnO/ipsKZt+mj6L5SN0qqyDkdlwahdCE DUT9KfdsS6C7YWTa6puFPGYTUu7boZGAg4RnVA5SNepVlCR7dd27JSAGg42qqoLVy++9 wVOqmatrhMIDtMGIBrstAyJ7aILz1oEJ1HI6nguzzwpKdZj/sdY4tvLRq809TXAxw0Ar V4Qv9TO/8UeIvlR2lTuxOxEajo/SHgWmd6/kasZX+zGgSQA6804f09EubyGRL2XbO9Kw 7LtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692688946; x=1693293746; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lbOm492kfn2NnT5mbCpnVZcB+ILWfzeNs0XAfBSLLZg=; b=cRi8IWxMiTP+Uftf6fw1JqYCuuXQ3QpjLaT4JctPLomSPDzK+KooABLkfdskDi2QBd gcTPrl2peyMR+N16mvsPir8aJQQVk3AzXQTjo3Dzp0X5LZo5PEm8N/IlSiYF8+53Otxh /WFYtLK1iXkFuZaLOt2PlFe9KoDUCW/KJGmscMWX+bQeSGtCBP4ldMvHTZmhA3OyPtJX d1b6IMjZwbEPI1ixJ9hRWsTBNXUXcYhJmQecIda4BeTEJGfTB2EYbg/GVYoGjid2M8Dh 35/YjVIP084ppY0oXglvUsw1XtYcuCtcHC3xtt6b/qaNoCU68fBIcG2jPr/McwE6DfIL dfKA== X-Gm-Message-State: AOJu0Yzbrb8F7XR02VVmsERUnJvK/t6ovF0lK7YMTvZ5oZ6TJFTcCyQ+ xmYKsReBNAo2jmYjExB0Hx2y5uq6sZ0PWIWhHRZxNw== X-Received: by 2002:a5d:4ed2:0:b0:315:ae39:27c with SMTP id s18-20020a5d4ed2000000b00315ae39027cmr6906575wrv.70.1692688946407; Tue, 22 Aug 2023 00:22:26 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id 17-20020a05600c025100b003fefb94ccc9sm487062wmj.11.2023.08.22.00.22.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 00:22:26 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Song Gao Cc: Jiajie Chen , Xiaojuan Yang , Huacai Chen , Richard Henderson Subject: [PATCH RESEND v5 19/19] target/loongarch: Add avail_IOCSR to check iocsr instructions Date: Tue, 22 Aug 2023 09:22:19 +0200 Message-ID: <20230822072219.35719-1-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822071405.35386-1-philmd@linaro.org> References: <20230822071405.35386-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Song Gao Signed-off-by: Song Gao Reviewed-by: Richard Henderson Message-ID: <20230822032724.1353391-16-gaosong@loongson.cn> --- target/loongarch/translate.h | 2 +- .../loongarch/insn_trans/trans_privileged.c.inc | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/target/loongarch/translate.h b/target/loongarch/translate.h index db46e9aa0f..89b49a859e 100644 --- a/target/loongarch/translate.h +++ b/target/loongarch/translate.h @@ -23,7 +23,7 @@ #define avail_LSPW(C) (FIELD_EX32((C)->cpucfg2, CPUCFG2, LSPW)) #define avail_LAM(C) (FIELD_EX32((C)->cpucfg2, CPUCFG2, LAM)) #define avail_LSX(C) (FIELD_EX32((C)->cpucfg2, CPUCFG2, LSX)) - +#define avail_IOCSR(C) (FIELD_EX32((C)->cpucfg1, CPUCFG1, IOCSR)) /* * If an operation is being performed on less than TARGET_LONG_BITS, diff --git a/target/loongarch/insn_trans/trans_privileged.c.inc b/target/loongarch/insn_trans/trans_privileged.c.inc index 099cd871f0..4cb701b4b5 100644 --- a/target/loongarch/insn_trans/trans_privileged.c.inc +++ b/target/loongarch/insn_trans/trans_privileged.c.inc @@ -312,14 +312,14 @@ static bool gen_iocsrwr(DisasContext *ctx, arg_rr *a, return true; } -TRANS(iocsrrd_b, ALL, gen_iocsrrd, gen_helper_iocsrrd_b) -TRANS(iocsrrd_h, ALL, gen_iocsrrd, gen_helper_iocsrrd_h) -TRANS(iocsrrd_w, ALL, gen_iocsrrd, gen_helper_iocsrrd_w) -TRANS(iocsrrd_d, ALL, gen_iocsrrd, gen_helper_iocsrrd_d) -TRANS(iocsrwr_b, ALL, gen_iocsrwr, gen_helper_iocsrwr_b) -TRANS(iocsrwr_h, ALL, gen_iocsrwr, gen_helper_iocsrwr_h) -TRANS(iocsrwr_w, ALL, gen_iocsrwr, gen_helper_iocsrwr_w) -TRANS(iocsrwr_d, ALL, gen_iocsrwr, gen_helper_iocsrwr_d) +TRANS(iocsrrd_b, IOCSR, gen_iocsrrd, gen_helper_iocsrrd_b) +TRANS(iocsrrd_h, IOCSR, gen_iocsrrd, gen_helper_iocsrrd_h) +TRANS(iocsrrd_w, IOCSR, gen_iocsrrd, gen_helper_iocsrrd_w) +TRANS(iocsrrd_d, IOCSR, gen_iocsrrd, gen_helper_iocsrrd_d) +TRANS(iocsrwr_b, IOCSR, gen_iocsrwr, gen_helper_iocsrwr_b) +TRANS(iocsrwr_h, IOCSR, gen_iocsrwr, gen_helper_iocsrwr_h) +TRANS(iocsrwr_w, IOCSR, gen_iocsrwr, gen_helper_iocsrwr_w) +TRANS(iocsrwr_d, IOCSR, gen_iocsrwr, gen_helper_iocsrwr_d) static void check_mmu_idx(DisasContext *ctx) {