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

Unified Diff: src/IceTargetLoweringX86Base.h

Issue 1257643004: Subzero. Buildable, non-functional TargetLoweringX8664. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: git pull Created 5 years, 5 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/IceTargetLoweringX8664Traits.h ('k') | unittest/AssemblerX8632/TestUtil.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringX86Base.h
diff --git a/src/IceTargetLoweringX86Base.h b/src/IceTargetLoweringX86Base.h
index 58c425a3b558f0b9a018500273aa2dbd9cf4991b..64f921d46b831237dabba3e21cc1c49ccce2a245 100644
--- a/src/IceTargetLoweringX86Base.h
+++ b/src/IceTargetLoweringX86Base.h
@@ -342,11 +342,25 @@ protected:
void _divss(Variable *Dest, Operand *Src0) {
Context.insert(Traits::Insts::Divss::create(Func, Dest, Src0));
}
- void _fld(Operand *Src0) {
- Context.insert(Traits::Insts::Fld::create(Func, Src0));
- }
- void _fstp(Variable *Dest) {
- Context.insert(Traits::Insts::Fstp::create(Func, Dest));
+ template <typename T = Traits>
+ typename std::enable_if<T::UsesX87, void>::type _fld(Operand *Src0) {
+ Context.insert(Traits::Insts::template Fld<>::create(Func, Src0));
+ }
+ // TODO(jpp): when implementing the X8664 calling convention, make sure x8664
+ // does not invoke this method, and remove it.
+ template <typename T = Traits>
+ typename std::enable_if<!T::UsesX87, void>::type _fld(Operand *) {
+ llvm::report_fatal_error("fld is not available in x86-64");
+ }
+ template <typename T = Traits>
+ typename std::enable_if<T::UsesX87, void>::type _fstp(Variable *Dest) {
+ Context.insert(Traits::Insts::template Fstp<>::create(Func, Dest));
+ }
+ // TODO(jpp): when implementing the X8664 calling convention, make sure x8664
+ // does not invoke this method, and remove it.
+ template <typename T = Traits>
+ typename std::enable_if<!T::UsesX87, void>::type _fstp(Variable *) {
+ llvm::report_fatal_error("fstp is not available in x86-64");
}
void _idiv(Variable *Dest, Operand *Src0, Operand *Src1) {
Context.insert(Traits::Insts::Idiv::create(Func, Dest, Src0, Src1));
« no previous file with comments | « src/IceTargetLoweringX8664Traits.h ('k') | unittest/AssemblerX8632/TestUtil.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698