[commit] Add some rtl operations to SID

Dave Brolley <[email protected]>
Newsgroups gmane.comp.tools.cgen.devel,gmane.comp.emulators.sid.devel
Message-ID <[email protected]>
Hi,

I've committed the attached patch which adds some operations that were 
needed by an internal port.

Dave
sid-ops.ChangeLog (text/plain, 138 B)
2005-02-16  Dave Brolley  <[email protected]>

	* cgen-ops.h (RUNCBIBI): New macro.
	(ADDOFQI): New function.
	(SUBOFQI): New function.
sid-ops.patch.txt (text/plain, 1.3 KB)
Index: sid/component/cgen-cpu/cgen-ops.h
===================================================================
RCS file: /cvs/src/src/sid/component/cgen-cpu/cgen-ops.h,v
retrieving revision 1.11
diff -c -p -r1.11 cgen-ops.h
*** sid/component/cgen-cpu/cgen-ops.h	13 Jun 2003 19:58:08 -0000	1.11
--- sid/component/cgen-cpu/cgen-ops.h	16 Feb 2005 21:15:43 -0000
*************** namespace cgen {
*** 251,256 ****
--- 251,257 ----
  #define ZEXTSIDI(x) ((DI) (USI) (x))
  #define ZEXTDIDI(x) ((UDI) (x))
  
+ #define TRUNCBIBI(x) ((BI) (x))
  #define TRUNCQIBI(x) ((BI) (QI) (x))
  #define TRUNCQIQI(x) ((QI) (x))
  #define TRUNCHIBI(x) ((BI) (HI) (x))
*************** ADDCFDI (DI a, DI b, BI c)
*** 407,412 ****
--- 408,422 ----
  }
  
  inline BI
+ ADDOFQI (QI a, QI b, BI c)
+ {
+   QI tmp = ADDQI (a, ADDQI (b, c));
+   BI res = (((a < 0) == (b < 0))
+ 	    && ((a < 0) != (tmp < 0)));
+   return res;
+ }
+ 
+ inline BI
  ADDOFHI (HI a, HI b, BI c)
  {
    HI tmp = ADDHI (a, ADDHI (b, c));
*************** SUBCFSI (SI a, SI b, BI c)
*** 477,482 ****
--- 487,501 ----
  }
  
  inline BI
+ SUBOFQI (QI a, QI b, BI c)
+ {
+   QI tmp = SUBQI (a, ADDQI (b, c));
+   BI res = (((a < 0) != (b < 0))
+ 	    && ((a < 0) != (tmp < 0)));
+   return res;
+ }
+ 
+ inline BI
  SUBOFHI (HI a, HI b, BI c)
  {
    HI tmp = SUBHI (a, ADDHI (b, c));
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.