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

Side by Side Diff: src/arm64/assembler-arm64.cc

Issue 1393043003: [arm64] Fix some signed/unsigned type inconsistencies. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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/arm64/assembler-arm64.h ('k') | src/arm64/assembler-arm64-inl.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // 2 //
3 // Redistribution and use in source and binary forms, with or without 3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are 4 // modification, are permitted provided that the following conditions are
5 // met: 5 // met:
6 // 6 //
7 // * Redistributions of source code must retain the above copyright 7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer. 8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above 9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following 10 // copyright notice, this list of conditions and the following
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 } else if (type() == CPURegister::kFPRegister) { 103 } else if (type() == CPURegister::kFPRegister) {
104 Remove(GetCalleeSavedFP(RegisterSizeInBits())); 104 Remove(GetCalleeSavedFP(RegisterSizeInBits()));
105 } else { 105 } else {
106 DCHECK(type() == CPURegister::kNoRegister); 106 DCHECK(type() == CPURegister::kNoRegister);
107 DCHECK(IsEmpty()); 107 DCHECK(IsEmpty());
108 // The list must already be empty, so do nothing. 108 // The list must already be empty, so do nothing.
109 } 109 }
110 } 110 }
111 111
112 112
113 CPURegList CPURegList::GetCalleeSaved(unsigned size) { 113 CPURegList CPURegList::GetCalleeSaved(int size) {
114 return CPURegList(CPURegister::kRegister, size, 19, 29); 114 return CPURegList(CPURegister::kRegister, size, 19, 29);
115 } 115 }
116 116
117 117
118 CPURegList CPURegList::GetCalleeSavedFP(unsigned size) { 118 CPURegList CPURegList::GetCalleeSavedFP(int size) {
119 return CPURegList(CPURegister::kFPRegister, size, 8, 15); 119 return CPURegList(CPURegister::kFPRegister, size, 8, 15);
120 } 120 }
121 121
122 122
123 CPURegList CPURegList::GetCallerSaved(unsigned size) { 123 CPURegList CPURegList::GetCallerSaved(int size) {
124 // Registers x0-x18 and lr (x30) are caller-saved. 124 // Registers x0-x18 and lr (x30) are caller-saved.
125 CPURegList list = CPURegList(CPURegister::kRegister, size, 0, 18); 125 CPURegList list = CPURegList(CPURegister::kRegister, size, 0, 18);
126 list.Combine(lr); 126 list.Combine(lr);
127 return list; 127 return list;
128 } 128 }
129 129
130 130
131 CPURegList CPURegList::GetCallerSavedFP(unsigned size) { 131 CPURegList CPURegList::GetCallerSavedFP(int size) {
132 // Registers d0-d7 and d16-d31 are caller-saved. 132 // Registers d0-d7 and d16-d31 are caller-saved.
133 CPURegList list = CPURegList(CPURegister::kFPRegister, size, 0, 7); 133 CPURegList list = CPURegList(CPURegister::kFPRegister, size, 0, 7);
134 list.Combine(CPURegList(CPURegister::kFPRegister, size, 16, 31)); 134 list.Combine(CPURegList(CPURegister::kFPRegister, size, 16, 31));
135 return list; 135 return list;
136 } 136 }
137 137
138 138
139 // This function defines the list of registers which are associated with a 139 // This function defines the list of registers which are associated with a
140 // safepoint slot. Safepoint register slots are saved contiguously on the stack. 140 // safepoint slot. Safepoint register slots are saved contiguously on the stack.
141 // MacroAssembler::SafepointRegisterStackIndex handles mapping from register 141 // MacroAssembler::SafepointRegisterStackIndex handles mapping from register
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 void Assembler::rorv(const Register& rd, 1271 void Assembler::rorv(const Register& rd,
1272 const Register& rn, 1272 const Register& rn,
1273 const Register& rm) { 1273 const Register& rm) {
1274 DCHECK(rd.SizeInBits() == rn.SizeInBits()); 1274 DCHECK(rd.SizeInBits() == rn.SizeInBits());
1275 DCHECK(rd.SizeInBits() == rm.SizeInBits()); 1275 DCHECK(rd.SizeInBits() == rm.SizeInBits());
1276 Emit(SF(rd) | RORV | Rm(rm) | Rn(rn) | Rd(rd)); 1276 Emit(SF(rd) | RORV | Rm(rm) | Rn(rn) | Rd(rd));
1277 } 1277 }
1278 1278
1279 1279
1280 // Bitfield operations. 1280 // Bitfield operations.
1281 void Assembler::bfm(const Register& rd, 1281 void Assembler::bfm(const Register& rd, const Register& rn, int immr,
1282 const Register& rn, 1282 int imms) {
1283 unsigned immr,
1284 unsigned imms) {
1285 DCHECK(rd.SizeInBits() == rn.SizeInBits()); 1283 DCHECK(rd.SizeInBits() == rn.SizeInBits());
1286 Instr N = SF(rd) >> (kSFOffset - kBitfieldNOffset); 1284 Instr N = SF(rd) >> (kSFOffset - kBitfieldNOffset);
1287 Emit(SF(rd) | BFM | N | 1285 Emit(SF(rd) | BFM | N |
1288 ImmR(immr, rd.SizeInBits()) | 1286 ImmR(immr, rd.SizeInBits()) |
1289 ImmS(imms, rn.SizeInBits()) | 1287 ImmS(imms, rn.SizeInBits()) |
1290 Rn(rn) | Rd(rd)); 1288 Rn(rn) | Rd(rd));
1291 } 1289 }
1292 1290
1293 1291
1294 void Assembler::sbfm(const Register& rd, 1292 void Assembler::sbfm(const Register& rd, const Register& rn, int immr,
1295 const Register& rn, 1293 int imms) {
1296 unsigned immr,
1297 unsigned imms) {
1298 DCHECK(rd.Is64Bits() || rn.Is32Bits()); 1294 DCHECK(rd.Is64Bits() || rn.Is32Bits());
1299 Instr N = SF(rd) >> (kSFOffset - kBitfieldNOffset); 1295 Instr N = SF(rd) >> (kSFOffset - kBitfieldNOffset);
1300 Emit(SF(rd) | SBFM | N | 1296 Emit(SF(rd) | SBFM | N |
1301 ImmR(immr, rd.SizeInBits()) | 1297 ImmR(immr, rd.SizeInBits()) |
1302 ImmS(imms, rn.SizeInBits()) | 1298 ImmS(imms, rn.SizeInBits()) |
1303 Rn(rn) | Rd(rd)); 1299 Rn(rn) | Rd(rd));
1304 } 1300 }
1305 1301
1306 1302
1307 void Assembler::ubfm(const Register& rd, 1303 void Assembler::ubfm(const Register& rd, const Register& rn, int immr,
1308 const Register& rn, 1304 int imms) {
1309 unsigned immr,
1310 unsigned imms) {
1311 DCHECK(rd.SizeInBits() == rn.SizeInBits()); 1305 DCHECK(rd.SizeInBits() == rn.SizeInBits());
1312 Instr N = SF(rd) >> (kSFOffset - kBitfieldNOffset); 1306 Instr N = SF(rd) >> (kSFOffset - kBitfieldNOffset);
1313 Emit(SF(rd) | UBFM | N | 1307 Emit(SF(rd) | UBFM | N |
1314 ImmR(immr, rd.SizeInBits()) | 1308 ImmR(immr, rd.SizeInBits()) |
1315 ImmS(imms, rn.SizeInBits()) | 1309 ImmS(imms, rn.SizeInBits()) |
1316 Rn(rn) | Rd(rd)); 1310 Rn(rn) | Rd(rd));
1317 } 1311 }
1318 1312
1319 1313
1320 void Assembler::extr(const Register& rd, 1314 void Assembler::extr(const Register& rd, const Register& rn, const Register& rm,
1321 const Register& rn, 1315 int lsb) {
1322 const Register& rm,
1323 unsigned lsb) {
1324 DCHECK(rd.SizeInBits() == rn.SizeInBits()); 1316 DCHECK(rd.SizeInBits() == rn.SizeInBits());
1325 DCHECK(rd.SizeInBits() == rm.SizeInBits()); 1317 DCHECK(rd.SizeInBits() == rm.SizeInBits());
1326 Instr N = SF(rd) >> (kSFOffset - kBitfieldNOffset); 1318 Instr N = SF(rd) >> (kSFOffset - kBitfieldNOffset);
1327 Emit(SF(rd) | EXTR | N | Rm(rm) | 1319 Emit(SF(rd) | EXTR | N | Rm(rm) |
1328 ImmS(lsb, rn.SizeInBits()) | Rn(rn) | Rd(rd)); 1320 ImmS(lsb, rn.SizeInBits()) | Rn(rn) | Rd(rd));
1329 } 1321 }
1330 1322
1331 1323
1332 void Assembler::csel(const Register& rd, 1324 void Assembler::csel(const Register& rd,
1333 const Register& rn, 1325 const Register& rn,
(...skipping 1808 matching lines...) Expand 10 before | Expand all | Expand 10 after
3142 movk(scratch, (target_offset >> 32) & 0xFFFF, 32); 3134 movk(scratch, (target_offset >> 32) & 0xFFFF, 32);
3143 DCHECK((target_offset >> 48) == 0); 3135 DCHECK((target_offset >> 48) == 0);
3144 add(rd, rd, scratch); 3136 add(rd, rd, scratch);
3145 } 3137 }
3146 3138
3147 3139
3148 } // namespace internal 3140 } // namespace internal
3149 } // namespace v8 3141 } // namespace v8
3150 3142
3151 #endif // V8_TARGET_ARCH_ARM64 3143 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm64/assembler-arm64.h ('k') | src/arm64/assembler-arm64-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698