right shift of signed type
Nathan Sidwell
nathan@codesourcery.com
Mon Apr 10 07:21:00 GMT 2000
Jeff,
thanks for confirming.
Jeffrey A Law wrote:
> > /* Right shift operations, for machines where these are not the same
> > as left shifting with a negative argument. */
> I believe this comment is out of date.
In that case is the following patch ok?
nathan
--
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
2000-04-10 Nathan Sidwell <nathan@codesourcery.com>
* rtl.def (ASHIFT, ROTATE, ASHIFTRT, LSHIFTRT, ROTATERT):
Recomment.
* tree.def (LSHIFT_EXPR, RSHIFT_EXPR): Recomment.
Index: rtl.def
===================================================================
RCS file: /cvs/gcc/egcs/gcc/rtl.def,v
retrieving revision 1.32
diff -c -3 -p -r1.32 rtl.def
*** rtl.def 2000/04/07 09:24:45 1.32
--- rtl.def 2000/04/10 10:41:55
*************** DEF_RTL_EXPR(NOT, "not", "e", '1')
*** 688,702 ****
/* Operand:
0: value to be shifted.
1: number of bits. */
! DEF_RTL_EXPR(ASHIFT, "ashift", "ee", '2')
! DEF_RTL_EXPR(ROTATE, "rotate", "ee", '2')
!
! /* Right shift operations, for machines where these are not the same
! as left shifting with a negative argument. */
!
! DEF_RTL_EXPR(ASHIFTRT, "ashiftrt", "ee", '2')
! DEF_RTL_EXPR(LSHIFTRT, "lshiftrt", "ee", '2')
! DEF_RTL_EXPR(ROTATERT, "rotatert", "ee", '2')
/* Minimum and maximum values of two operands. We need both signed and
unsigned forms. (We cannot use MIN for SMIN because it conflicts
--- 688,698 ----
/* Operand:
0: value to be shifted.
1: number of bits. */
! DEF_RTL_EXPR(ASHIFT, "ashift", "ee", '2') /* shift left */
! DEF_RTL_EXPR(ROTATE, "rotate", "ee", '2') /* rotate left */
! DEF_RTL_EXPR(ASHIFTRT, "ashiftrt", "ee", '2') /* arithmetic shift right */
! DEF_RTL_EXPR(LSHIFTRT, "lshiftrt", "ee", '2') /* logical shift right */
! DEF_RTL_EXPR(ROTATERT, "rotatert", "ee", '2') /* rotate right */
/* Minimum and maximum values of two operands. We need both signed and
unsigned forms. (We cannot use MIN for SMIN because it conflicts
Index: tree.def
===================================================================
RCS file: /cvs/gcc/egcs/gcc/tree.def,v
retrieving revision 1.30
diff -c -3 -p -r1.30 tree.def
*** tree.def 2000/03/06 09:50:17 1.30
--- tree.def 2000/04/10 10:41:55
*************** DEFTREECODE (ABS_EXPR, "abs_expr", '1',
*** 602,609 ****
DEFTREECODE (FFS_EXPR, "ffs_expr", '1', 1)
/* Shift operations for shift and rotate.
! Shift is supposed to mean logical shift if done on an
! unsigned type, arithmetic shift on a signed type.
The second operand is the number of bits to
shift by; it need not be the same type as the first operand and result. */
DEFTREECODE (LSHIFT_EXPR, "lshift_expr", '2', 2)
--- 602,609 ----
DEFTREECODE (FFS_EXPR, "ffs_expr", '1', 1)
/* Shift operations for shift and rotate.
! Shift means logical shift if done on an
! unsigned type, arithmetic shift if done on a signed type.
The second operand is the number of bits to
shift by; it need not be the same type as the first operand and result. */
DEFTREECODE (LSHIFT_EXPR, "lshift_expr", '2', 2)
More information about the Gcc-patches
mailing list