diff options
author | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2008-01-08 22:00:37 +0000 |
---|---|---|
committer | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2008-01-08 22:00:37 +0000 |
commit | b0b8de7fe5678ae1ebdc61d723a3a225a943b06a (patch) | |
tree | b99fcc7e58dd53cd6878806b4fb5df0d866f9d88 | |
parent | a00275c5437dcfe8e949b2465779f165be3cd666 (diff) | |
download | fpc-b0b8de7fe5678ae1ebdc61d723a3a225a943b06a.tar.gz |
* perform double->single-conversion-before-storing workaround for
fpu bug on some ppc's depending on the selected target cpu type
rather than depending on whether we're compiling for 64 bit
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@9685 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r-- | compiler/ppcgen/cgppc.pas | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/compiler/ppcgen/cgppc.pas b/compiler/ppcgen/cgppc.pas index d520416c94..50a7b9da85 100644 --- a/compiler/ppcgen/cgppc.pas +++ b/compiler/ppcgen/cgppc.pas @@ -532,9 +532,7 @@ unit cgppc; var op: tasmop; ref2: treference; -{$ifndef cpu64bit} reg2: tregister; -{$endif cpu64bit} begin if not(fromsize in [OS_F32,OS_F64]) or @@ -543,17 +541,17 @@ unit cgppc; ref2 := ref; fixref(list,ref2); op := fpustoreinstr[tosize,ref2.index <> NR_NO,false]; -{$ifndef cpu64bit} - { some ppc's have a bug whereby storing a double to memory } + + { some PPCs have a bug whereby storing a double to memory } { as single corrupts the value -> convert double to single } - { first } - if (tosize < fromsize) then + { first (bug confirmed on some G4s, but not on G5s) } + if (tosize < fromsize) and + (current_settings.cputype < cpu_PPC970) then begin reg2:=getfpuregister(list,tosize); a_loadfpu_reg_reg(list,fromsize,tosize,reg,reg2); reg:=reg2; end; -{$endif not cpu64bit} a_load_store(list,op,reg,ref2); end; |