Closed Bug 675395 Opened 13 years ago Closed 13 years ago

IonMonkey: Implement lowering of ADD with non-integer parameters

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: adrake, Assigned: dvander)

References

Details

Attachments

(1 file, 1 obsolete file)

Currently we bail with NYI if we try to lower an ADD that has either side anything but Int32.
Blocks: 670624
Attached patch wip v1 (obsolete) — Splinter Review
function f(a) {
    return 1.6 + a;
}
print(f(2.4));

This test now works on x64. x86 is a little harder, more tomorrow probably
Assignee: general → dvander
Status: NEW → ASSIGNED
Attached patch v2Splinter Review
This patch adds support for double arithmetic and boxing/unboxing doubles on both x86 and x64. For x86 we emit double literals using the same technique as JM: a double pool is reserved in the code buffer and we load from that pool.

To support the pool I've added two new classes that should help Hannes with LTableSwitch:
 * AbsoluteLabel. This is like Label except it's for an absolute position in the
   code stream. It can only be bound after linking. Using it is otherwise the
   same.
 * DeferredData. This is an object that requests extra bytes right before
   linking. The base class has an AbsoluteLabel which is automatically
   patched. It gets used like this:

>   MyDeferredData *deferred = new MyDeferredData(...);
>   if (!masm.addDefferedData(deferred, numBytes))
>       return false;
>   masm.mov(deferred->label(), reg);
>   ...
>
>   void
>   MyDeferredData::copy(uint8 *code, uint8 *buffer) {
>       // copy my data to buffer
>   }

Note that LSRA does not support doubles yet so this still needs --ion-regalloc=greedy
Attachment #549538 - Attachment is obsolete: true
Attachment #550286 - Flags: review?(sstangl)
Blocks: 676287
Comment on attachment 550286 [details] [diff] [review]
v2

Review of attachment 550286 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/ion/x64/CodeGenerator-x64.cpp
@@ +141,5 @@
> +    const LDefinition *result = unbox->getDef(0);
> +    const LDefinition *temp = unbox->getTemp(0);
> +
> +    masm.movq(ImmWord(JSVAL_SHIFTED_TAG_MAX_DOUBLE), ToRegister(temp));
> +    masm.cmpl(ToRegister(value), ToRegister(temp));

cmpq
Attachment #550286 - Flags: review?(sstangl) → review+
http://hg.mozilla.org/projects/ionmonkey/rev/da3142df0db5
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.