Bug 204442 - [JSC] Extend MacroAssemblerARM64::load/store for datasize = 16
Summary: [JSC] Extend MacroAssemblerARM64::load/store for datasize = 16
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-11-20 20:40 PST by Yusuke Suzuki
Modified: 2019-11-20 22:02 PST (History)
7 users (show)

See Also:


Attachments
Patch (5.98 KB, patch)
2019-11-20 20:40 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (5.94 KB, patch)
2019-11-20 20:43 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (8.11 KB, patch)
2019-11-20 21:04 PST, Yusuke Suzuki
mark.lam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2019-11-20 20:40:03 PST
[JSC] Extend MacroAssemblerARM64::load/store for datasize = 16
Comment 1 Yusuke Suzuki 2019-11-20 20:40:27 PST
Created attachment 384026 [details]
Patch

WIP
Comment 2 Yusuke Suzuki 2019-11-20 20:40:49 PST
<rdar://problem/57366761>
Comment 3 Yusuke Suzuki 2019-11-20 20:43:49 PST
Created attachment 384027 [details]
Patch

WIP
Comment 4 Yusuke Suzuki 2019-11-20 21:04:43 PST
Created attachment 384029 [details]
Patch
Comment 5 Mark Lam 2019-11-20 21:19:10 PST
Comment on attachment 384029 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=384029&action=review

> Source/JavaScriptCore/ChangeLog:9
> +        Our `void load16(const void* address, RegisterID dest)` and `void store16(RegisterID src, const void* address)` do not aware of

/do not aware/are not aware/.

> Source/JavaScriptCore/ChangeLog:10
> +        the condition that passed register is memoryTempRegister, while `MacroAssemblerARM64::{load,store}` handles it correctly, e.g.

/is memoryTempRegister/can be memoryTempRegister/

> Source/JavaScriptCore/ChangeLog:24
> +        to support 16 so that `or16` implementation looks like almost the same to `or32` etc.

/looks like almost the same to/is similar to/

> Source/JavaScriptCore/assembler/testmasm.cpp:1137
> +    // Just compiling test.
> +    compile([&] (CCallHelpers& jit) {
> +        emitFunctionPrologue(jit);
> +        jit.or16(CCallHelpers::TrustedImm32(42), CCallHelpers::AbsoluteAddress(nullptr));
> +        emitFunctionEpilogue(jit);
> +        jit.ret();
> +    });

How is this test case different than the one immediately above it?
Comment 6 Yusuke Suzuki 2019-11-20 21:20:02 PST
Comment on attachment 384029 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=384029&action=review

>> Source/JavaScriptCore/assembler/testmasm.cpp:1137
>> +    });
> 
> How is this test case different than the one immediately above it?

nullptr is always invalid logical imm in ARM64, so this takes the path this patch is fixing.
Comment 7 Mark Lam 2019-11-20 21:57:13 PST
Comment on attachment 384029 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=384029&action=review

r=me with fixes.

>>> Source/JavaScriptCore/assembler/testmasm.cpp:1137
>>> +    });
>> 
>> How is this test case different than the one immediately above it?
> 
> nullptr is always invalid logical imm in ARM64, so this takes the path this patch is fixing.

Yusuke told me offline that his intent is to take the !logicalImm.isValid() case in or16.  For that, we need to pass TrustedImm(0), not AbsoluteAddress(nullptr).
Comment 8 Yusuke Suzuki 2019-11-20 21:57:47 PST
Comment on attachment 384029 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=384029&action=review

Thanks!

>> Source/JavaScriptCore/ChangeLog:9
>> +        Our `void load16(const void* address, RegisterID dest)` and `void store16(RegisterID src, const void* address)` do not aware of
> 
> /do not aware/are not aware/.

Fixed.

>> Source/JavaScriptCore/ChangeLog:10
>> +        the condition that passed register is memoryTempRegister, while `MacroAssemblerARM64::{load,store}` handles it correctly, e.g.
> 
> /is memoryTempRegister/can be memoryTempRegister/

Fixed.

>> Source/JavaScriptCore/ChangeLog:24
>> +        to support 16 so that `or16` implementation looks like almost the same to `or32` etc.
> 
> /looks like almost the same to/is similar to/

Fixed.

>>>> Source/JavaScriptCore/assembler/testmasm.cpp:1137
>>>> +    });
>>> 
>>> How is this test case different than the one immediately above it?
>> 
>> nullptr is always invalid logical imm in ARM64, so this takes the path this patch is fixing.
> 
> Yusuke told me offline that his intent is to take the !logicalImm.isValid() case in or16.  For that, we need to pass TrustedImm(0), not AbsoluteAddress(nullptr).

Nice, fixed.
Comment 9 Yusuke Suzuki 2019-11-20 22:02:57 PST
Committed r252728: <https://trac.webkit.org/changeset/252728>