jcf-write.c (generate_bytecode_insns): Implement RSHIFT_EXPR of unsigned types using...
authorRoger Sayle <roger@eyesopen.com>
Tue, 1 Feb 2005 21:20:34 +0000 (21:20 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Tue, 1 Feb 2005 21:20:34 +0000 (21:20 +0000)
* jcf-write.c (generate_bytecode_insns): Implement RSHIFT_EXPR
of unsigned types using iushr and lushr JVM bytecodes.

From-SVN: r94560

gcc/java/ChangeLog
gcc/java/jcf-write.c

index 64e12fe61339c24427728619bfaeb82648b2910b..d8310a0db5d6f36c737b25d9d71b01bc66330a1d 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-01  Roger Sayle  <roger@eyesopen.com>
+
+       * jcf-write.c (generate_bytecode_insns): Implement RSHIFT_EXPR
+       of unsigned types using iushr and lushr JVM bytecodes.
+
 2005-02-02  Ranjit Mathew  <rmathew@hotmail.com>
 
        PR java/19738
index da8c6c99870eff0af8bb7ad00a10a192ffd9c7be..603eaa51ee951609c566782195db963991905d6d 100644 (file)
@@ -2146,7 +2146,9 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
       jopcode = OPCODE_irem;
       goto binop;
     case LSHIFT_EXPR:   jopcode = OPCODE_ishl;   goto binop;
-    case RSHIFT_EXPR:   jopcode = OPCODE_ishr;   goto binop;
+    case RSHIFT_EXPR:
+      jopcode = TYPE_UNSIGNED (type) ? OPCODE_iushr : OPCODE_ishr;
+      goto binop;
     case URSHIFT_EXPR:  jopcode = OPCODE_iushr;  goto binop;
     case TRUTH_AND_EXPR:
     case BIT_AND_EXPR:  jopcode = OPCODE_iand;   goto binop;