Bug 152176

Summary: [JSC] Add Floating Point Abs() to B3
Product: WebKit Reporter: Benjamin Poulain <benjamin>
Component: New BugsAssignee: Benjamin Poulain <benjamin>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, ggaren
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing
none
Patch for landing
none
Patch for landing none

Description Benjamin Poulain 2015-12-11 10:30:40 PST
[JSC] Add Floating Point Abs() to B3
Comment 1 Benjamin Poulain 2015-12-11 10:36:24 PST
Created attachment 267172 [details]
Patch
Comment 2 Geoffrey Garen 2015-12-11 11:28:13 PST
Comment on attachment 267172 [details]
Patch

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

r=me

> Source/JavaScriptCore/b3/B3LowerMacrosAfterOptimizations.cpp:81
> +                if (m_value->type() == Double)
> +                    mask = m_insertionSet.insert<ConstDoubleValue>(m_index, m_origin, bitwise_cast<double>(~(1l << 63)));
> +                if (m_value->type() == Float)
> +                    mask = m_insertionSet.insert<ConstFloatValue>(m_index, m_origin, bitwise_cast<float>(~(1 << 31)));

I think this would be clearest as else-if or switch.

> Source/JavaScriptCore/b3/B3LowerMacrosAfterOptimizations.h:35
> +// Lower certain high level Opcodes to lower-level opcode to help code generation.

opcodes
Comment 3 Benjamin Poulain 2015-12-11 11:35:03 PST
Created attachment 267177 [details]
Patch for landing
Comment 4 WebKit Commit Bot 2015-12-11 12:20:00 PST
Comment on attachment 267177 [details]
Patch for landing

Rejecting attachment 267177 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'build', '--no-clean', '--no-update', '--build-style=release', '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
ce/JavaScriptCore/b3/B3PatchpointValue.cpp -o /Volumes/Data/EWS/WebKit/WebKitBuild/JavaScriptCore.build/Release/JavaScriptCore.build/Objects-normal/x86_64/B3PatchpointValue.o

** BUILD FAILED **


The following build commands failed:
	CompileC /Volumes/Data/EWS/WebKit/WebKitBuild/JavaScriptCore.build/Release/JavaScriptCore.build/Objects-normal/x86_64/B3LowerMacrosAfterOptimizations.o b3/B3LowerMacrosAfterOptimizations.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

Full output: http://webkit-queues.webkit.org/results/546312
Comment 5 Benjamin Poulain 2015-12-11 13:53:41 PST
Created attachment 267186 [details]
Patch for landing
Comment 6 WebKit Commit Bot 2015-12-11 17:55:03 PST
Comment on attachment 267186 [details]
Patch for landing

Rejecting attachment 267186 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-01', 'apply-attachment', '--no-update', '--non-interactive', 267186, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
ource/JavaScriptCore/b3/B3Value.h
patching file Source/JavaScriptCore/b3/air/AirOpcode.opcodes
patching file Source/JavaScriptCore/b3/testb3.cpp
Hunk #1 succeeded at 1942 (offset 1 line).
Hunk #2 succeeded at 3031 (offset 1 line).
Hunk #3 succeeded at 7845 (offset 16 lines).
Hunk #4 succeeded at 8085 (offset 16 lines).
patching file Source/JavaScriptCore/ftl/FTLB3Output.h

Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Full output: http://webkit-queues.webkit.org/results/547523
Comment 7 Benjamin Poulain 2015-12-11 21:14:48 PST
Created attachment 267217 [details]
Patch for landing
Comment 8 WebKit Commit Bot 2015-12-11 22:10:31 PST
Comment on attachment 267217 [details]
Patch for landing

Clearing flags on attachment: 267217

Committed r194003: <http://trac.webkit.org/changeset/194003>
Comment 9 WebKit Commit Bot 2015-12-11 22:10:35 PST
All reviewed patches have been landed.  Closing bug.
Comment 10 Filip Pizlo 2015-12-12 18:41:35 PST
Comment on attachment 267217 [details]
Patch for landing

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

> Source/JavaScriptCore/b3/B3Validate.cpp:157
> +            case BitAnd:

This is super cool. :-)  Are you going to add BitXor for floating point neg as well? :-)
Comment 11 Benjamin Poulain 2015-12-12 18:45:30 PST
(In reply to comment #10)
> Comment on attachment 267217 [details]
> Patch for landing
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=267217&action=review
> 
> > Source/JavaScriptCore/b3/B3Validate.cpp:157
> > +            case BitAnd:
> 
> This is super cool. :-)  Are you going to add BitXor for floating point neg
> as well? :-)

Very likely yep.

I'll do ceil() next though. We need it asap for ArithRound()