This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cris.md: (define_attr "length" "" (const_int 2))


As described in
<URL:http://gcc.gnu.org/ml/gcc-patches/2005-04/msg00151.html>,
this has a quite unexpected positive effect on code size.
Actually, using 1 as mentioned there, is a teensy bit better
(like, fclose_r in newlib is 2 bytes shorter; two insns
combined), but less correct.  I expect more correct length
attribute settings for other insns to remedy that or else I'll
file a PR.

Committed.

	* config/cris/cris.md (attribute "length"): Define.

Index: cris.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/cris/cris.md,v
retrieving revision 1.25
diff -c -p -r1.25 cris.md
*** cris.md	3 Mar 2005 03:53:29 -0000	1.25
--- cris.md	2 Apr 2005 16:22:57 -0000
***************
*** 119,124 ****
--- 119,129 ----
  
  (define_attr "cc" "none,clobber,normal" (const_string "normal"))
  
+ ;; At the moment, this attribute is just used to help bb-reorder do its
+ ;; work; the default 0 doesn't help it.  Many insns have other lengths,
+ ;; though none are shorter.
+ (define_attr "length" "" (const_int 2))
+ 
  ;; A branch or return has one delay-slot.  The instruction in the
  ;; delay-slot is always executed, independent of whether the branch is
  ;; taken or not.  Note that besides setting "slottable" to "has_slot",

brgds, H-P


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]