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

Side by Side Diff: src/compiler/arm/code-generator-arm.cc

Issue 1862993002: [arm] Implement Float(32|64)(Min|Max) using vsel. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « src/arm/simulator-arm.cc ('k') | src/compiler/arm/instruction-codes-arm.h » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/arm/macro-assembler-arm.h" 7 #include "src/arm/macro-assembler-arm.h"
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/compiler/code-generator-impl.h" 9 #include "src/compiler/code-generator-impl.h"
10 #include "src/compiler/gap-resolver.h" 10 #include "src/compiler/gap-resolver.h"
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 __ vldr(i.OutputFloat64Register(), i.InputOffset()); 1139 __ vldr(i.OutputFloat64Register(), i.InputOffset());
1140 DCHECK_EQ(LeaveCC, i.OutputSBit()); 1140 DCHECK_EQ(LeaveCC, i.OutputSBit());
1141 break; 1141 break;
1142 case kArmVstrF64: { 1142 case kArmVstrF64: {
1143 size_t index = 0; 1143 size_t index = 0;
1144 MemOperand operand = i.InputOffset(&index); 1144 MemOperand operand = i.InputOffset(&index);
1145 __ vstr(i.InputFloat64Register(index), operand); 1145 __ vstr(i.InputFloat64Register(index), operand);
1146 DCHECK_EQ(LeaveCC, i.OutputSBit()); 1146 DCHECK_EQ(LeaveCC, i.OutputSBit());
1147 break; 1147 break;
1148 } 1148 }
1149 case kArmFloat32Max: {
1150 CpuFeatureScope scope(masm(), ARMv8);
1151 // (b < a) ? a : b
1152 SwVfpRegister a = i.InputFloat32Register(0);
1153 SwVfpRegister b = i.InputFloat32Register(1);
1154 SwVfpRegister result = i.OutputFloat32Register(0);
1155 __ VFPCompareAndSetFlags(a, b);
1156 __ vsel(gt, result, a, b);
1157 break;
1158 }
1159 case kArmFloat32Min: {
1160 CpuFeatureScope scope(masm(), ARMv8);
1161 // (a < b) ? a : b
1162 SwVfpRegister a = i.InputFloat32Register(0);
1163 SwVfpRegister b = i.InputFloat32Register(1);
1164 SwVfpRegister result = i.OutputFloat32Register(0);
1165 __ VFPCompareAndSetFlags(b, a);
1166 __ vsel(gt, result, a, b);
1167 break;
1168 }
1169 case kArmFloat64Max: {
1170 CpuFeatureScope scope(masm(), ARMv8);
1171 // (b < a) ? a : b
1172 DwVfpRegister a = i.InputFloat64Register(0);
1173 DwVfpRegister b = i.InputFloat64Register(1);
1174 DwVfpRegister result = i.OutputFloat64Register(0);
1175 __ VFPCompareAndSetFlags(a, b);
1176 __ vsel(gt, result, a, b);
1177 break;
1178 }
1179 case kArmFloat64Min: {
1180 CpuFeatureScope scope(masm(), ARMv8);
1181 // (a < b) ? a : b
1182 DwVfpRegister a = i.InputFloat64Register(0);
1183 DwVfpRegister b = i.InputFloat64Register(1);
1184 DwVfpRegister result = i.OutputFloat64Register(0);
1185 __ VFPCompareAndSetFlags(b, a);
1186 __ vsel(gt, result, a, b);
1187 break;
1188 }
1149 case kArmPush: 1189 case kArmPush:
1150 if (instr->InputAt(0)->IsDoubleRegister()) { 1190 if (instr->InputAt(0)->IsDoubleRegister()) {
1151 __ vpush(i.InputDoubleRegister(0)); 1191 __ vpush(i.InputDoubleRegister(0));
1152 frame_access_state()->IncreaseSPDelta(kDoubleSize / kPointerSize); 1192 frame_access_state()->IncreaseSPDelta(kDoubleSize / kPointerSize);
1153 } else { 1193 } else {
1154 __ push(i.InputRegister(0)); 1194 __ push(i.InputRegister(0));
1155 frame_access_state()->IncreaseSPDelta(1); 1195 frame_access_state()->IncreaseSPDelta(1);
1156 } 1196 }
1157 DCHECK_EQ(LeaveCC, i.OutputSBit()); 1197 DCHECK_EQ(LeaveCC, i.OutputSBit());
1158 break; 1198 break;
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1583 padding_size -= v8::internal::Assembler::kInstrSize; 1623 padding_size -= v8::internal::Assembler::kInstrSize;
1584 } 1624 }
1585 } 1625 }
1586 } 1626 }
1587 1627
1588 #undef __ 1628 #undef __
1589 1629
1590 } // namespace compiler 1630 } // namespace compiler
1591 } // namespace internal 1631 } // namespace internal
1592 } // namespace v8 1632 } // namespace v8
OLDNEW
« no previous file with comments | « src/arm/simulator-arm.cc ('k') | src/compiler/arm/instruction-codes-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698