This is the mail archive of the cgen@sources.redhat.com mailing list for the CGEN project.


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

CGEN: RFA: More CGEN_INT_INSN_P Work


Hi,

Ports for which CGEN_INT_INSN_P is 1 pass both the base insn bits
as well as the entire insn to the decode function. The generated
code goes on to extract fields which start within the base insn
bits from the entire insn, however the generated code currently
passes base-insn-bitsize instead of the total length of the insn
to the EXTRACT_* macros. This results in incorrect shift values
being computed, so the fields are extracted incorrectly.

The attached patch passes the actual length of the insn when
CGEN_INT_INSN_P is 1. I tested it against two internal ports
(same ones as last time) Both have CGEN_INT_INSN_P==1. One of
them has fixed length insns which are 32 bits in length, the
other has 16 bit and 32 bit insn (the port revealing the problem.
I also tested against m32r (CGEN_INT_INSN_P==1 and
base-insn-bitsize < max-insn-bitsize) and fr30
(CGEN_INT_INSN_P==0)

OK to commit?

Dave
2000-08-28  Dave Brolley  <brolley@redhat.com>

	* utils-gen.scm (gen-ifld-extract): Pass total-len if
	adata-integral-insn is true for this architecture.




	
Index: utils-gen.scm
===================================================================
RCS file: /cvs/src/src/cgen/utils-gen.scm,v
retrieving revision 1.1.1.1
diff -c -p -r1.1.1.1 utils-gen.scm
*** utils-gen.scm	2000/07/28 04:11:52	1.1.1.1
--- utils-gen.scm	2000/08/28 21:21:57
***************
*** 222,228 ****
     " = "
     (if (ifld-beyond-base? f base-length total-length)
         (-gen-ifld-extract-beyond f base-length total-length var-list)
!        (-gen-ifld-extract-base f (min base-length total-length) base-value))
     ";"
     (if macro? " \\\n" "\n")
     )
--- 222,232 ----
     " = "
     (if (ifld-beyond-base? f base-length total-length)
         (-gen-ifld-extract-beyond f base-length total-length var-list)
!        (-gen-ifld-extract-base f 
! 			       (if (adata-integral-insn? CURRENT-ARCH)
! 				   total-length
! 				   (min base-length total-length))
! 			       base-value))
     ";"
     (if macro? " \\\n" "\n")
     )

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