This is the mail archive of the gcc-bugs@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]

Re: Irix6 long doubles implemented wrong? (27_io/ostream_inserter_arith)


 > From: Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
 > 
 > There's the MIPS Processor ABI Conformance Guide Version 3.0 Draft 4
 > (dated: July 18, 1997) a.k.a. The Black Book.  It used to be available from
 > www.mipsabi.org, but this site has been closed down when the MIPS ABI group
 > dissolved.  I couldn't locate a copy on the Web, but have a local copy
 > here.  Maybe SGI could make it available again?  Their Dave Anderson has
 > always been quite helpful getting all sorts of ABI and toolset information.
 > 
 > Here's the relevant section from Appendix D: Platform Implementation Notes,
 > D4-5:


Thanks!  That was exactly what I needed.  Here's something I'm
currently testing.  I think I'm on the right track, my preliminary
tests shows it works and yields timing results comparable to cc.

Notes:

1.  Rainer's list included the following functions for which I
    couldn't glean a corresponding optabs entry:

long double __q_floti( int16_t ); 3
long double __q_flotju( uint32_t ); 3
long double __q_flotku( uint64_t ); 3
long double __q_neg( double, double ); 3
int16_t __ii_qint( double, double ); 3

2.  Conversely, there were several optabs TF entries for which I couldn't
    determine something in the irix libc list.  There were:

unordtf2_libfunc
floattitf_libfunc
fixtfti_libfunc
fixunstfti_libfunc
cmp_optab->handlers[(int) TFmode].libfunc (E.g. set by gofast)

3.  I notice neither irix nor optabs seems to have functions to
    convert *unsigned* ints to floating points.  Yet it seems to
    work.  Perhaps the C promotion rules mandate some intermediate
    type conversion that already exists.


Anyway, any comments on the notes or the patch?  Thanks.


diff -rup orig/egcc-3.3-CVS20030127/gcc/config/mips/iris6.h egcc-3.3-CVS20030127/gcc/config/mips/iris6.h
--- orig/egcc-3.3-CVS20030127/gcc/config/mips/iris6.h	2003-01-27 22:31:46.000000000 -0500
+++ egcc-3.3-CVS20030127/gcc/config/mips/iris6.h	2003-01-28 16:27:13.521707000 -0500
@@ -511,3 +511,31 @@ do {									 \
 %{mabi=32: -32}%{mabi=n32: -n32}%{mabi=64: -64}%{!mabi*: -n32}"
 
 #define MIPS_TFMODE_FORMAT ibm_extended_format
+
+#define INIT_NATIVE_TFP_OPTABS \
+do { \
+  add_optab->handlers[(int) TFmode].libfunc = init_one_libfunc ("__q_add"); \
+  sub_optab->handlers[(int) TFmode].libfunc = init_one_libfunc ("__q_sub"); \
+  smul_optab->handlers[(int) TFmode].libfunc = init_one_libfunc ("__q_mul"); \
+  sdiv_optab->handlers[(int) TFmode].libfunc = init_one_libfunc ("__q_div"); \
+\
+  extendsftf2_libfunc = init_one_libfunc ("__q_ext"); \
+  extenddftf2_libfunc = init_one_libfunc ("__q_extd"); \
+  trunctfsf2_libfunc = init_one_libfunc ("__sngl_q"); \
+  trunctfdf2_libfunc = init_one_libfunc ("__dble_q"); \
+\
+  eqtf2_libfunc = init_one_libfunc ("__q_eq"); \
+  netf2_libfunc = init_one_libfunc ("__q_ne"); \
+  gttf2_libfunc = init_one_libfunc ("__q_gt"); \
+  getf2_libfunc = init_one_libfunc ("__q_ge"); \
+  lttf2_libfunc = init_one_libfunc ("__q_lt"); \
+  letf2_libfunc = init_one_libfunc ("__q_le"); \
+\
+  fixtfsi_libfunc = init_one_libfunc ("__ji_qint"); \
+  fixtfdi_libfunc = init_one_libfunc ("__ki_qint"); \
+  fixunstfsi_libfunc = init_one_libfunc ("__ji_quint"); \
+  fixunstfdi_libfunc = init_one_libfunc ("__ki_quint"); \
+\
+  floatsitf_libfunc = init_one_libfunc ("__q_flotj"); \
+  floatditf_libfunc = init_one_libfunc ("__q_flotk"); \
+} while (0)
diff -rup orig/egcc-3.3-CVS20030127/gcc/config.gcc egcc-3.3-CVS20030127/gcc/config.gcc
--- orig/egcc-3.3-CVS20030127/gcc/config.gcc	2003-01-04 17:00:25.000000000 -0500
+++ egcc-3.3-CVS20030127/gcc/config.gcc	2003-01-28 14:39:51.670349000 -0500
@@ -2879,6 +2879,7 @@ mips*-*-*)
 		tm_file="gofast.h $tm_file"
 		tmake_file="mips/t-gofast $tmake_file"
 	else
+		tm_defines="INIT_SUBTARGET_OPTABS=INIT_NATIVE_TFP_OPTABS $tm_defines"
 		tmake_file="mips/t-mips $tmake_file"
 	fi
 	;;


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