[Bug target/99953] In AVX, SIMD support environment, strlen performance without optimization is 3 times faster than optimized strlen function.
novemberizing at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Apr 7 09:05:56 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99953
--- Comment #7 from Hyun Sik Park <novemberizing at gmail dot com> ---
Thank you.
I was tested and the result is below.
$ ./a.out
no optimize => 0.000009640
o1 optimize => 0.000009126
o2 optimize => 0.000009422
o3 optimize => 0.000009081
experiment_optimize_3
17d5: 48 01 c7 add %rax,%rdi
17d8: e8 c3 f8 ff ff callq 10a0 strlen@plt
17dd: 48 8b 74 24 08 mov 0x8(%rsp),%rsi
experiment_optimize_2
168d: 48 01 c7 add %rax,%rdi
1690: e8 0b fa ff ff callq 10a0 strlen@plt
1695: 48 8b 74 24 10 mov 0x10(%rsp),%rsi
experiment_optimize_1
154c: e8 4f fb ff ff callq 10a0 strlen@plt
1551: 48 89 04 24 mov %rax,(%rsp)
experiment_optimize_0
1375: 48 89 c7 mov %rax,%rdi
1378: e8 23 fd ff ff callq 10a0 strlen@plt
137d: 48 89 45 a8 mov %rax,-0x58(%rbp)
Thank you.
More information about the Gcc-bugs
mailing list