WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
188716
[WTF] Add WTF::unalignedLoad and WTF::unalignedStore
https://bugs.webkit.org/show_bug.cgi?id=188716
Summary
[WTF] Add WTF::unalignedLoad and WTF::unalignedStore
Yusuke Suzuki
Reported
2018-08-17 19:04:26 PDT
[WTF] Add WTF::unalignedLoad and WTF::unalignedStore
Attachments
Patch
(10.39 KB, patch)
2018-08-17 19:10 PDT
,
Yusuke Suzuki
no flags
Details
Formatted Diff
Diff
Patch
(12.75 KB, patch)
2018-08-17 19:18 PDT
,
Yusuke Suzuki
no flags
Details
Formatted Diff
Diff
Patch
(17.97 KB, patch)
2018-08-19 01:21 PDT
,
Yusuke Suzuki
darin
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Yusuke Suzuki
Comment 1
2018-08-17 19:10:40 PDT
Created
attachment 347421
[details]
Patch
Yusuke Suzuki
Comment 2
2018-08-17 19:18:59 PDT
Created
attachment 347423
[details]
Patch
Yusuke Suzuki
Comment 3
2018-08-19 01:21:51 PDT
Created
attachment 347455
[details]
Patch
Darin Adler
Comment 4
2018-08-19 12:24:36 PDT
Comment on
attachment 347455
[details]
Patch How close does this put us to removing reinterpret_cast_ptr?
Yusuke Suzuki
Comment 5
2018-08-19 15:42:00 PDT
(In reply to Darin Adler from
comment #4
)
> Comment on
attachment 347455
[details]
> Patch > > How close does this put us to removing reinterpret_cast_ptr?
Nice catch. Currently, `reinterpret_cast_ptr<T>(ptr)` is used only when we ensure that the casted `ptr` has the expected alignment by `T`. It would be optimized way with CPUs without unaligned accesses support. But since the major CPUs like ARM64, X86, and X86_64 support unaligned accesses, always using `WTF::unalignedXXX` would be feasible. We should investigate each site of `reinterpret_cast_ptr` carefully to decide whether we can replace it with unalignedXXX helpers!
Yusuke Suzuki
Comment 6
2018-08-19 15:50:11 PDT
Committed
r235018
: <
https://trac.webkit.org/changeset/235018
>
Fujii Hironori
Comment 7
2018-08-20 06:58:37 PDT
I'm surprised. There are so many unaligned access. I thought unaligned memory access is slow. See
https://github.com/spotify/linux/blob/master/Documentation/unaligned-memory-access.txt
Are they really unaligned memory access? Or, actually aligned?
Radar WebKit Bug Importer
Comment 8
2018-08-20 16:52:06 PDT
<
rdar://problem/43534448
>
Yusuke Suzuki
Comment 9
2018-08-20 20:38:26 PDT
(In reply to Fujii Hironori from
comment #7
)
> I'm surprised. There are so many unaligned access. > I thought unaligned memory access is slow. > See >
https://github.com/spotify/linux/blob/master/Documentation/unaligned-memory
- > access.txt > > Are they really unaligned memory access? Or, actually aligned?
Unaligned accesses reported by UBSan. They are typically filling/extracting an value into/from X86 machine code stream.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug