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

Unified Diff: src/IceInstARM32.cpp

Issue 1679023008: Add insert/extract element to the integrated ARM assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: src/IceInstARM32.cpp
diff --git a/src/IceInstARM32.cpp b/src/IceInstARM32.cpp
index 600658c0ff8d59f592a735d7fedb7dad96855279..a6ab14ff67466bd065c89a3350c4af0b0ceb9688 100644
--- a/src/IceInstARM32.cpp
+++ b/src/IceInstARM32.cpp
@@ -1065,6 +1065,8 @@ InstARM32Mov::InstARM32Mov(Cfg *Func, Variable *Dest, Operand *Src,
}
}
+namespace {
+
// These next two functions find the D register that maps to the half of the Q
// register that this instruction is accessing.
Register getDRegister(const Variable *Src, uint32_t Index) {
@@ -1122,6 +1124,8 @@ Register getSRegister(const Variable *Src, uint32_t Index) {
return static_cast<Register>(RegARM32::RegTable[SrcReg].Aliases[Index + 3]);
}
+} // end of anonymous namespace
+
void InstARM32Extract::emit(const Cfg *Func) const {
Ostream &Str = Func->getContext()->getStrEmit();
const Type DestTy = getDest()->getType();
@@ -1160,6 +1164,24 @@ void InstARM32Extract::emit(const Cfg *Func) const {
}
}
+void InstARM32Extract::emitIAS(const Cfg *Func) const {
+ const Operand *Dest = getDest();
+ const Type DestTy = Dest->getType();
+ const Operand *Src = getSrc(0);
+ const Type SrcTy = Src->getType();
+ assert(isVectorType(SrcTy));
+ assert(DestTy == typeElementType(SrcTy));
+ auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
+ if (isIntegerType(DestTy)) {
+ Asm->vmovrqi(Dest, Src, Index, getPredicate());
+ assert(!Asm->needsTextFixup());
+ return;
+ }
+ assert(isFloatingType(DestTy));
+ Asm->vmovsqi(Dest, Src, Index, getPredicate());
+ assert(!Asm->needsTextFixup());
+}
+
void InstARM32Insert::emit(const Cfg *Func) const {
Ostream &Str = Func->getContext()->getStrEmit();
const Variable *Dest = getDest();
@@ -1191,6 +1213,25 @@ void InstARM32Insert::emit(const Cfg *Func) const {
}
}
+void InstARM32Insert::emitIAS(const Cfg *Func) const {
+ const Variable *Dest = getDest();
+ const Type DestTy = getDest()->getType();
+ const Operand *Src = getSrc(0);
+ const Type SrcTy = Src->getType();
+ assert(isVectorType(DestTy));
+ assert(typeElementType(DestTy) == SrcTy);
+ auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
+ if (isIntegerType(SrcTy)) {
+ const Operand *Src = getSrc(0);
+ Asm->vmovqir(Dest, Index, Src, getPredicate());
+ assert(!Asm->needsTextFixup());
+ return;
+ }
+ assert(isFloatingType(SrcTy));
+ Asm->vmovqis(Dest, Index, Src, getPredicate());
+ assert(!Asm->needsTextFixup());
+}
+
template <InstARM32::InstKindARM32 K>
void InstARM32CmpLike<K>::emitIAS(const Cfg *Func) const {
emitUsingTextFixup(Func);

Powered by Google App Engine
This is Rietveld 408576698