Revision dce74c57
b/tcg/ppc64/tcg-target.c | ||
---|---|---|
527 | 527 |
} |
528 | 528 |
} |
529 | 529 |
|
530 |
static void tcg_out_zori32(TCGContext *s, TCGReg dst, TCGReg src, uint32_t c, |
|
531 |
int op_lo, int op_hi) |
|
532 |
{ |
|
533 |
if (c >> 16) { |
|
534 |
tcg_out32(s, op_hi | SAI(src, dst, c >> 16)); |
|
535 |
src = dst; |
|
536 |
} |
|
537 |
if (c & 0xffff) { |
|
538 |
tcg_out32(s, op_lo | SAI(src, dst, c)); |
|
539 |
src = dst; |
|
540 |
} |
|
541 |
} |
|
542 |
|
|
543 |
static void tcg_out_ori32(TCGContext *s, TCGReg dst, TCGReg src, uint32_t c) |
|
544 |
{ |
|
545 |
tcg_out_zori32(s, dst, src, c, ORI, ORIS); |
|
546 |
} |
|
547 |
|
|
548 |
static void tcg_out_xori32(TCGContext *s, TCGReg dst, TCGReg src, uint32_t c) |
|
549 |
{ |
|
550 |
tcg_out_zori32(s, dst, src, c, XORI, XORIS); |
|
551 |
} |
|
552 |
|
|
530 | 553 |
static void tcg_out_b (TCGContext *s, int mask, tcg_target_long target) |
531 | 554 |
{ |
532 | 555 |
tcg_target_long disp; |
... | ... | |
1349 | 1372 |
break; |
1350 | 1373 |
case INDEX_op_or_i64: |
1351 | 1374 |
case INDEX_op_or_i32: |
1375 |
a0 = args[0], a1 = args[1], a2 = args[2]; |
|
1352 | 1376 |
if (const_args[2]) { |
1353 |
if (args[2] & 0xffff) { |
|
1354 |
tcg_out32(s, ORI | SAI(args[1], args[0], args[2])); |
|
1355 |
if (args[2] >> 16) { |
|
1356 |
tcg_out32(s, ORIS | SAI(args[0], args[0], args[2] >> 16)); |
|
1357 |
} |
|
1358 |
} |
|
1359 |
else { |
|
1360 |
tcg_out32(s, ORIS | SAI(args[1], args[0], args[2] >> 16)); |
|
1361 |
} |
|
1377 |
tcg_out_ori32(s, a0, a1, a2); |
|
1378 |
} else { |
|
1379 |
tcg_out32(s, OR | SAB(a1, a0, a2)); |
|
1362 | 1380 |
} |
1363 |
else |
|
1364 |
tcg_out32 (s, OR | SAB (args[1], args[0], args[2])); |
|
1365 | 1381 |
break; |
1366 | 1382 |
case INDEX_op_xor_i64: |
1367 | 1383 |
case INDEX_op_xor_i32: |
1384 |
a0 = args[0], a1 = args[1], a2 = args[2]; |
|
1368 | 1385 |
if (const_args[2]) { |
1369 |
if ((args[2] & 0xffff) == args[2]) { |
|
1370 |
tcg_out32(s, XORI | SAI(args[1], args[0], args[2])); |
|
1371 |
} else if ((args[2] & 0xffff0000) == args[2]) { |
|
1372 |
tcg_out32(s, XORIS | SAI(args[1], args[0], args[2] >> 16)); |
|
1373 |
} else { |
|
1374 |
tcg_out_movi (s, (opc == INDEX_op_and_i32 |
|
1375 |
? TCG_TYPE_I32 |
|
1376 |
: TCG_TYPE_I64), |
|
1377 |
0, args[2]); |
|
1378 |
tcg_out32 (s, XOR | SAB (args[1], args[0], 0)); |
|
1379 |
} |
|
1386 |
tcg_out_xori32(s, a0, a1, a2); |
|
1387 |
} else { |
|
1388 |
tcg_out32(s, XOR | SAB(a1, a0, a2)); |
|
1380 | 1389 |
} |
1381 |
else |
|
1382 |
tcg_out32 (s, XOR | SAB (args[1], args[0], args[2])); |
|
1383 | 1390 |
break; |
1384 | 1391 |
|
1385 | 1392 |
case INDEX_op_mul_i32: |
Also available in: Unified diff