Commit 945ca823b9c5e3f99798d06f84939e610b362310
1 parent
a7ec4229
Add concat32_i64 and concat_tl_i64 ops
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5282 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
18 additions
and
0 deletions
tcg/README
| @@ -269,6 +269,10 @@ Truncate t1 (64 bit) to t0 (32 bit) | @@ -269,6 +269,10 @@ Truncate t1 (64 bit) to t0 (32 bit) | ||
| 269 | Construct t0 (64-bit) taking the low half from t1 (32 bit) and the high half | 269 | Construct t0 (64-bit) taking the low half from t1 (32 bit) and the high half |
| 270 | from t2 (32 bit). | 270 | from t2 (32 bit). |
| 271 | 271 | ||
| 272 | +* concat32_i64 t0, t1, t2 | ||
| 273 | +Construct t0 (64-bit) taking the low half from t1 (64 bit) and the high half | ||
| 274 | +from t2 (64 bit). | ||
| 275 | + | ||
| 272 | ********* Load/Store | 276 | ********* Load/Store |
| 273 | 277 | ||
| 274 | * ld_i32/i64 t0, t1, offset | 278 | * ld_i32/i64 t0, t1, offset |
tcg/tcg-op.h
| @@ -1412,6 +1412,18 @@ static inline void tcg_gen_concat_i32_i64(TCGv dest, TCGv low, TCGv high) | @@ -1412,6 +1412,18 @@ static inline void tcg_gen_concat_i32_i64(TCGv dest, TCGv low, TCGv high) | ||
| 1412 | #endif | 1412 | #endif |
| 1413 | } | 1413 | } |
| 1414 | 1414 | ||
| 1415 | +static inline void tcg_gen_concat32_i64(TCGv dest, TCGv low, TCGv high) | ||
| 1416 | +{ | ||
| 1417 | +#if TCG_TARGET_REG_BITS == 32 | ||
| 1418 | + tcg_gen_concat_i32_i64(dest, low, high); | ||
| 1419 | +#else | ||
| 1420 | + TCGv tmp = tcg_temp_new(TCG_TYPE_I64); | ||
| 1421 | + tcg_gen_shli_i64(tmp, high, 32); | ||
| 1422 | + tcg_gen_or_i64(dest, low, tmp); | ||
| 1423 | + tcg_temp_free(tmp); | ||
| 1424 | +#endif | ||
| 1425 | +} | ||
| 1426 | + | ||
| 1415 | /***************************************/ | 1427 | /***************************************/ |
| 1416 | /* QEMU specific operations. Their type depend on the QEMU CPU | 1428 | /* QEMU specific operations. Their type depend on the QEMU CPU |
| 1417 | type. */ | 1429 | type. */ |
| @@ -1664,6 +1676,7 @@ static inline void tcg_gen_qemu_st64(TCGv arg, TCGv addr, int mem_index) | @@ -1664,6 +1676,7 @@ static inline void tcg_gen_qemu_st64(TCGv arg, TCGv addr, int mem_index) | ||
| 1664 | #define tcg_gen_ext16s_tl tcg_gen_ext16s_i64 | 1676 | #define tcg_gen_ext16s_tl tcg_gen_ext16s_i64 |
| 1665 | #define tcg_gen_ext32u_tl tcg_gen_ext32u_i64 | 1677 | #define tcg_gen_ext32u_tl tcg_gen_ext32u_i64 |
| 1666 | #define tcg_gen_ext32s_tl tcg_gen_ext32s_i64 | 1678 | #define tcg_gen_ext32s_tl tcg_gen_ext32s_i64 |
| 1679 | +#define tcg_gen_concat_tl_i64 tcg_gen_concat32_i64 | ||
| 1667 | #define tcg_const_tl tcg_const_i64 | 1680 | #define tcg_const_tl tcg_const_i64 |
| 1668 | #else | 1681 | #else |
| 1669 | #define TCG_TYPE_TL TCG_TYPE_I32 | 1682 | #define TCG_TYPE_TL TCG_TYPE_I32 |
| @@ -1715,6 +1728,7 @@ static inline void tcg_gen_qemu_st64(TCGv arg, TCGv addr, int mem_index) | @@ -1715,6 +1728,7 @@ static inline void tcg_gen_qemu_st64(TCGv arg, TCGv addr, int mem_index) | ||
| 1715 | #define tcg_gen_ext16s_tl tcg_gen_ext16s_i32 | 1728 | #define tcg_gen_ext16s_tl tcg_gen_ext16s_i32 |
| 1716 | #define tcg_gen_ext32u_tl tcg_gen_mov_i32 | 1729 | #define tcg_gen_ext32u_tl tcg_gen_mov_i32 |
| 1717 | #define tcg_gen_ext32s_tl tcg_gen_mov_i32 | 1730 | #define tcg_gen_ext32s_tl tcg_gen_mov_i32 |
| 1731 | +#define tcg_gen_concat_tl_i64 tcg_gen_concat_i32_i64 | ||
| 1718 | #define tcg_const_tl tcg_const_i32 | 1732 | #define tcg_const_tl tcg_const_i32 |
| 1719 | #endif | 1733 | #endif |
| 1720 | 1734 |