WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
184023
Emit fjcvtzs on ARM64E on Darwin
https://bugs.webkit.org/show_bug.cgi?id=184023
Summary
Emit fjcvtzs on ARM64E on Darwin
Yusuke Suzuki
Reported
2018-03-26 14:20:47 PDT
ARMv8.3-a adds a new instruction "jscvt", which can be used for converting double to int32_t in JS semantics.
Attachments
WIP
(8.06 KB, patch)
2018-10-14 00:19 PDT
,
Saam Barati
no flags
Details
Formatted Diff
Diff
WIP
(10.62 KB, patch)
2018-10-14 14:49 PDT
,
Saam Barati
no flags
Details
Formatted Diff
Diff
patch
(12.87 KB, patch)
2018-10-14 14:53 PDT
,
Saam Barati
no flags
Details
Formatted Diff
Diff
patch
(14.33 KB, patch)
2018-10-14 15:01 PDT
,
Saam Barati
no flags
Details
Formatted Diff
Diff
patch
(14.12 KB, patch)
2018-10-14 15:02 PDT
,
Saam Barati
ysuzuki
: review+
Details
Formatted Diff
Diff
patch for landing
(14.16 KB, patch)
2018-10-15 11:35 PDT
,
Saam Barati
no flags
Details
Formatted Diff
Diff
Show Obsolete
(5)
View All
Add attachment
proposed patch, testcase, etc.
Yusuke Suzuki
Comment 1
2018-03-26 14:56:18 PDT
In Linux, we can use hwcap to detect this feature.
https://github.com/torvalds/linux/blob/3b3b681097fae73b7f5dcdd42db6cfdf32943d4c/Documentation/arm64/elf_hwcaps.txt
Yusuke Suzuki
Comment 2
2018-03-26 15:18:24 PDT
(In reply to Yusuke Suzuki from
comment #1
)
> In Linux, we can use hwcap to detect this feature. >
https://github.com/torvalds/linux/blob/
> 3b3b681097fae73b7f5dcdd42db6cfdf32943d4c/Documentation/arm64/elf_hwcaps.txt
This is necessary since ARM64 feature registers are only available in privileged mode. To detect features, some kernel support is necessary. In Linux, we can use auxiliary vector provided by the kernel's ELF loader. This includes hwcaps, which tells us whether the CPU features are available.
JF Bastien
Comment 3
2018-03-26 15:21:38 PDT
Asking the kernel is best. If you can't you can also sigsetjmp, try the instruction, and then siglongjmp. It'll sigill if not supported. Caveat is that the kernel may decide to emulate instead of sigill, and then it'll be super slow.
Saam Barati
Comment 4
2018-10-08 00:33:50 PDT
Ima try to get to this this week
Yusuke Suzuki
Comment 5
2018-10-13 16:33:10 PDT
BTW, Linux MacroAssemblerARM64 already has "s_jscvtCheckState" state (runtime detection flag of jscvt availability). If we emit jscvt based on this condition, we can support jscvt opcode on wider platforms.
Saam Barati
Comment 6
2018-10-14 00:19:10 PDT
Created
attachment 352269
[details]
WIP
EWS Watchlist
Comment 7
2018-10-14 00:21:40 PDT
Attachment 352269
[details]
did not pass style-queue: ERROR: Source/JavaScriptCore/runtime/MathCommon.h:144: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 1 in 9 files If any of these errors are false positives, please file a bug against check-webkit-style.
Saam Barati
Comment 8
2018-10-14 11:37:56 PDT
(In reply to Yusuke Suzuki from
comment #5
)
> BTW, Linux MacroAssemblerARM64 already has "s_jscvtCheckState" state > (runtime detection flag of jscvt availability). > If we emit jscvt based on this condition, we can support jscvt opcode on > wider platforms.
Yeah makes sense. I saw that. I haven't gotten to integrating that yet.
Saam Barati
Comment 9
2018-10-14 14:49:06 PDT
Created
attachment 352277
[details]
WIP
Saam Barati
Comment 10
2018-10-14 14:53:09 PDT
Created
attachment 352278
[details]
patch
EWS Watchlist
Comment 11
2018-10-14 14:54:45 PDT
Attachment 352278
[details]
did not pass style-queue: ERROR: Source/JavaScriptCore/runtime/MathCommon.h:144: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 1 in 12 files If any of these errors are false positives, please file a bug against check-webkit-style.
Saam Barati
Comment 12
2018-10-14 15:01:04 PDT
Created
attachment 352279
[details]
patch
Saam Barati
Comment 13
2018-10-14 15:02:06 PDT
Created
attachment 352280
[details]
patch
EWS Watchlist
Comment 14
2018-10-14 15:05:53 PDT
Attachment 352280
[details]
did not pass style-queue: ERROR: Source/JavaScriptCore/runtime/MathCommon.h:144: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 1 in 14 files If any of these errors are false positives, please file a bug against check-webkit-style.
Yusuke Suzuki
Comment 15
2018-10-15 07:09:07 PDT
Comment on
attachment 352280
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=352280&action=review
r=me
> Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:14440 > +#endif
Nice.
Filip Pizlo
Comment 16
2018-10-15 07:29:47 PDT
Comment on
attachment 352280
[details]
patch R=me too.
Mark Lam
Comment 17
2018-10-15 07:59:12 PDT
Comment on
attachment 352280
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=352280&action=review
> Source/JavaScriptCore/ChangeLog:11 > + This patch patch teaches JSC to use that instruction when possible.
duplicate "patch".
> Source/JavaScriptCore/assembler/MacroAssemblerARM64.h:3764 > +#if HAVE(FJCVTZS_INSTRUCTION)
Should this be "HAVE(FJCVTZS_INSTRUCTION) && !OS(LINUX)"? The code in MacroAssemblerARM64::collectCPUFeatures() implies that this is needed.
Saam Barati
Comment 18
2018-10-15 11:08:40 PDT
Comment on
attachment 352280
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=352280&action=review
>> Source/JavaScriptCore/ChangeLog:11 >> + This patch patch teaches JSC to use that instruction when possible. > > duplicate "patch".
Will fix.
>> Source/JavaScriptCore/assembler/MacroAssemblerARM64.h:3764 >> +#if HAVE(FJCVTZS_INSTRUCTION) > > Should this be "HAVE(FJCVTZS_INSTRUCTION) && !OS(LINUX)"? The code in MacroAssemblerARM64::collectCPUFeatures() implies that this is needed.
HAVE(FJCVTZS) is only true on Darwin ATM. If it ever became true somewhere else at compile time, there’s be no need to make sure that we call that function on Linux, since it’s known based on the compile target that we’re going to have this instruction.
Saam Barati
Comment 19
2018-10-15 11:35:40 PDT
Created
attachment 352349
[details]
patch for landing
EWS Watchlist
Comment 20
2018-10-15 11:38:40 PDT
Attachment 352349
[details]
did not pass style-queue: ERROR: Source/JavaScriptCore/runtime/MathCommon.h:144: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 1 in 14 files If any of these errors are false positives, please file a bug against check-webkit-style.
WebKit Commit Bot
Comment 21
2018-10-15 12:47:19 PDT
Comment on
attachment 352349
[details]
patch for landing Clearing flags on attachment: 352349 Committed
r237136
: <
https://trac.webkit.org/changeset/237136
>
WebKit Commit Bot
Comment 22
2018-10-15 12:47:21 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 23
2018-10-15 12:48:26 PDT
<
rdar://problem/45281003
>
Saam Barati
Comment 24
2018-10-17 11:28:00 PDT
This is a 0.5-1% progression on JetStream2 on our bots on devices that support this instruction. As Yusuke predicted, these JetStream 2 subtests are improved: - 15% better on stanford-crypto-aes - 30% better on stanford-crypto-pbkf2 - 97% better on stanford-crypto-sha256
Saam Barati
Comment 25
2018-10-17 11:48:13 PDT
Some devices show a 2% overall progression on JetStream 2. So it seems this is somewhere between a 0.5-2% progression.
Filip Pizlo
Comment 26
2018-10-17 12:20:24 PDT
(In reply to Saam Barati from
comment #25
)
> Some devices show a 2% overall progression on JetStream 2. > > So it seems this is somewhere between a 0.5-2% progression.
Nice!
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