Summary: | Optimize clz() and ctz() for ARM64. | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Mark Lam <mark.lam> | ||||
Component: | Web Template Framework | Assignee: | Mark Lam <mark.lam> | ||||
Status: | RESOLVED WONTFIX | ||||||
Severity: | Normal | CC: | benjamin, cdumez, cmarcelo, ews-watchlist, rmorisset, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Mark Lam
2020-05-18 16:36:06 PDT
Created attachment 399683 [details]
proposed patch.
Comment on attachment 399683 [details]
proposed patch.
r=me
Yusuke pointed out that it may not be safe for me to use the builtin without the null check. This is because the compiler may make assumptions about the incoming value not being null if I elide the check. As a result, I used an inline asm statement instead to implement the equivalent of the builtin. However, using the inline asm statement seems to block Clang from applying some optimizations (e.g. loop unrolling). As a result, perf was actually worse with the inline asm statement. Given the microbenchmark results I'm seeing, I think this change is not worth making. |