OSDN Git Service

* jcf-write.c (generate_bytecode_insns): Implement RSHIFT_EXPR
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Feb 2005 21:20:34 +0000 (21:20 +0000)
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Feb 2005 21:20:34 +0000 (21:20 +0000)
of unsigned types using iushr and lushr JVM bytecodes.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94560 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 64e12fe..d8310a0 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 da8c6c9..603eaa5 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;