[11/25] libcpu: Use __asm instead asm that can be recognized by both clang-cl and gcc
Message ID | 20221020182603.815-12-luoyonggang@gmail.com |
---|---|
State | Superseded |
Headers |
Return-Path: <elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DE7C5384B0C9 for <patchwork@sourceware.org>; Thu, 20 Oct 2022 18:27:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DE7C5384B0C9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666290431; bh=4jmJwUVCsODCvNPa2Reqfk1yvJJaV2ytewti/ko8TmQ=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:From; b=CA/W8JT51eaZ86IjOatxXvpW/je1AlR8+y3BQ1q8HSMD++k/iCzasne+T6PFV4FCv Lylpu7lCMHC9rkT3eMiJYIvCQrVSDYTU/RZ65fsfMFmnJ/4DB9p07NqtSm1QVNXhhg KttT79unB5LaMqsWJlgDtyUqPvD34fNklPajsDM4= X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id E4B47384D156 for <elfutils-devel@sourceware.org>; Thu, 20 Oct 2022 18:26:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E4B47384D156 Received: by mail-pl1-x62a.google.com with SMTP id j12so102135plj.5 for <elfutils-devel@sourceware.org>; Thu, 20 Oct 2022 11:26:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=4jmJwUVCsODCvNPa2Reqfk1yvJJaV2ytewti/ko8TmQ=; b=fbxCt2bxP7yrPTw47rUKPH8JIo/gTWWgyws14jt+7Az8gZpUNlP/5DSoUVWB0u+71g F9EV9KqBCYwMjWVNsXwRUZ1qgodxC2uShH8HaYHKTlflEfCVBYu2tNU0iYepwEnP9HWf 8wLOLRNhr6C/KRGzRrzRfQ57S3rVEkpYvvPzjFc3+8h/+VRfEn3pvavk/V1HWVZo9qnj Eeu2UnR++I3KqrTisqel69FccfELP38WCqmZlDWOfgp5eGJkPO2JWqVh4gEN0T0VM5yB R1HTEyfTNpioubHNQZCjFrUSFwOclhux8CCXl/LA3xI9j3vByernAYuIINYEYZYPO5j5 QybQ== X-Gm-Message-State: ACrzQf2vhnHsYrz/B4wkkDp5JaEGWl5tj3E4IaO4q818W2W6daOn2ryM RtYF0KAkMi7VtcpMeQ7QUyAOHWX/mK0+ZA== X-Google-Smtp-Source: AMsMyM4FNNwV6KfaimaHHZImT35SIe+tDVo/6FXHqfodKJ641re+Um+cVBl9J4ZSFG21LtWSZl2inQ== X-Received: by 2002:a17:902:e3cd:b0:17f:9c94:b22f with SMTP id r13-20020a170902e3cd00b0017f9c94b22fmr15211841ple.80.1666290405198; Thu, 20 Oct 2022 11:26:45 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id w15-20020a17090a460f00b00202fbd9c21dsm115067pjg.48.2022.10.20.11.26.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 11:26:44 -0700 (PDT) To: elfutils-devel@sourceware.org Subject: [PATCH 11/25] libcpu: Use __asm instead asm that can be recognized by both clang-cl and gcc Date: Fri, 21 Oct 2022 02:25:50 +0800 Message-Id: <20221020182603.815-12-luoyonggang@gmail.com> X-Mailer: git-send-email 2.36.1.windows.1 In-Reply-To: <20221020182603.815-1-luoyonggang@gmail.com> References: <20221020182603.815-1-luoyonggang@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list <elfutils-devel.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/elfutils-devel>, <mailto:elfutils-devel-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/elfutils-devel/> List-Help: <mailto:elfutils-devel-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/elfutils-devel>, <mailto:elfutils-devel-request@sourceware.org?subject=subscribe> From: Yonggang Luo via Elfutils-devel <elfutils-devel@sourceware.org> Reply-To: Yonggang Luo <luoyonggang@gmail.com> Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org Sender: "Elfutils-devel" <elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
Patches for building with mingw/gcc msvc/clang-cl
|
|
Commit Message
Yonggang Luo
Oct. 20, 2022, 6:25 p.m. UTC
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
libcpu/i386_disasm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi, On Fri, 2022-10-21 at 02:25 +0800, Yonggang Luo via Elfutils-devel wrote: > Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> > --- > libcpu/i386_disasm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c > index 599d1654..cc75a7b1 100644 > --- a/libcpu/i386_disasm.c > +++ b/libcpu/i386_disasm.c > @@ -480,7 +480,7 @@ i386_disasm (Ebl *ebl __attribute__((unused)), > > /* gcc is not clever enough to see the following > variables > are not used uninitialized. */ > - asm ("" > + __asm ("" > : "=mr" (opoff), "=mr" (correct_prefix), "=mr" > (codep), > "=mr" (next_curr), "=mr" (len)); > } Urgh. Is this really (still) necessary? It is inside an if (0) block. So it also is never used. Can we just get rid of the whole block? Thanks, Mark
On Mon, Dec 12, 2022 at 8:42 PM Mark Wielaard <mark@klomp.org> wrote: > > Hi, > > On Fri, 2022-10-21 at 02:25 +0800, Yonggang Luo via Elfutils-devel > wrote: > > Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> > > --- > > libcpu/i386_disasm.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c > > index 599d1654..cc75a7b1 100644 > > --- a/libcpu/i386_disasm.c > > +++ b/libcpu/i386_disasm.c > > @@ -480,7 +480,7 @@ i386_disasm (Ebl *ebl __attribute__((unused)), > > > > /* gcc is not clever enough to see the following > > variables > > are not used uninitialized. */ > > - asm ("" > > + __asm ("" > > : "=mr" (opoff), "=mr" (correct_prefix), "=mr" > > (codep), > > "=mr" (next_curr), "=mr" (len)); > > } > > Urgh. Is this really (still) necessary? It is inside an if (0) block. > So it also is never used. Can we just get rid of the whole block? OK, I'll get rid of it > > Thanks, > > Mark -- 此致 礼 罗勇刚 Yours sincerely, Yonggang Luo
diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c index 599d1654..cc75a7b1 100644 --- a/libcpu/i386_disasm.c +++ b/libcpu/i386_disasm.c @@ -480,7 +480,7 @@ i386_disasm (Ebl *ebl __attribute__((unused)), /* gcc is not clever enough to see the following variables are not used uninitialized. */ - asm ("" + __asm ("" : "=mr" (opoff), "=mr" (correct_prefix), "=mr" (codep), "=mr" (next_curr), "=mr" (len)); }