marxin
64bce5a24b
Use GCC builtins for bswap as compiler can then emit these via instructions.
Using current macros, one get for:
static inline int BSWAP32(int x) {
return ((x << 24) | ((x << 8) & 0x00FF0000) | ((x >> 8) & 0x0000FF00) | (x >> 24));
}
int main(int argc, char **argv)
{
return BSWAP32(argc);
}
main:
.LFB1:
.cfi_startproc
movl %edi, %eax
movl %edi, %edx
sarl $24, %edx
sall $24, %eax
orl %edx, %eax
movl %edi, %edx
sarl $8, %edi
sall $8, %edx
andl $65280, %edi
andl $16711680, %edx
orl %edx, %eax
orl %edi, %eax
ret
while using:
int main(int argc, char **argv)
{
return __builtin_bswap32(argc);
}
one gets:
main:
.LFB0:
.cfi_startproc
movl %edi, %eax
bswap %eax
ret
2019-03-05 22:27:02 +01:00
..
2019-02-16 14:41:07 +01:00
2019-03-04 21:01:21 -03:00
2019-03-04 21:03:10 -03:00
2019-03-04 10:11:29 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2018-09-12 09:52:22 +02:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-02-16 04:00:19 +01:00
2019-02-16 04:00:19 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2018-09-15 14:45:54 +02:00
2019-01-01 12:58:10 +01:00
2019-02-12 13:34:25 +01:00
2019-01-07 17:34:44 +00:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-02-17 13:38:52 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-03-01 16:01:44 -03:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-02-12 13:34:25 +01:00
2019-01-01 12:58:10 +01:00
2019-02-12 13:34:25 +01:00
2019-02-20 19:44:12 +01:00
2019-02-12 13:34:25 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-02-12 13:34:25 +01:00
2018-07-28 18:13:48 +02:00
2019-01-01 12:58:10 +01:00
2019-01-14 11:24:00 -03:00
2019-01-14 11:00:05 -03:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-02-12 13:34:25 +01:00
2019-01-01 12:58:10 +01:00
2019-03-05 12:24:21 +02:00
2019-02-21 20:49:42 -03:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-30 06:43:56 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-02-12 13:34:25 +01:00
2019-02-12 13:34:25 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-02-20 19:44:12 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-02-12 13:34:25 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-03-03 17:12:19 -03:00
2019-02-23 12:09:35 -03:00
2019-02-20 19:44:12 +01:00
2019-02-09 00:32:18 +01:00
2019-01-03 22:35:20 -02:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-02-12 13:34:25 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-02-12 13:34:25 +01:00
2019-02-12 13:34:25 +01:00
2019-02-20 19:44:12 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-03-05 22:27:02 +01:00
2019-01-01 12:58:10 +01:00
2019-03-03 17:57:16 -03:00
2019-03-03 17:57:16 -03:00
2019-02-22 19:28:19 +01:00
2019-02-21 20:24:29 +01:00
2019-02-21 18:52:29 +08:00
2019-03-03 13:30:43 +01:00
2019-02-21 11:24:00 +01:00
2019-01-01 12:58:10 +01:00
2019-01-30 06:43:56 +01:00
2019-02-20 11:14:22 +00:00
2019-02-12 13:34:25 +01:00
2019-02-17 13:38:52 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00