home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / gnu / gcc / help / 2577 < prev    next >
Encoding:
Internet Message Format  |  1992-11-22  |  2.0 KB

  1. Path: sparky!uunet!cis.ohio-state.edu!ucbvax!ucdavis!alder.eecs.ucdavis.edu!kong
  2. From: kong@ece.ucdavis.edu (Timothy Kong)
  3. Newsgroups: gnu.gcc.help
  4. Subject: help needed in gcc 2.3.1 instruction scheduling
  5. Message-ID: <19512@ucdavis.ucdavis.edu>
  6. Date: 22 Nov 92 23:56:17 GMT
  7. Sender: usenet@ucdavis.ucdavis.edu
  8. Organization: U.C. Davis - Department of Electrical Engineering and Computer Science
  9. Lines: 43
  10. Originator: kong@alder.eecs.ucdavis.edu
  11.  
  12. I am using gcc 2.3.1 to schedule code for a variant of the R4000
  13. that includes two types of loads/stores:
  14.  
  15. load/store        ; take 1 cycle  in function unit "memory" 
  16. load_type2/store_type2    ; take 2 cycles in function unit "memory" 
  17.  
  18. Thus, any type of load/store that immediately follows a _type2 causes
  19. a structure hazard in the memory unit.
  20.  
  21. I created the following description of the function unit "memory":
  22.  
  23.   (define_function_unit "memory" 1 0 (eq_attr "type" "load_type2,load")
  24.     2 2 [(eq_attr "type" "load_type2,store_type2")])
  25.     
  26.   (define_function_unit "memory" 1 0 (eq_attr "type" "store_type2,store")
  27.     1 2 [(eq_attr "type" "load_type2,store_type2")])
  28.     
  29. I also added the constraint T and a subroutine to test for T in the
  30. machine description, as shown in the following example:
  31.  
  32.   (define_insn "movsi_usw"
  33.     [(set (match_operand:SI 0 "memory_operand" "=T,=R,o")
  34.        (unspec [(match_operand:SI 1 "reg_or_0_operand" "dJ,dJ,dJ")] 0))]
  35.  
  36.     <unmodified code deleted>
  37.  
  38.    [(set_attr "type"     "store_type2,store,store")
  39.     (set_attr "mode"     "SI")
  40.     (set_attr "length"   "2,2,4")])
  41.  
  42. For this example case, an instruction matching constraint T is 
  43. classified as a store_type2. From a -dp debugging dump, type2 
  44. loads/stores seem to be correctly classified.  However, these changes 
  45. have zero effect on the code scheduling.
  46.  
  47. Is this approach valid?  Are there other valid approaches to this or a
  48. similar problem?  Are there known bugs with the new code scheduler that
  49. might cause this modification to have no effect?
  50.  
  51. Any assistance would be appreciated.
  52.  
  53. Timothy Kong
  54. kong@eecs.ucdavis.edu
  55.