Chromium Code Reviews| Index: src/IceAssemblerX86Base.h |
| diff --git a/src/IceAssemblerX86Base.h b/src/IceAssemblerX86Base.h |
| index 1db270ab20af84ff7d7f07670930fb124b280e37..648d768bdfcc2f56615c3d11d2c55ca760eb6399 100644 |
| --- a/src/IceAssemblerX86Base.h |
| +++ b/src/IceAssemblerX86Base.h |
| @@ -314,7 +314,7 @@ public: |
| */ |
| void call(typename Traits::GPRRegister reg); |
| void call(const typename Traits::Address &address); |
| - void call(const ConstantRelocatable *label); |
| + void call(const ConstantRelocatable *label); // not testable. |
| void call(const Immediate &abs_address); |
| static const intptr_t kCallExternalLabelSize = 5; |
| @@ -324,7 +324,11 @@ public: |
| void popl(typename Traits::GPRRegister reg); |
| void popl(const typename Traits::Address &address); |
| + template <typename T = Traits, |
| + typename = typename std::enable_if<T::HasPusha>::type> |
| void pushal(); |
| + template <typename T = Traits, |
| + typename = typename std::enable_if<T::HasPopa>::type> |
| void popal(); |
| void setcc(typename Traits::Cond::BrCond condition, |
| @@ -332,7 +336,6 @@ public: |
| void setcc(typename Traits::Cond::BrCond condition, |
| const typename Traits::Address &address); |
| - // All mov() overloads are tested. |
| void mov(Type Ty, typename Traits::GPRRegister dst, const Immediate &src); |
| void mov(Type Ty, typename Traits::GPRRegister dst, |
| typename Traits::GPRRegister src); |
| @@ -503,6 +506,7 @@ public: |
| void sqrtps(typename Traits::XmmRegister dst); |
| void rsqrtps(typename Traits::XmmRegister dst); |
| void reciprocalps(typename Traits::XmmRegister dst); |
| + |
| void movhlps(typename Traits::XmmRegister dst, |
| typename Traits::XmmRegister src); |
| void movlhps(typename Traits::XmmRegister dst, |
| @@ -517,15 +521,15 @@ public: |
| typename Traits::XmmRegister src); |
| void set1ps(typename Traits::XmmRegister dst, |
| - typename Traits::GPRRegister tmp, const Immediate &imm); |
| - void shufps(typename Traits::XmmRegister dst, |
| - typename Traits::XmmRegister src, const Immediate &mask); |
|
jvoung (off chromium)
2015/07/23 17:59:36
oops (on the weird clustering)... is this one even
John
2015/07/27 20:35:57
Yeah, initially I thought about removing the irreg
|
| + typename Traits::GPRRegister tmp, |
| + const Immediate &imm); |
| void minpd(typename Traits::XmmRegister dst, |
| typename Traits::XmmRegister src); |
| void maxpd(typename Traits::XmmRegister dst, |
| typename Traits::XmmRegister src); |
| void sqrtpd(typename Traits::XmmRegister dst); |
| + |
| void shufpd(typename Traits::XmmRegister dst, |
| typename Traits::XmmRegister src, const Immediate &mask); |
| @@ -533,6 +537,8 @@ public: |
| typename Traits::XmmRegister src, const Immediate &mask); |
| void pshufd(Type Ty, typename Traits::XmmRegister dst, |
| const typename Traits::Address &src, const Immediate &mask); |
| + void shufps(typename Traits::XmmRegister dst, |
| + typename Traits::XmmRegister src, const Immediate &mask); |
| void shufps(Type Ty, typename Traits::XmmRegister dst, |
| typename Traits::XmmRegister src, const Immediate &mask); |
| void shufps(Type Ty, typename Traits::XmmRegister dst, |
| @@ -606,6 +612,7 @@ public: |
| void pextr(Type Ty, typename Traits::GPRRegister dst, |
| typename Traits::XmmRegister src, const Immediate &imm); |
| + // The following overload is not implemented. |
| void pextr(Type Ty, typename Traits::GPRRegister dst, |
|
jvoung (off chromium)
2015/07/23 17:59:35
I think just delete it then, and we can add it bac
|
| const typename Traits::Address &src, const Immediate &imm); |
| @@ -630,19 +637,49 @@ public: |
| void roundsd(typename Traits::XmmRegister dst, |
| typename Traits::XmmRegister src, RoundingMode mode); |
| - void fld(Type Ty, const typename Traits::Address &src); |
| - void fstp(Type Ty, const typename Traits::Address &dst); |
| - void fstp(typename Traits::X87STRegister st); |
| - |
| - void fnstcw(const typename Traits::Address &dst); |
| - void fldcw(const typename Traits::Address &src); |
| - |
| - void fistpl(const typename Traits::Address &dst); |
| - void fistps(const typename Traits::Address &dst); |
| - void fildl(const typename Traits::Address &src); |
| - void filds(const typename Traits::Address &src); |
| - |
| + //---------------------------------------------------------------------------- |
| + // |
| + // Begin: X87 instructions. Only available when Traits::UsesX87. |
| + // |
| + //---------------------------------------------------------------------------- |
| + template <typename T = Traits, |
| + typename = typename std::enable_if<T::UsesX87>::type> |
| + void fld(Type Ty, const typename T::Address &src); |
| + template <typename T = Traits, |
| + typename = typename std::enable_if<T::UsesX87>::type> |
| + void fstp(Type Ty, const typename T::Address &dst); |
| + template <typename T = Traits, |
| + typename = typename std::enable_if<T::UsesX87>::type> |
| + void fstp(typename T::X87STRegister st); |
| + |
| + template <typename T = Traits, |
| + typename = typename std::enable_if<T::UsesX87>::type> |
| + void fnstcw(const typename T::Address &dst); |
| + template <typename T = Traits, |
| + typename = typename std::enable_if<T::UsesX87>::type> |
| + void fldcw(const typename T::Address &src); |
| + |
| + template <typename T = Traits, |
| + typename = typename std::enable_if<T::UsesX87>::type> |
| + void fistpl(const typename T::Address &dst); |
| + template <typename T = Traits, |
| + typename = typename std::enable_if<T::UsesX87>::type> |
| + void fistps(const typename T::Address &dst); |
| + template <typename T = Traits, |
| + typename = typename std::enable_if<T::UsesX87>::type> |
| + void fildl(const typename T::Address &src); |
| + template <typename T = Traits, |
| + typename = typename std::enable_if<T::UsesX87>::type> |
| + void filds(const typename T::Address &src); |
| + |
| + template <typename T = Traits, |
| + typename = typename std::enable_if<T::UsesX87>::type> |
| void fincstp(); |
| + //---------------------------------------------------------------------------- |
| + // |
| + // End: X87 instructions. |
| + // |
| + //---------------------------------------------------------------------------- |
| void cmp(Type Ty, typename Traits::GPRRegister reg0, |
| typename Traits::GPRRegister reg1); |
| @@ -754,9 +791,11 @@ public: |
| void mul(Type Ty, typename Traits::GPRRegister reg); |
| void mul(Type Ty, const typename Traits::Address &address); |
| + template <class T = Traits, typename = typename std::enable_if<!T::Is64Bit>::type> |
|
jvoung (off chromium)
2015/07/23 17:59:35
80 col
John
2015/07/27 20:35:57
Done.
|
| void incl(typename Traits::GPRRegister reg); |
| void incl(const typename Traits::Address &address); |
| + template <class T = Traits, typename = typename std::enable_if<!T::Is64Bit>::type> |
| void decl(typename Traits::GPRRegister reg); |
| void decl(const typename Traits::Address &address); |
| @@ -825,16 +864,14 @@ public: |
| void ud2(); |
| // j(Label) is fully tested. |
| - // j(ConstantRelocatable) is not tested as the test can not easily create such |
| - // an argument. |
| void j(typename Traits::Cond::BrCond condition, Label *label, |
| bool near = kFarJump); |
| void j(typename Traits::Cond::BrCond condition, |
| - const ConstantRelocatable *label); |
| + const ConstantRelocatable *label); // not testable. |
| void jmp(typename Traits::GPRRegister reg); |
| void jmp(Label *label, bool near = kFarJump); |
| - void jmp(const ConstantRelocatable *label); |
| + void jmp(const ConstantRelocatable *label); // not testable. |
| void mfence(); |