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

Side by Side Diff: src/ppc/assembler-ppc.cc

Issue 2775413002: PPC: Declare X format assembler function with opcode list macro (Closed)
Patch Set: Created 3 years, 9 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/ppc/assembler-ppc.h ('k') | src/ppc/constants-ppc.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions 5 // modification, are permitted provided that the following conditions
6 // are met: 6 // are met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 PrintF("val = %" V8PRIdPTR ", 0x%" V8PRIxPTR 635 PrintF("val = %" V8PRIdPTR ", 0x%" V8PRIxPTR
636 ", is_unsigned_imm16(val)=%d, kImm16Mask=0x%x\n", 636 ", is_unsigned_imm16(val)=%d, kImm16Mask=0x%x\n",
637 val, val, is_uint16(val), kImm16Mask); 637 val, val, is_uint16(val), kImm16Mask);
638 } 638 }
639 CHECK(is_uint16(val)); 639 CHECK(is_uint16(val));
640 } 640 }
641 emit(instr | rt.code() * B21 | ra.code() * B16 | (kImm16Mask & val)); 641 emit(instr | rt.code() * B21 | ra.code() * B16 | (kImm16Mask & val));
642 } 642 }
643 643
644 644
645 void Assembler::x_form(Instr instr, Register ra, Register rs, Register rb,
646 RCBit r) {
647 emit(instr | rs.code() * B21 | ra.code() * B16 | rb.code() * B11 | r);
648 }
649
650 void Assembler::xo_form(Instr instr, Register rt, Register ra, Register rb, 645 void Assembler::xo_form(Instr instr, Register rt, Register ra, Register rb,
651 OEBit o, RCBit r) { 646 OEBit o, RCBit r) {
652 emit(instr | rt.code() * B21 | ra.code() * B16 | rb.code() * B11 | o | r); 647 emit(instr | rt.code() * B21 | ra.code() * B16 | rb.code() * B11 | o | r);
653 } 648 }
654 649
655 void Assembler::md_form(Instr instr, Register ra, Register rs, int shift, 650 void Assembler::md_form(Instr instr, Register ra, Register rs, int shift,
656 int maskbit, RCBit r) { 651 int maskbit, RCBit r) {
657 int sh0_4 = shift & 0x1f; 652 int sh0_4 = shift & 0x1f;
658 int sh5 = (shift >> 5) & 0x1; 653 int sh5 = (shift >> 5) & 0x1;
659 int m0_4 = maskbit & 0x1f; 654 int m0_4 = maskbit & 0x1f;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 void Assembler::xori(Register dst, Register src, const Operand& imm) { 746 void Assembler::xori(Register dst, Register src, const Operand& imm) {
752 d_form(XORI, src, dst, imm.imm_, false); 747 d_form(XORI, src, dst, imm.imm_, false);
753 } 748 }
754 749
755 750
756 void Assembler::xoris(Register ra, Register rs, const Operand& imm) { 751 void Assembler::xoris(Register ra, Register rs, const Operand& imm) {
757 d_form(XORIS, rs, ra, imm.imm_, false); 752 d_form(XORIS, rs, ra, imm.imm_, false);
758 } 753 }
759 754
760 755
761 void Assembler::xor_(Register dst, Register src1, Register src2, RCBit rc) {
762 x_form(EXT2 | XORX, dst, src1, src2, rc);
763 }
764
765
766 void Assembler::cntlzw_(Register ra, Register rs, RCBit rc) {
767 x_form(EXT2 | CNTLZWX, ra, rs, r0, rc);
768 }
769
770
771 void Assembler::popcntw(Register ra, Register rs) {
772 emit(EXT2 | POPCNTW | rs.code() * B21 | ra.code() * B16);
773 }
774
775
776 void Assembler::and_(Register ra, Register rs, Register rb, RCBit rc) {
777 x_form(EXT2 | ANDX, ra, rs, rb, rc);
778 }
779
780
781 void Assembler::rlwinm(Register ra, Register rs, int sh, int mb, int me, 756 void Assembler::rlwinm(Register ra, Register rs, int sh, int mb, int me,
782 RCBit rc) { 757 RCBit rc) {
783 sh &= 0x1f; 758 sh &= 0x1f;
784 mb &= 0x1f; 759 mb &= 0x1f;
785 me &= 0x1f; 760 me &= 0x1f;
786 emit(RLWINMX | rs.code() * B21 | ra.code() * B16 | sh * B11 | mb * B6 | 761 emit(RLWINMX | rs.code() * B21 | ra.code() * B16 | sh * B11 | mb * B6 |
787 me << 1 | rc); 762 me << 1 | rc);
788 } 763 }
789 764
790 765
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 } 801 }
827 802
828 803
829 void Assembler::clrlwi(Register dst, Register src, const Operand& val, 804 void Assembler::clrlwi(Register dst, Register src, const Operand& val,
830 RCBit rc) { 805 RCBit rc) {
831 DCHECK((32 > val.imm_) && (val.imm_ >= 0)); 806 DCHECK((32 > val.imm_) && (val.imm_ >= 0));
832 rlwinm(dst, src, 0, val.imm_, 31, rc); 807 rlwinm(dst, src, 0, val.imm_, 31, rc);
833 } 808 }
834 809
835 810
836 void Assembler::srawi(Register ra, Register rs, int sh, RCBit r) {
837 emit(EXT2 | SRAWIX | rs.code() * B21 | ra.code() * B16 | sh * B11 | r);
838 }
839
840
841 void Assembler::srw(Register dst, Register src1, Register src2, RCBit r) {
842 x_form(EXT2 | SRWX, dst, src1, src2, r);
843 }
844
845
846 void Assembler::slw(Register dst, Register src1, Register src2, RCBit r) {
847 x_form(EXT2 | SLWX, dst, src1, src2, r);
848 }
849
850
851 void Assembler::sraw(Register ra, Register rs, Register rb, RCBit r) {
852 x_form(EXT2 | SRAW, ra, rs, rb, r);
853 }
854
855
856 void Assembler::rotlw(Register ra, Register rs, Register rb, RCBit r) { 811 void Assembler::rotlw(Register ra, Register rs, Register rb, RCBit r) {
857 rlwnm(ra, rs, rb, 0, 31, r); 812 rlwnm(ra, rs, rb, 0, 31, r);
858 } 813 }
859 814
860 815
861 void Assembler::rotlwi(Register ra, Register rs, int sh, RCBit r) { 816 void Assembler::rotlwi(Register ra, Register rs, int sh, RCBit r) {
862 rlwinm(ra, rs, sh, 0, 31, r); 817 rlwinm(ra, rs, sh, 0, 31, r);
863 } 818 }
864 819
865 820
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 xo_form(EXT2 | DIVW, dst, src1, src2, o, r); 894 xo_form(EXT2 | DIVW, dst, src1, src2, o, r);
940 } 895 }
941 896
942 897
943 // Divide word unsigned 898 // Divide word unsigned
944 void Assembler::divwu(Register dst, Register src1, Register src2, OEBit o, 899 void Assembler::divwu(Register dst, Register src1, Register src2, OEBit o,
945 RCBit r) { 900 RCBit r) {
946 xo_form(EXT2 | DIVWU, dst, src1, src2, o, r); 901 xo_form(EXT2 | DIVWU, dst, src1, src2, o, r);
947 } 902 }
948 903
949 void Assembler::modsw(Register rt, Register ra, Register rb) {
950 x_form(EXT2 | MODSW, ra, rt, rb, LeaveRC);
951 }
952
953 void Assembler::moduw(Register rt, Register ra, Register rb) {
954 x_form(EXT2 | MODUW, ra, rt, rb, LeaveRC);
955 }
956 904
957 void Assembler::addi(Register dst, Register src, const Operand& imm) { 905 void Assembler::addi(Register dst, Register src, const Operand& imm) {
958 DCHECK(!src.is(r0)); // use li instead to show intent 906 DCHECK(!src.is(r0)); // use li instead to show intent
959 d_form(ADDI, dst, src, imm.imm_, true); 907 d_form(ADDI, dst, src, imm.imm_, true);
960 } 908 }
961 909
962 910
963 void Assembler::addis(Register dst, Register src, const Operand& imm) { 911 void Assembler::addis(Register dst, Register src, const Operand& imm) {
964 DCHECK(!src.is(r0)); // use lis instead to show intent 912 DCHECK(!src.is(r0)); // use lis instead to show intent
965 d_form(ADDIS, dst, src, imm.imm_, true); 913 d_form(ADDIS, dst, src, imm.imm_, true);
966 } 914 }
967 915
968 916
969 void Assembler::addic(Register dst, Register src, const Operand& imm) { 917 void Assembler::addic(Register dst, Register src, const Operand& imm) {
970 d_form(ADDIC, dst, src, imm.imm_, true); 918 d_form(ADDIC, dst, src, imm.imm_, true);
971 } 919 }
972 920
973 921
974 void Assembler::andi(Register ra, Register rs, const Operand& imm) { 922 void Assembler::andi(Register ra, Register rs, const Operand& imm) {
975 d_form(ANDIx, rs, ra, imm.imm_, false); 923 d_form(ANDIx, rs, ra, imm.imm_, false);
976 } 924 }
977 925
978 926
979 void Assembler::andis(Register ra, Register rs, const Operand& imm) { 927 void Assembler::andis(Register ra, Register rs, const Operand& imm) {
980 d_form(ANDISx, rs, ra, imm.imm_, false); 928 d_form(ANDISx, rs, ra, imm.imm_, false);
981 } 929 }
982 930
983 931
984 void Assembler::nor(Register dst, Register src1, Register src2, RCBit r) {
985 x_form(EXT2 | NORX, dst, src1, src2, r);
986 }
987
988
989 void Assembler::notx(Register dst, Register src, RCBit r) {
990 x_form(EXT2 | NORX, dst, src, src, r);
991 }
992
993
994 void Assembler::ori(Register ra, Register rs, const Operand& imm) { 932 void Assembler::ori(Register ra, Register rs, const Operand& imm) {
995 d_form(ORI, rs, ra, imm.imm_, false); 933 d_form(ORI, rs, ra, imm.imm_, false);
996 } 934 }
997 935
998 936
999 void Assembler::oris(Register dst, Register src, const Operand& imm) { 937 void Assembler::oris(Register dst, Register src, const Operand& imm) {
1000 d_form(ORIS, src, dst, imm.imm_, false); 938 d_form(ORIS, src, dst, imm.imm_, false);
1001 } 939 }
1002 940
1003 941
1004 void Assembler::orx(Register dst, Register src1, Register src2, RCBit rc) {
1005 x_form(EXT2 | ORX, dst, src1, src2, rc);
1006 }
1007
1008
1009 void Assembler::orc(Register dst, Register src1, Register src2, RCBit rc) {
1010 x_form(EXT2 | ORC, dst, src1, src2, rc);
1011 }
1012
1013
1014 void Assembler::cmpi(Register src1, const Operand& src2, CRegister cr) { 942 void Assembler::cmpi(Register src1, const Operand& src2, CRegister cr) {
1015 intptr_t imm16 = src2.imm_; 943 intptr_t imm16 = src2.imm_;
1016 #if V8_TARGET_ARCH_PPC64 944 #if V8_TARGET_ARCH_PPC64
1017 int L = 1; 945 int L = 1;
1018 #else 946 #else
1019 int L = 0; 947 int L = 0;
1020 #endif 948 #endif
1021 DCHECK(is_int16(imm16)); 949 DCHECK(is_int16(imm16));
1022 DCHECK(cr.code() >= 0 && cr.code() <= 7); 950 DCHECK(cr.code() >= 0 && cr.code() <= 7);
1023 imm16 &= kImm16Mask; 951 imm16 &= kImm16Mask;
1024 emit(CMPI | cr.code() * B23 | L * B21 | src1.code() * B16 | imm16); 952 emit(CMPI | cr.code() * B23 | L * B21 | src1.code() * B16 | imm16);
1025 } 953 }
1026 954
1027 955
1028 void Assembler::cmpli(Register src1, const Operand& src2, CRegister cr) { 956 void Assembler::cmpli(Register src1, const Operand& src2, CRegister cr) {
1029 uintptr_t uimm16 = src2.imm_; 957 uintptr_t uimm16 = src2.imm_;
1030 #if V8_TARGET_ARCH_PPC64 958 #if V8_TARGET_ARCH_PPC64
1031 int L = 1; 959 int L = 1;
1032 #else 960 #else
1033 int L = 0; 961 int L = 0;
1034 #endif 962 #endif
1035 DCHECK(is_uint16(uimm16)); 963 DCHECK(is_uint16(uimm16));
1036 DCHECK(cr.code() >= 0 && cr.code() <= 7); 964 DCHECK(cr.code() >= 0 && cr.code() <= 7);
1037 uimm16 &= kImm16Mask; 965 uimm16 &= kImm16Mask;
1038 emit(CMPLI | cr.code() * B23 | L * B21 | src1.code() * B16 | uimm16); 966 emit(CMPLI | cr.code() * B23 | L * B21 | src1.code() * B16 | uimm16);
1039 } 967 }
1040 968
1041 969
1042 void Assembler::cmp(Register src1, Register src2, CRegister cr) {
1043 #if V8_TARGET_ARCH_PPC64
1044 int L = 1;
1045 #else
1046 int L = 0;
1047 #endif
1048 DCHECK(cr.code() >= 0 && cr.code() <= 7);
1049 emit(EXT2 | CMP | cr.code() * B23 | L * B21 | src1.code() * B16 |
1050 src2.code() * B11);
1051 }
1052
1053
1054 void Assembler::cmpl(Register src1, Register src2, CRegister cr) {
1055 #if V8_TARGET_ARCH_PPC64
1056 int L = 1;
1057 #else
1058 int L = 0;
1059 #endif
1060 DCHECK(cr.code() >= 0 && cr.code() <= 7);
1061 emit(EXT2 | CMPL | cr.code() * B23 | L * B21 | src1.code() * B16 |
1062 src2.code() * B11);
1063 }
1064
1065
1066 void Assembler::cmpwi(Register src1, const Operand& src2, CRegister cr) { 970 void Assembler::cmpwi(Register src1, const Operand& src2, CRegister cr) {
1067 intptr_t imm16 = src2.imm_; 971 intptr_t imm16 = src2.imm_;
1068 int L = 0; 972 int L = 0;
1069 int pos = pc_offset(); 973 int pos = pc_offset();
1070 DCHECK(is_int16(imm16)); 974 DCHECK(is_int16(imm16));
1071 DCHECK(cr.code() >= 0 && cr.code() <= 7); 975 DCHECK(cr.code() >= 0 && cr.code() <= 7);
1072 imm16 &= kImm16Mask; 976 imm16 &= kImm16Mask;
1073 977
1074 // For cmpwi against 0, save postition and cr for later examination 978 // For cmpwi against 0, save postition and cr for later examination
1075 // of potential optimization. 979 // of potential optimization.
1076 if (imm16 == 0 && pos > 0 && last_bound_pos_ != pos) { 980 if (imm16 == 0 && pos > 0 && last_bound_pos_ != pos) {
1077 optimizable_cmpi_pos_ = pos; 981 optimizable_cmpi_pos_ = pos;
1078 cmpi_cr_ = cr; 982 cmpi_cr_ = cr;
1079 } 983 }
1080 emit(CMPI | cr.code() * B23 | L * B21 | src1.code() * B16 | imm16); 984 emit(CMPI | cr.code() * B23 | L * B21 | src1.code() * B16 | imm16);
1081 } 985 }
1082 986
1083 987
1084 void Assembler::cmplwi(Register src1, const Operand& src2, CRegister cr) { 988 void Assembler::cmplwi(Register src1, const Operand& src2, CRegister cr) {
1085 uintptr_t uimm16 = src2.imm_; 989 uintptr_t uimm16 = src2.imm_;
1086 int L = 0; 990 int L = 0;
1087 DCHECK(is_uint16(uimm16)); 991 DCHECK(is_uint16(uimm16));
1088 DCHECK(cr.code() >= 0 && cr.code() <= 7); 992 DCHECK(cr.code() >= 0 && cr.code() <= 7);
1089 uimm16 &= kImm16Mask; 993 uimm16 &= kImm16Mask;
1090 emit(CMPLI | cr.code() * B23 | L * B21 | src1.code() * B16 | uimm16); 994 emit(CMPLI | cr.code() * B23 | L * B21 | src1.code() * B16 | uimm16);
1091 } 995 }
1092 996
1093 997
1094 void Assembler::cmpw(Register src1, Register src2, CRegister cr) {
1095 int L = 0;
1096 DCHECK(cr.code() >= 0 && cr.code() <= 7);
1097 emit(EXT2 | CMP | cr.code() * B23 | L * B21 | src1.code() * B16 |
1098 src2.code() * B11);
1099 }
1100
1101
1102 void Assembler::cmplw(Register src1, Register src2, CRegister cr) {
1103 int L = 0;
1104 DCHECK(cr.code() >= 0 && cr.code() <= 7);
1105 emit(EXT2 | CMPL | cr.code() * B23 | L * B21 | src1.code() * B16 |
1106 src2.code() * B11);
1107 }
1108
1109
1110 void Assembler::isel(Register rt, Register ra, Register rb, int cb) { 998 void Assembler::isel(Register rt, Register ra, Register rb, int cb) {
1111 emit(EXT2 | ISEL | rt.code() * B21 | ra.code() * B16 | rb.code() * B11 | 999 emit(EXT2 | ISEL | rt.code() * B21 | ra.code() * B16 | rb.code() * B11 |
1112 cb * B6); 1000 cb * B6);
1113 } 1001 }
1114 1002
1115 1003
1116 // Pseudo op - load immediate 1004 // Pseudo op - load immediate
1117 void Assembler::li(Register dst, const Operand& imm) { 1005 void Assembler::li(Register dst, const Operand& imm) {
1118 d_form(ADDI, dst, r0, imm.imm_, true); 1006 d_form(ADDI, dst, r0, imm.imm_, true);
1119 } 1007 }
(...skipping 10 matching lines...) Expand all
1130 orx(dst, src, src); 1018 orx(dst, src, src);
1131 } 1019 }
1132 1020
1133 1021
1134 void Assembler::lbz(Register dst, const MemOperand& src) { 1022 void Assembler::lbz(Register dst, const MemOperand& src) {
1135 DCHECK(!src.ra_.is(r0)); 1023 DCHECK(!src.ra_.is(r0));
1136 d_form(LBZ, dst, src.ra(), src.offset(), true); 1024 d_form(LBZ, dst, src.ra(), src.offset(), true);
1137 } 1025 }
1138 1026
1139 1027
1140 void Assembler::lbzx(Register rt, const MemOperand& src) {
1141 Register ra = src.ra();
1142 Register rb = src.rb();
1143 DCHECK(!ra.is(r0));
1144 emit(EXT2 | LBZX | rt.code() * B21 | ra.code() * B16 | rb.code() * B11 |
1145 LeaveRC);
1146 }
1147
1148
1149 void Assembler::lbzux(Register rt, const MemOperand& src) {
1150 Register ra = src.ra();
1151 Register rb = src.rb();
1152 DCHECK(!ra.is(r0));
1153 emit(EXT2 | LBZUX | rt.code() * B21 | ra.code() * B16 | rb.code() * B11 |
1154 LeaveRC);
1155 }
1156
1157
1158 void Assembler::lhz(Register dst, const MemOperand& src) { 1028 void Assembler::lhz(Register dst, const MemOperand& src) {
1159 DCHECK(!src.ra_.is(r0)); 1029 DCHECK(!src.ra_.is(r0));
1160 d_form(LHZ, dst, src.ra(), src.offset(), true); 1030 d_form(LHZ, dst, src.ra(), src.offset(), true);
1161 } 1031 }
1162 1032
1163 1033
1164 void Assembler::lhzx(Register rt, const MemOperand& src) {
1165 Register ra = src.ra();
1166 Register rb = src.rb();
1167 DCHECK(!ra.is(r0));
1168 emit(EXT2 | LHZX | rt.code() * B21 | ra.code() * B16 | rb.code() * B11 |
1169 LeaveRC);
1170 }
1171
1172
1173 void Assembler::lhzux(Register rt, const MemOperand& src) {
1174 Register ra = src.ra();
1175 Register rb = src.rb();
1176 DCHECK(!ra.is(r0));
1177 emit(EXT2 | LHZUX | rt.code() * B21 | ra.code() * B16 | rb.code() * B11 |
1178 LeaveRC);
1179 }
1180
1181
1182 void Assembler::lhax(Register rt, const MemOperand& src) {
1183 Register ra = src.ra();
1184 Register rb = src.rb();
1185 DCHECK(!ra.is(r0));
1186 emit(EXT2 | LHAX | rt.code() * B21 | ra.code() * B16 | rb.code() * B11);
1187 }
1188
1189
1190 void Assembler::lwz(Register dst, const MemOperand& src) { 1034 void Assembler::lwz(Register dst, const MemOperand& src) {
1191 DCHECK(!src.ra_.is(r0)); 1035 DCHECK(!src.ra_.is(r0));
1192 d_form(LWZ, dst, src.ra(), src.offset(), true); 1036 d_form(LWZ, dst, src.ra(), src.offset(), true);
1193 } 1037 }
1194 1038
1195 1039
1196 void Assembler::lwzu(Register dst, const MemOperand& src) { 1040 void Assembler::lwzu(Register dst, const MemOperand& src) {
1197 DCHECK(!src.ra_.is(r0)); 1041 DCHECK(!src.ra_.is(r0));
1198 d_form(LWZU, dst, src.ra(), src.offset(), true); 1042 d_form(LWZU, dst, src.ra(), src.offset(), true);
1199 } 1043 }
1200 1044
1201 1045
1202 void Assembler::lwzx(Register rt, const MemOperand& src) {
1203 Register ra = src.ra();
1204 Register rb = src.rb();
1205 DCHECK(!ra.is(r0));
1206 emit(EXT2 | LWZX | rt.code() * B21 | ra.code() * B16 | rb.code() * B11 |
1207 LeaveRC);
1208 }
1209
1210
1211 void Assembler::lwzux(Register rt, const MemOperand& src) {
1212 Register ra = src.ra();
1213 Register rb = src.rb();
1214 DCHECK(!ra.is(r0));
1215 emit(EXT2 | LWZUX | rt.code() * B21 | ra.code() * B16 | rb.code() * B11 |
1216 LeaveRC);
1217 }
1218
1219
1220 void Assembler::lha(Register dst, const MemOperand& src) { 1046 void Assembler::lha(Register dst, const MemOperand& src) {
1221 DCHECK(!src.ra_.is(r0)); 1047 DCHECK(!src.ra_.is(r0));
1222 d_form(LHA, dst, src.ra(), src.offset(), true); 1048 d_form(LHA, dst, src.ra(), src.offset(), true);
1223 } 1049 }
1224 1050
1225 1051
1226 void Assembler::lwa(Register dst, const MemOperand& src) { 1052 void Assembler::lwa(Register dst, const MemOperand& src) {
1227 #if V8_TARGET_ARCH_PPC64 1053 #if V8_TARGET_ARCH_PPC64
1228 int offset = src.offset(); 1054 int offset = src.offset();
1229 DCHECK(!src.ra_.is(r0)); 1055 DCHECK(!src.ra_.is(r0));
1230 CHECK(!(offset & 3) && is_int16(offset)); 1056 CHECK(!(offset & 3) && is_int16(offset));
1231 offset = kImm16Mask & offset; 1057 offset = kImm16Mask & offset;
1232 emit(LD | dst.code() * B21 | src.ra().code() * B16 | offset | 2); 1058 emit(LD | dst.code() * B21 | src.ra().code() * B16 | offset | 2);
1233 #else 1059 #else
1234 lwz(dst, src); 1060 lwz(dst, src);
1235 #endif 1061 #endif
1236 } 1062 }
1237 1063
1238 1064
1239 void Assembler::lwax(Register rt, const MemOperand& src) {
1240 #if V8_TARGET_ARCH_PPC64
1241 Register ra = src.ra();
1242 Register rb = src.rb();
1243 DCHECK(!ra.is(r0));
1244 emit(EXT2 | LWAX | rt.code() * B21 | ra.code() * B16 | rb.code() * B11);
1245 #else
1246 lwzx(rt, src);
1247 #endif
1248 }
1249
1250
1251 void Assembler::ldbrx(Register dst, const MemOperand& src) {
1252 x_form(EXT2 | LDBRX, src.ra(), dst, src.rb(), LeaveRC);
1253 }
1254
1255
1256 void Assembler::lwbrx(Register dst, const MemOperand& src) {
1257 x_form(EXT2 | LWBRX, src.ra(), dst, src.rb(), LeaveRC);
1258 }
1259
1260
1261 void Assembler::lhbrx(Register dst, const MemOperand& src) {
1262 x_form(EXT2 | LHBRX, src.ra(), dst, src.rb(), LeaveRC);
1263 }
1264
1265
1266 void Assembler::stb(Register dst, const MemOperand& src) { 1065 void Assembler::stb(Register dst, const MemOperand& src) {
1267 DCHECK(!src.ra_.is(r0)); 1066 DCHECK(!src.ra_.is(r0));
1268 d_form(STB, dst, src.ra(), src.offset(), true); 1067 d_form(STB, dst, src.ra(), src.offset(), true);
1269 } 1068 }
1270 1069
1271 1070
1272 void Assembler::stbx(Register rs, const MemOperand& src) {
1273 Register ra = src.ra();
1274 Register rb = src.rb();
1275 DCHECK(!ra.is(r0));
1276 emit(EXT2 | STBX | rs.code() * B21 | ra.code() * B16 | rb.code() * B11 |
1277 LeaveRC);
1278 }
1279
1280
1281 void Assembler::stbux(Register rs, const MemOperand& src) {
1282 Register ra = src.ra();
1283 Register rb = src.rb();
1284 DCHECK(!ra.is(r0));
1285 emit(EXT2 | STBUX | rs.code() * B21 | ra.code() * B16 | rb.code() * B11 |
1286 LeaveRC);
1287 }
1288
1289
1290 void Assembler::sth(Register dst, const MemOperand& src) { 1071 void Assembler::sth(Register dst, const MemOperand& src) {
1291 DCHECK(!src.ra_.is(r0)); 1072 DCHECK(!src.ra_.is(r0));
1292 d_form(STH, dst, src.ra(), src.offset(), true); 1073 d_form(STH, dst, src.ra(), src.offset(), true);
1293 } 1074 }
1294 1075
1295 1076
1296 void Assembler::sthx(Register rs, const MemOperand& src) {
1297 Register ra = src.ra();
1298 Register rb = src.rb();
1299 DCHECK(!ra.is(r0));
1300 emit(EXT2 | STHX | rs.code() * B21 | ra.code() * B16 | rb.code() * B11 |
1301 LeaveRC);
1302 }
1303
1304
1305 void Assembler::sthux(Register rs, const MemOperand& src) {
1306 Register ra = src.ra();
1307 Register rb = src.rb();
1308 DCHECK(!ra.is(r0));
1309 emit(EXT2 | STHUX | rs.code() * B21 | ra.code() * B16 | rb.code() * B11 |
1310 LeaveRC);
1311 }
1312
1313
1314 void Assembler::stw(Register dst, const MemOperand& src) { 1077 void Assembler::stw(Register dst, const MemOperand& src) {
1315 DCHECK(!src.ra_.is(r0)); 1078 DCHECK(!src.ra_.is(r0));
1316 d_form(STW, dst, src.ra(), src.offset(), true); 1079 d_form(STW, dst, src.ra(), src.offset(), true);
1317 } 1080 }
1318 1081
1319 1082
1320 void Assembler::stwu(Register dst, const MemOperand& src) { 1083 void Assembler::stwu(Register dst, const MemOperand& src) {
1321 DCHECK(!src.ra_.is(r0)); 1084 DCHECK(!src.ra_.is(r0));
1322 d_form(STWU, dst, src.ra(), src.offset(), true); 1085 d_form(STWU, dst, src.ra(), src.offset(), true);
1323 } 1086 }
1324 1087
1325 1088
1326 void Assembler::stwx(Register rs, const MemOperand& src) {
1327 Register ra = src.ra();
1328 Register rb = src.rb();
1329 DCHECK(!ra.is(r0));
1330 emit(EXT2 | STWX | rs.code() * B21 | ra.code() * B16 | rb.code() * B11 |
1331 LeaveRC);
1332 }
1333
1334
1335 void Assembler::stwux(Register rs, const MemOperand& src) {
1336 Register ra = src.ra();
1337 Register rb = src.rb();
1338 DCHECK(!ra.is(r0));
1339 emit(EXT2 | STWUX | rs.code() * B21 | ra.code() * B16 | rb.code() * B11 |
1340 LeaveRC);
1341 }
1342
1343
1344 void Assembler::extsb(Register rs, Register ra, RCBit rc) {
1345 emit(EXT2 | EXTSB | ra.code() * B21 | rs.code() * B16 | rc);
1346 }
1347
1348
1349 void Assembler::extsh(Register rs, Register ra, RCBit rc) {
1350 emit(EXT2 | EXTSH | ra.code() * B21 | rs.code() * B16 | rc);
1351 }
1352
1353
1354 void Assembler::extsw(Register rs, Register ra, RCBit rc) {
1355 #if V8_TARGET_ARCH_PPC64
1356 emit(EXT2 | EXTSW | ra.code() * B21 | rs.code() * B16 | rc);
1357 #else
1358 // nop on 32-bit
1359 DCHECK(rs.is(ra) && rc == LeaveRC);
1360 #endif
1361 }
1362
1363
1364 void Assembler::neg(Register rt, Register ra, OEBit o, RCBit r) { 1089 void Assembler::neg(Register rt, Register ra, OEBit o, RCBit r) {
1365 emit(EXT2 | NEGX | rt.code() * B21 | ra.code() * B16 | o | r); 1090 emit(EXT2 | NEGX | rt.code() * B21 | ra.code() * B16 | o | r);
1366 } 1091 }
1367 1092
1368 1093
1369 void Assembler::andc(Register dst, Register src1, Register src2, RCBit rc) {
1370 x_form(EXT2 | ANDCX, dst, src1, src2, rc);
1371 }
1372
1373
1374 #if V8_TARGET_ARCH_PPC64 1094 #if V8_TARGET_ARCH_PPC64
1375 // 64bit specific instructions 1095 // 64bit specific instructions
1376 void Assembler::ld(Register rd, const MemOperand& src) { 1096 void Assembler::ld(Register rd, const MemOperand& src) {
1377 int offset = src.offset(); 1097 int offset = src.offset();
1378 DCHECK(!src.ra_.is(r0)); 1098 DCHECK(!src.ra_.is(r0));
1379 CHECK(!(offset & 3) && is_int16(offset)); 1099 CHECK(!(offset & 3) && is_int16(offset));
1380 offset = kImm16Mask & offset; 1100 offset = kImm16Mask & offset;
1381 emit(LD | rd.code() * B21 | src.ra().code() * B16 | offset); 1101 emit(LD | rd.code() * B21 | src.ra().code() * B16 | offset);
1382 } 1102 }
1383 1103
1384 1104
1385 void Assembler::ldx(Register rd, const MemOperand& src) {
1386 Register ra = src.ra();
1387 Register rb = src.rb();
1388 DCHECK(!ra.is(r0));
1389 emit(EXT2 | LDX | rd.code() * B21 | ra.code() * B16 | rb.code() * B11);
1390 }
1391
1392
1393 void Assembler::ldu(Register rd, const MemOperand& src) { 1105 void Assembler::ldu(Register rd, const MemOperand& src) {
1394 int offset = src.offset(); 1106 int offset = src.offset();
1395 DCHECK(!src.ra_.is(r0)); 1107 DCHECK(!src.ra_.is(r0));
1396 CHECK(!(offset & 3) && is_int16(offset)); 1108 CHECK(!(offset & 3) && is_int16(offset));
1397 offset = kImm16Mask & offset; 1109 offset = kImm16Mask & offset;
1398 emit(LD | rd.code() * B21 | src.ra().code() * B16 | offset | 1); 1110 emit(LD | rd.code() * B21 | src.ra().code() * B16 | offset | 1);
1399 } 1111 }
1400 1112
1401 1113
1402 void Assembler::ldux(Register rd, const MemOperand& src) {
1403 Register ra = src.ra();
1404 Register rb = src.rb();
1405 DCHECK(!ra.is(r0));
1406 emit(EXT2 | LDUX | rd.code() * B21 | ra.code() * B16 | rb.code() * B11);
1407 }
1408
1409
1410 void Assembler::std(Register rs, const MemOperand& src) { 1114 void Assembler::std(Register rs, const MemOperand& src) {
1411 int offset = src.offset(); 1115 int offset = src.offset();
1412 DCHECK(!src.ra_.is(r0)); 1116 DCHECK(!src.ra_.is(r0));
1413 CHECK(!(offset & 3) && is_int16(offset)); 1117 CHECK(!(offset & 3) && is_int16(offset));
1414 offset = kImm16Mask & offset; 1118 offset = kImm16Mask & offset;
1415 emit(STD | rs.code() * B21 | src.ra().code() * B16 | offset); 1119 emit(STD | rs.code() * B21 | src.ra().code() * B16 | offset);
1416 } 1120 }
1417 1121
1418 1122
1419 void Assembler::stdx(Register rs, const MemOperand& src) {
1420 Register ra = src.ra();
1421 Register rb = src.rb();
1422 DCHECK(!ra.is(r0));
1423 emit(EXT2 | STDX | rs.code() * B21 | ra.code() * B16 | rb.code() * B11);
1424 }
1425
1426
1427 void Assembler::stdu(Register rs, const MemOperand& src) { 1123 void Assembler::stdu(Register rs, const MemOperand& src) {
1428 int offset = src.offset(); 1124 int offset = src.offset();
1429 DCHECK(!src.ra_.is(r0)); 1125 DCHECK(!src.ra_.is(r0));
1430 CHECK(!(offset & 3) && is_int16(offset)); 1126 CHECK(!(offset & 3) && is_int16(offset));
1431 offset = kImm16Mask & offset; 1127 offset = kImm16Mask & offset;
1432 emit(STD | rs.code() * B21 | src.ra().code() * B16 | offset | 1); 1128 emit(STD | rs.code() * B21 | src.ra().code() * B16 | offset | 1);
1433 } 1129 }
1434 1130
1435 1131
1436 void Assembler::stdux(Register rs, const MemOperand& src) {
1437 Register ra = src.ra();
1438 Register rb = src.rb();
1439 DCHECK(!ra.is(r0));
1440 emit(EXT2 | STDUX | rs.code() * B21 | ra.code() * B16 | rb.code() * B11);
1441 }
1442
1443
1444 void Assembler::rldic(Register ra, Register rs, int sh, int mb, RCBit r) { 1132 void Assembler::rldic(Register ra, Register rs, int sh, int mb, RCBit r) {
1445 md_form(EXT5 | RLDIC, ra, rs, sh, mb, r); 1133 md_form(EXT5 | RLDIC, ra, rs, sh, mb, r);
1446 } 1134 }
1447 1135
1448 1136
1449 void Assembler::rldicl(Register ra, Register rs, int sh, int mb, RCBit r) { 1137 void Assembler::rldicl(Register ra, Register rs, int sh, int mb, RCBit r) {
1450 md_form(EXT5 | RLDICL, ra, rs, sh, mb, r); 1138 md_form(EXT5 | RLDICL, ra, rs, sh, mb, r);
1451 } 1139 }
1452 1140
1453 1141
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1494 1182
1495 void Assembler::sradi(Register ra, Register rs, int sh, RCBit r) { 1183 void Assembler::sradi(Register ra, Register rs, int sh, RCBit r) {
1496 int sh0_4 = sh & 0x1f; 1184 int sh0_4 = sh & 0x1f;
1497 int sh5 = (sh >> 5) & 0x1; 1185 int sh5 = (sh >> 5) & 0x1;
1498 1186
1499 emit(EXT2 | SRADIX | rs.code() * B21 | ra.code() * B16 | sh0_4 * B11 | 1187 emit(EXT2 | SRADIX | rs.code() * B21 | ra.code() * B16 | sh0_4 * B11 |
1500 sh5 * B1 | r); 1188 sh5 * B1 | r);
1501 } 1189 }
1502 1190
1503 1191
1504 void Assembler::srd(Register dst, Register src1, Register src2, RCBit r) {
1505 x_form(EXT2 | SRDX, dst, src1, src2, r);
1506 }
1507
1508
1509 void Assembler::sld(Register dst, Register src1, Register src2, RCBit r) {
1510 x_form(EXT2 | SLDX, dst, src1, src2, r);
1511 }
1512
1513
1514 void Assembler::srad(Register ra, Register rs, Register rb, RCBit r) {
1515 x_form(EXT2 | SRAD, ra, rs, rb, r);
1516 }
1517
1518
1519 void Assembler::rotld(Register ra, Register rs, Register rb, RCBit r) { 1192 void Assembler::rotld(Register ra, Register rs, Register rb, RCBit r) {
1520 rldcl(ra, rs, rb, 0, r); 1193 rldcl(ra, rs, rb, 0, r);
1521 } 1194 }
1522 1195
1523 1196
1524 void Assembler::rotldi(Register ra, Register rs, int sh, RCBit r) { 1197 void Assembler::rotldi(Register ra, Register rs, int sh, RCBit r) {
1525 rldicl(ra, rs, sh, 0, r); 1198 rldicl(ra, rs, sh, 0, r);
1526 } 1199 }
1527 1200
1528 1201
1529 void Assembler::rotrdi(Register ra, Register rs, int sh, RCBit r) { 1202 void Assembler::rotrdi(Register ra, Register rs, int sh, RCBit r) {
1530 rldicl(ra, rs, 64 - sh, 0, r); 1203 rldicl(ra, rs, 64 - sh, 0, r);
1531 } 1204 }
1532 1205
1533 1206
1534 void Assembler::cntlzd_(Register ra, Register rs, RCBit rc) {
1535 x_form(EXT2 | CNTLZDX, ra, rs, r0, rc);
1536 }
1537
1538
1539 void Assembler::popcntd(Register ra, Register rs) {
1540 emit(EXT2 | POPCNTD | rs.code() * B21 | ra.code() * B16);
1541 }
1542
1543
1544 void Assembler::mulld(Register dst, Register src1, Register src2, OEBit o, 1207 void Assembler::mulld(Register dst, Register src1, Register src2, OEBit o,
1545 RCBit r) { 1208 RCBit r) {
1546 xo_form(EXT2 | MULLD, dst, src1, src2, o, r); 1209 xo_form(EXT2 | MULLD, dst, src1, src2, o, r);
1547 } 1210 }
1548 1211
1549 1212
1550 void Assembler::divd(Register dst, Register src1, Register src2, OEBit o, 1213 void Assembler::divd(Register dst, Register src1, Register src2, OEBit o,
1551 RCBit r) { 1214 RCBit r) {
1552 xo_form(EXT2 | DIVD, dst, src1, src2, o, r); 1215 xo_form(EXT2 | DIVD, dst, src1, src2, o, r);
1553 } 1216 }
1554 1217
1555 1218
1556 void Assembler::divdu(Register dst, Register src1, Register src2, OEBit o, 1219 void Assembler::divdu(Register dst, Register src1, Register src2, OEBit o,
1557 RCBit r) { 1220 RCBit r) {
1558 xo_form(EXT2 | DIVDU, dst, src1, src2, o, r); 1221 xo_form(EXT2 | DIVDU, dst, src1, src2, o, r);
1559 } 1222 }
1560
1561 void Assembler::modsd(Register rt, Register ra, Register rb) {
1562 x_form(EXT2 | MODSD, ra, rt, rb, LeaveRC);
1563 }
1564
1565 void Assembler::modud(Register rt, Register ra, Register rb) {
1566 x_form(EXT2 | MODUD, ra, rt, rb, LeaveRC);
1567 }
1568 #endif 1223 #endif
1569 1224
1570 1225
1571 // Function descriptor for AIX. 1226 // Function descriptor for AIX.
1572 // Code address skips the function descriptor "header". 1227 // Code address skips the function descriptor "header".
1573 // TOC and static chain are ignored and set to 0. 1228 // TOC and static chain are ignored and set to 0.
1574 void Assembler::function_descriptor() { 1229 void Assembler::function_descriptor() {
1575 if (ABI_USES_FUNCTION_DESCRIPTORS) { 1230 if (ABI_USES_FUNCTION_DESCRIPTORS) {
1576 Label instructions; 1231 Label instructions;
1577 DCHECK(pc_offset() == 0); 1232 DCHECK(pc_offset() == 0);
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
2005 int offset = src.offset(); 1660 int offset = src.offset();
2006 Register ra = src.ra(); 1661 Register ra = src.ra();
2007 DCHECK(!ra.is(r0)); 1662 DCHECK(!ra.is(r0));
2008 CHECK(is_int16(offset)); 1663 CHECK(is_int16(offset));
2009 int imm16 = offset & kImm16Mask; 1664 int imm16 = offset & kImm16Mask;
2010 // could be x_form instruction with some casting magic 1665 // could be x_form instruction with some casting magic
2011 emit(LFDU | frt.code() * B21 | ra.code() * B16 | imm16); 1666 emit(LFDU | frt.code() * B21 | ra.code() * B16 | imm16);
2012 } 1667 }
2013 1668
2014 1669
2015 void Assembler::lfdx(const DoubleRegister frt, const MemOperand& src) {
2016 Register ra = src.ra();
2017 Register rb = src.rb();
2018 DCHECK(!ra.is(r0));
2019 emit(EXT2 | LFDX | frt.code() * B21 | ra.code() * B16 | rb.code() * B11 |
2020 LeaveRC);
2021 }
2022
2023
2024 void Assembler::lfdux(const DoubleRegister frt, const MemOperand& src) {
2025 Register ra = src.ra();
2026 Register rb = src.rb();
2027 DCHECK(!ra.is(r0));
2028 emit(EXT2 | LFDUX | frt.code() * B21 | ra.code() * B16 | rb.code() * B11 |
2029 LeaveRC);
2030 }
2031
2032
2033 void Assembler::lfs(const DoubleRegister frt, const MemOperand& src) { 1670 void Assembler::lfs(const DoubleRegister frt, const MemOperand& src) {
2034 int offset = src.offset(); 1671 int offset = src.offset();
2035 Register ra = src.ra(); 1672 Register ra = src.ra();
2036 CHECK(is_int16(offset)); 1673 CHECK(is_int16(offset));
2037 DCHECK(!ra.is(r0)); 1674 DCHECK(!ra.is(r0));
2038 int imm16 = offset & kImm16Mask; 1675 int imm16 = offset & kImm16Mask;
2039 // could be x_form instruction with some casting magic 1676 // could be x_form instruction with some casting magic
2040 emit(LFS | frt.code() * B21 | ra.code() * B16 | imm16); 1677 emit(LFS | frt.code() * B21 | ra.code() * B16 | imm16);
2041 } 1678 }
2042 1679
2043 1680
2044 void Assembler::lfsu(const DoubleRegister frt, const MemOperand& src) { 1681 void Assembler::lfsu(const DoubleRegister frt, const MemOperand& src) {
2045 int offset = src.offset(); 1682 int offset = src.offset();
2046 Register ra = src.ra(); 1683 Register ra = src.ra();
2047 CHECK(is_int16(offset)); 1684 CHECK(is_int16(offset));
2048 DCHECK(!ra.is(r0)); 1685 DCHECK(!ra.is(r0));
2049 int imm16 = offset & kImm16Mask; 1686 int imm16 = offset & kImm16Mask;
2050 // could be x_form instruction with some casting magic 1687 // could be x_form instruction with some casting magic
2051 emit(LFSU | frt.code() * B21 | ra.code() * B16 | imm16); 1688 emit(LFSU | frt.code() * B21 | ra.code() * B16 | imm16);
2052 } 1689 }
2053 1690
2054 1691
2055 void Assembler::lfsx(const DoubleRegister frt, const MemOperand& src) {
2056 Register ra = src.ra();
2057 Register rb = src.rb();
2058 DCHECK(!ra.is(r0));
2059 emit(EXT2 | LFSX | frt.code() * B21 | ra.code() * B16 | rb.code() * B11 |
2060 LeaveRC);
2061 }
2062
2063
2064 void Assembler::lfsux(const DoubleRegister frt, const MemOperand& src) {
2065 Register ra = src.ra();
2066 Register rb = src.rb();
2067 DCHECK(!ra.is(r0));
2068 emit(EXT2 | LFSUX | frt.code() * B21 | ra.code() * B16 | rb.code() * B11 |
2069 LeaveRC);
2070 }
2071
2072
2073 void Assembler::stfd(const DoubleRegister frs, const MemOperand& src) { 1692 void Assembler::stfd(const DoubleRegister frs, const MemOperand& src) {
2074 int offset = src.offset(); 1693 int offset = src.offset();
2075 Register ra = src.ra(); 1694 Register ra = src.ra();
2076 CHECK(is_int16(offset)); 1695 CHECK(is_int16(offset));
2077 DCHECK(!ra.is(r0)); 1696 DCHECK(!ra.is(r0));
2078 int imm16 = offset & kImm16Mask; 1697 int imm16 = offset & kImm16Mask;
2079 // could be x_form instruction with some casting magic 1698 // could be x_form instruction with some casting magic
2080 emit(STFD | frs.code() * B21 | ra.code() * B16 | imm16); 1699 emit(STFD | frs.code() * B21 | ra.code() * B16 | imm16);
2081 } 1700 }
2082 1701
2083 1702
2084 void Assembler::stfdu(const DoubleRegister frs, const MemOperand& src) { 1703 void Assembler::stfdu(const DoubleRegister frs, const MemOperand& src) {
2085 int offset = src.offset(); 1704 int offset = src.offset();
2086 Register ra = src.ra(); 1705 Register ra = src.ra();
2087 CHECK(is_int16(offset)); 1706 CHECK(is_int16(offset));
2088 DCHECK(!ra.is(r0)); 1707 DCHECK(!ra.is(r0));
2089 int imm16 = offset & kImm16Mask; 1708 int imm16 = offset & kImm16Mask;
2090 // could be x_form instruction with some casting magic 1709 // could be x_form instruction with some casting magic
2091 emit(STFDU | frs.code() * B21 | ra.code() * B16 | imm16); 1710 emit(STFDU | frs.code() * B21 | ra.code() * B16 | imm16);
2092 } 1711 }
2093 1712
2094 1713
2095 void Assembler::stfdx(const DoubleRegister frs, const MemOperand& src) {
2096 Register ra = src.ra();
2097 Register rb = src.rb();
2098 DCHECK(!ra.is(r0));
2099 emit(EXT2 | STFDX | frs.code() * B21 | ra.code() * B16 | rb.code() * B11 |
2100 LeaveRC);
2101 }
2102
2103
2104 void Assembler::stfdux(const DoubleRegister frs, const MemOperand& src) {
2105 Register ra = src.ra();
2106 Register rb = src.rb();
2107 DCHECK(!ra.is(r0));
2108 emit(EXT2 | STFDUX | frs.code() * B21 | ra.code() * B16 | rb.code() * B11 |
2109 LeaveRC);
2110 }
2111
2112
2113 void Assembler::stfs(const DoubleRegister frs, const MemOperand& src) { 1714 void Assembler::stfs(const DoubleRegister frs, const MemOperand& src) {
2114 int offset = src.offset(); 1715 int offset = src.offset();
2115 Register ra = src.ra(); 1716 Register ra = src.ra();
2116 CHECK(is_int16(offset)); 1717 CHECK(is_int16(offset));
2117 DCHECK(!ra.is(r0)); 1718 DCHECK(!ra.is(r0));
2118 int imm16 = offset & kImm16Mask; 1719 int imm16 = offset & kImm16Mask;
2119 // could be x_form instruction with some casting magic 1720 // could be x_form instruction with some casting magic
2120 emit(STFS | frs.code() * B21 | ra.code() * B16 | imm16); 1721 emit(STFS | frs.code() * B21 | ra.code() * B16 | imm16);
2121 } 1722 }
2122 1723
2123 1724
2124 void Assembler::stfsu(const DoubleRegister frs, const MemOperand& src) { 1725 void Assembler::stfsu(const DoubleRegister frs, const MemOperand& src) {
2125 int offset = src.offset(); 1726 int offset = src.offset();
2126 Register ra = src.ra(); 1727 Register ra = src.ra();
2127 CHECK(is_int16(offset)); 1728 CHECK(is_int16(offset));
2128 DCHECK(!ra.is(r0)); 1729 DCHECK(!ra.is(r0));
2129 int imm16 = offset & kImm16Mask; 1730 int imm16 = offset & kImm16Mask;
2130 // could be x_form instruction with some casting magic 1731 // could be x_form instruction with some casting magic
2131 emit(STFSU | frs.code() * B21 | ra.code() * B16 | imm16); 1732 emit(STFSU | frs.code() * B21 | ra.code() * B16 | imm16);
2132 } 1733 }
2133 1734
2134 1735
2135 void Assembler::stfsx(const DoubleRegister frs, const MemOperand& src) {
2136 Register ra = src.ra();
2137 Register rb = src.rb();
2138 DCHECK(!ra.is(r0));
2139 emit(EXT2 | STFSX | frs.code() * B21 | ra.code() * B16 | rb.code() * B11 |
2140 LeaveRC);
2141 }
2142
2143
2144 void Assembler::stfsux(const DoubleRegister frs, const MemOperand& src) {
2145 Register ra = src.ra();
2146 Register rb = src.rb();
2147 DCHECK(!ra.is(r0));
2148 emit(EXT2 | STFSUX | frs.code() * B21 | ra.code() * B16 | rb.code() * B11 |
2149 LeaveRC);
2150 }
2151
2152
2153 void Assembler::fsub(const DoubleRegister frt, const DoubleRegister fra, 1736 void Assembler::fsub(const DoubleRegister frt, const DoubleRegister fra,
2154 const DoubleRegister frb, RCBit rc) { 1737 const DoubleRegister frb, RCBit rc) {
2155 a_form(EXT4 | FSUB, frt, fra, frb, rc); 1738 a_form(EXT4 | FSUB, frt, fra, frb, rc);
2156 } 1739 }
2157 1740
2158 1741
2159 void Assembler::fadd(const DoubleRegister frt, const DoubleRegister fra, 1742 void Assembler::fadd(const DoubleRegister frt, const DoubleRegister fra,
2160 const DoubleRegister frb, RCBit rc) { 1743 const DoubleRegister frb, RCBit rc) {
2161 a_form(EXT4 | FADD, frt, fra, frb, rc); 1744 a_form(EXT4 | FADD, frt, fra, frb, rc);
2162 } 1745 }
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
2554 } 2137 }
2555 2138
2556 void PatchingAssembler::FlushICache(Isolate* isolate) { 2139 void PatchingAssembler::FlushICache(Isolate* isolate) {
2557 Assembler::FlushICache(isolate, buffer_, buffer_size_ - kGap); 2140 Assembler::FlushICache(isolate, buffer_, buffer_size_ - kGap);
2558 } 2141 }
2559 2142
2560 } // namespace internal 2143 } // namespace internal
2561 } // namespace v8 2144 } // namespace v8
2562 2145
2563 #endif // V8_TARGET_ARCH_PPC 2146 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/ppc/assembler-ppc.h ('k') | src/ppc/constants-ppc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698