Bug 204442

Summary: [JSC] Extend MacroAssemblerARM64::load/store for datasize = 16
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch mark.lam: review+

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>