* [PATCH 2/2] Subject: Add a few GCC builtins
@ 2009-08-01 9:28 Blue Swirl
2009-08-01 16:53 ` Christopher Li
0 siblings, 1 reply; 4+ messages in thread
From: Blue Swirl @ 2009-08-01 9:28 UTC (permalink / raw)
To: linux-sparse
Add c{l,t}z{,l,ll}, ffsl{,l}, popcountll and floating point comparison
builtins.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
lib.c | 25 ++++++++++++++++++++++---
1 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/lib.c b/lib.c
index 42affcd..600939b 100644
--- a/lib.c
+++ b/lib.c
@@ -685,15 +685,26 @@ void declare_builtin_functions(void)
add_pre_buffer("extern char * __builtin_strpbrk(const char *, const
char *);\n");
add_pre_buffer("extern __SIZE_TYPE__ __builtin_strlen(const char *);\n");
+ /* And bitwise operations.. */
+ add_pre_buffer("extern int __builtin_clz(int);\n");
+ add_pre_buffer("extern int __builtin_clzl(long);\n");
+ add_pre_buffer("extern int __builtin_clzll(long long);\n");
+ add_pre_buffer("extern int __builtin_ctz(int);\n");
+ add_pre_buffer("extern int __builtin_ctzl(long);\n");
+ add_pre_buffer("extern int __builtin_ctzll(long long);\n");
+ add_pre_buffer("extern int __builtin_ffs(int);\n");
+ add_pre_buffer("extern int __builtin_ffsl(long);\n");
+ add_pre_buffer("extern int __builtin_ffsll(long long);\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 int __builtin_popcountll(unsigned long long);\n");
+
/* And some random ones.. */
add_pre_buffer("extern void *__builtin_return_address(unsigned int);\n");
add_pre_buffer("extern void *__builtin_extract_return_addr(void *);\n");
add_pre_buffer("extern void *__builtin_frame_address(unsigned int);\n");
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");
@@ -704,6 +715,14 @@ void declare_builtin_functions(void)
add_pre_buffer("extern long __builtin_alpha_cmpbge(long, long);\n");
add_pre_buffer("extern long __builtin_labs(long);\n");
+ /* And some floating point stuff.. */
+ add_pre_buffer("extern int __builtin_isgreater(float, float);\n");
+ add_pre_buffer("extern int __builtin_isgreaterequal(float, float);\n");
+ add_pre_buffer("extern int __builtin_isless(float, float);\n");
+ add_pre_buffer("extern int __builtin_islessequal(float, float);\n");
+ add_pre_buffer("extern int __builtin_islessgreater(float, float);\n");
+ add_pre_buffer("extern int __builtin_isunordered(float, float);\n");
+
/* And some __FORTIFY_SOURCE ones.. */
add_pre_buffer ("extern __SIZE_TYPE__ __builtin_object_size(void *, int);\n");
add_pre_buffer ("extern void * __builtin___memcpy_chk(void *, const
void *, __SIZE_TYPE__, __SIZE_TYPE__);\n");
--
1.6.2.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] Subject: Add a few GCC builtins
2009-08-01 9:28 [PATCH 2/2] Subject: Add a few GCC builtins Blue Swirl
@ 2009-08-01 16:53 ` Christopher Li
2009-08-01 17:23 ` Blue Swirl
0 siblings, 1 reply; 4+ messages in thread
From: Christopher Li @ 2009-08-01 16:53 UTC (permalink / raw)
To: Blue Swirl; +Cc: linux-sparse
On Sat, Aug 1, 2009 at 2:28 AM, Blue Swirl<blauwirbel@gmail.com> wrote:
> Add c{l,t}z{,l,ll}, ffsl{,l}, popcountll and floating point comparison
> builtins.
Your two patches looks good. But the patch itself is white space damaged.
Gmail does some strange thing to inlined patches.
Can you resend this patch using "attach a file"?
Thanks
Chris
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] Subject: Add a few GCC builtins
2009-08-01 16:53 ` Christopher Li
@ 2009-08-01 17:23 ` Blue Swirl
2009-08-04 21:35 ` Christopher Li
0 siblings, 1 reply; 4+ messages in thread
From: Blue Swirl @ 2009-08-01 17:23 UTC (permalink / raw)
To: Christopher Li; +Cc: linux-sparse
[-- Attachment #1: Type: text/plain, Size: 478 bytes --]
On Sat, Aug 1, 2009 at 7:53 PM, Christopher Li<sparse@chrisli.org> wrote:
> On Sat, Aug 1, 2009 at 2:28 AM, Blue Swirl<blauwirbel@gmail.com> wrote:
>> Add c{l,t}z{,l,ll}, ffsl{,l}, popcountll and floating point comparison
>> builtins.
>
> Your two patches looks good. But the patch itself is white space damaged.
> Gmail does some strange thing to inlined patches.
>
> Can you resend this patch using "attach a file"?
Sure. I removed the extra "Subject:" from the description.
[-- Attachment #2: 0002-Add-a-few-GCC-builtins.patch --]
[-- Type: application/x-patch, Size: 3176 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-08-04 21:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-01 9:28 [PATCH 2/2] Subject: Add a few GCC builtins Blue Swirl
2009-08-01 16:53 ` Christopher Li
2009-08-01 17:23 ` Blue Swirl
2009-08-04 21:35 ` Christopher Li
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).