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

Unified Diff: src/IceInstARM32.cpp

Issue 1647113003: Add VSQRT instruction to the integrated ARM assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Update DART files. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceInstARM32.h ('k') | tests_lit/assembler/arm32/vsqrt.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInstARM32.cpp
diff --git a/src/IceInstARM32.cpp b/src/IceInstARM32.cpp
index f104803b881dfa99bdfa4f1f68151ff2a128d2e7..93bbb2769b2db2e1e7027c614765415e557e2856 100644
--- a/src/IceInstARM32.cpp
+++ b/src/IceInstARM32.cpp
@@ -97,10 +97,6 @@ void InstARM32::emitUsingTextFixup(const Cfg *Func) const {
if (!BuildDefs::dump())
return;
GlobalContext *Ctx = Func->getContext();
- if (Ctx->getFlags().getDisableHybridAssembly()) {
- UnimplementedError(Ctx->getFlags());
- return;
- }
auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
std::string Buffer;
llvm::raw_string_ostream StrBuf(Buffer);
@@ -113,6 +109,11 @@ void InstARM32::emitUsingTextFixup(const Cfg *Func) const {
Asm->incEmitTextSize(InstSize);
emit(Func);
Ctx->setStrEmit(OldStr);
+ if (Ctx->getFlags().getDisableHybridAssembly()) {
+ llvm::errs() << "Can't assemble: " << StrBuf.str() << "\n";
+ UnimplementedError(Ctx->getFlags());
+ return;
+ }
Asm->emitTextInst(StrBuf.str(), Asm->getEmitTextSize());
}
@@ -1683,6 +1684,29 @@ template <> void InstARM32Uxt::emitIAS(const Cfg *Func) const {
emitUsingTextFixup(Func);
}
+template <InstARM32::InstKindARM32 K>
+void InstARM32UnaryopFP<K>::emitIAS(const Cfg *Func) const {
+ emitUsingTextFixup(Func);
+}
+
+template <> void InstARM32Vsqrt::emitIAS(const Cfg *Func) const {
+ assert(getSrcSize() == 1);
+ auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
+ const Operand *Dest = getDest();
+ switch (Dest->getType()) {
+ case IceType_f32:
+ Asm->vsqrts(Dest, getSrc(0), getPredicate());
+ break;
+ case IceType_f64:
+ Asm->vsqrtd(Dest, getSrc(0), getPredicate());
+ break;
+ default:
+ llvm::report_fatal_error("Vqrt of non-floating type");
Jim Stichnoth 2016/01/29 20:48:02 Vsqrt
Karl 2016/01/29 22:00:55 Done.
+ }
+ if (Asm->needsTextFixup())
+ emitUsingTextFixup(Func);
+}
+
const char *InstARM32Pop::getGPROpcode() const { return "pop"; }
const char *InstARM32Pop::getSRegOpcode() const { return "vpop"; }
« no previous file with comments | « src/IceInstARM32.h ('k') | tests_lit/assembler/arm32/vsqrt.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698