Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1317311
| From | Chen Gang <chengang@emindsoft.com.cn> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] fs: dcache: Use bool return value instead of int |
| Date | 2016-01-25 22:30 +0100 |
| Message-ID | <qUWRY-1zn-5@gated-at.bofh.it> (permalink) |
| References | (4 earlier) <qQCf8-6cl-21@gated-at.bofh.it> <qQCyu-6kn-5@gated-at.bofh.it> <qQSae-yO-37@gated-at.bofh.it> <qUAeK-2a9-9@gated-at.bofh.it> <qUAop-2dS-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 1/25/16 05:27, Al Viro wrote:
>
> Again, do you have _any_ evidence of improved code generation with that
> patch? Because if you do, I would really like to see it, so I could file
> bugs against gcc optimizer.
>
> Your impression of what _Bool is and what semantics does it have appears
> to be rather different from that described in C99, but that's a secondary
> issue - first and foremost, on which .config and with which gcc version
> do you see improvements from that change?
>
For our case, the check_mount function have smaller size under x86_64
(movl for int, movb for bool, movl is longer than movb).
The related objdump is below, welcome any ideas, suggestions, and
discussions for it.
origin (for int):
00000000 <check_mount>:
0: 8b 12 mov (%edx),%edx
2: 81 e2 00 00 01 00 and $0x10000,%edx
8: 74 16 je 20 <check_mount+0x20>
a: c7 00 01 00 00 00 movl $0x1,(%eax)
10: b8 01 00 00 00 mov $0x1,%eax
15: c3 ret
16: 8d 76 00 lea 0x0(%esi),%esi
19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
20: 31 c0 xor %eax,%eax
22: c3 ret
23: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
new (for bool):
00000000 <check_mount>:
0: 8b 12 mov (%edx),%edx
2: 81 e2 00 00 01 00 and $0x10000,%edx
8: 74 0e je 18 <check_mount+0x18>
a: c6 00 01 movb $0x1,(%eax)
d: b8 01 00 00 00 mov $0x1,%eax
12: c3 ret
13: 90 nop
14: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
18: 31 c0 xor %eax,%eax
1a: c3 ret
1b: 90 nop
1c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
[root@localhost fs]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-ana/configure
Thread model: posix
gcc version 6.0.0 20151121 (experimental) (GCC)
--
Chen Gang (陈刚)
Open, share, and attitude like air, water, and life which God blessed
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH] fs: dcache: Use bool return value instead of int Chen Gang <chengang@emindsoft.com.cn> - 2016-01-24 22:20 +0100
Re: [PATCH] fs: dcache: Use bool return value instead of int Al Viro <viro@ZenIV.linux.org.uk> - 2016-01-24 22:30 +0100
Re: [PATCH] fs: dcache: Use bool return value instead of int Chen Gang <chengang@emindsoft.com.cn> - 2016-01-25 22:30 +0100
csiph-web