public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* QFmode float support  missing from optabs?
@ 2002-02-20  9:08 Alan Lehotsky
  2002-02-20 14:13 ` Richard Henderson
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Lehotsky @ 2002-02-20  9:08 UTC (permalink / raw)
  To: gcc

I've got a machine with 32 bit bytes and want to support software single-precision FP
(it's only got 4k words of control-store ANYWAY).

"int" maps onto QImode, so float should map to QFmode.  But there are SEVERAL problems, and
I'm wondering if my solution is acceptable as a patch.

Right now in optabs.c, there are checks for HFmode, SFmode, DFmode, XFmode, etc. but no corresponding
checks for QFmode (this is in places that do conversions between float and int).  Similarly, there are no
entries in the libfuncs.h enumeration for QF compare routines, viz LTI_equqf2.

I've patched these in, and had to make one or two other changes (for example, there's code that wants to
hard-wire extending any GET_MODE_SIZE(mode) argument that's smaller than GET_MODE_SIZE(SImode) to
an SImode argument before calling certain library functions - but SImode is a 128-bit mode on my machine.

Specifically, in expand_float() and expand_fix() (in optabs.c), there's a line

	if (GET_MODE_SIZE (GET_MODE (from)) < GET_MODE_SIZE (SImode))

that I think should be

	if (GET_MODE_BITSIZE (GET_MODE (from)) < INT_TYPE_SIZE)

There aren't a lot of machines with BITS_PER_UNIT of 32, and the C4X seems to have double-precision
FP (their floats are HFmode)  So, I can only really test the patch with my developmental port and
"confirm" that it doesn't break anything in a vanilla port like the SPARC or x86.



-- 
------------------------------------------------------------------------

		    Quality Software Management
		http://home.earthlink.net/~qsmgmt
			apl@alum.mit.edu
			(978)287-0435 Voice
			(978)808-6836 Cell
			(978)287-0436 Fax

	Software Process Improvement and Management Consulting
	     Language Design and Compiler Implementation

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: QFmode float support  missing from optabs?
  2002-02-20  9:08 QFmode float support missing from optabs? Alan Lehotsky
@ 2002-02-20 14:13 ` Richard Henderson
  2002-02-20 14:54   ` Alan Lehotsky
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Henderson @ 2002-02-20 14:13 UTC (permalink / raw)
  To: Alan Lehotsky; +Cc: gcc

On Wed, Feb 20, 2002 at 11:41:41AM -0500, Alan Lehotsky wrote:
> Right now in optabs.c, there are checks for HFmode, SFmode, DFmode,
> XFmode, etc. but no corresponding checks for QFmode...

I'm curious that this works for c4x but not your target?


r~

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: QFmode float support  missing from optabs?
  2002-02-20 14:13 ` Richard Henderson
@ 2002-02-20 14:54   ` Alan Lehotsky
  2002-02-20 15:31     ` Richard Henderson
  2002-02-20 22:59     ` Michael Hayes
  0 siblings, 2 replies; 6+ messages in thread
From: Alan Lehotsky @ 2002-02-20 14:54 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Alan Lehotsky, gcc

At 2:10 PM -0800 2/20/02, Richard Henderson wrote:

>On Wed, Feb 20, 2002 at 11:41:41AM -0500, Alan Lehotsky wrote:
>> Right now in optabs.c, there are checks for HFmode, SFmode, DFmode,
>> XFmode, etc. but no corresponding checks for QFmode...
>
>I'm curious that this works for c4x but not your target?
>
>r~

	I think it's partly that c4x is using HFmode (two 32 bit bytes), and partly because they've
	got define_expands for most of the QF mode things.   Including doing libcalls directly
	in the backend. Maybe Michael Hayes will chime in on this?

	The c4x port also defines some of the things that are normally in the libfuncs tables as private
	copies and initializes them in the INIT_TARGET_OPTABS, even though the global symbols are
	declared in the backend and apparently not used by the optabs directly.

	My machine is STRICTLY software floating point.

	I could use the c4x workarounds at a large increase in pain, but fixing the optabs is IMHO
	a better solution.....

	-- Al

-- 
------------------------------------------------------------------------

		    Quality Software Management
		http://home.earthlink.net/~qsmgmt
			apl@alum.mit.edu
			(978)287-0435 Voice
			(978)808-6836 Cell
			(978)287-0436 Fax

	Software Process Improvement and Management Consulting
	     Language Design and Compiler Implementation

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: QFmode float support  missing from optabs?
  2002-02-20 14:54   ` Alan Lehotsky
@ 2002-02-20 15:31     ` Richard Henderson
  2002-02-20 15:47       ` Alan Lehotsky
  2002-02-20 22:59     ` Michael Hayes
  1 sibling, 1 reply; 6+ messages in thread
From: Richard Henderson @ 2002-02-20 15:31 UTC (permalink / raw)
  To: Alan Lehotsky; +Cc: gcc

On Wed, Feb 20, 2002 at 05:34:40PM -0500, Alan Lehotsky wrote:
> I think it's partly that c4x is using HFmode (two 32 bit bytes), and
> partly because they've got define_expands for most of the QFmode things.
> Including doing libcalls directly in the backend.

Oh, so the bug is in the part of optabs that generates libcalls?
That makes more sense.  Yes, we can fix all of this.


r~

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: QFmode float support  missing from optabs?
  2002-02-20 15:31     ` Richard Henderson
@ 2002-02-20 15:47       ` Alan Lehotsky
  0 siblings, 0 replies; 6+ messages in thread
From: Alan Lehotsky @ 2002-02-20 15:47 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Alan Lehotsky, gcc

At 3:19 PM -0800 2/20/02, Richard Henderson wrote:

>On Wed, Feb 20, 2002 at 05:34:40PM -0500, Alan Lehotsky wrote:
>> I think it's partly that c4x is using HFmode (two 32 bit bytes), and
>> partly because they've got define_expands for most of the QFmode things.
>> Including doing libcalls directly in the backend.
>
>Oh, so the bug is in the part of optabs that generates libcalls?
>That makes more sense.  Yes, we can fix all of this.
>
>
>r~


	Okay.  I'll write up the patch and build a SPARC target to show that it doesn't break anything vanilla
	(and my target to show that it does the right thing....)

-- Al



-- 
------------------------------------------------------------------------

		    Quality Software Management
		http://home.earthlink.net/~qsmgmt
			apl@alum.mit.edu
			(978)287-0435 Voice
			(978)808-6836 Cell
			(978)287-0436 Fax

	Software Process Improvement and Management Consulting
	     Language Design and Compiler Implementation

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: QFmode float support  missing from optabs?
  2002-02-20 14:54   ` Alan Lehotsky
  2002-02-20 15:31     ` Richard Henderson
@ 2002-02-20 22:59     ` Michael Hayes
  1 sibling, 0 replies; 6+ messages in thread
From: Michael Hayes @ 2002-02-20 22:59 UTC (permalink / raw)
  To: Alan Lehotsky; +Cc: Richard Henderson, gcc

Alan Lehotsky writes:
 > 
 > I think it's partly that c4x is using HFmode (two 32 bit
 > bytes), and partly because they've got define_expands for most of
 > the QF mode things.  Including doing libcalls directly in the
 > backend. Maybe Michael Hayes will chime in on this?

No, we use QFmode for floats/doubles and HFmode for long double.

Expanders are used for most patterns to ensure that the operand
combinations are valid.

Michael.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-02-21  4:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-20  9:08 QFmode float support missing from optabs? Alan Lehotsky
2002-02-20 14:13 ` Richard Henderson
2002-02-20 14:54   ` Alan Lehotsky
2002-02-20 15:31     ` Richard Henderson
2002-02-20 15:47       ` Alan Lehotsky
2002-02-20 22:59     ` Michael Hayes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).