summary refs log tree commit diff stats
path: root/tcg/optimize.c
diff options
context:
space:
mode:
authorAnthony Liguori <anthony@codemonkey.ws>2013-10-09 07:50:37 -0700
committerAnthony Liguori <anthony@codemonkey.ws>2013-10-09 07:51:23 -0700
commitce079abb410d685d48c1285bc6749d9b23c78c5c (patch)
tree3947e0b5939a542437995a711a182ee4311bde29 /tcg/optimize.c
parent0e19885e736938c3f6bd8c139eca00728bb24384 (diff)
parent3df2b8fde949be86d8a78923c992fdd698d4ea4c (diff)
downloadfocaccia-qemu-ce079abb410d685d48c1285bc6749d9b23c78c5c.tar.gz
focaccia-qemu-ce079abb410d685d48c1285bc6749d9b23c78c5c.zip
Merge remote-tracking branch 'sweil/tci' into staging
# By Stefan Weil
# Via Stefan Weil
* sweil/tci:
  misc: Use new rotate functions
  bitops: Add rotate functions (rol8, ror8, ...)
  tci: Add implementation of rotl_i64, rotr_i64

Message-id: 1380137693-3729-1-git-send-email-sw@weilnetz.de
Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
Diffstat (limited to 'tcg/optimize.c')
-rw-r--r--tcg/optimize.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/tcg/optimize.c b/tcg/optimize.c
index b29bf25b67..89e2d6a3b3 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -238,20 +238,16 @@ static TCGArg do_constant_folding_2(TCGOpcode op, TCGArg x, TCGArg y)
         return (int64_t)x >> (int64_t)y;
 
     case INDEX_op_rotr_i32:
-        x = ((uint32_t)x << (32 - y)) | ((uint32_t)x >> y);
-        return x;
+        return ror32(x, y);
 
     case INDEX_op_rotr_i64:
-        x = ((uint64_t)x << (64 - y)) | ((uint64_t)x >> y);
-        return x;
+        return ror64(x, y);
 
     case INDEX_op_rotl_i32:
-        x = ((uint32_t)x << y) | ((uint32_t)x >> (32 - y));
-        return x;
+        return rol32(x, y);
 
     case INDEX_op_rotl_i64:
-        x = ((uint64_t)x << y) | ((uint64_t)x >> (64 - y));
-        return x;
+        return rol64(x, y);
 
     CASE_OP_32_64(not):
         return ~x;