Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(990)

Side by Side Diff: src/arm/macro-assembler-arm.cc

Issue 131363008: A64: Synchronize with r15922. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | src/arm/simulator-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 if (value.bits == zero.bits) { 785 if (value.bits == zero.bits) {
786 vmov(dst, kDoubleRegZero); 786 vmov(dst, kDoubleRegZero);
787 } else if (value.bits == minus_zero.bits) { 787 } else if (value.bits == minus_zero.bits) {
788 vneg(dst, kDoubleRegZero); 788 vneg(dst, kDoubleRegZero);
789 } else { 789 } else {
790 vmov(dst, imm, scratch); 790 vmov(dst, imm, scratch);
791 } 791 }
792 } 792 }
793 793
794 794
795 void MacroAssembler::VmovHigh(Register dst, DwVfpRegister src) {
796 if (src.code() < 16) {
797 const LowDwVfpRegister loc = LowDwVfpRegister::from_code(src.code());
798 vmov(dst, loc.high());
799 } else {
800 vmov(dst, VmovIndexHi, src);
801 }
802 }
803
804
805 void MacroAssembler::VmovHigh(DwVfpRegister dst, Register src) {
806 if (dst.code() < 16) {
807 const LowDwVfpRegister loc = LowDwVfpRegister::from_code(dst.code());
808 vmov(loc.high(), src);
809 } else {
810 vmov(dst, VmovIndexHi, src);
811 }
812 }
813
814
815 void MacroAssembler::VmovLow(Register dst, DwVfpRegister src) {
816 if (src.code() < 16) {
817 const LowDwVfpRegister loc = LowDwVfpRegister::from_code(src.code());
818 vmov(dst, loc.low());
819 } else {
820 vmov(dst, VmovIndexLo, src);
821 }
822 }
823
824
825 void MacroAssembler::VmovLow(DwVfpRegister dst, Register src) {
826 if (dst.code() < 16) {
827 const LowDwVfpRegister loc = LowDwVfpRegister::from_code(dst.code());
828 vmov(loc.low(), src);
829 } else {
830 vmov(dst, VmovIndexLo, src);
831 }
832 }
833
834
795 void MacroAssembler::ConvertNumberToInt32(Register object, 835 void MacroAssembler::ConvertNumberToInt32(Register object,
796 Register dst, 836 Register dst,
797 Register heap_number_map, 837 Register heap_number_map,
798 Register scratch1, 838 Register scratch1,
799 Register scratch2, 839 Register scratch2,
800 Register scratch3, 840 Register scratch3,
801 DwVfpRegister double_scratch1, 841 DwVfpRegister double_scratch1,
802 DwVfpRegister double_scratch2, 842 LowDwVfpRegister double_scratch2,
803 Label* not_number) { 843 Label* not_number) {
804 Label done; 844 Label done;
805 UntagAndJumpIfSmi(dst, object, &done); 845 UntagAndJumpIfSmi(dst, object, &done);
806 JumpIfNotHeapNumber(object, heap_number_map, scratch1, not_number); 846 JumpIfNotHeapNumber(object, heap_number_map, scratch1, not_number);
807 vldr(double_scratch1, FieldMemOperand(object, HeapNumber::kValueOffset)); 847 vldr(double_scratch1, FieldMemOperand(object, HeapNumber::kValueOffset));
808 ECMAToInt32(dst, double_scratch1, 848 ECMAToInt32(dst, double_scratch1,
809 scratch1, scratch2, scratch3, double_scratch2); 849 scratch1, scratch2, scratch3, double_scratch2);
810 850
811 bind(&done); 851 bind(&done);
812 } 852 }
813 853
814 854
815 void MacroAssembler::LoadNumber(Register object, 855 void MacroAssembler::LoadNumber(Register object,
816 DwVfpRegister dst, 856 LowDwVfpRegister dst,
817 Register heap_number_map, 857 Register heap_number_map,
818 Register scratch, 858 Register scratch,
819 Label* not_number) { 859 Label* not_number) {
820 Label is_smi, done; 860 Label is_smi, done;
821 861
822 UntagAndJumpIfSmi(scratch, object, &is_smi); 862 UntagAndJumpIfSmi(scratch, object, &is_smi);
823 JumpIfNotHeapNumber(object, heap_number_map, scratch, not_number); 863 JumpIfNotHeapNumber(object, heap_number_map, scratch, not_number);
824 864
825 vldr(dst, FieldMemOperand(object, HeapNumber::kValueOffset)); 865 vldr(dst, FieldMemOperand(object, HeapNumber::kValueOffset));
826 b(&done); 866 b(&done);
827 867
828 // Handle loading a double from a smi. 868 // Handle loading a double from a smi.
829 bind(&is_smi); 869 bind(&is_smi);
830 vmov(dst.high(), scratch); 870 vmov(dst.high(), scratch);
831 vcvt_f64_s32(dst, dst.high()); 871 vcvt_f64_s32(dst, dst.high());
832 872
833 bind(&done); 873 bind(&done);
834 } 874 }
835 875
836 876
837 void MacroAssembler::LoadNumberAsInt32Double(Register object, 877 void MacroAssembler::LoadNumberAsInt32Double(Register object,
838 DwVfpRegister double_dst, 878 DwVfpRegister double_dst,
839 Register heap_number_map, 879 Register heap_number_map,
840 Register scratch, 880 Register scratch,
841 DwVfpRegister double_scratch, 881 LowDwVfpRegister double_scratch,
842 Label* not_int32) { 882 Label* not_int32) {
843 ASSERT(!scratch.is(object)); 883 ASSERT(!scratch.is(object));
844 ASSERT(!heap_number_map.is(object) && !heap_number_map.is(scratch)); 884 ASSERT(!heap_number_map.is(object) && !heap_number_map.is(scratch));
845 885
846 Label done, obj_is_not_smi; 886 Label done, obj_is_not_smi;
847 887
848 UntagAndJumpIfNotSmi(scratch, object, &obj_is_not_smi); 888 UntagAndJumpIfNotSmi(scratch, object, &obj_is_not_smi);
849 vmov(double_scratch.low(), scratch); 889 vmov(double_scratch.low(), scratch);
850 vcvt_f64_s32(double_dst, double_scratch.low()); 890 vcvt_f64_s32(double_dst, double_scratch.low());
851 b(&done); 891 b(&done);
(...skipping 11 matching lines...) Expand all
863 903
864 bind(&done); 904 bind(&done);
865 } 905 }
866 906
867 907
868 void MacroAssembler::LoadNumberAsInt32(Register object, 908 void MacroAssembler::LoadNumberAsInt32(Register object,
869 Register dst, 909 Register dst,
870 Register heap_number_map, 910 Register heap_number_map,
871 Register scratch, 911 Register scratch,
872 DwVfpRegister double_scratch0, 912 DwVfpRegister double_scratch0,
873 DwVfpRegister double_scratch1, 913 LowDwVfpRegister double_scratch1,
874 Label* not_int32) { 914 Label* not_int32) {
875 ASSERT(!dst.is(object)); 915 ASSERT(!dst.is(object));
876 ASSERT(!scratch.is(object)); 916 ASSERT(!scratch.is(object));
877 917
878 Label done, maybe_undefined; 918 Label done, maybe_undefined;
879 919
880 UntagAndJumpIfSmi(dst, object, &done); 920 UntagAndJumpIfSmi(dst, object, &done);
881 921
882 JumpIfNotHeapNumber(object, heap_number_map, scratch, &maybe_undefined); 922 JumpIfNotHeapNumber(object, heap_number_map, scratch, &maybe_undefined);
883 923
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
1618 ldr(result, FieldMemOperand(t2, kValueOffset)); 1658 ldr(result, FieldMemOperand(t2, kValueOffset));
1619 } 1659 }
1620 1660
1621 1661
1622 void MacroAssembler::Allocate(int object_size, 1662 void MacroAssembler::Allocate(int object_size,
1623 Register result, 1663 Register result,
1624 Register scratch1, 1664 Register scratch1,
1625 Register scratch2, 1665 Register scratch2,
1626 Label* gc_required, 1666 Label* gc_required,
1627 AllocationFlags flags) { 1667 AllocationFlags flags) {
1668 ASSERT(object_size <= Page::kMaxNonCodeHeapObjectSize);
1628 if (!FLAG_inline_new) { 1669 if (!FLAG_inline_new) {
1629 if (emit_debug_code()) { 1670 if (emit_debug_code()) {
1630 // Trash the registers to simulate an allocation failure. 1671 // Trash the registers to simulate an allocation failure.
1631 mov(result, Operand(0x7091)); 1672 mov(result, Operand(0x7091));
1632 mov(scratch1, Operand(0x7191)); 1673 mov(scratch1, Operand(0x7191));
1633 mov(scratch2, Operand(0x7291)); 1674 mov(scratch2, Operand(0x7291));
1634 } 1675 }
1635 jmp(gc_required); 1676 jmp(gc_required);
1636 return; 1677 return;
1637 } 1678 }
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
2058 Register scratch, 2099 Register scratch,
2059 Label* fail) { 2100 Label* fail) {
2060 STATIC_ASSERT(FAST_SMI_ELEMENTS == 0); 2101 STATIC_ASSERT(FAST_SMI_ELEMENTS == 0);
2061 STATIC_ASSERT(FAST_HOLEY_SMI_ELEMENTS == 1); 2102 STATIC_ASSERT(FAST_HOLEY_SMI_ELEMENTS == 1);
2062 ldrb(scratch, FieldMemOperand(map, Map::kBitField2Offset)); 2103 ldrb(scratch, FieldMemOperand(map, Map::kBitField2Offset));
2063 cmp(scratch, Operand(Map::kMaximumBitField2FastHoleySmiElementValue)); 2104 cmp(scratch, Operand(Map::kMaximumBitField2FastHoleySmiElementValue));
2064 b(hi, fail); 2105 b(hi, fail);
2065 } 2106 }
2066 2107
2067 2108
2068 void MacroAssembler::StoreNumberToDoubleElements(Register value_reg, 2109 void MacroAssembler::StoreNumberToDoubleElements(
2069 Register key_reg, 2110 Register value_reg,
2070 Register elements_reg, 2111 Register key_reg,
2071 Register scratch1, 2112 Register elements_reg,
2072 Label* fail, 2113 Register scratch1,
2073 int elements_offset) { 2114 LowDwVfpRegister double_scratch,
2115 Label* fail,
2116 int elements_offset) {
2074 Label smi_value, store; 2117 Label smi_value, store;
2075 2118
2076 // Handle smi values specially. 2119 // Handle smi values specially.
2077 JumpIfSmi(value_reg, &smi_value); 2120 JumpIfSmi(value_reg, &smi_value);
2078 2121
2079 // Ensure that the object is a heap number 2122 // Ensure that the object is a heap number
2080 CheckMap(value_reg, 2123 CheckMap(value_reg,
2081 scratch1, 2124 scratch1,
2082 isolate()->factory()->heap_number_map(), 2125 isolate()->factory()->heap_number_map(),
2083 fail, 2126 fail,
2084 DONT_DO_SMI_CHECK); 2127 DONT_DO_SMI_CHECK);
2085 2128
2086 vldr(d0, FieldMemOperand(value_reg, HeapNumber::kValueOffset)); 2129 vldr(double_scratch, FieldMemOperand(value_reg, HeapNumber::kValueOffset));
2087 // Force a canonical NaN. 2130 // Force a canonical NaN.
2088 if (emit_debug_code()) { 2131 if (emit_debug_code()) {
2089 vmrs(ip); 2132 vmrs(ip);
2090 tst(ip, Operand(kVFPDefaultNaNModeControlBit)); 2133 tst(ip, Operand(kVFPDefaultNaNModeControlBit));
2091 Assert(ne, "Default NaN mode not set"); 2134 Assert(ne, "Default NaN mode not set");
2092 } 2135 }
2093 VFPCanonicalizeNaN(d0); 2136 VFPCanonicalizeNaN(double_scratch);
2094 b(&store); 2137 b(&store);
2095 2138
2096 bind(&smi_value); 2139 bind(&smi_value);
2097 SmiToDouble(d0, value_reg); 2140 SmiToDouble(double_scratch, value_reg);
2098 2141
2099 bind(&store); 2142 bind(&store);
2100 add(scratch1, elements_reg, Operand::DoubleOffsetFromSmiKey(key_reg)); 2143 add(scratch1, elements_reg, Operand::DoubleOffsetFromSmiKey(key_reg));
2101 vstr(d0, FieldMemOperand(scratch1, 2144 vstr(double_scratch,
2102 FixedDoubleArray::kHeaderSize - elements_offset)); 2145 FieldMemOperand(scratch1,
2146 FixedDoubleArray::kHeaderSize - elements_offset));
2103 } 2147 }
2104 2148
2105 2149
2106 void MacroAssembler::CompareMap(Register obj, 2150 void MacroAssembler::CompareMap(Register obj,
2107 Register scratch, 2151 Register scratch,
2108 Handle<Map> map, 2152 Handle<Map> map,
2109 Label* early_success) { 2153 Label* early_success) {
2110 ldr(scratch, FieldMemOperand(obj, HeapObject::kMapOffset)); 2154 ldr(scratch, FieldMemOperand(obj, HeapObject::kMapOffset));
2111 CompareMap(scratch, map, early_success); 2155 CompareMap(scratch, map, early_success);
2112 } 2156 }
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
2398 // conflict. 2442 // conflict.
2399 ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) < 2443 ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) <
2400 (1 << String::kArrayIndexValueBits)); 2444 (1 << String::kArrayIndexValueBits));
2401 // We want the smi-tagged index in key. kArrayIndexValueMask has zeros in 2445 // We want the smi-tagged index in key. kArrayIndexValueMask has zeros in
2402 // the low kHashShift bits. 2446 // the low kHashShift bits.
2403 Ubfx(hash, hash, String::kHashShift, String::kArrayIndexValueBits); 2447 Ubfx(hash, hash, String::kHashShift, String::kArrayIndexValueBits);
2404 SmiTag(index, hash); 2448 SmiTag(index, hash);
2405 } 2449 }
2406 2450
2407 2451
2408 void MacroAssembler::SmiToDouble(DwVfpRegister value, Register smi) { 2452 void MacroAssembler::SmiToDouble(LowDwVfpRegister value, Register smi) {
2409 ASSERT(value.code() < 16);
2410 if (CpuFeatures::IsSupported(VFP3)) { 2453 if (CpuFeatures::IsSupported(VFP3)) {
2411 vmov(value.low(), smi); 2454 vmov(value.low(), smi);
2412 vcvt_f64_s32(value, 1); 2455 vcvt_f64_s32(value, 1);
2413 } else { 2456 } else {
2414 SmiUntag(ip, smi); 2457 SmiUntag(ip, smi);
2415 vmov(value.low(), ip); 2458 vmov(value.low(), ip);
2416 vcvt_f64_s32(value, value.low()); 2459 vcvt_f64_s32(value, value.low());
2417 } 2460 }
2418 } 2461 }
2419 2462
2420 2463
2421 void MacroAssembler::TestDoubleIsInt32(DwVfpRegister double_input, 2464 void MacroAssembler::TestDoubleIsInt32(DwVfpRegister double_input,
2422 DwVfpRegister double_scratch) { 2465 LowDwVfpRegister double_scratch) {
2423 ASSERT(!double_input.is(double_scratch)); 2466 ASSERT(!double_input.is(double_scratch));
2424 vcvt_s32_f64(double_scratch.low(), double_input); 2467 vcvt_s32_f64(double_scratch.low(), double_input);
2425 vcvt_f64_s32(double_scratch, double_scratch.low()); 2468 vcvt_f64_s32(double_scratch, double_scratch.low());
2426 VFPCompareAndSetFlags(double_input, double_scratch); 2469 VFPCompareAndSetFlags(double_input, double_scratch);
2427 } 2470 }
2428 2471
2429 2472
2430 void MacroAssembler::TryDoubleToInt32Exact(Register result, 2473 void MacroAssembler::TryDoubleToInt32Exact(Register result,
2431 DwVfpRegister double_input, 2474 DwVfpRegister double_input,
2432 DwVfpRegister double_scratch) { 2475 LowDwVfpRegister double_scratch) {
2433 ASSERT(!double_input.is(double_scratch)); 2476 ASSERT(!double_input.is(double_scratch));
2434 vcvt_s32_f64(double_scratch.low(), double_input); 2477 vcvt_s32_f64(double_scratch.low(), double_input);
2435 vmov(result, double_scratch.low()); 2478 vmov(result, double_scratch.low());
2436 vcvt_f64_s32(double_scratch, double_scratch.low()); 2479 vcvt_f64_s32(double_scratch, double_scratch.low());
2437 VFPCompareAndSetFlags(double_input, double_scratch); 2480 VFPCompareAndSetFlags(double_input, double_scratch);
2438 } 2481 }
2439 2482
2440 2483
2441 void MacroAssembler::TryInt32Floor(Register result, 2484 void MacroAssembler::TryInt32Floor(Register result,
2442 DwVfpRegister double_input, 2485 DwVfpRegister double_input,
2443 Register input_high, 2486 Register input_high,
2444 DwVfpRegister double_scratch, 2487 LowDwVfpRegister double_scratch,
2445 Label* done, 2488 Label* done,
2446 Label* exact) { 2489 Label* exact) {
2447 ASSERT(!result.is(input_high)); 2490 ASSERT(!result.is(input_high));
2448 ASSERT(!double_input.is(double_scratch)); 2491 ASSERT(!double_input.is(double_scratch));
2449 Label negative, exception; 2492 Label negative, exception;
2450 2493
2494 VmovHigh(input_high, double_input);
2495
2451 // Test for NaN and infinities. 2496 // Test for NaN and infinities.
2452 Sbfx(result, input_high, 2497 Sbfx(result, input_high,
2453 HeapNumber::kExponentShift, HeapNumber::kExponentBits); 2498 HeapNumber::kExponentShift, HeapNumber::kExponentBits);
2454 cmp(result, Operand(-1)); 2499 cmp(result, Operand(-1));
2455 b(eq, &exception); 2500 b(eq, &exception);
2456 // Test for values that can be exactly represented as a 2501 // Test for values that can be exactly represented as a
2457 // signed 32-bit integer. 2502 // signed 32-bit integer.
2458 TryDoubleToInt32Exact(result, double_input, double_scratch); 2503 TryDoubleToInt32Exact(result, double_input, double_scratch);
2459 // If exact, return (result already fetched). 2504 // If exact, return (result already fetched).
2460 b(eq, exact); 2505 b(eq, exact);
(...skipping 20 matching lines...) Expand all
2481 b(mi, done); 2526 b(mi, done);
2482 bind(&exception); 2527 bind(&exception);
2483 } 2528 }
2484 2529
2485 2530
2486 void MacroAssembler::ECMAToInt32(Register result, 2531 void MacroAssembler::ECMAToInt32(Register result,
2487 DwVfpRegister double_input, 2532 DwVfpRegister double_input,
2488 Register scratch, 2533 Register scratch,
2489 Register scratch_high, 2534 Register scratch_high,
2490 Register scratch_low, 2535 Register scratch_low,
2491 DwVfpRegister double_scratch) { 2536 LowDwVfpRegister double_scratch) {
2492 ASSERT(!scratch_high.is(result)); 2537 ASSERT(!scratch_high.is(result));
2493 ASSERT(!scratch_low.is(result)); 2538 ASSERT(!scratch_low.is(result));
2494 ASSERT(!scratch_low.is(scratch_high)); 2539 ASSERT(!scratch_low.is(scratch_high));
2495 ASSERT(!scratch.is(result) && 2540 ASSERT(!scratch.is(result) &&
2496 !scratch.is(scratch_high) && 2541 !scratch.is(scratch_high) &&
2497 !scratch.is(scratch_low)); 2542 !scratch.is(scratch_low));
2498 ASSERT(!double_input.is(double_scratch)); 2543 ASSERT(!double_input.is(double_scratch));
2499 2544
2500 Label out_of_range, only_low, negate, done; 2545 Label out_of_range, only_low, negate, done;
2501 2546
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
3135 Label* gc_required) { 3180 Label* gc_required) {
3136 AllocateHeapNumber(result, scratch1, scratch2, heap_number_map, gc_required); 3181 AllocateHeapNumber(result, scratch1, scratch2, heap_number_map, gc_required);
3137 sub(scratch1, result, Operand(kHeapObjectTag)); 3182 sub(scratch1, result, Operand(kHeapObjectTag));
3138 vstr(value, scratch1, HeapNumber::kValueOffset); 3183 vstr(value, scratch1, HeapNumber::kValueOffset);
3139 } 3184 }
3140 3185
3141 3186
3142 // Copies a fixed number of fields of heap objects from src to dst. 3187 // Copies a fixed number of fields of heap objects from src to dst.
3143 void MacroAssembler::CopyFields(Register dst, 3188 void MacroAssembler::CopyFields(Register dst,
3144 Register src, 3189 Register src,
3145 DwVfpRegister double_scratch, 3190 LowDwVfpRegister double_scratch,
3146 SwVfpRegister single_scratch,
3147 int field_count) { 3191 int field_count) {
3148 int double_count = field_count / (DwVfpRegister::kSizeInBytes / kPointerSize); 3192 int double_count = field_count / (DwVfpRegister::kSizeInBytes / kPointerSize);
3149 for (int i = 0; i < double_count; i++) { 3193 for (int i = 0; i < double_count; i++) {
3150 vldr(double_scratch, FieldMemOperand(src, i * DwVfpRegister::kSizeInBytes)); 3194 vldr(double_scratch, FieldMemOperand(src, i * DwVfpRegister::kSizeInBytes));
3151 vstr(double_scratch, FieldMemOperand(dst, i * DwVfpRegister::kSizeInBytes)); 3195 vstr(double_scratch, FieldMemOperand(dst, i * DwVfpRegister::kSizeInBytes));
3152 } 3196 }
3153 3197
3154 STATIC_ASSERT(SwVfpRegister::kSizeInBytes == kPointerSize); 3198 STATIC_ASSERT(SwVfpRegister::kSizeInBytes == kPointerSize);
3155 STATIC_ASSERT(2 * SwVfpRegister::kSizeInBytes == DwVfpRegister::kSizeInBytes); 3199 STATIC_ASSERT(2 * SwVfpRegister::kSizeInBytes == DwVfpRegister::kSizeInBytes);
3156 3200
3157 int remain = field_count % (DwVfpRegister::kSizeInBytes / kPointerSize); 3201 int remain = field_count % (DwVfpRegister::kSizeInBytes / kPointerSize);
3158 if (remain != 0) { 3202 if (remain != 0) {
3159 vldr(single_scratch, 3203 vldr(double_scratch.low(),
3160 FieldMemOperand(src, (field_count - 1) * kPointerSize)); 3204 FieldMemOperand(src, (field_count - 1) * kPointerSize));
3161 vstr(single_scratch, 3205 vstr(double_scratch.low(),
3162 FieldMemOperand(dst, (field_count - 1) * kPointerSize)); 3206 FieldMemOperand(dst, (field_count - 1) * kPointerSize));
3163 } 3207 }
3164 } 3208 }
3165 3209
3166 3210
3167 void MacroAssembler::CopyBytes(Register src, 3211 void MacroAssembler::CopyBytes(Register src,
3168 Register dst, 3212 Register dst,
3169 Register length, 3213 Register length,
3170 Register scratch) { 3214 Register scratch) {
3171 Label align_loop, align_loop_1, word_loop, byte_loop, byte_loop_1, done; 3215 Label align_loop, align_loop_1, word_loop, byte_loop, byte_loop_1, done;
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
3652 } 3696 }
3653 3697
3654 3698
3655 void MacroAssembler::ClampUint8(Register output_reg, Register input_reg) { 3699 void MacroAssembler::ClampUint8(Register output_reg, Register input_reg) {
3656 Usat(output_reg, 8, Operand(input_reg)); 3700 Usat(output_reg, 8, Operand(input_reg));
3657 } 3701 }
3658 3702
3659 3703
3660 void MacroAssembler::ClampDoubleToUint8(Register result_reg, 3704 void MacroAssembler::ClampDoubleToUint8(Register result_reg,
3661 DwVfpRegister input_reg, 3705 DwVfpRegister input_reg,
3662 DwVfpRegister temp_double_reg) { 3706 LowDwVfpRegister double_scratch) {
3663 Label above_zero; 3707 Label above_zero;
3664 Label done; 3708 Label done;
3665 Label in_bounds; 3709 Label in_bounds;
3666 3710
3667 Vmov(temp_double_reg, 0.0); 3711 VFPCompareAndSetFlags(input_reg, 0.0);
3668 VFPCompareAndSetFlags(input_reg, temp_double_reg);
3669 b(gt, &above_zero); 3712 b(gt, &above_zero);
3670 3713
3671 // Double value is less than zero, NaN or Inf, return 0. 3714 // Double value is less than zero, NaN or Inf, return 0.
3672 mov(result_reg, Operand::Zero()); 3715 mov(result_reg, Operand::Zero());
3673 b(al, &done); 3716 b(al, &done);
3674 3717
3675 // Double value is >= 255, return 255. 3718 // Double value is >= 255, return 255.
3676 bind(&above_zero); 3719 bind(&above_zero);
3677 Vmov(temp_double_reg, 255.0, result_reg); 3720 Vmov(double_scratch, 255.0, result_reg);
3678 VFPCompareAndSetFlags(input_reg, temp_double_reg); 3721 VFPCompareAndSetFlags(input_reg, double_scratch);
3679 b(le, &in_bounds); 3722 b(le, &in_bounds);
3680 mov(result_reg, Operand(255)); 3723 mov(result_reg, Operand(255));
3681 b(al, &done); 3724 b(al, &done);
3682 3725
3683 // In 0-255 range, round and truncate. 3726 // In 0-255 range, round and truncate.
3684 bind(&in_bounds); 3727 bind(&in_bounds);
3685 // Save FPSCR. 3728 // Save FPSCR.
3686 vmrs(ip); 3729 vmrs(ip);
3687 // Set rounding mode to round to the nearest integer by clearing bits[23:22]. 3730 // Set rounding mode to round to the nearest integer by clearing bits[23:22].
3688 bic(result_reg, ip, Operand(kVFPRoundingModeMask)); 3731 bic(result_reg, ip, Operand(kVFPRoundingModeMask));
3689 vmsr(result_reg); 3732 vmsr(result_reg);
3690 vcvt_s32_f64(input_reg.low(), input_reg, kFPSCRRounding); 3733 vcvt_s32_f64(double_scratch.low(), input_reg, kFPSCRRounding);
3691 vmov(result_reg, input_reg.low()); 3734 vmov(result_reg, double_scratch.low());
3692 // Restore FPSCR. 3735 // Restore FPSCR.
3693 vmsr(ip); 3736 vmsr(ip);
3694 bind(&done); 3737 bind(&done);
3695 } 3738 }
3696 3739
3697 3740
3698 void MacroAssembler::LoadInstanceDescriptors(Register map, 3741 void MacroAssembler::LoadInstanceDescriptors(Register map,
3699 Register descriptors) { 3742 Register descriptors) {
3700 ldr(descriptors, FieldMemOperand(map, Map::kDescriptorsOffset)); 3743 ldr(descriptors, FieldMemOperand(map, Map::kDescriptorsOffset));
3701 } 3744 }
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
3833 void CodePatcher::EmitCondition(Condition cond) { 3876 void CodePatcher::EmitCondition(Condition cond) {
3834 Instr instr = Assembler::instr_at(masm_.pc_); 3877 Instr instr = Assembler::instr_at(masm_.pc_);
3835 instr = (instr & ~kCondMask) | cond; 3878 instr = (instr & ~kCondMask) | cond;
3836 masm_.emit(instr); 3879 masm_.emit(instr);
3837 } 3880 }
3838 3881
3839 3882
3840 } } // namespace v8::internal 3883 } } // namespace v8::internal
3841 3884
3842 #endif // V8_TARGET_ARCH_ARM 3885 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | src/arm/simulator-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698