Bug 212053 - Optimize clz() and ctz() for ARM64.
Summary: Optimize clz() and ctz() for ARM64.
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-05-18 16:36 PDT by Mark Lam
Modified: 2020-05-18 21:38 PDT (History)
6 users (show)

See Also:


Attachments
proposed patch. (3.88 KB, patch)
2020-05-18 16:51 PDT, Mark Lam
rmorisset: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2020-05-18 16:36:06 PDT
...
Comment 1 Radar WebKit Bug Importer 2020-05-18 16:37:09 PDT
<rdar://problem/63368271>
Comment 2 Mark Lam 2020-05-18 16:51:05 PDT
Created attachment 399683 [details]
proposed patch.
Comment 3 Robin Morisset 2020-05-18 16:53:14 PDT
Comment on attachment 399683 [details]
proposed patch.

r=me
Comment 4 Mark Lam 2020-05-18 21:38:12 PDT
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.