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

Side by Side Diff: src/IceInstX8632.h

Issue 550723002: Subzero: Use cvttss2si and similar instead of cvtss2si for fp->int casts. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Use truncating conversion instruction for fp to int conversions Created 6 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 unified diff | Download patch
« no previous file with comments | « crosstest/test_cast_main.cpp ('k') | src/IceInstX8632.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceInstX8632.h - Low-level x86 instructions --*- C++ -*-===// 1 //===- subzero/src/IceInstX8632.h - Low-level x86 instructions --*- C++ -*-===//
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 // This file declares the InstX8632 and OperandX8632 classes and 10 // This file declares the InstX8632 and OperandX8632 classes and
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 operator=(const InstX8632Cmpxchg8b &) LLVM_DELETED_FUNCTION; 856 operator=(const InstX8632Cmpxchg8b &) LLVM_DELETED_FUNCTION;
857 virtual ~InstX8632Cmpxchg8b() {} 857 virtual ~InstX8632Cmpxchg8b() {}
858 }; 858 };
859 859
860 // Cvt instruction - wrapper for cvtsX2sY where X and Y are in {s,d,i} 860 // Cvt instruction - wrapper for cvtsX2sY where X and Y are in {s,d,i}
861 // as appropriate. s=float, d=double, i=int. X and Y are determined 861 // as appropriate. s=float, d=double, i=int. X and Y are determined
862 // from dest/src types. Sign and zero extension on the integer 862 // from dest/src types. Sign and zero extension on the integer
863 // operand needs to be done separately. 863 // operand needs to be done separately.
864 class InstX8632Cvt : public InstX8632 { 864 class InstX8632Cvt : public InstX8632 {
865 public: 865 public:
866 static InstX8632Cvt *create(Cfg *Func, Variable *Dest, Operand *Source) { 866 static InstX8632Cvt *create(Cfg *Func, Variable *Dest, Operand *Source,
867 bool Trunc) {
867 return new (Func->allocate<InstX8632Cvt>()) 868 return new (Func->allocate<InstX8632Cvt>())
868 InstX8632Cvt(Func, Dest, Source); 869 InstX8632Cvt(Func, Dest, Source, Trunc);
869 } 870 }
870 virtual void emit(const Cfg *Func) const; 871 virtual void emit(const Cfg *Func) const;
871 virtual void dump(const Cfg *Func) const; 872 virtual void dump(const Cfg *Func) const;
872 static bool classof(const Inst *Inst) { return isClassof(Inst, Cvt); } 873 static bool classof(const Inst *Inst) { return isClassof(Inst, Cvt); }
873 874
874 private: 875 private:
875 InstX8632Cvt(Cfg *Func, Variable *Dest, Operand *Source); 876 bool Trunc;
877 InstX8632Cvt(Cfg *Func, Variable *Dest, Operand *Source, bool Trunc);
876 InstX8632Cvt(const InstX8632Cvt &) LLVM_DELETED_FUNCTION; 878 InstX8632Cvt(const InstX8632Cvt &) LLVM_DELETED_FUNCTION;
877 InstX8632Cvt &operator=(const InstX8632Cvt &) LLVM_DELETED_FUNCTION; 879 InstX8632Cvt &operator=(const InstX8632Cvt &) LLVM_DELETED_FUNCTION;
878 virtual ~InstX8632Cvt() {} 880 virtual ~InstX8632Cvt() {}
879 }; 881 };
880 882
881 // cmp - Integer compare instruction. 883 // cmp - Integer compare instruction.
882 class InstX8632Icmp : public InstX8632 { 884 class InstX8632Icmp : public InstX8632 {
883 public: 885 public:
884 static InstX8632Icmp *create(Cfg *Func, Operand *Src1, Operand *Src2) { 886 static InstX8632Icmp *create(Cfg *Func, Operand *Src1, Operand *Src2) {
885 return new (Func->allocate<InstX8632Icmp>()) 887 return new (Func->allocate<InstX8632Icmp>())
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 template <> void InstX8632Pmuludq::emit(const Cfg *Func) const; 1244 template <> void InstX8632Pmuludq::emit(const Cfg *Func) const;
1243 template <> void InstX8632Psll::emit(const Cfg *Func) const; 1245 template <> void InstX8632Psll::emit(const Cfg *Func) const;
1244 template <> void InstX8632Psra::emit(const Cfg *Func) const; 1246 template <> void InstX8632Psra::emit(const Cfg *Func) const;
1245 template <> void InstX8632Psub::emit(const Cfg *Func) const; 1247 template <> void InstX8632Psub::emit(const Cfg *Func) const;
1246 template <> void InstX8632Sqrtss::emit(const Cfg *Func) const; 1248 template <> void InstX8632Sqrtss::emit(const Cfg *Func) const;
1247 template <> void InstX8632Subss::emit(const Cfg *Func) const; 1249 template <> void InstX8632Subss::emit(const Cfg *Func) const;
1248 1250
1249 } // end of namespace Ice 1251 } // end of namespace Ice
1250 1252
1251 #endif // SUBZERO_SRC_ICEINSTX8632_H 1253 #endif // SUBZERO_SRC_ICEINSTX8632_H
OLDNEW
« no previous file with comments | « crosstest/test_cast_main.cpp ('k') | src/IceInstX8632.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698