* [Qemu-devel] [4525] small shift opts
@ 2008-05-22 13:25 Fabrice Bellard
0 siblings, 0 replies; only message in thread
From: Fabrice Bellard @ 2008-05-22 13:25 UTC (permalink / raw)
To: qemu-devel
Revision: 4525
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4525
Author: bellard
Date: 2008-05-22 13:25:14 +0000 (Thu, 22 May 2008)
Log Message:
-----------
small shift opts
Modified Paths:
--------------
trunk/tcg/tcg-op.h
Modified: trunk/tcg/tcg-op.h
===================================================================
--- trunk/tcg/tcg-op.h 2008-05-22 12:36:31 UTC (rev 4524)
+++ trunk/tcg/tcg-op.h 2008-05-22 13:25:14 UTC (rev 4525)
@@ -404,7 +404,11 @@
static inline void tcg_gen_shli_i32(TCGv ret, TCGv arg1, int32_t arg2)
{
- tcg_gen_shl_i32(ret, arg1, tcg_const_i32(arg2));
+ if (arg2 == 0) {
+ tcg_gen_mov_i32(ret, arg1);
+ } else {
+ tcg_gen_shl_i32(ret, arg1, tcg_const_i32(arg2));
+ }
}
static inline void tcg_gen_shr_i32(TCGv ret, TCGv arg1, TCGv arg2)
@@ -414,7 +418,11 @@
static inline void tcg_gen_shri_i32(TCGv ret, TCGv arg1, int32_t arg2)
{
- tcg_gen_shr_i32(ret, arg1, tcg_const_i32(arg2));
+ if (arg2 == 0) {
+ tcg_gen_mov_i32(ret, arg1);
+ } else {
+ tcg_gen_shr_i32(ret, arg1, tcg_const_i32(arg2));
+ }
}
static inline void tcg_gen_sar_i32(TCGv ret, TCGv arg1, TCGv arg2)
@@ -424,7 +432,11 @@
static inline void tcg_gen_sari_i32(TCGv ret, TCGv arg1, int32_t arg2)
{
- tcg_gen_sar_i32(ret, arg1, tcg_const_i32(arg2));
+ if (arg2 == 0) {
+ tcg_gen_mov_i32(ret, arg1);
+ } else {
+ tcg_gen_sar_i32(ret, arg1, tcg_const_i32(arg2));
+ }
}
static inline void tcg_gen_brcond_i32(int cond, TCGv arg1, TCGv arg2,
@@ -862,7 +874,11 @@
static inline void tcg_gen_shli_i64(TCGv ret, TCGv arg1, int64_t arg2)
{
- tcg_gen_shl_i64(ret, arg1, tcg_const_i64(arg2));
+ if (arg2 == 0) {
+ tcg_gen_mov_i64(ret, arg1);
+ } else {
+ tcg_gen_shl_i64(ret, arg1, tcg_const_i64(arg2));
+ }
}
static inline void tcg_gen_shr_i64(TCGv ret, TCGv arg1, TCGv arg2)
@@ -872,7 +888,11 @@
static inline void tcg_gen_shri_i64(TCGv ret, TCGv arg1, int64_t arg2)
{
- tcg_gen_shr_i64(ret, arg1, tcg_const_i64(arg2));
+ if (arg2 == 0) {
+ tcg_gen_mov_i64(ret, arg1);
+ } else {
+ tcg_gen_shr_i64(ret, arg1, tcg_const_i64(arg2));
+ }
}
static inline void tcg_gen_sar_i64(TCGv ret, TCGv arg1, TCGv arg2)
@@ -882,7 +902,11 @@
static inline void tcg_gen_sari_i64(TCGv ret, TCGv arg1, int64_t arg2)
{
- tcg_gen_sar_i64(ret, arg1, tcg_const_i64(arg2));
+ if (arg2 == 0) {
+ tcg_gen_mov_i64(ret, arg1);
+ } else {
+ tcg_gen_sar_i64(ret, arg1, tcg_const_i64(arg2));
+ }
}
static inline void tcg_gen_brcond_i64(int cond, TCGv arg1, TCGv arg2,
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-05-22 13:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-22 13:25 [Qemu-devel] [4525] small shift opts Fabrice Bellard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).