OLD | NEW |
1 //===- subzero/src/IceInstX8632.cpp - X86-32 instruction implementation ---===// | 1 //===- subzero/src/IceInstX8632.cpp - X86-32 instruction implementation ---===// |
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 implements the InstX8632 and OperandX8632 classes, | 10 // This file implements the InstX8632 and OperandX8632 classes, |
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 template <> const char *InstX8632Div::Opcode = "div"; | 936 template <> const char *InstX8632Div::Opcode = "div"; |
937 template <> const char *InstX8632Divps::Opcode = "divps"; | 937 template <> const char *InstX8632Divps::Opcode = "divps"; |
938 template <> const char *InstX8632Idiv::Opcode = "idiv"; | 938 template <> const char *InstX8632Idiv::Opcode = "idiv"; |
939 template <> const char *InstX8632Divss::Opcode = "divss"; | 939 template <> const char *InstX8632Divss::Opcode = "divss"; |
940 template <> const char *InstX8632Rol::Opcode = "rol"; | 940 template <> const char *InstX8632Rol::Opcode = "rol"; |
941 template <> const char *InstX8632Shl::Opcode = "shl"; | 941 template <> const char *InstX8632Shl::Opcode = "shl"; |
942 template <> const char *InstX8632Psll::Opcode = "psll"; | 942 template <> const char *InstX8632Psll::Opcode = "psll"; |
943 template <> const char *InstX8632Shr::Opcode = "shr"; | 943 template <> const char *InstX8632Shr::Opcode = "shr"; |
944 template <> const char *InstX8632Sar::Opcode = "sar"; | 944 template <> const char *InstX8632Sar::Opcode = "sar"; |
945 template <> const char *InstX8632Psra::Opcode = "psra"; | 945 template <> const char *InstX8632Psra::Opcode = "psra"; |
| 946 template <> const char *InstX8632Psrl::Opcode = "psrl"; |
946 template <> const char *InstX8632Pcmpeq::Opcode = "pcmpeq"; | 947 template <> const char *InstX8632Pcmpeq::Opcode = "pcmpeq"; |
947 template <> const char *InstX8632Pcmpgt::Opcode = "pcmpgt"; | 948 template <> const char *InstX8632Pcmpgt::Opcode = "pcmpgt"; |
948 template <> const char *InstX8632MovssRegs::Opcode = "movss"; | 949 template <> const char *InstX8632MovssRegs::Opcode = "movss"; |
949 // Ternary ops | 950 // Ternary ops |
950 template <> const char *InstX8632Insertps::Opcode = "insertps"; | 951 template <> const char *InstX8632Insertps::Opcode = "insertps"; |
951 template <> const char *InstX8632Shufps::Opcode = "shufps"; | 952 template <> const char *InstX8632Shufps::Opcode = "shufps"; |
952 template <> const char *InstX8632Pinsr::Opcode = "pinsr"; | 953 template <> const char *InstX8632Pinsr::Opcode = "pinsr"; |
953 template <> const char *InstX8632Blendvps::Opcode = "blendvps"; | 954 template <> const char *InstX8632Blendvps::Opcode = "blendvps"; |
954 template <> const char *InstX8632Pblendvb::Opcode = "pblendvb"; | 955 template <> const char *InstX8632Pblendvb::Opcode = "pblendvb"; |
955 // Three address ops | 956 // Three address ops |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 | 1084 |
1084 // Binary XMM Shift ops | 1085 // Binary XMM Shift ops |
1085 template <> | 1086 template <> |
1086 const x86::AssemblerX86::XmmEmitterShiftOp InstX8632Psll::Emitter = { | 1087 const x86::AssemblerX86::XmmEmitterShiftOp InstX8632Psll::Emitter = { |
1087 &x86::AssemblerX86::psll, &x86::AssemblerX86::psll, | 1088 &x86::AssemblerX86::psll, &x86::AssemblerX86::psll, |
1088 &x86::AssemblerX86::psll}; | 1089 &x86::AssemblerX86::psll}; |
1089 template <> | 1090 template <> |
1090 const x86::AssemblerX86::XmmEmitterShiftOp InstX8632Psra::Emitter = { | 1091 const x86::AssemblerX86::XmmEmitterShiftOp InstX8632Psra::Emitter = { |
1091 &x86::AssemblerX86::psra, &x86::AssemblerX86::psra, | 1092 &x86::AssemblerX86::psra, &x86::AssemblerX86::psra, |
1092 &x86::AssemblerX86::psra}; | 1093 &x86::AssemblerX86::psra}; |
| 1094 template <> |
| 1095 const x86::AssemblerX86::XmmEmitterShiftOp InstX8632Psrl::Emitter = { |
| 1096 &x86::AssemblerX86::psrl, &x86::AssemblerX86::psrl, |
| 1097 &x86::AssemblerX86::psrl}; |
1093 | 1098 |
1094 template <> void InstX8632Sqrtss::emit(const Cfg *Func) const { | 1099 template <> void InstX8632Sqrtss::emit(const Cfg *Func) const { |
1095 if (!ALLOW_DUMP) | 1100 if (!ALLOW_DUMP) |
1096 return; | 1101 return; |
1097 Ostream &Str = Func->getContext()->getStrEmit(); | 1102 Ostream &Str = Func->getContext()->getStrEmit(); |
1098 assert(getSrcSize() == 1); | 1103 assert(getSrcSize() == 1); |
1099 Type Ty = getSrc(0)->getType(); | 1104 Type Ty = getSrc(0)->getType(); |
1100 assert(isScalarFloatingType(Ty)); | 1105 assert(isScalarFloatingType(Ty)); |
1101 Str << "\tsqrt" << TypeX8632Attributes[Ty].SdSsString << "\t"; | 1106 Str << "\tsqrt" << TypeX8632Attributes[Ty].SdSsString << "\t"; |
1102 getSrc(0)->emit(Func); | 1107 getSrc(0)->emit(Func); |
(...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2672 assert(getDest()->getType() == IceType_v8i16 || | 2677 assert(getDest()->getType() == IceType_v8i16 || |
2673 getDest()->getType() == IceType_v8i1 || | 2678 getDest()->getType() == IceType_v8i1 || |
2674 getDest()->getType() == IceType_v4i32 || | 2679 getDest()->getType() == IceType_v4i32 || |
2675 getDest()->getType() == IceType_v4i1); | 2680 getDest()->getType() == IceType_v4i1); |
2676 char buf[30]; | 2681 char buf[30]; |
2677 snprintf(buf, llvm::array_lengthof(buf), "psra%s", | 2682 snprintf(buf, llvm::array_lengthof(buf), "psra%s", |
2678 TypeX8632Attributes[getDest()->getType()].PackString); | 2683 TypeX8632Attributes[getDest()->getType()].PackString); |
2679 emitTwoAddress(buf, this, Func); | 2684 emitTwoAddress(buf, this, Func); |
2680 } | 2685 } |
2681 | 2686 |
| 2687 template <> void InstX8632Psrl::emit(const Cfg *Func) const { |
| 2688 if (!ALLOW_DUMP) |
| 2689 return; |
| 2690 char buf[30]; |
| 2691 snprintf(buf, llvm::array_lengthof(buf), "psrl%s", |
| 2692 TypeX8632Attributes[getDest()->getType()].PackString); |
| 2693 emitTwoAddress(buf, this, Func); |
| 2694 } |
| 2695 |
2682 void InstX8632Ret::emit(const Cfg *Func) const { | 2696 void InstX8632Ret::emit(const Cfg *Func) const { |
2683 if (!ALLOW_DUMP) | 2697 if (!ALLOW_DUMP) |
2684 return; | 2698 return; |
2685 Ostream &Str = Func->getContext()->getStrEmit(); | 2699 Ostream &Str = Func->getContext()->getStrEmit(); |
2686 Str << "\tret"; | 2700 Str << "\tret"; |
2687 } | 2701 } |
2688 | 2702 |
2689 void InstX8632Ret::emitIAS(const Cfg *Func) const { | 2703 void InstX8632Ret::emitIAS(const Cfg *Func) const { |
2690 x86::AssemblerX86 *Asm = Func->getAssembler<x86::AssemblerX86>(); | 2704 x86::AssemblerX86 *Asm = Func->getAssembler<x86::AssemblerX86>(); |
2691 Asm->ret(); | 2705 Asm->ret(); |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2936 } | 2950 } |
2937 Str << "("; | 2951 Str << "("; |
2938 if (Func) | 2952 if (Func) |
2939 Var->dump(Func); | 2953 Var->dump(Func); |
2940 else | 2954 else |
2941 Var->dump(Str); | 2955 Var->dump(Str); |
2942 Str << ")"; | 2956 Str << ")"; |
2943 } | 2957 } |
2944 | 2958 |
2945 } // end of namespace Ice | 2959 } // end of namespace Ice |
OLD | NEW |