From nobody Mon Feb 9 23:01:35 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621363074; cv=none; d=zohomail.com; s=zohoarc; b=EwUoj26X4bBVUJ/Xb0ZblCexiZM3ryMJYqNBYOGosOLAZ3mkisTVyCIvpMuY85D7MmpeLx2byJSy9/mxUIqv086aOgvSI8089smh89XLKF31ElSUuocWG1NkZUDkDVx2tTsAFBQITvQTZ+VcoH+3QdSVVi1rm2Bs6geqiXdwZnc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621363074; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=BPTuZOZaAUyGNk5xJrzvkHAhCtxsbeJLCsray2K+DT4=; b=HRGeG6wcOA2SJ19041WuMhcqV0GF3v6t+yBbtJJOX7RaqYRa0xYSScjxKTHMfAeW842PUr8yXzBfDwqfEh9Q3JesMPz6AzxTpO1g3k0Btjys8xGQf4RkFLs2ZRwa9WOMe8Bu+b9h4T+CFzJtdk73abiMZE4XJQUn761gVpFhTzE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1621363074001967.3847654120096; Tue, 18 May 2021 11:37:54 -0700 (PDT) Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-237-yCYnUNZyNKinJpx73pS6yw-1; Tue, 18 May 2021 14:37:49 -0400 Received: by mail-ej1-f70.google.com with SMTP id h18-20020a1709063992b02903d59b32b039so2575252eje.12 for ; Tue, 18 May 2021 11:37:49 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (31.red-83-51-215.dynamicip.rima-tde.net. [83.51.215.31]) by smtp.gmail.com with ESMTPSA id m13sm8129927eds.21.2021.05.18.11.37.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 11:37:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621363073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BPTuZOZaAUyGNk5xJrzvkHAhCtxsbeJLCsray2K+DT4=; b=Do4TCwje83J4zOevMjM0ChMi2Qntk2iYXou18rBE25U+mUz5cvAK3Cqi5sJkSH2LvLmu86 w8SaCV6P6aEM1h72e4CO2PcFCnk2nr50m8RThV2QttWl+6fmHPJO7RJNPVDTz8JkHfb3Z4 +c919zp7jyH2JPDx0wYSiyRVk1Auexs= X-MC-Unique: yCYnUNZyNKinJpx73pS6yw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BPTuZOZaAUyGNk5xJrzvkHAhCtxsbeJLCsray2K+DT4=; b=qvB0Xn6sIdHbBi6E8g4Utg+CGsQkqRWginsHTiScbVScL/66PFsSn4ptmmolra0fjB YsBobHmn//vlUL8KFo7+FKygf24QVQtk6TdKTVY1Umhe6UTLDjnbLhtZA8nlXdSe4Bvu BMQQkzILhvwogBjAa+JYTLyhvOKQk5QxlyrUmOVJqM5iRrgUnJ6SQ3TLBOo9nFhhI1pV vDoLFSyTTHnVnU+RekHQljex++pX5JkNzuRBUHq7a1PEcqoUgulm1be52jmVIy92WHTD w1H9g5zD+3BPFfRWHOnkEv8NwBbJBRsXtZRhu50pJosvPGPznBj0Q+HjnXUw1lpiKPGz TOvw== X-Gm-Message-State: AOAM532794+UAcHGol/uM/QCK9n8YQacAe8/2u7mxhMXaF1ODXOYowAn I6KrRA3FlO/1Uuj6zYg6lr4a6lTvCmSY/iJSqe+l0EVwlC84bWdqt3cp6IKGAgq6g+lTOnPL4Yc BHONxZUa7biK4Uw== X-Received: by 2002:a17:906:b14f:: with SMTP id bt15mr7721535ejb.126.1621363068304; Tue, 18 May 2021 11:37:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCSastuJp7jB4TQ7qYkPlmgKXuzOrv/bYGUDd6cIUowFmAO0Px/5FQ1QvwF9VSzTiYjSwltA== X-Received: by 2002:a17:906:b14f:: with SMTP id bt15mr7721521ejb.126.1621363068133; Tue, 18 May 2021 11:37:48 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bibo Mao , "Michael S. Tsirkin" , Richard Henderson , Paolo Bonzini , Jiaxun Yang , Peter Xu , Huacai Chen , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 10/25] qemu/bswap: Use LD_CONVERT macro to emit 16-bit signed load/store code Date: Tue, 18 May 2021 20:36:40 +0200 Message-Id: <20210518183655.1711377-11-philmd@redhat.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210518183655.1711377-1-philmd@redhat.com> References: <20210518183655.1711377-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/qemu/bswap.h | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h index c2fd4f31d20..af9b18f373d 100644 --- a/include/qemu/bswap.h +++ b/include/qemu/bswap.h @@ -343,13 +343,6 @@ static inline int lduw_he_p(const void *ptr) return r; } =20 -static inline int ldsw_he_p(const void *ptr) -{ - int16_t r; - __builtin_memcpy(&r, ptr, sizeof(r)); - return r; -} - static inline int ldl_he_p(const void *ptr) { int32_t r; @@ -379,11 +372,6 @@ static inline int lduw_le_p(const void *ptr) return (uint16_t)le_bswap(lduw_he_p(ptr), 16); } =20 -static inline int ldsw_le_p(const void *ptr) -{ - return (int16_t)le_bswap(lduw_he_p(ptr), 16); -} - static inline int ldl_le_p(const void *ptr) { return le_bswap(ldl_he_p(ptr), 32); @@ -409,11 +397,6 @@ static inline int lduw_be_p(const void *ptr) return (uint16_t)be_bswap(lduw_he_p(ptr), 16); } =20 -static inline int ldsw_be_p(const void *ptr) -{ - return (int16_t)be_bswap(lduw_he_p(ptr), 16); -} - static inline int ldl_be_p(const void *ptr) { return be_bswap(ldl_he_p(ptr), 32); @@ -471,6 +454,7 @@ static inline void st ## size ## _ ## endian ## _p(void= *ptr, vtype v)\ ST_CONVERT_END(be, bits, vtype, size) =20 ST_CONVERT(16, uint16_t, w) +LD_CONVERT(16, int, int16_t, sw) =20 static inline unsigned long leul_to_cpu(unsigned long v) { --=20 2.26.3