Commit f730fd27b8e358efb3f7b31a564ecc6b1543b689

Authored by ths
1 parent 653ccb80

Add helpers and shorthands for mul and muli operations.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4319 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 19 additions and 0 deletions
tcg/tcg-op.h
... ... @@ -438,6 +438,11 @@ static inline void tcg_gen_mul_i32(TCGv ret, TCGv arg1, TCGv arg2)
438 438 tcg_gen_op3(INDEX_op_mul_i32, ret, arg1, arg2);
439 439 }
440 440  
  441 +static inline void tcg_gen_muli_i32(TCGv ret, TCGv arg1, int32_t arg2)
  442 +{
  443 + tcg_gen_mul_i32(ret, arg1, tcg_const_i32(arg2));
  444 +}
  445 +
441 446 #ifdef TCG_TARGET_HAS_div_i32
442 447 static inline void tcg_gen_div_i32(TCGv ret, TCGv arg1, TCGv arg2)
443 448 {
... ... @@ -698,6 +703,11 @@ static inline void tcg_gen_mul_i64(TCGv ret, TCGv arg1, TCGv arg2)
698 703 tcg_gen_mov_i64(ret, t0);
699 704 }
700 705  
  706 +static inline void tcg_gen_muli_i64(TCGv ret, TCGv arg1, int64_t arg2)
  707 +{
  708 + tcg_gen_mul_i64(ret, arg1, tcg_const_i64(arg2));
  709 +}
  710 +
701 711 static inline void tcg_gen_div_i64(TCGv ret, TCGv arg1, TCGv arg2)
702 712 {
703 713 tcg_gen_helper_1_2(tcg_helper_div_i64, ret, arg1, arg2);
... ... @@ -886,6 +896,11 @@ static inline void tcg_gen_mul_i64(TCGv ret, TCGv arg1, TCGv arg2)
886 896 tcg_gen_op3(INDEX_op_mul_i64, ret, arg1, arg2);
887 897 }
888 898  
  899 +static inline void tcg_gen_muli_i64(TCGv ret, TCGv arg1, int64_t arg2)
  900 +{
  901 + tcg_gen_mul_i64(ret, arg1, tcg_const_i64(arg2));
  902 +}
  903 +
889 904 #ifdef TCG_TARGET_HAS_div_i64
890 905 static inline void tcg_gen_div_i64(TCGv ret, TCGv arg1, TCGv arg2)
891 906 {
... ... @@ -1395,6 +1410,8 @@ static inline void tcg_gen_qemu_st64(TCGv arg, TCGv addr, int mem_index)
1395 1410 #define tcg_gen_sar_tl tcg_gen_sar_i64
1396 1411 #define tcg_gen_sari_tl tcg_gen_sari_i64
1397 1412 #define tcg_gen_brcond_tl tcg_gen_brcond_i64
  1413 +#define tcg_gen_mul_tl tcg_gen_mul_i64
  1414 +#define tcg_gen_muli_tl tcg_gen_muli_i64
1398 1415 #define tcg_gen_discard_tl tcg_gen_discard_i64
1399 1416 #define tcg_gen_trunc_tl_i32 tcg_gen_trunc_i64_i32
1400 1417 #define tcg_gen_trunc_i64_tl tcg_gen_mov_i64
... ... @@ -1435,6 +1452,8 @@ static inline void tcg_gen_qemu_st64(TCGv arg, TCGv addr, int mem_index)
1435 1452 #define tcg_gen_sar_tl tcg_gen_sar_i32
1436 1453 #define tcg_gen_sari_tl tcg_gen_sari_i32
1437 1454 #define tcg_gen_brcond_tl tcg_gen_brcond_i32
  1455 +#define tcg_gen_mul_tl tcg_gen_mul_i32
  1456 +#define tcg_gen_muli_tl tcg_gen_muli_i32
1438 1457 #define tcg_gen_discard_tl tcg_gen_discard_i32
1439 1458 #define tcg_gen_trunc_tl_i32 tcg_gen_mov_i32
1440 1459 #define tcg_gen_trunc_i64_tl tcg_gen_trunc_i64_i32
... ...