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

Side by Side Diff: src/IceInstX8632.cpp

Issue 1186713010: Subzero: Add more kinds of RMW lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Refactor the assembler for 8 integer arithmetic instructions Created 5 years, 6 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 | « src/IceInstX8632.h ('k') | src/IceTargetLowering.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.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 919 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 template <> const char *InstX8632Cbwdq::Opcode = "cbw/cwd/cdq"; 930 template <> const char *InstX8632Cbwdq::Opcode = "cbw/cwd/cdq";
931 // Mov-like ops 931 // Mov-like ops
932 template <> const char *InstX8632Mov::Opcode = "mov"; 932 template <> const char *InstX8632Mov::Opcode = "mov";
933 template <> const char *InstX8632Movp::Opcode = "movups"; 933 template <> const char *InstX8632Movp::Opcode = "movups";
934 template <> const char *InstX8632Movq::Opcode = "movq"; 934 template <> const char *InstX8632Movq::Opcode = "movq";
935 // Binary ops 935 // Binary ops
936 template <> const char *InstX8632Add::Opcode = "add"; 936 template <> const char *InstX8632Add::Opcode = "add";
937 template <> const char *InstX8632AddRMW::Opcode = "add"; 937 template <> const char *InstX8632AddRMW::Opcode = "add";
938 template <> const char *InstX8632Addps::Opcode = "addps"; 938 template <> const char *InstX8632Addps::Opcode = "addps";
939 template <> const char *InstX8632Adc::Opcode = "adc"; 939 template <> const char *InstX8632Adc::Opcode = "adc";
940 template <> const char *InstX8632AdcRMW::Opcode = "adc";
940 template <> const char *InstX8632Addss::Opcode = "addss"; 941 template <> const char *InstX8632Addss::Opcode = "addss";
941 template <> const char *InstX8632Padd::Opcode = "padd"; 942 template <> const char *InstX8632Padd::Opcode = "padd";
942 template <> const char *InstX8632Sub::Opcode = "sub"; 943 template <> const char *InstX8632Sub::Opcode = "sub";
944 template <> const char *InstX8632SubRMW::Opcode = "sub";
943 template <> const char *InstX8632Subps::Opcode = "subps"; 945 template <> const char *InstX8632Subps::Opcode = "subps";
944 template <> const char *InstX8632Subss::Opcode = "subss"; 946 template <> const char *InstX8632Subss::Opcode = "subss";
945 template <> const char *InstX8632Sbb::Opcode = "sbb"; 947 template <> const char *InstX8632Sbb::Opcode = "sbb";
948 template <> const char *InstX8632SbbRMW::Opcode = "sbb";
946 template <> const char *InstX8632Psub::Opcode = "psub"; 949 template <> const char *InstX8632Psub::Opcode = "psub";
947 template <> const char *InstX8632And::Opcode = "and"; 950 template <> const char *InstX8632And::Opcode = "and";
951 template <> const char *InstX8632AndRMW::Opcode = "and";
948 template <> const char *InstX8632Pand::Opcode = "pand"; 952 template <> const char *InstX8632Pand::Opcode = "pand";
949 template <> const char *InstX8632Pandn::Opcode = "pandn"; 953 template <> const char *InstX8632Pandn::Opcode = "pandn";
950 template <> const char *InstX8632Or::Opcode = "or"; 954 template <> const char *InstX8632Or::Opcode = "or";
955 template <> const char *InstX8632OrRMW::Opcode = "or";
951 template <> const char *InstX8632Por::Opcode = "por"; 956 template <> const char *InstX8632Por::Opcode = "por";
952 template <> const char *InstX8632Xor::Opcode = "xor"; 957 template <> const char *InstX8632Xor::Opcode = "xor";
958 template <> const char *InstX8632XorRMW::Opcode = "xor";
953 template <> const char *InstX8632Pxor::Opcode = "pxor"; 959 template <> const char *InstX8632Pxor::Opcode = "pxor";
954 template <> const char *InstX8632Imul::Opcode = "imul"; 960 template <> const char *InstX8632Imul::Opcode = "imul";
955 template <> const char *InstX8632Mulps::Opcode = "mulps"; 961 template <> const char *InstX8632Mulps::Opcode = "mulps";
956 template <> const char *InstX8632Mulss::Opcode = "mulss"; 962 template <> const char *InstX8632Mulss::Opcode = "mulss";
957 template <> const char *InstX8632Pmull::Opcode = "pmull"; 963 template <> const char *InstX8632Pmull::Opcode = "pmull";
958 template <> const char *InstX8632Pmuludq::Opcode = "pmuludq"; 964 template <> const char *InstX8632Pmuludq::Opcode = "pmuludq";
959 template <> const char *InstX8632Div::Opcode = "div"; 965 template <> const char *InstX8632Div::Opcode = "div";
960 template <> const char *InstX8632Divps::Opcode = "divps"; 966 template <> const char *InstX8632Divps::Opcode = "divps";
961 template <> const char *InstX8632Idiv::Opcode = "idiv"; 967 template <> const char *InstX8632Idiv::Opcode = "idiv";
962 template <> const char *InstX8632Divss::Opcode = "divss"; 968 template <> const char *InstX8632Divss::Opcode = "divss";
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 &X8632::AssemblerX8632::add, &X8632::AssemblerX8632::add, 1024 &X8632::AssemblerX8632::add, &X8632::AssemblerX8632::add,
1019 &X8632::AssemblerX8632::add}; 1025 &X8632::AssemblerX8632::add};
1020 template <> 1026 template <>
1021 const X8632::AssemblerX8632::GPREmitterAddrOp InstX8632AddRMW::Emitter = { 1027 const X8632::AssemblerX8632::GPREmitterAddrOp InstX8632AddRMW::Emitter = {
1022 &X8632::AssemblerX8632::add, &X8632::AssemblerX8632::add}; 1028 &X8632::AssemblerX8632::add, &X8632::AssemblerX8632::add};
1023 template <> 1029 template <>
1024 const X8632::AssemblerX8632::GPREmitterRegOp InstX8632Adc::Emitter = { 1030 const X8632::AssemblerX8632::GPREmitterRegOp InstX8632Adc::Emitter = {
1025 &X8632::AssemblerX8632::adc, &X8632::AssemblerX8632::adc, 1031 &X8632::AssemblerX8632::adc, &X8632::AssemblerX8632::adc,
1026 &X8632::AssemblerX8632::adc}; 1032 &X8632::AssemblerX8632::adc};
1027 template <> 1033 template <>
1034 const X8632::AssemblerX8632::GPREmitterAddrOp InstX8632AdcRMW::Emitter = {
1035 &X8632::AssemblerX8632::adc, &X8632::AssemblerX8632::adc};
1036 template <>
1028 const X8632::AssemblerX8632::GPREmitterRegOp InstX8632And::Emitter = { 1037 const X8632::AssemblerX8632::GPREmitterRegOp InstX8632And::Emitter = {
1029 &X8632::AssemblerX8632::And, &X8632::AssemblerX8632::And, 1038 &X8632::AssemblerX8632::And, &X8632::AssemblerX8632::And,
1030 &X8632::AssemblerX8632::And}; 1039 &X8632::AssemblerX8632::And};
1031 template <> 1040 template <>
1041 const X8632::AssemblerX8632::GPREmitterAddrOp InstX8632AndRMW::Emitter = {
1042 &X8632::AssemblerX8632::And, &X8632::AssemblerX8632::And};
1043 template <>
1032 const X8632::AssemblerX8632::GPREmitterRegOp InstX8632Or::Emitter = { 1044 const X8632::AssemblerX8632::GPREmitterRegOp InstX8632Or::Emitter = {
1033 &X8632::AssemblerX8632::Or, &X8632::AssemblerX8632::Or, 1045 &X8632::AssemblerX8632::Or, &X8632::AssemblerX8632::Or,
1034 &X8632::AssemblerX8632::Or}; 1046 &X8632::AssemblerX8632::Or};
1035 template <> 1047 template <>
1048 const X8632::AssemblerX8632::GPREmitterAddrOp InstX8632OrRMW::Emitter = {
1049 &X8632::AssemblerX8632::Or, &X8632::AssemblerX8632::Or};
1050 template <>
1036 const X8632::AssemblerX8632::GPREmitterRegOp InstX8632Sbb::Emitter = { 1051 const X8632::AssemblerX8632::GPREmitterRegOp InstX8632Sbb::Emitter = {
1037 &X8632::AssemblerX8632::sbb, &X8632::AssemblerX8632::sbb, 1052 &X8632::AssemblerX8632::sbb, &X8632::AssemblerX8632::sbb,
1038 &X8632::AssemblerX8632::sbb}; 1053 &X8632::AssemblerX8632::sbb};
1039 template <> 1054 template <>
1055 const X8632::AssemblerX8632::GPREmitterAddrOp InstX8632SbbRMW::Emitter = {
1056 &X8632::AssemblerX8632::sbb, &X8632::AssemblerX8632::sbb};
1057 template <>
1040 const X8632::AssemblerX8632::GPREmitterRegOp InstX8632Sub::Emitter = { 1058 const X8632::AssemblerX8632::GPREmitterRegOp InstX8632Sub::Emitter = {
1041 &X8632::AssemblerX8632::sub, &X8632::AssemblerX8632::sub, 1059 &X8632::AssemblerX8632::sub, &X8632::AssemblerX8632::sub,
1042 &X8632::AssemblerX8632::sub}; 1060 &X8632::AssemblerX8632::sub};
1043 template <> 1061 template <>
1062 const X8632::AssemblerX8632::GPREmitterAddrOp InstX8632SubRMW::Emitter = {
1063 &X8632::AssemblerX8632::sub, &X8632::AssemblerX8632::sub};
1064 template <>
1044 const X8632::AssemblerX8632::GPREmitterRegOp InstX8632Xor::Emitter = { 1065 const X8632::AssemblerX8632::GPREmitterRegOp InstX8632Xor::Emitter = {
1045 &X8632::AssemblerX8632::Xor, &X8632::AssemblerX8632::Xor, 1066 &X8632::AssemblerX8632::Xor, &X8632::AssemblerX8632::Xor,
1046 &X8632::AssemblerX8632::Xor}; 1067 &X8632::AssemblerX8632::Xor};
1068 template <>
1069 const X8632::AssemblerX8632::GPREmitterAddrOp InstX8632XorRMW::Emitter = {
1070 &X8632::AssemblerX8632::Xor, &X8632::AssemblerX8632::Xor};
1047 1071
1048 // Binary Shift GPR ops 1072 // Binary Shift GPR ops
1049 template <> 1073 template <>
1050 const X8632::AssemblerX8632::GPREmitterShiftOp InstX8632Rol::Emitter = { 1074 const X8632::AssemblerX8632::GPREmitterShiftOp InstX8632Rol::Emitter = {
1051 &X8632::AssemblerX8632::rol, &X8632::AssemblerX8632::rol}; 1075 &X8632::AssemblerX8632::rol, &X8632::AssemblerX8632::rol};
1052 template <> 1076 template <>
1053 const X8632::AssemblerX8632::GPREmitterShiftOp InstX8632Sar::Emitter = { 1077 const X8632::AssemblerX8632::GPREmitterShiftOp InstX8632Sar::Emitter = {
1054 &X8632::AssemblerX8632::sar, &X8632::AssemblerX8632::sar}; 1078 &X8632::AssemblerX8632::sar, &X8632::AssemblerX8632::sar};
1055 template <> 1079 template <>
1056 const X8632::AssemblerX8632::GPREmitterShiftOp InstX8632Shl::Emitter = { 1080 const X8632::AssemblerX8632::GPREmitterShiftOp InstX8632Shl::Emitter = {
(...skipping 1972 matching lines...) Expand 10 before | Expand all | Expand 10 after
3029 } 3053 }
3030 Str << "("; 3054 Str << "(";
3031 if (Func) 3055 if (Func)
3032 Var->dump(Func); 3056 Var->dump(Func);
3033 else 3057 else
3034 Var->dump(Str); 3058 Var->dump(Str);
3035 Str << ")"; 3059 Str << ")";
3036 } 3060 }
3037 3061
3038 } // end of namespace Ice 3062 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceInstX8632.h ('k') | src/IceTargetLowering.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698