From patchwork Wed Aug 23 20:23:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 716136 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp1003203wrp; Wed, 23 Aug 2023 13:28:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEoMmoBVjhNiEenQrPbLHk7fuco35t3IHlEK4ezuC3pJcnjR33rBRngxV5NLH1HluNNpFCw X-Received: by 2002:ac8:5a88:0:b0:410:9b8d:ff6e with SMTP id c8-20020ac85a88000000b004109b8dff6emr12145213qtc.42.1692822506238; Wed, 23 Aug 2023 13:28:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692822506; cv=none; d=google.com; s=arc-20160816; b=Gh8ptehrwpDsuCkqp4UwkMPH+Pd7ZYimWcE/vGAk+xYjIBd9vIuVoApzl9TB2sd7bR 2ZSsmCPwAWTHNB22XQPo6wjDro1HRCWAaM8u/znxjvqNbPlTA4Hec7ovtFo5R8UOLJbN FT07KF7+TFq+PvTFzo015HxHNbgJand4BxqxBqYjVINjfGTVeZnxrXFB/o3rYFexMUbv QKGmF8b3HhsHay9sBOmd3u7yIn9jZ1HK2bh3YblsivrAZQvidrz0DLZMKLvazitG+sIL UM1q0Yo7qdu7JHEatB9BDyqSWRK/a2vxj8b4uEMU2nooohBr8P9eBckbGAx/bJCReycu yoeQ== 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=mSK1FwATZQ2r2xwm25ea0QEMJ0jlampktK+qTGiEiAc=; fh=i1mkeM7bD/ppus3C3v+92ltBBCUUU0zBXrpbYjAjHqE=; b=MVmhrtIDsUrH/2oBXuwZgamKTVeGsGd1Z/YaBB+xNHDinxz5R+mL1J1UoG5rgF/WFn MvOrYUNivY4AXlZesOxwFCMQshMYp945HlfNCmkgT+HQaAbbgEQF4Ap1RzTL9jp4+mk/ aS51rO3HkJS4wfg481c/H+zysOy2GyihRie8OgbEVszwLC5VKO5pDXW/ON9g62r6s4d4 0y0Qt0uKgWt8ceNK3g86bqu/d+59WRFWO0r7mHmmtavAaaqWsG0ISEWpbMxxGJiSOmzv BB20cFAWNotOWJkmp5+age41umZ1rcB5ssFMM+QLEsEmVVCK7Sjc8VCXRjx1rQfsVwFE rWBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eXbRWb0J; 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 t3-20020a05622a148300b004054947c58esi2821452qtx.531.2023.08.23.13.28.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Aug 2023 13:28:26 -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=eXbRWb0J; 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 1qYuRe-0005UI-50; Wed, 23 Aug 2023 16:27:14 -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 1qYuRZ-0005AO-PH for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:27:10 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuRY-0006Ch-1G for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:27:09 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-68becf931d0so188803b3a.3 for ; Wed, 23 Aug 2023 13:27:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822426; x=1693427226; 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=mSK1FwATZQ2r2xwm25ea0QEMJ0jlampktK+qTGiEiAc=; b=eXbRWb0JNqbCvHsuyQy5sZUHiSnqmKdTq0OuFkEi8oaLXbcMK0BWKEqW/Q8ypk+IHM Umi/llkZiMdszFLNHRJbTWgmPX/dew9pCE5m4PWG+OnYQQN+NadNEBp3gOnAVb1pL0Bd qX1VfpfnWwgRbWhfqtn0PEVFe6ivJ18NSV5av4qRV+/1ZYCnQSGeKC+vGL6WVzQziBnK yS2RoqXILT35DUMVOf2RU5yGaIUf0yq2cWSLAwXRVmxdiTJVorJDULf6lhrihaTiQ4Yq rgTJdK5A86F7589V6ZEEY0p1ViEIoZ8umpMDrqpzJ0o+SaUY4QIFvaYQzNo0QU6tG1NO YD+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822426; x=1693427226; 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=mSK1FwATZQ2r2xwm25ea0QEMJ0jlampktK+qTGiEiAc=; b=YRZyrYULZzZqQh5z6w9I4SV7rifEiFj/8b1ArcZNmxAn4ywye0To9tQdgWKBYMgapO QMJE1cV/gqiFry7gNdjdlyc+cwjNefnmbHsqEKfKmSmMAS5ruFu/lTuW4Wi7YVvcsIZz AlbQ07m+328OcbOBGeFagvBoGq1IuEkcEZvkwkcW6ekcQmbDbruB+VdG0NEEle+HmuT3 /wL29/7c8VHBaCj5/MlusiQYXAi8t6d2kmDOtrwauQPXpDSGMqHoAs2USQwkaz1B1FlA 1jn/R8jXCFmrr5UDLuYyWjJAEFvxTfnZobgSBK72cwME55GY2ICl2x6pBOJIox9RZNbr Gt0w== X-Gm-Message-State: AOJu0Yz4tS1mViqY5sOlhpjjaol4sbDGNT0KztGSGeqeE1DjjFqyZnMi xvvOXGUZMApmeW21yhy5XSkzFC7Oq7CN+A9vRG4= X-Received: by 2002:a05:6a20:12d1:b0:148:2f62:c47f with SMTP id v17-20020a056a2012d100b001482f62c47fmr13427996pzg.41.1692822426651; Wed, 23 Aug 2023 13:27:06 -0700 (PDT) Received: from stoup.. ([2602:47:d483:7301:72f0:1ea7:85d2:141e]) by smtp.gmail.com with ESMTPSA id j25-20020aa783d9000000b006873aa079aasm10117871pfn.171.2023.08.23.13.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:27:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 42/48] tcg/tcg-op: Document bswap32_i64() byte pattern Date: Wed, 23 Aug 2023 13:23:20 -0700 Message-Id: <20230823202326.1353645-43-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230823202326.1353645-1-richard.henderson@linaro.org> References: <20230823202326.1353645-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20230823145542.79633-5-philmd@linaro.org> Signed-off-by: Richard Henderson --- tcg/tcg-op.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index ed0ab218a1..b56ae748b8 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1822,6 +1822,14 @@ 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: xxxxabcd -> yyyydcba + * + * With TCG_BSWAP_IZ, x == zero, else undefined. + * With TCG_BSWAP_OZ, y == zero, with TCG_BSWAP_OS y == sign, else undefined. + */ void tcg_gen_bswap32_i64(TCGv_i64 ret, TCGv_i64 arg, int flags) { /* Only one extension flag may be present. */ @@ -1855,7 +1863,8 @@ void tcg_gen_bswap32_i64(TCGv_i64 ret, TCGv_i64 arg, int flags) } else { tcg_gen_shri_i64(t1, t1, 32); /* t1 = ....dc.. */ } - tcg_gen_or_i64(ret, t0, t1); /* ret = ssssdcba */ + tcg_gen_or_i64(ret, t0, t1); /* ret = ssssdcba (OS) */ + /* ....dcba (else) */ tcg_temp_free_i64(t0); tcg_temp_free_i64(t1);