Chromium Code Reviews| Index: runtime/vm/intrinsifier_ia32.cc |
| diff --git a/runtime/vm/intrinsifier_ia32.cc b/runtime/vm/intrinsifier_ia32.cc |
| index 17a06b948a95ed9deb9b27d0ad7910631d12bfd9..5b17d6938911afe326a6f32dc2d9227130fadfae 100644 |
| --- a/runtime/vm/intrinsifier_ia32.cc |
| +++ b/runtime/vm/intrinsifier_ia32.cc |
| @@ -551,6 +551,35 @@ bool Intrinsifier::Uint32Array_getIndexed(Assembler* assembler) { |
| return false; |
| } |
| +bool Intrinsifier::Float32Array_getIndexed(Assembler* assembler) { |
| + Label fall_through; |
| + TestByteArrayIndex(assembler, &fall_through); |
| + // After TestByteArrayIndex: |
| + // EAX has the base address of the byte array |
| + // EBX has the index into the array |
| + |
| + // Load single precision float into XMM7 |
| + __ movss(XMM7, FieldAddress(EAX, EBX, TIMES_4, |
|
srdjan
2012/09/09 14:26:52
Terminate all comments with a period ('.').
Cutch
2012/09/10 14:44:43
Done.
|
| + Float32Array::data_offset())); |
| + // Convert into a double precision float |
| + __ cvtss2sd(XMM6, XMM7); |
| + // Allocate a double instance |
| + const Class& double_class = Class::Handle( |
| + Isolate::Current()->object_store()->double_class()); |
| + AssemblerMacros::TryAllocate(assembler, |
| + double_class, |
| + &fall_through, |
| + Assembler::kNearJump, EAX); |
| + // Store XMM6 into double instance |
| + __ movsd(FieldAddress(EAX, Double::value_offset()), XMM6); |
| + __ ret(); |
| + __ Bind(&fall_through); |
| + return false; |
| +} |
| + |
| +bool Intrinsifier::Float32Array_setIndexed(Assembler* assembler) { |
| + return false; |
|
srdjan
2012/09/09 14:26:52
This one should be quicker as no allocation of dou
|
| +} |
| // Tests if two top most arguments are smis, jumps to label not_smi if not. |
| // Topmost argument is in EAX. |