Bug 164811 - B3 should support UDiv/UMod
Summary: B3 should support UDiv/UMod
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: Keith Miller
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-15 19:13 PST by Keith Miller
Modified: 2016-11-16 08:18 PST (History)
5 users (show)

See Also:


Attachments
Patch (37.20 KB, patch)
2016-11-15 19:17 PST, Keith Miller
no flags Details | Formatted Diff | Diff
Patch for landing (38.25 KB, patch)
2016-11-15 19:31 PST, Keith Miller
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Miller 2016-11-15 19:13:08 PST
B3 should support UDiv/UMod
Comment 1 Keith Miller 2016-11-15 19:17:33 PST
Created attachment 294915 [details]
Patch
Comment 2 WebKit Commit Bot 2016-11-15 19:20:23 PST
This patch modifies one of the wasm.json files. Please ensure that any changes in one have been mirrored to the other. You can find the wasm.json files at "Source/JavaScriptCore/wasm/wasm.json" and "JSTests/wasm/wasm.json".
Comment 3 Filip Pizlo 2016-11-15 19:24:52 PST
Comment on attachment 294915 [details]
Patch

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

r=me with comments

> Source/JavaScriptCore/b3/B3Common.h:152
> +
> +

So blank, much space.

> Source/JavaScriptCore/b3/B3LowerToAir.cpp:2830
> +    void lowerX86UDiv()
> +    {

The way I would have done this, and in hindsight the code above for signed div, is that the #if's should be inside the body, like:

#if CPU(blah)
    your code
#else
    UNREACHABLE_FOR_PLATFORM();
#endif

This would get rid of a lot of #if gunk above.  You could then just use if (isX86()).

> Source/JavaScriptCore/b3/air/AirOpcode.opcodes:313
> +Tmp*, Tmp*, Tmp

Indent!
Comment 4 Keith Miller 2016-11-15 19:31:19 PST
Created attachment 294916 [details]
Patch for landing
Comment 5 WebKit Commit Bot 2016-11-15 20:47:24 PST
Comment on attachment 294916 [details]
Patch for landing

Clearing flags on attachment: 294916

Committed r208781: <http://trac.webkit.org/changeset/208781>
Comment 6 WebKit Commit Bot 2016-11-15 20:47:28 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Csaba Osztrogonác 2016-11-16 07:13:18 PST
(In reply to comment #5)
> Comment on attachment 294916 [details]
> Patch for landing
> 
> Clearing flags on attachment: 294916
> 
> Committed r208781: <http://trac.webkit.org/changeset/208781>

It broke the iOS build:
https://build.webkit.org/builders/Apple%20iOS%2010%20Release%20%28Build%29/builds/1378


/Volumes/Data/slave/ios-10-release/build/Source/JavaScriptCore/b3/B3LowerToAir.cpp:2100:34: error: use of undeclared identifier 'X86Registers'
                append(Move, Tmp(X86Registers::eax), tmp(m_value));
                                 ^
/Volumes/Data/slave/ios-10-release/build/Source/JavaScriptCore/b3/B3LowerToAir.cpp:2112:34: error: use of undeclared identifier 'X86Registers'
                append(Move, Tmp(X86Registers::eax), tmp(m_value));
                                 ^
2 errors generated.
Comment 8 Keith Miller 2016-11-16 08:18:50 PST
(In reply to comment #7)
> (In reply to comment #5)
> > Comment on attachment 294916 [details]
> > Patch for landing
> > 
> > Clearing flags on attachment: 294916
> > 
> > Committed r208781: <http://trac.webkit.org/changeset/208781>
> 
> It broke the iOS build:
> https://build.webkit.org/builders/Apple%20iOS%2010%20Release%20%28Build%29/
> builds/1378
> 
> 
> /Volumes/Data/slave/ios-10-release/build/Source/JavaScriptCore/b3/
> B3LowerToAir.cpp:2100:34: error: use of undeclared identifier 'X86Registers'
>                 append(Move, Tmp(X86Registers::eax), tmp(m_value));
>                                  ^
> /Volumes/Data/slave/ios-10-release/build/Source/JavaScriptCore/b3/
> B3LowerToAir.cpp:2112:34: error: use of undeclared identifier 'X86Registers'
>                 append(Move, Tmp(X86Registers::eax), tmp(m_value));
>                                  ^
> 2 errors generated.

Should hopefully be fixed by: http://trac.webkit.org/changeset/208791