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

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

Issue 1538893002: PPC: [turbofan] Fixed the second return value of TryTruncateFloatXXToUint64. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 | « no previous file | no next file » | 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/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/compiler/code-generator-impl.h" 8 #include "src/compiler/code-generator-impl.h"
9 #include "src/compiler/gap-resolver.h" 9 #include "src/compiler/gap-resolver.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1184 __ isel(i.OutputRegister(1), r0, i.OutputRegister(1), 1184 __ isel(i.OutputRegister(1), r0, i.OutputRegister(1),
1185 v8::internal::Assembler::encode_crbit(cr7, crbit)); 1185 v8::internal::Assembler::encode_crbit(cr7, crbit));
1186 } 1186 }
1187 #endif 1187 #endif
1188 DCHECK_EQ(LeaveRC, i.OutputRCBit()); 1188 DCHECK_EQ(LeaveRC, i.OutputRCBit());
1189 break; 1189 break;
1190 } 1190 }
1191 #if V8_TARGET_ARCH_PPC64 1191 #if V8_TARGET_ARCH_PPC64
1192 case kPPC_DoubleToUint64: { 1192 case kPPC_DoubleToUint64: {
1193 bool check_conversion = (i.OutputCount() > 1); 1193 bool check_conversion = (i.OutputCount() > 1);
1194 Label done;
1195 if (check_conversion) { 1194 if (check_conversion) {
1196 // Set 2nd output to zero if conversion fails.
1197 // We must check explicitly for negative values here since the
1198 // conversion instruction rounds the input toward zero before
1199 // checking for validity (otherwise, values between -1 and 0
1200 // would produce incorrect results).
1201 __ li(i.OutputRegister(1), Operand::Zero());
1202 __ fcmpu(i.InputDoubleRegister(0), kDoubleRegZero);
1203 __ blt(&done);
1204 __ mtfsb0(VXCVI); // clear FPSCR:VXCVI bit 1195 __ mtfsb0(VXCVI); // clear FPSCR:VXCVI bit
1205 } 1196 }
1206 __ ConvertDoubleToUnsignedInt64(i.InputDoubleRegister(0), 1197 __ ConvertDoubleToUnsignedInt64(i.InputDoubleRegister(0),
1207 i.OutputRegister(0), kScratchDoubleReg); 1198 i.OutputRegister(0), kScratchDoubleReg);
1208 if (check_conversion) { 1199 if (check_conversion) {
1200 // Set 2nd output to zero if conversion fails.
1209 CRBit crbit = static_cast<CRBit>(VXCVI % CRWIDTH); 1201 CRBit crbit = static_cast<CRBit>(VXCVI % CRWIDTH);
1210 __ mcrfs(cr7, VXCVI); // extract FPSCR field containing VXCVI into cr7 1202 __ mcrfs(cr7, VXCVI); // extract FPSCR field containing VXCVI into cr7
1211 __ li(i.OutputRegister(1), Operand(1)); 1203 __ li(i.OutputRegister(1), Operand(1));
1212 __ isel(i.OutputRegister(1), r0, i.OutputRegister(1), 1204 __ isel(i.OutputRegister(1), r0, i.OutputRegister(1),
1213 v8::internal::Assembler::encode_crbit(cr7, crbit)); 1205 v8::internal::Assembler::encode_crbit(cr7, crbit));
1214 __ bind(&done);
1215 } 1206 }
1216 DCHECK_EQ(LeaveRC, i.OutputRCBit()); 1207 DCHECK_EQ(LeaveRC, i.OutputRCBit());
1217 break; 1208 break;
1218 } 1209 }
1219 #endif 1210 #endif
1220 case kPPC_DoubleToFloat32: 1211 case kPPC_DoubleToFloat32:
1221 ASSEMBLE_FLOAT_UNOP_RC(frsp); 1212 ASSEMBLE_FLOAT_UNOP_RC(frsp);
1222 break; 1213 break;
1223 case kPPC_Float32ToDouble: 1214 case kPPC_Float32ToDouble:
1224 // Nothing to do. 1215 // Nothing to do.
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
1815 padding_size -= v8::internal::Assembler::kInstrSize; 1806 padding_size -= v8::internal::Assembler::kInstrSize;
1816 } 1807 }
1817 } 1808 }
1818 } 1809 }
1819 1810
1820 #undef __ 1811 #undef __
1821 1812
1822 } // namespace compiler 1813 } // namespace compiler
1823 } // namespace internal 1814 } // namespace internal
1824 } // namespace v8 1815 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698