From patchwork Tue Aug 22 09:37:06 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: 715715 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp163555wrp; Tue, 22 Aug 2023 02:38:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE9owWq1oTCeFNskak6r7JHrq3B4+jSDjaVXzue6YsCkkA5UxBQzbFMO964PQW9xsuCVG9k X-Received: by 2002:ac8:5ad6:0:b0:403:b395:b450 with SMTP id d22-20020ac85ad6000000b00403b395b450mr12242832qtd.2.1692697083262; Tue, 22 Aug 2023 02:38:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692697083; cv=none; d=google.com; s=arc-20160816; b=CIAb4eVq3Gn17ODlRr48SyiMIr5EWqf2x4IU39UWN0ypHTSqiGnmN+/QplY2zLRe5/ bfZ3ftAQCle12abC3RyJK1eifTq7hgx3R0XjQOXP7WDH8Aa+lKf0KKo/ySOO0Bhx/PMS KtmlYxPMfggsfStcvPDd90wZDkw3iV5eJDwKcQwxAjvVY92dxg+iOaFcM+c5kEEwcqHW Kkx0im9HpWo6tIz81ANgn9m7+/2JOZEbcIJEzG9QY62Y8563VKgsvcMDPjdp7yEHozUy dMn5632BiSyX3/Ya5QuEw5yXLAmnHymNuddAFegnuHP0a77AmwNRd1sOHIROClHbA6ES KLKQ== 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=ZJPKVO+xaCar/pzXI7lGpOGhrynSj4d9rgRqF1K4Bw0=; fh=eYtoxxKzGuW/ZzBKGY04QGXjEEWdmzL/9j0dDOZVqP8=; b=dIthwtDkgSoacsFfaBEw1kr7lKhH1HzlARC50E3Vmhy76raj7dYa2pmQdrPZcA+sr5 TGiu0NIv32641pM7JIU+no7CB9QDIpNN1fWkzAL24v/Oee0DW1Pm3oV0N3BgLQ/qNzYY XHFx6cRA6t7i/kiGUm1I7xRjqyGV2ONYmFxMwDqNWXPzEQDSnxm2g23SGXgWErY8RE8K 20th5NAAWr1urS0b+pP+kcb7DIrAJFHc5x53NZxbHnc7KhOlN8t8uz/onMCF+2w5rdDh TX060Yk0IjYYaYOAKR5EL14R35mByqsGuOBVQbrIjWTQljY2MD7RBrrJ+cfJeNJQb0KH rvSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uI5rO9kS; 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 bp39-20020a05622a1ba700b004055a8c7903si6124736qtb.211.2023.08.22.02.38.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 02:38:03 -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=uI5rO9kS; 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 1qYNpG-0000TN-67; Tue, 22 Aug 2023 05:37: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 1qYNpF-0000TF-Je for qemu-devel@nongnu.org; Tue, 22 Aug 2023 05:37:25 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYNpD-0001et-8H for qemu-devel@nongnu.org; Tue, 22 Aug 2023 05:37:25 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-31c5cac3ae2so1112722f8f.3 for ; Tue, 22 Aug 2023 02:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692697041; x=1693301841; 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=ZJPKVO+xaCar/pzXI7lGpOGhrynSj4d9rgRqF1K4Bw0=; b=uI5rO9kSQBwwmw9FQAmlyduqYoGGLMMoSbQ5vcdSzDUBi/VJ2zae+9j0RRaBvGgVwo FSdY1oXCtoOk9fUkMrSU7CEjFGKC/2hemT6i9gcSwaPIje4WI/T9TABpYUuk5vbK+xYt xgdUTrzTbRIa/Tz3ac2K99YFlP2RjI91SHFfa+3PV/TUSFHRrpKjV1TQwy0jAz3/Hcig rnzD6Fq20pSm5DYOhz8rlmu82axsadA7mAbDVE64bXMb9Jh71lH/bmiboVNhJrPCwo6d 2c6ejzwmsSJ1MKCJZfuGnfHVOIxCt7ii3ExWXNPDpd+5GAOHdIBXxhPhgIJ1rmaxKR0u U56Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692697041; x=1693301841; 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=ZJPKVO+xaCar/pzXI7lGpOGhrynSj4d9rgRqF1K4Bw0=; b=W3tq74RNMAvK2wAHcN8zsFO4+j+aJWj23G/YNeg32S8i/r6DIDwL0UVlUb0mbXlf9X KsSi2tHC+pJEjX7mVAnOwDV68iGM6nNv1x3pBVvQTTWuJPyhCxyHgvLvYOH2XZRJaZ5q lTTUL5Bxn89syp+PuzO7VPD1lAY9ccXYNLbw9Nz5ySWgT8xCd73Gk8OcMHIzJmhWW1+O bgqx5tFp3B6iEPTk5HNZ4vtsFAzBlf612+NR7kAYmFdfARFXLkwsa2aWBaZ8azfTBt/p ntcSoaWFKKn0v25/rEX3S1gdLAUC200J84iTw6L60deqAwq09H9YpSBg8YXqUCPZ8qga oZkQ== X-Gm-Message-State: AOJu0Yx/2tDpFU2tgq1QgaMjs8dDS53eLs5H/hRxSHIRbzPxgS8dS5Fg Mu+sSMIS6g6NGR/i+fkjcuURFmNDzfbc0g6vH9Et1A== X-Received: by 2002:adf:ec8a:0:b0:319:790e:3bc5 with SMTP id z10-20020adfec8a000000b00319790e3bc5mr6561589wrn.41.1692697041498; Tue, 22 Aug 2023 02:37:21 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id z1-20020adfd0c1000000b003143c9beeaesm15257485wrh.44.2023.08.22.02.37.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 02:37:21 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 1/7] tcg/tcg-op: Document bswap16() byte pattern Date: Tue, 22 Aug 2023 11:37:06 +0200 Message-ID: <20230822093712.38922-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822093712.38922-1-philmd@linaro.org> References: <20230822093712.38922-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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 Signed-off-by: Philippe Mathieu-Daudé --- tcg/tcg-op.c | 48 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 7aadb37756..f164ddc95e 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1021,6 +1021,13 @@ void tcg_gen_ext16u_i32(TCGv_i32 ret, TCGv_i32 arg) } } +/* + * bswap16_i32: 16-bit byte swap on the low bits of a 32-bit value. + * + * Byte pattern: bswap16_i32(xxab) -> ..ba (TCG_BSWAP_OZ) + * bswap16_i32(xxab) -> ssba (TCG_BSWAP_OS) + * bswap16_i32(xxab) -> xxba + */ void tcg_gen_bswap16_i32(TCGv_i32 ret, TCGv_i32 arg, int flags) { /* Only one extension flag may be present. */ @@ -1032,22 +1039,23 @@ void tcg_gen_bswap16_i32(TCGv_i32 ret, TCGv_i32 arg, int flags) TCGv_i32 t0 = tcg_temp_ebb_new_i32(); TCGv_i32 t1 = tcg_temp_ebb_new_i32(); - tcg_gen_shri_i32(t0, arg, 8); + /* arg = xxab */ + tcg_gen_shri_i32(t0, arg, 8); /* t0 = .xxa */ if (!(flags & TCG_BSWAP_IZ)) { - tcg_gen_ext8u_i32(t0, t0); + tcg_gen_ext8u_i32(t0, t0); /* t0 = ...a */ } if (flags & TCG_BSWAP_OS) { - tcg_gen_shli_i32(t1, arg, 24); - tcg_gen_sari_i32(t1, t1, 16); + tcg_gen_shli_i32(t1, arg, 24); /* t1 = b... */ + tcg_gen_sari_i32(t1, t1, 16); /* t1 = ssb. */ } else if (flags & TCG_BSWAP_OZ) { - tcg_gen_ext8u_i32(t1, arg); - tcg_gen_shli_i32(t1, t1, 8); + tcg_gen_ext8u_i32(t1, arg); /* t1 = ...b */ + tcg_gen_shli_i32(t1, t1, 8); /* t1 = ..b. */ } else { - tcg_gen_shli_i32(t1, arg, 8); + tcg_gen_shli_i32(t1, arg, 8); /* t1 = xab. */ } - tcg_gen_or_i32(ret, t0, t1); + tcg_gen_or_i32(ret, t0, t1); /* ret = ssba */ tcg_temp_free_i32(t0); tcg_temp_free_i32(t1); } @@ -1721,6 +1729,13 @@ void tcg_gen_ext32u_i64(TCGv_i64 ret, TCGv_i64 arg) } } +/* + * bswap16_i64: 16-bit byte swap on the low bits of a 64-bit value. + * + * Byte pattern: bswap16_i32(xxxxxxab) -> ......ba (TCG_BSWAP_OZ) + * bswap16_i32(xxxxxxab) -> ssssssba (TCG_BSWAP_OS) + * bswap16_i32(xxxxxxab) -> xxxxxxba + */ void tcg_gen_bswap16_i64(TCGv_i64 ret, TCGv_i64 arg, int flags) { /* Only one extension flag may be present. */ @@ -1739,22 +1754,23 @@ void tcg_gen_bswap16_i64(TCGv_i64 ret, TCGv_i64 arg, int flags) TCGv_i64 t0 = tcg_temp_ebb_new_i64(); TCGv_i64 t1 = tcg_temp_ebb_new_i64(); - tcg_gen_shri_i64(t0, arg, 8); + /* arg = xxxxxxab */ + tcg_gen_shri_i64(t0, arg, 8); /* t0 = .xxxxxxa */ if (!(flags & TCG_BSWAP_IZ)) { - tcg_gen_ext8u_i64(t0, t0); + tcg_gen_ext8u_i64(t0, t0); /* t0 = .......a */ } if (flags & TCG_BSWAP_OS) { - tcg_gen_shli_i64(t1, arg, 56); - tcg_gen_sari_i64(t1, t1, 48); + tcg_gen_shli_i64(t1, arg, 56); /* t1 = b....... */ + tcg_gen_sari_i64(t1, t1, 48); /* t1 = ssssssb. */ } else if (flags & TCG_BSWAP_OZ) { - tcg_gen_ext8u_i64(t1, arg); - tcg_gen_shli_i64(t1, t1, 8); + tcg_gen_ext8u_i64(t1, arg); /* t1 = .......b */ + tcg_gen_shli_i64(t1, t1, 8); /* t1 = ......b. */ } else { - tcg_gen_shli_i64(t1, arg, 8); + tcg_gen_shli_i64(t1, arg, 8); /* t1 = xxxxxxb. */ } - tcg_gen_or_i64(ret, t0, t1); + tcg_gen_or_i64(ret, t0, t1); /* ret = ssssssba */ tcg_temp_free_i64(t0); tcg_temp_free_i64(t1); } From patchwork Tue Aug 22 09:37:07 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: 715713 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp163559wrp; Tue, 22 Aug 2023 02:38:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGMB289Ws4mJo02Zh+FGklSbaA8uhx5upIfxi+5SWN4FKuQ7gAGa304cqZs4TZeMD1YxVU0 X-Received: by 2002:ac8:7d04:0:b0:403:a0a4:97d5 with SMTP id g4-20020ac87d04000000b00403a0a497d5mr10344493qtb.36.1692697083331; Tue, 22 Aug 2023 02:38:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692697083; cv=none; d=google.com; s=arc-20160816; b=cD0crftz57MYAsKfW1vmNakArOq1Dh8JJ69opIKJZrcT+uYhlN0fZ4jfrDQyXh0oSG 1UgtTTE76xhwE2N62wHFPvTEg5d+k3nK9O0dLdybi8saARTYPsv6cpjFJv0co/hy2hwK eomh2Td/9h9vU+DaISu43NgiuYW/ub2cgvqgaaUeX7Vn9OwnQ8ITVbvdihqDv6Gem1YV sVfSFkDjFl2hXM79e2HRnLUYM6/BgZKrU5Z++QlD7df0UuA6QnxSl8hBmfQlm2yvwXGM p+HIW/uTHeosg/wj2Q8J+CVFGcYs8/NDuZauhLn8B/OSGbxlB0xd8p5lmf0ImG42s7vu Fu2A== 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=ScWnOEjDsuqOjg+NrysUJ/0UybO3mydJWW4efYlOcP8=; fh=eYtoxxKzGuW/ZzBKGY04QGXjEEWdmzL/9j0dDOZVqP8=; b=0udgzxh3A/HqwuRws0mYlOCIr6m9QgIT7HTGEpbU1EyOzRKgELAgb8s3fmObkSkWyG zp3R9W4bKz8cpYYUMqoPSTR8ukeJ+CEmVgE6rV4U8P+qCe04+cd4FjIAKKzN5TJ10TeR m1l673BqC5cFUBVIWT+ympoBeI1GkpPN84pp7rzGP/h9RPp71fol7gv3atKUq+VClWlq UM3gsSbhnWecKVlmB0D0djR95QgZJVMoWhRvgQ5ZQsAP764uTCxzhWrgPA3DxRKb47vA 9Ez9c8AcUPiUO7US+pbGAMOe/oVx1SwB505CUunvVSneNsCfQsNxaKveu16rp1f+SF4e pkDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H0pNobUt; 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 n12-20020a05622a11cc00b00403ac829523si985408qtk.304.2023.08.22.02.38.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 02:38:03 -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=H0pNobUt; 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 1qYNpM-0000UK-KT; Tue, 22 Aug 2023 05:37: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 1qYNpL-0000U6-92 for qemu-devel@nongnu.org; Tue, 22 Aug 2023 05:37:31 -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 1qYNpJ-0001f5-6R for qemu-devel@nongnu.org; Tue, 22 Aug 2023 05:37:31 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3fed6c2a5cfso36531695e9.3 for ; Tue, 22 Aug 2023 02:37:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692697047; x=1693301847; 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=ScWnOEjDsuqOjg+NrysUJ/0UybO3mydJWW4efYlOcP8=; b=H0pNobUtiCZdW651FbO/wmC5OXN0Dz7vwvnB0zAGqZtsQiLGN/J4KkaEvb4q4xP1LU XnpZt7jVRHjgP8+fqjl0eZTTeiakV86cVzksBBfLroI9/rAFMcWCM1BJpsuHol4kr7wX ASkPQ1GxPbCzldfmyh6V+wtdIPhwNAinPGN2V3DsnloxmmY2Yh6D9TXluWZYwJN/kxGA 5/+qi2cl1FiT+fO2Rsxh6CPICYAjhIVSlT2PqMPpj+u0b+JbIWqJZ+t9wIxWqcfp5ScF ApFTJmnhZ0Y3JyLag+RsU1P0CYoyv4M4F2y/Phx9gixIIUmGfTLjGTeIpIrhpNBACf6l oI8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692697047; x=1693301847; 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=ScWnOEjDsuqOjg+NrysUJ/0UybO3mydJWW4efYlOcP8=; b=Iv2fC52tVViSVGJiKL8/jW/l6KZvViJ47w7T6iywshjE9S7OMwXz9QKaczWWkYuwyJ cBivK6qMjBonAiuTXdqYrpeo4VjcEpg2Rd1eHbWR0AivkyUDL9tLkBj/V88nReEaRC9n u3D9onWrWGl+Em8k0zhR54IWlwHxhsKp/sEeym3HQu1JFBhbF6ch/CJkHQeedVylQxBS qF+pIx0lZa7e+b9zWpzVpRe0546Ez5kEJmVzpMG5EIoKXspFOkWy+HFOwxlhSGhEhPzi Q61cgFI88Vv5mBCKheEtPgnI1uAwyWmVU7BbKnKUdr2kKXeJMyNR/2ycghMwnzGLIjwc r2ew== X-Gm-Message-State: AOJu0YyVeuqpKLVcQH7dhJSmMgUfWQGuz80Y5IE0+XR9g5aS7f2z2qim ka7ert7UQDa7i8ZN2Z8OMHUJSHQSaV/2qybEtIE96g== X-Received: by 2002:a7b:cb59:0:b0:3fe:f45:772d with SMTP id v25-20020a7bcb59000000b003fe0f45772dmr7038232wmj.28.1692697047571; Tue, 22 Aug 2023 02:37:27 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id q12-20020a05600c040c00b003fe2397c17fsm18871021wmb.17.2023.08.22.02.37.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 02:37:27 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 2/7] tcg/tcg-op: Document bswap32() byte pattern Date: Tue, 22 Aug 2023 11:37:07 +0200 Message-ID: <20230822093712.38922-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822093712.38922-1-philmd@linaro.org> References: <20230822093712.38922-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 Signed-off-by: Philippe Mathieu-Daudé --- tcg/tcg-op.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index f164ddc95e..e6b0d74a46 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1061,6 +1061,11 @@ void tcg_gen_bswap16_i32(TCGv_i32 ret, TCGv_i32 arg, int flags) } } +/* + * bswap32_i32: 32-bit byte swap on a 32-bit value. + * + * Byte pattern: bswap32_i32(abcd) -> dcba + */ void tcg_gen_bswap32_i32(TCGv_i32 ret, TCGv_i32 arg) { if (TCG_TARGET_HAS_bswap32_i32) { @@ -1776,6 +1781,13 @@ void tcg_gen_bswap16_i64(TCGv_i64 ret, TCGv_i64 arg, int flags) } } +/* + * bswap32_i64: 32-bit byte swap on the low bits of a 64-bit value. + * + * Byte pattern: bswap32_i64(xxxxabcd) -> ....dcba (TCG_BSWAP_OZ) + * bswap32_i64(xxxxabcd) -> ssssdcba (TCG_BSWAP_OS) + * bswap32_i64(xxxxabcd) -> xxxxdcba + */ void tcg_gen_bswap32_i64(TCGv_i64 ret, TCGv_i64 arg, int flags) { /* Only one extension flag may be present. */ From patchwork Tue Aug 22 09:37:08 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: 715723 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp163894wrp; Tue, 22 Aug 2023 02:38:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEyANPQnR0kdY7Zu6vDj6kdg71OQHqZDlGH74UEytJ4+6v39xi4uU1ByH1tCr9eGbZmmWnF X-Received: by 2002:a05:620a:9c7:b0:765:a74d:62b1 with SMTP id y7-20020a05620a09c700b00765a74d62b1mr10433747qky.19.1692697138815; Tue, 22 Aug 2023 02:38:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692697138; cv=none; d=google.com; s=arc-20160816; b=T/mueiekE0uBbm9CNQYw7p4IYXbNEmRnUejTYev8H4yMo/Xz44J/3M1MOkgt/RoxqJ Jmc9sRgvlNByOQFy038aeS93tEQ6jNawzx6+jil2iyJidLSbQyXiDFdkycL4m7Lglbl3 Mogk+BMckVyOOd1+D5ILNPiDxletyv9MI4DH4kSjUi+u4ufH0ZKtZ5V3MghEGfriCdCA IU+03EY1X3D2rDefKfnB/YvxfYq74mV7iE8BKOax0ZWqxhN7zh9COra+iZ7UNqpaK53S IGwEeHMhmpnP9b+QeGRbm9QNZ1MaW8ElA3TRl2rJa6cpH/qWst69vvvVFvNtdPLGGIfh fwBQ== 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=/QkMiRMtS+BPrSW1C74ldMs/YFboqxxYKG6pOhc/mwU=; fh=eYtoxxKzGuW/ZzBKGY04QGXjEEWdmzL/9j0dDOZVqP8=; b=N7IguNcbfuhRbVFrj9J1wz4hBttD+ZvfIHOsUa3eqVR0iLs2+Q/Ekn1ATtB2w6w77N XNRzMZAtHMfYF6nA8O9Rpg06ca6WX24ZVooNnl5lU0enfpoyFyZcsvhgr4PR4CWa7WQo XcYS//B6sRqc2d9JF2kgQkI+cPLW0L0bBPWHsl0YvRB2pp3XYZqTRe7AkTsHdP9Bcwzj tdaPtHvU3wRQVOTqtXllVvgnB0uSGFRPVCqRPXzLGwGzoSfhm7ZsNmeWc+zh3pDp1LyT 2uW1RRwaPOijKkr+o77/9YNOdDh+bKxgk5mkUIKWOBVJnnBBHdLXf3J0UByjkAYii1Li D3tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HxhCKrhL; 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 m2-20020a05620a24c200b00767b7436df3si5124676qkn.319.2023.08.22.02.38.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 02:38:58 -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=HxhCKrhL; 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 1qYNpT-0000Uv-FM; Tue, 22 Aug 2023 05:37:39 -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 1qYNpR-0000Uc-6J for qemu-devel@nongnu.org; Tue, 22 Aug 2023 05:37:37 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYNpP-0001fL-3D for qemu-devel@nongnu.org; Tue, 22 Aug 2023 05:37:36 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3fef5809999so11181895e9.2 for ; Tue, 22 Aug 2023 02:37:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692697053; x=1693301853; 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=/QkMiRMtS+BPrSW1C74ldMs/YFboqxxYKG6pOhc/mwU=; b=HxhCKrhLNHY9hutzC5ZPYe2DemcqKXyNX7mvHguq5SqvdViD/sFD0mza+9X9buu6dj Ds9L+RD5XYDWnuQFKAOUwXf91NOnLN+TVzvRFT0gASbqhlaN1dGVXdorKc4uklWdyi48 Y3kfQapDDUUETu2hmr5MTYuPKhYm+GH2yZnuKC2Twxvw2m2s2DQ3CTzrTyVnsbQXOlpj Se/TJLJv7NTMMxjY+o4oND30LFNfrz7Eg7vT0egBOx4eq5zfZbeor8TjT/bOqQd016K0 Of5WN1AyaY11dUmyg8AEyOE7T85wgak7jwYRpW40OaC1RvrzTe+rLVqfX3rl0xIV4aQc 9e4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692697053; x=1693301853; 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=/QkMiRMtS+BPrSW1C74ldMs/YFboqxxYKG6pOhc/mwU=; b=jLYQ3l80Y+c2EvjzSlahc1E2h5eXio+kRKO1iZ7jmNtm3fToWvq0writVVBeA62XMO zm1ur5L/LNeONzbSBZO8DPk1TcCJ/qntqWx8SDdn1Y38AKfI17hl9aFwnF2DKNk8CO5W D9jzTqyt0hxolXvc1JiCpIUXJkK3oFEh/MkXSYKht4j12xSte29czzSA1K+jufSa/MEN UPaYuuhmvGnwdZSWybBzT17eCLYkCsFcp2xR+B2eULDK2U2irR3Yv4woLbh3+4ycPvRA 9evQHiQNBQyuAI3RJmSZ2DtgTUrLndIxlIF09L1vYn+jy1TfblvV3eVRKBJeIMfGJCFj C75A== X-Gm-Message-State: AOJu0YzDt/szyZr7/LEzaaU71OqrWpq/qjWIh2vNNJwcwTlCmT+pw+aH 3rhjCN7pGa/V65QPFltyWBA4Uie2U1/Z3sKYdszo+Q== X-Received: by 2002:a05:600c:2157:b0:3fb:ff34:a846 with SMTP id v23-20020a05600c215700b003fbff34a846mr7168833wml.22.1692697053440; Tue, 22 Aug 2023 02:37:33 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id eo4-20020a05600c82c400b003fe1a092925sm15259234wmb.19.2023.08.22.02.37.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 02:37:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 3/7] tcg/tcg-op: Document bswap64() byte pattern Date: Tue, 22 Aug 2023 11:37:08 +0200 Message-ID: <20230822093712.38922-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822093712.38922-1-philmd@linaro.org> References: <20230822093712.38922-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- tcg/tcg-op.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index e6b0d74a46..f4fe13e040 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1828,6 +1828,11 @@ void tcg_gen_bswap32_i64(TCGv_i64 ret, TCGv_i64 arg, int flags) } } +/* + * bswap64_i64: 64-bit byte swap on a 64-bit value. + * + * Byte pattern: bswap64_i64(abcdefgh) -> hgfedcba + */ void tcg_gen_bswap64_i64(TCGv_i64 ret, TCGv_i64 arg) { if (TCG_TARGET_REG_BITS == 32) { From patchwork Tue Aug 22 09:37:09 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: 715716 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp163564wrp; Tue, 22 Aug 2023 02:38:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEsy8cw6wei9hfr5MugYHyV+qN0tGw0Jx0GmgLg0RDL+DISkLO73yqVaBuOhgKpBUeCrYrE X-Received: by 2002:a05:620a:2450:b0:76c:e932:bf7c with SMTP id h16-20020a05620a245000b0076ce932bf7cmr10124565qkn.8.1692697083633; Tue, 22 Aug 2023 02:38:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692697083; cv=none; d=google.com; s=arc-20160816; b=i4tLNJ01bl/aLPgAkv3YHGGBEO0sv/sZt1/aupUY9Th+CMY4RI7qtk8J9PLKAE8gtL tefVMAtoYweXl55GWl02/Xd+rc9uSiIvK+/gogkwiW6eS/7oud4XHA7bYd2Gl57/Cv9g oGryuEFDTWx+08SvSTKCDbLQDzGX/IFV+tvtp4ZBv3vBTBzRahM7EL+gNoaG2NY1mPZ9 bxwYYt79DGedkqRAxRxQFLVA6j2AHIwfUY7XDr6kOr9YTsOoBS+WCqINswH/rwEHfOIl Ai5GEF2jMy+BgRFH8joyUawlB2VIjaT7uN9PyM3Yt8fPjSXlRp7sa2Y9gF21FKtNPaZO C9Nw== 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=B+OXb740KGUXF3OHqmG1MiP4vOFoMPudT9ZeJkwj3l8=; fh=eYtoxxKzGuW/ZzBKGY04QGXjEEWdmzL/9j0dDOZVqP8=; b=EaX9hHGhDnP61ccuF/Z6fLNxn+lp0rMtM2IXlcUQMfMZ/IGQ2LpErjUrrTrWzuTgKW R8E8ps9CBU+1GyiZq5krX/lruYTQPKuBZH0HaWJUp5V8hlRIqGJA9sQRXgfXFGFL1MQl 30bpY7dH6jR6RgPcIujDghRTiujTaX+imIjGYz5Sc9GgGEzuc/gQmGKFbsDUZQGA8Caa Ur0vlKQyj3yeY4RVtySWd2YO2ZNBdC05L4egnNxyqBHqc7hHQb/LUXoWxubO6p9yp4hM jpIfzXkl8pgERwcXSnhehOdqv2RRSN4vo9NgpWGBD89lW0yW5NsuvccLOehi5vSLJ3eX O4HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I8gLh+KM; 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 c27-20020a05620a269b00b0076c930c7fd9si5948276qkp.657.2023.08.22.02.38.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 02:38:03 -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=I8gLh+KM; 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 1qYNpY-0000VR-7M; Tue, 22 Aug 2023 05:37:44 -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 1qYNpX-0000VH-4Z for qemu-devel@nongnu.org; Tue, 22 Aug 2023 05:37:43 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYNpU-0001iB-U5 for qemu-devel@nongnu.org; Tue, 22 Aug 2023 05:37:42 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3fee843b44cso24864605e9.1 for ; Tue, 22 Aug 2023 02:37:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692697059; x=1693301859; 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=B+OXb740KGUXF3OHqmG1MiP4vOFoMPudT9ZeJkwj3l8=; b=I8gLh+KMwphLr2Kx8qM3HiGiSZEV+yOXZcRYLMsdiUHLLVnSI3GEloGwgZSsgcNm29 juvyna1WfJJeOsmpnogb4/sqDgXRDSlBhyA2Jgoigii15sE/HKC/9Zk+jiLH6HbRFcyq TfHCni3lS88x1kuadgBNTkrCx1eYPz/EADyd0EYW+3rkSRshwgATnqOHEgoBXspBfIAo Zwx4OgZOHV1wIv9tG6xcIAhDZrmoX+le7FmhZ8HhP9czy1NRX4AwJ9aacWlGJRFjUoGq q5kNUo5Emz9+t/zlNo+sQ/j82g7SvtBu+9soY6jpQbxznx9GDV8VbITbZ6T1q/EwIKFo FTdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692697059; x=1693301859; 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=B+OXb740KGUXF3OHqmG1MiP4vOFoMPudT9ZeJkwj3l8=; b=I0bIq7mXhD78riKCGYYhV5Ab6j7UfJZHKR5f6FZzwtc/5CiL/gFD/37d6R9ne+zYc7 eEE2hWYaUdSdme3d18dTTnTbUns1eGh4iY5eFoMqn+CKMXlPqAMA4bmjXTXkgQADzObo OgGBfNq6YWA1UVC+6N+tc9uVZSPOl/O7rd+aTHDvg1KVNtDgiSfRnl+94W/XHbEHoOMb W9i4otLiYcsPYJILrm8DvLc+/IRrO7rue1S7hSNh8RnQ3Ap6pbybPA71q8ZJf9Jm8ovx ROhrR4wGMJhyPeaHfgxuFvZSXIZdAOerBBbFsnH1Ec3qIqykNtDnYwnQe9aD9UKy7lTZ wj2g== X-Gm-Message-State: AOJu0Ywvl9TQOv9p57wIALzW0DE2YrvRFYqF52iWPFbRSYsXXNbr994w ONOqRYalrSJkayeYmLIOR+be+xXRmNdgaa+xeU2uNQ== X-Received: by 2002:a5d:628e:0:b0:31a:e06f:2187 with SMTP id k14-20020a5d628e000000b0031ae06f2187mr6418668wru.56.1692697059362; Tue, 22 Aug 2023 02:37:39 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id a8-20020adfed08000000b003196dba130asm15266442wro.106.2023.08.22.02.37.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 02:37:39 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 4/7] tcg/tcg-op: Document hswap() byte pattern Date: Tue, 22 Aug 2023 11:37:09 +0200 Message-ID: <20230822093712.38922-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822093712.38922-1-philmd@linaro.org> References: <20230822093712.38922-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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 Document hswap_i32() and hswap_i64(), added in commit 46be8425ff ("tcg: Implement tcg_gen_{h,w}swap_{i32,i64}"). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- docs/devel/tcg-ops.rst | 4 ++++ tcg/tcg-op.c | 26 +++++++++++++++++++------- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/docs/devel/tcg-ops.rst b/docs/devel/tcg-ops.rst index 6a166c5665..d9364effd2 100644 --- a/docs/devel/tcg-ops.rst +++ b/docs/devel/tcg-ops.rst @@ -486,6 +486,10 @@ Misc into 32-bit output *t0*. Depending on the host, this may be a simple shift, or may require additional canonicalization. + * - hswap_i32/i64 *t0*, *t1* + + - | Swap 16-bit halfwords within a 32/64-bit value. + Conditional moves ----------------- diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index f4fe13e040..bb64326a1a 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1091,6 +1091,11 @@ void tcg_gen_bswap32_i32(TCGv_i32 ret, TCGv_i32 arg) } } +/* + * hswap_i32: Swap 16-bit halfwords within a 32-bit value. + * + * Byte pattern: hswap_i32(abcd) -> cdab + */ void tcg_gen_hswap_i32(TCGv_i32 ret, TCGv_i32 arg) { /* Swapping 2 16-bit elements is a rotate. */ @@ -1878,19 +1883,26 @@ void tcg_gen_bswap64_i64(TCGv_i64 ret, TCGv_i64 arg) } } +/* + * hswap_i64: Swap 16-bit halfwords within a 64-bit value. + * + * See hswap64() in include/qemu/bitops.h + * + * Byte pattern: hswap_i64(abcdefgh) -> ghefcdab + */ void tcg_gen_hswap_i64(TCGv_i64 ret, TCGv_i64 arg) { uint64_t m = 0x0000ffff0000ffffull; TCGv_i64 t0 = tcg_temp_ebb_new_i64(); TCGv_i64 t1 = tcg_temp_ebb_new_i64(); - /* See include/qemu/bitops.h, hswap64. */ - tcg_gen_rotli_i64(t1, arg, 32); - tcg_gen_andi_i64(t0, t1, m); - tcg_gen_shli_i64(t0, t0, 16); - tcg_gen_shri_i64(t1, t1, 16); - tcg_gen_andi_i64(t1, t1, m); - tcg_gen_or_i64(ret, t0, t1); + /* arg = abcdefgh */ + tcg_gen_rotli_i64(t1, arg, 32); /* t1 = efghabcd */ + tcg_gen_andi_i64(t0, t1, m); /* t0 = ..gh..cd */ + tcg_gen_shli_i64(t0, t0, 16); /* t0 = gh..cd.. */ + tcg_gen_shri_i64(t1, t1, 16); /* t1 = ..efghab */ + tcg_gen_andi_i64(t1, t1, m); /* t1 = ..ef..ab */ + tcg_gen_or_i64(ret, t0, t1); /* ret = ghefcdab */ tcg_temp_free_i64(t0); tcg_temp_free_i64(t1); From patchwork Tue Aug 22 09:37:10 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: 715722 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp163868wrp; Tue, 22 Aug 2023 02:38:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHlwgwmS1JdzfVKWgZoX6VlC/s4za59oRV2Sxwv8tJWQDQHfqi8BPnwPIMJ0lsn+vbmtsMg X-Received: by 2002:a05:622a:2cb:b0:403:72fa:62fc with SMTP id a11-20020a05622a02cb00b0040372fa62fcmr12816491qtx.68.1692697132715; Tue, 22 Aug 2023 02:38:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692697132; cv=none; d=google.com; s=arc-20160816; b=EtWYFhRxq9ib7SxPQj+EgGldqftypGCOjG4lq3bEwQlFbfBdgl1f1Qn63bdgtgtcE/ Cvx3Lygzi/sga1QgumvqvNbyeL8cp8D5H7byVpepU02JlOcQyonJQBGBgtiGffPazNyD coW0EPPQBnFxkr3qIYYO7RcfbPkoak7otp0kY9W34VUxjS0P/lnCB3mTH/p0kmKPYZ2G QJkjUpsA/FS+rz70VZBQCleS8jS80H72brVm3mDvZm/PvjgJ80oG4YJfofEOwT2MC2Km 0PIXu/OJha+p+p3vjqpKJfY/xxBf2jCCQQQCeMGo7QYUPHuRMbcmu3XTe/gNurBbV46e 8+CQ== 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=sU04/oy8W8gfiSCI2qoAJqVtytEmmI6vE5KNlHJUhf0=; fh=eYtoxxKzGuW/ZzBKGY04QGXjEEWdmzL/9j0dDOZVqP8=; b=Z5cW6UnJiQwnEqgkmhpFjtCdtpLLvjrsH2wcsBBiONLu3iZa60GwWVexeGOQRpjrSW G+32ahmI1fQAdtPmOHMeYo54bqOCAlobLnGIHkrJQvtAg7BdePolgfF/YFfXyx56TCWr K9xOryQBKTUaKw6XBN9GDg7hfUzY+A1A4XDIOayIDfL9Xg9pjkQGyZtz8D1ahj7Z6vDE X4ArkDI+ZcCAS3bxKXG8C6calfiJw3pIsarg/VdY5IRMDDgBnsIQG5+bR0PRds9VRU8X /z5K/kHzGtsnbB6begxftlIhsQG8S8PzmYBUHZ9Eq/DOR/F3aIgHwA4X07MZh2k+Uu0k 2kwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FzF0HedS; 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 u1-20020a05622a010100b0040fe2b345ccsi6083992qtw.761.2023.08.22.02.38.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 02:38:52 -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=FzF0HedS; 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 1qYNpf-0000W6-Om; Tue, 22 Aug 2023 05:37:51 -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 1qYNpd-0000Vr-O6 for qemu-devel@nongnu.org; Tue, 22 Aug 2023 05:37:49 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYNpb-0001ig-JS for qemu-devel@nongnu.org; Tue, 22 Aug 2023 05:37:49 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3197b461bb5so3805512f8f.3 for ; Tue, 22 Aug 2023 02:37:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692697065; x=1693301865; 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=sU04/oy8W8gfiSCI2qoAJqVtytEmmI6vE5KNlHJUhf0=; b=FzF0HedSb556jDIcBe6YjWz6UqgJ2b8GKLh4iBap0t4DO/w2xUhTZPvIjAfM9pM018 ve4agsbYg5gl3Iv19tEotRchSLDpZTQgVciRxA8tF8xLVV2/ugTCHl0hTzG7qAXpuvAf uplzfsYvCK5cTh/u2fPZrhFKHlXigEjYF9EDnvs6wAmwZYN9HPpFtQADomr9u1p283Bg YobpunRSEGlwGcNhDwSADKRy70yxxwkmjZ0ISGPx6RLSIwW4mWyvxqncDiF5gSQthetY eMvY9m2IskVSX3nbJOR8RytWhy+yDoXFet+R9xtXNxKuRQjbWvrFSyvjMwjRwQUm24xS 7+2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692697065; x=1693301865; 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=sU04/oy8W8gfiSCI2qoAJqVtytEmmI6vE5KNlHJUhf0=; b=RxzdZga0u2ovyhjWt4BCOHO1HQrxpWUd0cOvqTZOK1Q4SngAjehBF0EutcdfO/6sB2 aRuQAEOtxXnHxtejk4GkVcA9jqPee9darad40JIlQ5lCw6vm5gu/LOfG84y/rVrUFnYf ccjzF5OK8cjcSQ5wq4XnDt5gydC5YOr9CL0ZDms2909ewSdsYKACCyV7gEBQX6KjBmcj PAG6+L9pXribEMIn5ncVA74DdFkIu9PnmCq9k9mqbES/KhSBl0Dq1Sldejqy/tRPSObK wC+0fsiZW+98HOCKIWiI31rW/cCUzTSTVJZQvvY/NBIVcYxiKuY+mojWe7IgvbOI6RB0 EXnw== X-Gm-Message-State: AOJu0YzyKgR6++TgtBvDe0/UySFIM0mJKZqaMdSJfXYaMk1mEBitgqQP 3H77q7GZ78Av5k0kgm30DY/AYMzlcyV00VaXZhMFCQ== X-Received: by 2002:adf:ded1:0:b0:313:f395:f5a3 with SMTP id i17-20020adfded1000000b00313f395f5a3mr7040842wrn.38.1692697065383; Tue, 22 Aug 2023 02:37:45 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id l9-20020a5d6749000000b003143867d2ebsm15438796wrw.63.2023.08.22.02.37.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 02:37:45 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 5/7] tcg/tcg-op: Document wswap() byte pattern Date: Tue, 22 Aug 2023 11:37:10 +0200 Message-ID: <20230822093712.38922-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822093712.38922-1-philmd@linaro.org> References: <20230822093712.38922-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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 Document wswap_i64(), added in commit 46be8425ff ("tcg: Implement tcg_gen_{h,w}swap_{i32,i64}"). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- docs/devel/tcg-ops.rst | 4 ++++ tcg/tcg-op.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/docs/devel/tcg-ops.rst b/docs/devel/tcg-ops.rst index d9364effd2..306025ece7 100644 --- a/docs/devel/tcg-ops.rst +++ b/docs/devel/tcg-ops.rst @@ -490,6 +490,10 @@ Misc - | Swap 16-bit halfwords within a 32/64-bit value. + * - wswap_i64 *t0*, *t1* + + - | Swap 32-bit words within a 64-bit value. + Conditional moves ----------------- diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index bb64326a1a..c436c5e263 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1908,6 +1908,11 @@ void tcg_gen_hswap_i64(TCGv_i64 ret, TCGv_i64 arg) tcg_temp_free_i64(t1); } +/* + * wswap_i64: Swap 32-bit words within a 64-bit value. + * + * Byte pattern: wswap_i64(abcdefgh) -> efghabcd + */ void tcg_gen_wswap_i64(TCGv_i64 ret, TCGv_i64 arg) { /* Swapping 2 32-bit elements is a rotate. */ From patchwork Tue Aug 22 09:37:11 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: 715720 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp163836wrp; Tue, 22 Aug 2023 02:38:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG7jPObu6743WKKnfWtwwPNaS1DE5GMrblAUIKTmFQtyWSSL5o6BMgZ8wpIW4UFLReTEDvN X-Received: by 2002:a05:6214:488f:b0:64f:3c26:fec3 with SMTP id pc15-20020a056214488f00b0064f3c26fec3mr7312385qvb.1.1692697124572; Tue, 22 Aug 2023 02:38:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692697124; cv=none; d=google.com; s=arc-20160816; b=dAZlqjHMtGI2j4e69cLMs6aCaODLzyiLpLeDlVXYi/VY2it1790ko8hwnr7aPm5RHy nkN/OxuTQznWPxT4RYucKCxJYpw3w0BOdj1Y98pib2wnsp1C47dPm9yxPIGkBEaKAmg0 WeWibRpI3EK+jzo0PetRarXw6GTiBD+jSXqPAtgTcyT/DCbagf5L7pGawj4KUql3bufA 6Ssm64LDIFCZeEWsIUev5Szc09XzcqQAg4u5bGF0bGv8lRJGLF3Kfwd0a+bEn5tJHxsl +gIGmdMCRpklhkhZeqVJCA/0uHMMoQT2J4jf/s/qGGuU4S5Er6N82GwUd0JaTiNAdO5Q VLsw== 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=ssIMRuL1OyQOsdEBR17Mz29ZALSmu3/U8oxoKYB7pZ4=; fh=eYtoxxKzGuW/ZzBKGY04QGXjEEWdmzL/9j0dDOZVqP8=; b=bj7S7o5aZHFxafJm2iGIUA1iO6RddSf2z946gG1WjBhYDnRgHkDSH7QHYyS70lrmzj /O4YJspAngNO5Z/1Mgcb/3QEJzbQ8oWegvlKpusOp8c+v+b0JLBm810ogjwQU9yswFyz ffGmaGTblsoq7CwNvwZ9xK+ZyckVZ5I7Eq4XfO9f8x3nY9T26NqSHJU3M/dH6zNV/hwJ 3bz46EA4a+86RpQu3Q5I1oPSYMifmJpghVwHrj/tCC1795BFFxBhri6V0e+pzPtfn9PK H9CiLqq2kSfd5adKYAXzz5Lsgf1pm08rLTW8A7dQ3C3dVN8qmzRgFrlzSfm+491vV3ds 5vBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C9korm5U; 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 r17-20020a0ccc11000000b0064f3b82497fsi3084768qvk.557.2023.08.22.02.38.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 02:38: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=C9korm5U; 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 1qYNpk-0000WV-9a; Tue, 22 Aug 2023 05:37:56 -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 1qYNpj-0000WN-0B for qemu-devel@nongnu.org; Tue, 22 Aug 2023 05:37:55 -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 1qYNpg-0001jJ-UF for qemu-devel@nongnu.org; Tue, 22 Aug 2023 05:37:54 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3fed6c2a5cfso36534225e9.3 for ; Tue, 22 Aug 2023 02:37:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692697071; x=1693301871; 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=ssIMRuL1OyQOsdEBR17Mz29ZALSmu3/U8oxoKYB7pZ4=; b=C9korm5UeFj8UelkeyvZunH0m1QhImOMZ4Qn/sk7b0xSPTKBqwxXAFSKRKYomMotAV B6hSbaIdUOXKpn20QJi1ne3Cz7xxpUxwVU8GE9YDt3nzNM9VobSoS50vnONu1sFXvCBE 7c5h0Xdch38aKi/bgaXvaf/oaB5ODclBoIY+ZVGgsCNUA3/MX3QhoGfZU6c34dRgaV1o eKVEdf5oNP749wQjTtPSkc4v+aY4A6qu7WViUbQtluF0XQWcx+YKrKmhDob2+UO/LF63 4sHFGFiJzbuswdRhKvFeZexS2wB5VtF22Of7ckHPha87S4VOO+wGaBUaLBwlUGayOMQE 5K1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692697071; x=1693301871; 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=ssIMRuL1OyQOsdEBR17Mz29ZALSmu3/U8oxoKYB7pZ4=; b=cFX8cWq4xXdSOGehMJlF5LmQpyJpQOhdC98pFrEv3DaAriuI1IdymBNgnZ4IwGImnO 23TYKaquGD2c+DsKF5hPJKGWcfaNTlDBap7sYgwNdPCfiw8jxTT3yRnYMyizJMu2mGtD hWgSnVe8xheIUorfnzXWMSFdFQAtxwtIARSoEMw7G0GYrHKeh0xDe1EjGTmbBAJor2Cy o6VM3R2u7noQcTgNvQ8ATXQ+trlUBRC7hy5X3BwId7PF0kkJZDd1jRJr8rNIpg4vOAHb LyLx01o/AnMVReUm9wbI2jbplo9xLdWtDSAntrwdlTv58XO8VcD15o+a4QSs/YTjU1Y6 Ji9Q== X-Gm-Message-State: AOJu0Yz3M4Tb7FWxsDQI0zAGTF+BI/+7HljbTK2GX3w6aGhw25Gl9VmE MZnJFnD+abrafYKq8hGAVhqguDvrjQx1Avhu5D1Qsw== X-Received: by 2002:a05:600c:255:b0:3fe:90f:8496 with SMTP id 21-20020a05600c025500b003fe090f8496mr6645538wmj.1.1692697071423; Tue, 22 Aug 2023 02:37:51 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id eo4-20020a05600c82c400b003fe1a092925sm15260039wmb.19.2023.08.22.02.37.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 02:37:51 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 6/7] tcg/tcg-op: Document deposit_z() Date: Tue, 22 Aug 2023 11:37:11 +0200 Message-ID: <20230822093712.38922-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822093712.38922-1-philmd@linaro.org> References: <20230822093712.38922-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 Document deposit_z_i32() and deposit_z_i64(), added in commit 07cc68d528 ("tcg: Add deposit_z expander"). Signed-off-by: Philippe Mathieu-Daudé --- docs/devel/tcg-ops.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/devel/tcg-ops.rst b/docs/devel/tcg-ops.rst index 306025ece7..7ea6aba502 100644 --- a/docs/devel/tcg-ops.rst +++ b/docs/devel/tcg-ops.rst @@ -449,6 +449,10 @@ Misc | | *dest* = (*t1* & ~0x0f00) | ((*t2* << 8) & 0x0f00) + * - deposit_z_i32/i64 *dest*, *t1*, *pos*, *len* + + - | Similar to deposit, except that a zero value is deposited. + * - extract_i32/i64 *dest*, *t1*, *pos*, *len* sextract_i32/i64 *dest*, *t1*, *pos*, *len* From patchwork Tue Aug 22 09:37:12 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: 715718 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp163771wrp; Tue, 22 Aug 2023 02:38:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHGEoXKvIxyjkblT5Ou3gW/vzI7x93Wtcuyr0j5yixfA4hbmvuB8QESMRI2HOAbqLaMed4j X-Received: by 2002:a05:620a:290e:b0:76c:ee05:8d72 with SMTP id m14-20020a05620a290e00b0076cee058d72mr13758557qkp.19.1692697108805; Tue, 22 Aug 2023 02:38:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692697108; cv=none; d=google.com; s=arc-20160816; b=Lus46DEK6V+zaquDhxL2t/e4AD9II5AEXgATlmi26zqmZXGBzNGX6H9NGI8MMba8qi tpCUZ0xwfZb3PHLyv2CFgyBOhXtx8hi6xS2D2G7ek9f2/yHeZOmgDOSh871/Vg1bmQDn i3/dXGC/x4zyIRRzcFMeYQnDs77KyFejq45bphUXPEhQLRbMCGnamojBK1S8sIPQg121 BsILVClMjZfwdAnNZg4lIA2XQd2oL4GaNSOthJiYuf6fZ8D6JL2pH7V9hSOjP0juXz5v fC9SI0+ZbJQcCa6gBd1lUAF2vzbeWdEOkwnA0RYhoz4Lf7UQMZKic0zxthD3XI1sUKW5 UKoA== 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=XE9v7foDNFxPe4946YxN3Nb7epPtd1r5RF+iq2i5yko=; fh=eYtoxxKzGuW/ZzBKGY04QGXjEEWdmzL/9j0dDOZVqP8=; b=wEKg9nluXrmoZaPgb3B1V7xSfglRP96g0RlJUN20FjdxvhshLmw/h+g3BueX+rYNKv /YvHoUSudA0l4DYuJOCNAgFAj7I2jbu6rVw2BzWJxbTr0M3i4LlV6BGhW7dwkr7u3E7v 6ZNFn1KR4mNzzXKNb2vSfYWEajz6A7ubqCE2zOp16TCA0Raw6/gjhFouSSsqX8/1+Nif SmCjQ0krPbvu7iBfsIgHjBFIqG1sGxfsHn/FlBEJBgRxZFjX9vUazEmkF8QRrBNLYbNs hk+8J5DglK3vBQUdxKPUwE5ixLfneAh2ntM2qLgn4y/rFQH24iGoJ5SW+9S1UXu6PPaG X0jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cso+sRbO; 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 22-20020a05620a079600b0076cc8473f13si5548462qka.786.2023.08.22.02.38.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 02:38:28 -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=cso+sRbO; 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 1qYNpq-0000XY-RH; Tue, 22 Aug 2023 05:38:02 -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 1qYNpp-0000Wt-Ah for qemu-devel@nongnu.org; Tue, 22 Aug 2023 05:38:01 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYNpn-0001jx-6w for qemu-devel@nongnu.org; Tue, 22 Aug 2023 05:38:01 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3fee5ddc23eso28687265e9.1 for ; Tue, 22 Aug 2023 02:37:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692697077; x=1693301877; 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=XE9v7foDNFxPe4946YxN3Nb7epPtd1r5RF+iq2i5yko=; b=cso+sRbOVwJhQ5sWKY78qogSQx+0FyJXIY04LJlWwODOf8canyw29dTgwAz1bk8T5i 8tJfCKY1/K8IWZBMKak3GRsedGt2VO/hPl/p9LozNrf6/8gP2CfTBk59zmf2zhD1MiXr 7+cvQ5NwUfrHMMpG+KQ2zPdewr5PEgEp8tMr3Qr0waqvD9y09Ft/RJtc2IPlQSBknVyi ONLKno0Oi4cS3pODEL7t/ExCRsnqoqfeHghBijkGw+o5QE7pmTr/cx84eVEE9Xhw78VJ 3xNlp3h0RsUUFNePzj0bp9DtA2oUa7cF/0Hd+S7uLusDNmA6l/t68u42DFIllFhw5XQ6 DwPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692697077; x=1693301877; 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=XE9v7foDNFxPe4946YxN3Nb7epPtd1r5RF+iq2i5yko=; b=NrOPQ0g4N0GF+tcuUfqjXifHPBXnWfDPQ63kZSW8Fac3a3MO4eVm76dd/9Ca2Q3ucb M3znXlVzMD3oHHdX3AjeWIM+uSr7ZtaAuzf0Yhn4cTEM5fYKDuIEkSu7WzvUezeLV6cL 8FYfaj5mVBQB7Ie/7vGxrh4rDgdQkLxugJYbYsgc8KYbgjL4hSfiz/4PHMuoEvblAJ6/ 7kWPWnVu65Hf76mtylbwuTKueUrY8hbXHxclOLgQBn2eO6CoTWuFkZfGqJM50NL4ShBX 4VoxGi5kIQ3ABivkRBRyfmO/L4W7emGjbYN+Kh1SPYfn2RL2EVSvJgYkt81PJEi9gri0 f04g== X-Gm-Message-State: AOJu0Yyti5R+YjV4ttbd6NEnCsE+T6dM23EbmjUANk36Jxezs6YF2Wpa lBX28bACbXWQMgrDsVhd+aUkkFeDnNxrMADiW/BfGA== X-Received: by 2002:a1c:7908:0:b0:3fe:111b:7fc4 with SMTP id l8-20020a1c7908000000b003fe111b7fc4mr6823728wme.21.1692697077420; Tue, 22 Aug 2023 02:37:57 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id c15-20020a7bc84f000000b003feeb082a9fsm8688005wml.3.2023.08.22.02.37.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 02:37:57 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 7/7] target/cris: Fix a typo in gen_swapr() Date: Tue, 22 Aug 2023 11:37:12 +0200 Message-ID: <20230822093712.38922-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822093712.38922-1-philmd@linaro.org> References: <20230822093712.38922-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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 Signed-off-by: Philippe Mathieu-Daudé --- target/cris/translate.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/target/cris/translate.c b/target/cris/translate.c index 0b3d724281..42103b5558 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -411,15 +411,17 @@ static inline void t_gen_swapw(TCGv d, TCGv s) tcg_gen_or_tl(d, d, t); } -/* Reverse the within each byte. - T0 = (((T0 << 7) & 0x80808080) | - ((T0 << 5) & 0x40404040) | - ((T0 << 3) & 0x20202020) | - ((T0 << 1) & 0x10101010) | - ((T0 >> 1) & 0x08080808) | - ((T0 >> 3) & 0x04040404) | - ((T0 >> 5) & 0x02020202) | - ((T0 >> 7) & 0x01010101)); +/* + * Reverse the bits within each byte. + * + * T0 = ((T0 << 7) & 0x80808080) + * | ((T0 << 5) & 0x40404040) + * | ((T0 << 3) & 0x20202020) + * | ((T0 << 1) & 0x10101010) + * | ((T0 >> 1) & 0x08080808) + * | ((T0 >> 3) & 0x04040404) + * | ((T0 >> 5) & 0x02020202) + * | ((T0 >> 7) & 0x01010101); */ static void t_gen_swapr(TCGv d, TCGv s) {