This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] h8300.c: Don't do GET_MODE_MASK by hand.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 05 Apr 2003 21:19:04 -0500 (EST)
- Subject: [patch] h8300.c: Don't do GET_MODE_MASK by hand.
Hi,
Attached is a patch to stop doing GET_MODE_MASK by hand in
single_one_operand and single_zero_operand.
Tested on h8300 port. Committed.
Kazu Hirata
2003-04-05 Kazu Hirata <kazu at cs dot umass dot edu>
* config/h8300/h8300.c (single_one_operand): Use GET_MODE_MASK.
(single_zero_operand): Likewise.
Index: h8300.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.c,v
retrieving revision 1.224
diff -c -r1.224 h8300.c
*** h8300.c 4 Apr 2003 22:01:42 -0000 1.224
--- h8300.c 5 Apr 2003 19:30:26 -0000
***************
*** 757,769 ****
{
/* We really need to do this masking because 0x80 in QImode is
represented as -128 for example. */
! unsigned HOST_WIDE_INT mask =
! (GET_MODE_BITSIZE (mode) < HOST_BITS_PER_WIDE_INT)
! ? ((unsigned HOST_WIDE_INT) 1 << GET_MODE_BITSIZE (mode)) - 1
! : ~(unsigned HOST_WIDE_INT) 0;
! unsigned HOST_WIDE_INT value = INTVAL (operand);
!
! if (exact_log2 (value & mask) >= 0)
return 1;
}
--- 757,763 ----
{
/* We really need to do this masking because 0x80 in QImode is
represented as -128 for example. */
! if (exact_log2 (INTVAL (operand) & GET_MODE_MASK (mode)) >= 0)
return 1;
}
***************
*** 782,794 ****
{
/* We really need to do this masking because 0x80 in QImode is
represented as -128 for example. */
! unsigned HOST_WIDE_INT mask =
! (GET_MODE_BITSIZE (mode) < HOST_BITS_PER_WIDE_INT)
! ? ((unsigned HOST_WIDE_INT) 1 << GET_MODE_BITSIZE (mode)) - 1
! : ~(unsigned HOST_WIDE_INT) 0;
! unsigned HOST_WIDE_INT value = INTVAL (operand);
!
! if (exact_log2 (~value & mask) >= 0)
return 1;
}
--- 776,782 ----
{
/* We really need to do this masking because 0x80 in QImode is
represented as -128 for example. */
! if (exact_log2 (~INTVAL (operand) & GET_MODE_MASK (mode)) >= 0)
return 1;
}