| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 3916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3927 if (array_type == kExternalFloatArray) { | 3927 if (array_type == kExternalFloatArray) { |
| 3928 __ cvt_s_d(f0, f0); | 3928 __ cvt_s_d(f0, f0); |
| 3929 __ sll(t8, t0, 2); | 3929 __ sll(t8, t0, 2); |
| 3930 __ addu(t8, a3, t8); | 3930 __ addu(t8, a3, t8); |
| 3931 __ swc1(f0, MemOperand(t8, 0)); | 3931 __ swc1(f0, MemOperand(t8, 0)); |
| 3932 } else if (array_type == kExternalDoubleArray) { | 3932 } else if (array_type == kExternalDoubleArray) { |
| 3933 __ sll(t8, t0, 3); | 3933 __ sll(t8, t0, 3); |
| 3934 __ addu(t8, a3, t8); | 3934 __ addu(t8, a3, t8); |
| 3935 __ sdc1(f0, MemOperand(t8, 0)); | 3935 __ sdc1(f0, MemOperand(t8, 0)); |
| 3936 } else { | 3936 } else { |
| 3937 Label done; | 3937 __ EmitECMATruncate(t3, f0, f2, t2, t1, t5); |
| 3938 | 3938 |
| 3939 // Need to perform float-to-int conversion. | |
| 3940 // Test whether exponent equal to 0x7FF (infinity or NaN). | |
| 3941 | |
| 3942 __ mfc1(t3, f1); // Move exponent word of double to t3 (as raw bits). | |
| 3943 __ li(t1, Operand(0x7FF00000)); | |
| 3944 __ And(t3, t3, Operand(t1)); | |
| 3945 __ Branch(USE_DELAY_SLOT, &done, eq, t3, Operand(t1)); | |
| 3946 __ mov(t3, zero_reg); // In delay slot. | |
| 3947 | |
| 3948 // Not infinity or NaN simply convert to int. | |
| 3949 if (IsElementTypeSigned(array_type)) { | |
| 3950 __ trunc_w_d(f0, f0); | |
| 3951 __ mfc1(t3, f0); | |
| 3952 } else { | |
| 3953 __ Trunc_uw_d(f0, t3); | |
| 3954 } | |
| 3955 | |
| 3956 // t3: HeapNumber converted to integer | |
| 3957 __ bind(&done); | |
| 3958 switch (array_type) { | 3939 switch (array_type) { |
| 3959 case kExternalByteArray: | 3940 case kExternalByteArray: |
| 3960 case kExternalUnsignedByteArray: | 3941 case kExternalUnsignedByteArray: |
| 3961 __ addu(t8, a3, t0); | 3942 __ addu(t8, a3, t0); |
| 3962 __ sb(t3, MemOperand(t8, 0)); | 3943 __ sb(t3, MemOperand(t8, 0)); |
| 3963 break; | 3944 break; |
| 3964 case kExternalShortArray: | 3945 case kExternalShortArray: |
| 3965 case kExternalUnsignedShortArray: | 3946 case kExternalUnsignedShortArray: |
| 3966 __ sll(t8, t0, 1); | 3947 __ sll(t8, t0, 1); |
| 3967 __ addu(t8, a3, t8); | 3948 __ addu(t8, a3, t8); |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4276 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); | 4257 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); |
| 4277 __ Jump(ic, RelocInfo::CODE_TARGET); | 4258 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 4278 } | 4259 } |
| 4279 | 4260 |
| 4280 | 4261 |
| 4281 #undef __ | 4262 #undef __ |
| 4282 | 4263 |
| 4283 } } // namespace v8::internal | 4264 } } // namespace v8::internal |
| 4284 | 4265 |
| 4285 #endif // V8_TARGET_ARCH_MIPS | 4266 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |