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

Unified Diff: src/IceInstARM32.cpp

Issue 1330933002: Implements int2fp, fp2int, and fp2fp conversions for ARM32. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments. Created 5 years, 3 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') | src/IceTargetLoweringARM32.h » ('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 add4df02ab00f7390af048b1778f5c9bee54faf5..375132bc35e831ba4f4ad11ca03c4538d7c5c6f6 100644
--- a/src/IceInstARM32.cpp
+++ b/src/IceInstARM32.cpp
@@ -377,6 +377,13 @@ InstARM32Umull::InstARM32Umull(Cfg *Func, Variable *DestLo, Variable *DestHi,
addSource(Src1);
}
+InstARM32Vcvt::InstARM32Vcvt(Cfg *Func, Variable *Dest, Variable *Src,
+ VcvtVariant Variant, CondARM32::Cond Predicate)
+ : InstARM32Pred(Func, InstARM32::Vcvt, 1, Dest, Predicate),
+ Variant(Variant) {
+ addSource(Src);
+}
+
// ======================== Dump routines ======================== //
// Two-addr ops
@@ -909,6 +916,63 @@ void InstARM32Umull::dump(const Cfg *Func) const {
dumpSources(Func);
}
+namespace {
+const char *vcvtVariantSuffix(const InstARM32Vcvt::VcvtVariant Variant) {
+ switch (Variant) {
+ case InstARM32Vcvt::S2si:
+ return ".s32.f32";
+ case InstARM32Vcvt::S2ui:
+ return ".u32.f32";
+ case InstARM32Vcvt::Si2s:
+ return ".f32.s32";
+ case InstARM32Vcvt::Ui2s:
+ return ".f32.u32";
+ case InstARM32Vcvt::D2si:
+ return ".s32.f64";
+ case InstARM32Vcvt::D2ui:
+ return ".u32.f64";
+ case InstARM32Vcvt::Si2d:
+ return ".f64.s32";
+ case InstARM32Vcvt::Ui2d:
+ return ".f64.u32";
+ case InstARM32Vcvt::S2d:
+ return ".f64.f32";
+ case InstARM32Vcvt::D2s:
+ return ".f32.f64";
+ }
+ llvm::report_fatal_error("Invalid VcvtVariant enum.");
+}
+} // end of anonymous namespace
+
+void InstARM32Vcvt::emit(const Cfg *Func) const {
+ if (!BuildDefs::dump())
+ return;
+ Ostream &Str = Func->getContext()->getStrEmit();
+ assert(getSrcSize() == 1);
+ assert(getDest()->hasReg());
+ Str << "\t"
+ << "vcvt" << getPredicate() << vcvtVariantSuffix(Variant) << "\t";
+ getDest()->emit(Func);
+ Str << ", ";
+ getSrc(0)->emit(Func);
+}
+
+void InstARM32Vcvt::emitIAS(const Cfg *Func) const {
+ assert(getSrcSize() == 1);
+ (void)Func;
+ llvm_unreachable("Not yet implemented");
+}
+
+void InstARM32Vcvt::dump(const Cfg *Func) const {
+ if (!BuildDefs::dump())
+ return;
+ Ostream &Str = Func->getContext()->getStrDump();
+ dumpDest(Func);
+ Str << " = "
+ << "vcvt" << getPredicate() << vcvtVariantSuffix(Variant) << " ";
+ dumpSources(Func);
+}
+
void OperandARM32Mem::emit(const Cfg *Func) const {
if (!BuildDefs::dump())
return;
« no previous file with comments | « src/IceInstARM32.h ('k') | src/IceTargetLoweringARM32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698