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

Side by Side Diff: src/mips64/codegen-mips64.cc

Issue 1605093002: MIPS64: Use the Lsa() and Dlsa() macro/r6 instructions in existing code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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/mips64/code-stubs-mips64.cc ('k') | src/mips64/deoptimizer-mips64.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 // 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/mips64/codegen-mips64.h" 5 #include "src/mips64/codegen-mips64.h"
6 6
7 #if V8_TARGET_ARCH_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/macro-assembler.h" 10 #include "src/macro-assembler.h"
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 __ And(at, result, Operand(kShortExternalStringMask)); 1071 __ And(at, result, Operand(kShortExternalStringMask));
1072 __ Branch(call_runtime, ne, at, Operand(zero_reg)); 1072 __ Branch(call_runtime, ne, at, Operand(zero_reg));
1073 __ ld(string, FieldMemOperand(string, ExternalString::kResourceDataOffset)); 1073 __ ld(string, FieldMemOperand(string, ExternalString::kResourceDataOffset));
1074 1074
1075 Label one_byte, done; 1075 Label one_byte, done;
1076 __ bind(&check_encoding); 1076 __ bind(&check_encoding);
1077 STATIC_ASSERT(kTwoByteStringTag == 0); 1077 STATIC_ASSERT(kTwoByteStringTag == 0);
1078 __ And(at, result, Operand(kStringEncodingMask)); 1078 __ And(at, result, Operand(kStringEncodingMask));
1079 __ Branch(&one_byte, ne, at, Operand(zero_reg)); 1079 __ Branch(&one_byte, ne, at, Operand(zero_reg));
1080 // Two-byte string. 1080 // Two-byte string.
1081 __ dsll(at, index, 1); 1081 __ Dlsa(at, string, index, 1);
1082 __ Daddu(at, string, at);
1083 __ lhu(result, MemOperand(at)); 1082 __ lhu(result, MemOperand(at));
1084 __ jmp(&done); 1083 __ jmp(&done);
1085 __ bind(&one_byte); 1084 __ bind(&one_byte);
1086 // One_byte string. 1085 // One_byte string.
1087 __ Daddu(at, string, index); 1086 __ Daddu(at, string, index);
1088 __ lbu(result, MemOperand(at)); 1087 __ lbu(result, MemOperand(at));
1089 __ bind(&done); 1088 __ bind(&done);
1090 } 1089 }
1091 1090
1092 1091
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 DCHECK(*reinterpret_cast<double*> 1143 DCHECK(*reinterpret_cast<double*>
1145 (ExternalReference::math_exp_constants(8).address()) == 1); 1144 (ExternalReference::math_exp_constants(8).address()) == 1);
1146 __ Move(double_scratch2, 1.); 1145 __ Move(double_scratch2, 1.);
1147 __ add_d(result, result, double_scratch2); 1146 __ add_d(result, result, double_scratch2);
1148 __ dsrl(temp1, temp2, 11); 1147 __ dsrl(temp1, temp2, 11);
1149 __ Ext(temp2, temp2, 0, 11); 1148 __ Ext(temp2, temp2, 0, 11);
1150 __ Daddu(temp1, temp1, Operand(0x3ff)); 1149 __ Daddu(temp1, temp1, Operand(0x3ff));
1151 1150
1152 // Must not call ExpConstant() after overwriting temp3! 1151 // Must not call ExpConstant() after overwriting temp3!
1153 __ li(temp3, Operand(ExternalReference::math_exp_log_table())); 1152 __ li(temp3, Operand(ExternalReference::math_exp_log_table()));
1154 __ dsll(at, temp2, 3); 1153 __ Dlsa(temp3, temp3, temp2, 3);
1155 __ Daddu(temp3, temp3, Operand(at));
1156 __ lwu(temp2, MemOperand(temp3, Register::kMantissaOffset)); 1154 __ lwu(temp2, MemOperand(temp3, Register::kMantissaOffset));
1157 __ lwu(temp3, MemOperand(temp3, Register::kExponentOffset)); 1155 __ lwu(temp3, MemOperand(temp3, Register::kExponentOffset));
1158 // The first word is loaded is the lower number register. 1156 // The first word is loaded is the lower number register.
1159 if (temp2.code() < temp3.code()) { 1157 if (temp2.code() < temp3.code()) {
1160 __ dsll(at, temp1, 20); 1158 __ dsll(at, temp1, 20);
1161 __ Or(temp1, temp3, at); 1159 __ Or(temp1, temp3, at);
1162 __ Move(double_scratch1, temp2, temp1); 1160 __ Move(double_scratch1, temp2, temp1);
1163 } else { 1161 } else {
1164 __ dsll(at, temp1, 20); 1162 __ dsll(at, temp1, 20);
1165 __ Or(temp1, temp2, at); 1163 __ Or(temp1, temp2, at);
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
1260 } 1258 }
1261 } 1259 }
1262 1260
1263 1261
1264 #undef __ 1262 #undef __
1265 1263
1266 } // namespace internal 1264 } // namespace internal
1267 } // namespace v8 1265 } // namespace v8
1268 1266
1269 #endif // V8_TARGET_ARCH_MIPS64 1267 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/code-stubs-mips64.cc ('k') | src/mips64/deoptimizer-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698