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

Side by Side Diff: src/IceInstARM32.cpp

Issue 1645683003: Add vmov between floating point registers to ARM assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. 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
OLDNEW
1 //===- subzero/src/IceInstARM32.cpp - ARM32 instruction implementation ----===// 1 //===- subzero/src/IceInstARM32.cpp - ARM32 instruction implementation ----===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 void InstARM32Mov::emitMultiDestSingleSource(const Cfg *Func) const { 1053 void InstARM32Mov::emitMultiDestSingleSource(const Cfg *Func) const {
1054 if (!BuildDefs::dump()) 1054 if (!BuildDefs::dump())
1055 return; 1055 return;
1056 Ostream &Str = Func->getContext()->getStrEmit(); 1056 Ostream &Str = Func->getContext()->getStrEmit();
1057 Variable *DestLo = getDest(); 1057 Variable *DestLo = getDest();
1058 Variable *DestHi = getDestHi(); 1058 Variable *DestHi = getDestHi();
1059 auto *Src = llvm::cast<Variable>(getSrc(0)); 1059 auto *Src = llvm::cast<Variable>(getSrc(0));
1060 1060
1061 assert(DestHi->hasReg()); 1061 assert(DestHi->hasReg());
1062 assert(DestLo->hasReg()); 1062 assert(DestLo->hasReg());
1063 assert(llvm::isa<Variable>(Src) && Src->hasReg()); 1063 assert(llvm::isa<Variable>(Src) && Src->hasReg());
Jim Stichnoth 2016/01/27 22:10:49 llvm::isa<Variable>(Src) is redundant with the llv
Karl 2016/01/27 22:58:09 Done.
1064 1064
1065 Str << "\t" 1065 Str << "\t"
1066 "vmov" << getPredicate() << "\t"; 1066 "vmov" << getPredicate() << "\t";
1067 DestLo->emit(Func); 1067 DestLo->emit(Func);
1068 Str << ", "; 1068 Str << ", ";
1069 DestHi->emit(Func); 1069 DestHi->emit(Func);
1070 Str << ", "; 1070 Str << ", ";
1071 Src->emit(Func); 1071 Src->emit(Func);
1072 } 1072 }
1073 1073
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
1151 Src0->emit(Func); 1151 Src0->emit(Func);
1152 } 1152 }
1153 1153
1154 void InstARM32Mov::emitIASScalarVFPMove(const Cfg *Func) const { 1154 void InstARM32Mov::emitIASScalarVFPMove(const Cfg *Func) const {
1155 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); 1155 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
1156 Operand *Src0 = getSrc(0); 1156 Operand *Src0 = getSrc(0);
1157 Variable *Dest = getDest(); 1157 Variable *Dest = getDest();
1158 switch (Dest->getType()) { 1158 switch (Dest->getType()) {
1159 default: 1159 default:
1160 assert(false && "Do not know how to emit scalar FP move for type."); 1160 assert(false && "Do not know how to emit scalar FP move for type.");
1161 return; 1161 break;
1162 case IceType_f32: 1162 case IceType_f32:
1163 if (const auto *FpImm = llvm::dyn_cast<OperandARM32FlexFpImm>(Src0)) { 1163 if (llvm::isa<Variable>(Src0)) {
Jim Stichnoth 2016/01/27 22:10:49 Are vmovss and vmovdd always going to have a Varia
Karl 2016/01/27 22:58:09 Done.
1164 Asm->vmovss(Dest, Src0, getPredicate());
1165 return;
1166 } else if (const auto *FpImm =
1167 llvm::dyn_cast<OperandARM32FlexFpImm>(Src0)) {
1164 Asm->vmovs(Dest, FpImm, getPredicate()); 1168 Asm->vmovs(Dest, FpImm, getPredicate());
1165 return; 1169 return;
1166 } 1170 }
1167 break; 1171 assert(!Asm->needsTextFixup());
1172 return;
1168 case IceType_f64: 1173 case IceType_f64:
1169 if (const auto *FpImm = llvm::dyn_cast<OperandARM32FlexFpImm>(Src0)) { 1174 if (llvm::isa<Variable>(Src0)) {
1175 Asm->vmovdd(Dest, Src0, getPredicate());
1176 return;
1177 } else if (const auto *FpImm =
1178 llvm::dyn_cast<OperandARM32FlexFpImm>(Src0)) {
1170 Asm->vmovd(Dest, FpImm, getPredicate()); 1179 Asm->vmovd(Dest, FpImm, getPredicate());
1171 return; 1180 return;
1172 } 1181 }
1173 break; 1182 assert(!Asm->needsTextFixup());
1183 return;
1174 } 1184 }
1175 // TODO(kschimpf) Handle register to register move. 1185 // TODO(kschimpf) Handle register to register move.
1176 Asm->setNeedsTextFixup(); 1186 Asm->setNeedsTextFixup();
1177 return; 1187 return;
1178 } 1188 }
1179 1189
1180 void InstARM32Mov::emitIASCoreVFPMove(const Cfg *Func) const { 1190 void InstARM32Mov::emitIASCoreVFPMove(const Cfg *Func) const {
1181 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); 1191 auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
1182 Operand *Src0 = getSrc(0); 1192 Operand *Src0 = getSrc(0);
1183 if (!llvm::isa<Variable>(Src0)) 1193 if (!llvm::isa<Variable>(Src0))
(...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after
2356 2366
2357 template class InstARM32FourAddrGPR<InstARM32::Mla>; 2367 template class InstARM32FourAddrGPR<InstARM32::Mla>;
2358 template class InstARM32FourAddrGPR<InstARM32::Mls>; 2368 template class InstARM32FourAddrGPR<InstARM32::Mls>;
2359 2369
2360 template class InstARM32CmpLike<InstARM32::Cmn>; 2370 template class InstARM32CmpLike<InstARM32::Cmn>;
2361 template class InstARM32CmpLike<InstARM32::Cmp>; 2371 template class InstARM32CmpLike<InstARM32::Cmp>;
2362 template class InstARM32CmpLike<InstARM32::Tst>; 2372 template class InstARM32CmpLike<InstARM32::Tst>;
2363 2373
2364 } // end of namespace ARM32 2374 } // end of namespace ARM32
2365 } // end of namespace Ice 2375 } // end of namespace Ice
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698