[patch] PowerPC ieee float tests

Tom Rix trix@redhat.com
Sat Feb 2 13:48:00 GMT 2002


Dale Johannesen wrote:

> On Saturday, February 2, 2002, at 12:11 PM, Tom Rix wrote:
>
> > PowerPC uses 64 bit floating point registers which causes the ieee float
> > tests to fail.  This patch appends -ffloat-store to the test flags.   It
> > also cleans up other targets doing the same thing.
>
> I don't think this is right.  These tests have been passing on Darwin
> (ppc32)
> "forever", and it doesn't look like anybody has hacked the ieee.exp
> file locally to make this happen.

This is  a regression wrt  GnuPro branch that I work on.   In the dim past
-ffloat-store was always appended to every target.  From ChangeLog this was
8/13/1998,  it was limited to only x86  7/22/2001.   You should check if your
ieee.exp is up to date.

The test I looked at specifically is 980619-1.  Fairly simple, count how may
divides by two does it take to get a 1.0 to go to 0.   I have included a dump
of the assembly.  Since this calculation is being done in   64 bit registers,
it takes 53 iterations instead of the expected 24.

> Perhaps you mean Power, which didn'thave the single-precision instructions?

This is powerpc-ibm-aix4.3.3.0.

Tom

--
Tom Rix
GCC Engineer
trix@redhat.com


-------------- next part --------------
	.file	"980619-1.c"
	.toc
	.csect .text[PR]
	.toc
LC..0:
	.tc FS_3f800000[TC],0x3f800000		1.0
LC..1:	
	.tc FS_3f000000[TC],0x3f000000		0.5
	.csect .text[PR]
	.align 2
	.globl main
	.globl .main
	.csect main[DS]
main:
	.long .main, TOC[tc0], 0
	.csect .text[PR]
.main:
	.extern __mulh
	.extern __mull
	.extern __divss
	.extern __divus
	.extern __quoss
	.extern __quous
	lfs 13,LC..0(2)		f13 = 1.0
	mflr 0
	li 9,0
	lfs 11,LC..1(2)		f11 = 0.5
	stw 0,8(1)
	fmr 12,13		f12 = 1.0
	stwu 1,-56(1)
L..6:
	fmul 13,13,11		f13 = f13 * 0.5
	addi 9,9,1
	fadd 0,13,12		f0 = 1.0 + f13
	fcmpu 0,0,12
	bne+ 0,L..6		continue until f0 == 1.0 
	cmpwi 0,9,24
	beq- 0,L..9
	bl .abort
	nop
L..9:
	li 3,0
	bl .exit
	nop
LT..main:
	.long 0
	.byte 0,0,32,65,128,0,0,0
	.long LT..main-.main
	.short 4
	.byte "main"
_section_.text:
	.csect .data[RW],3
	.long _section_.text


More information about the Gcc-patches mailing list