linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ftp.linux.org.uk>
To: Matthew Wilcox <matthew@wil.cx>
Cc: linux-sparse@vger.kernel.org
Subject: Re: [PATCH] Add __builtin_popcountl
Date: Thu, 26 Oct 2006 19:43:01 +0100	[thread overview]
Message-ID: <20061026184301.GJ29920@ftp.linux.org.uk> (raw)
In-Reply-To: <20061026174730.GE5591@parisc-linux.org>

On Thu, Oct 26, 2006 at 11:47:30AM -0600, Matthew Wilcox wrote:
> 
> IA-64 uses __builtin_popcountl() which wasn't a function sparse knew
> about.  This patch adds it.  I've never looked at sparse before, so this
> is a hack-and-run job.  Please feel free to rewrite it if it doesn't suit.

AFAICS, that's way over the top.  That kind of stuff is needed only
when builtin can't be described as a normal function.  This, OTOH...

diff --git a/lib.c b/lib.c
--- a/lib.c
+++ b/lib.c
@@ -467,6 +467,16 @@ void declare_builtin_functions(void)
 	add_pre_buffer("extern void __builtin_trap(void);\n");
 	add_pre_buffer("extern int __builtin_ffs(int);\n");
 	add_pre_buffer("extern void *__builtin_alloca(__SIZE_TYPE__);\n");
+	add_pre_buffer("extern int __builtin_popcount(unsigned int);\n");
+	add_pre_buffer("extern int __builtin_popcountl(unsigned long);\n");
+	add_pre_buffer("extern void __builtin_prefetch (const void *, ...);\n");
+	add_pre_buffer("extern long __builtin_alpha_extbl(long, long);\n");
+	add_pre_buffer("extern long __builtin_alpha_extwl(long, long);\n");
+	add_pre_buffer("extern long __builtin_alpha_insbl(long, long);\n");
+	add_pre_buffer("extern long __builtin_alpha_inswl(long, long);\n");
+	add_pre_buffer("extern long __builtin_alpha_insql(long, long);\n");
+	add_pre_buffer("extern long __builtin_alpha_inslh(long, long);\n");
+	add_pre_buffer("extern long __builtin_alpha_cmpbge(long, long);\n");
 }
 
 void create_builtin_stream(void)

  reply	other threads:[~2006-10-26 18:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-26 17:47 [PATCH] Add __builtin_popcountl Matthew Wilcox
2006-10-26 18:43 ` Al Viro [this message]
2006-10-26 18:56   ` Linus Torvalds
2006-10-26 19:19     ` Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061026184301.GJ29920@ftp.linux.org.uk \
    --to=viro@ftp.linux.org.uk \
    --cc=linux-sparse@vger.kernel.org \
    --cc=matthew@wil.cx \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).