Revision 000a2d86 tcg/ppc/tcg-target.c
b/tcg/ppc/tcg-target.c | ||
---|---|---|
1113 | 1113 |
|
1114 | 1114 |
case INDEX_op_and_i32: |
1115 | 1115 |
if (const_args[2]) { |
1116 |
if (!args[2]) |
|
1117 |
tcg_out_movi (s, TCG_TYPE_I32, args[0], 0); |
|
1116 |
if ((args[2] & 0xffff) == args[2]) |
|
1117 |
tcg_out32 (s, ANDI | RS (args[1]) | RA (args[0]) | args[2]); |
|
1118 |
else if ((args[2] & 0xffff0000) == args[2]) |
|
1119 |
tcg_out32 (s, ANDIS | RS (args[1]) | RA (args[0]) |
|
1120 |
| ((args[2] >> 16) & 0xffff)); |
|
1118 | 1121 |
else { |
1119 |
if ((args[2] & 0xffff) == args[2]) |
|
1120 |
tcg_out32 (s, ANDI | RS (args[1]) | RA (args[0]) | args[2]); |
|
1121 |
else if ((args[2] & 0xffff0000) == args[2]) |
|
1122 |
tcg_out32 (s, ANDIS | RS (args[1]) | RA (args[0]) |
|
1123 |
| ((args[2] >> 16) & 0xffff)); |
|
1124 |
else if (args[2] == 0xffffffff) { |
|
1125 |
if (args[0] != args[1]) |
|
1126 |
tcg_out_mov (s, args[0], args[1]); |
|
1127 |
} |
|
1128 |
else { |
|
1129 |
tcg_out_movi (s, TCG_TYPE_I32, 0, args[2]); |
|
1130 |
tcg_out32 (s, AND | SAB (args[1], args[0], 0)); |
|
1131 |
} |
|
1122 |
tcg_out_movi (s, TCG_TYPE_I32, 0, args[2]); |
|
1123 |
tcg_out32 (s, AND | SAB (args[1], args[0], 0)); |
|
1132 | 1124 |
} |
1133 | 1125 |
} |
1134 | 1126 |
else |
... | ... | |
1136 | 1128 |
break; |
1137 | 1129 |
case INDEX_op_or_i32: |
1138 | 1130 |
if (const_args[2]) { |
1139 |
if (args[2]) { |
|
1140 |
if (args[2] & 0xffff) { |
|
1141 |
tcg_out32 (s, ORI | RS (args[1]) | RA (args[0]) |
|
1142 |
| (args[2] & 0xffff)); |
|
1143 |
if (args[2] >> 16) |
|
1144 |
tcg_out32 (s, ORIS | RS (args[0]) | RA (args[0]) |
|
1145 |
| ((args[2] >> 16) & 0xffff)); |
|
1146 |
} |
|
1147 |
else { |
|
1148 |
tcg_out32 (s, ORIS | RS (args[1]) | RA (args[0]) |
|
1131 |
if (args[2] & 0xffff) { |
|
1132 |
tcg_out32 (s, ORI | RS (args[1]) | RA (args[0]) |
|
1133 |
| (args[2] & 0xffff)); |
|
1134 |
if (args[2] >> 16) |
|
1135 |
tcg_out32 (s, ORIS | RS (args[0]) | RA (args[0]) |
|
1149 | 1136 |
| ((args[2] >> 16) & 0xffff)); |
1150 |
} |
|
1151 | 1137 |
} |
1152 | 1138 |
else { |
1153 |
if (args[0] != args[1])
|
|
1154 |
tcg_out_mov (s, args[0], args[1]);
|
|
1139 |
tcg_out32 (s, ORIS | RS (args[1]) | RA (args[0])
|
|
1140 |
| ((args[2] >> 16) & 0xffff));
|
|
1155 | 1141 |
} |
1156 | 1142 |
} |
1157 | 1143 |
else |
... | ... | |
1159 | 1145 |
break; |
1160 | 1146 |
case INDEX_op_xor_i32: |
1161 | 1147 |
if (const_args[2]) { |
1162 |
if (args[2]) { |
|
1163 |
if ((args[2] & 0xffff) == args[2]) |
|
1164 |
tcg_out32 (s, XORI | RS (args[1]) | RA (args[0]) |
|
1165 |
| (args[2] & 0xffff)); |
|
1166 |
else if ((args[2] & 0xffff0000) == args[2]) |
|
1167 |
tcg_out32 (s, XORIS | RS (args[1]) | RA (args[0]) |
|
1168 |
| ((args[2] >> 16) & 0xffff)); |
|
1169 |
else { |
|
1170 |
tcg_out_movi (s, TCG_TYPE_I32, 0, args[2]); |
|
1171 |
tcg_out32 (s, XOR | SAB (args[1], args[0], 0)); |
|
1172 |
} |
|
1173 |
} |
|
1148 |
if ((args[2] & 0xffff) == args[2]) |
|
1149 |
tcg_out32 (s, XORI | RS (args[1]) | RA (args[0]) |
|
1150 |
| (args[2] & 0xffff)); |
|
1151 |
else if ((args[2] & 0xffff0000) == args[2]) |
|
1152 |
tcg_out32 (s, XORIS | RS (args[1]) | RA (args[0]) |
|
1153 |
| ((args[2] >> 16) & 0xffff)); |
|
1174 | 1154 |
else { |
1175 |
if (args[0] != args[1])
|
|
1176 |
tcg_out_mov (s, args[0], args[1]);
|
|
1155 |
tcg_out_movi (s, TCG_TYPE_I32, 0, args[2]);
|
|
1156 |
tcg_out32 (s, XOR | SAB (args[1], args[0], 0));
|
|
1177 | 1157 |
} |
1178 | 1158 |
} |
1179 | 1159 |
else |
... | ... | |
1228 | 1208 |
|
1229 | 1209 |
case INDEX_op_shl_i32: |
1230 | 1210 |
if (const_args[2]) { |
1231 |
if (args[2]) |
|
1232 |
tcg_out32 (s, (RLWINM |
|
1233 |
| RA (args[0]) |
|
1234 |
| RS (args[1]) |
|
1235 |
| SH (args[2]) |
|
1236 |
| MB (0) |
|
1237 |
| ME (31 - args[2]) |
|
1238 |
) |
|
1239 |
); |
|
1240 |
else |
|
1241 |
tcg_out_mov (s, args[0], args[1]); |
|
1211 |
tcg_out32 (s, (RLWINM |
|
1212 |
| RA (args[0]) |
|
1213 |
| RS (args[1]) |
|
1214 |
| SH (args[2]) |
|
1215 |
| MB (0) |
|
1216 |
| ME (31 - args[2]) |
|
1217 |
) |
|
1218 |
); |
|
1242 | 1219 |
} |
1243 | 1220 |
else |
1244 | 1221 |
tcg_out32 (s, SLW | SAB (args[1], args[0], args[2])); |
1245 | 1222 |
break; |
1246 | 1223 |
case INDEX_op_shr_i32: |
1247 | 1224 |
if (const_args[2]) { |
1248 |
if (args[2]) |
|
1249 |
tcg_out32 (s, (RLWINM |
|
1250 |
| RA (args[0]) |
|
1251 |
| RS (args[1]) |
|
1252 |
| SH (32 - args[2]) |
|
1253 |
| MB (args[2]) |
|
1254 |
| ME (31) |
|
1255 |
) |
|
1256 |
); |
|
1257 |
else |
|
1258 |
tcg_out_mov (s, args[0], args[1]); |
|
1225 |
tcg_out32 (s, (RLWINM |
|
1226 |
| RA (args[0]) |
|
1227 |
| RS (args[1]) |
|
1228 |
| SH (32 - args[2]) |
|
1229 |
| MB (args[2]) |
|
1230 |
| ME (31) |
|
1231 |
) |
|
1232 |
); |
|
1259 | 1233 |
} |
1260 | 1234 |
else |
1261 | 1235 |
tcg_out32 (s, SRW | SAB (args[1], args[0], args[2])); |
Also available in: Unified diff