Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
asomers
PostPosted: Dec 15, 2010 - 04:53 PM
Rookie


Joined: Dec 13, 2010
Posts: 35


When I try to compile a trivial floating point routine with -mhard-float, gcc crashes with an "internal compiler error". The file works fine without -mhard-float. I have reproduced this problem on both Ubuntu 10.04 amd64 and Windows XP SP3 x86. Does avr32-gcc's floating point support work at all? I opened a trouble ticket at support.atmel.no, but it has received no attention.

somers@tryptophan:~/ctest/avr32$ avr32-gcc --version
avr32-gcc (-(Linux-i386)) 4.3.2

somers@tryptophan:~/ctest/avr32$ avr32-gcc -mhard-float -c -o myfadd.o myfadd.c
myfadd.c: In function 'myfadd':
myfadd.c:3: error: insn does not satisfy its constraints:
(insn 34 17 36 myfadd.c:2 (set (reg:SF 16 f15)
(reg:SF 5 r10 [48])) 11 {*movsf_internal} (nil))
myfadd.c:3: internal compiler error: in note_invalid_constants, at config/avr32/avr32.c:6411
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://www.atmel.com/avr32> for instructions.

$ cat ~/ctest/avr32/myfadd.c
float myfadd(float x, float y){
return x + y;
}
 
 View user's profile Send private message  
Reply with quote Back to top
hce
PostPosted: Dec 15, 2010 - 06:26 PM
Raving lunatic


Joined: Jan 07, 2003
Posts: 4580
Location: Oslo, Norway

The AVR32 port of GCC does not support hardware floats. There is even only one AVR32 cpu family that has a hardware FPU, and that is UC3C.
 
 View user's profile Send private message  
Reply with quote Back to top
asomers
PostPosted: Dec 15, 2010 - 09:05 PM
Rookie


Joined: Dec 13, 2010
Posts: 35


If it does not support hardware floats, it should abort with a suitable message when you pass -mhard-float. It should never crash; that is a bug.

Google found this document for me: http://distribute.atmel.no/tools/avr32/ ... readme.pdf . It claims that the AVR32 gnu toolchain v3.1.0.166 supports hard floats. However, I can't figure out how to download it. Version 2.4.2 is the only version that I can find on your website. Could you tell me where to download it?

Hardware floating point is a seriously exciting feature in the UC3C: it's biggest selling point in my opinion. Renesas RX is the only other chip that can compete. I'm very excited to use it and I hope that this project works out.
 
 View user's profile Send private message  
Reply with quote Back to top
hce
PostPosted: Dec 15, 2010 - 09:13 PM
Raving lunatic


Joined: Jan 07, 2003
Posts: 4580
Location: Oslo, Norway

Quote:
Version 2.4.2 is the only version that I can find on your website. Could you tell me where to download it?
Grab the latest AVR32 Studio from http://www.atmel.no/beta_ware/ it comes with the toolchain as a plugin.

Quote:
Hardware floating point is a seriously exciting feature in the UC3C: it's biggest selling point in my opinion. Renesas RX is the only other chip that can compete. I'm very excited to use it and I hope that this project works out.
If the toolchain in AVR32 Studio 2.7 doesn't work for you, it might be an option to test out IAR just to evaluate.
 
 View user's profile Send private message  
Reply with quote Back to top
asomers
PostPosted: Dec 15, 2010 - 10:59 PM
Rookie


Joined: Dec 13, 2010
Posts: 35


SOLVED. As hce says, to use the FPU with avr32-gcc, you need the beta release of AVR32 Studio (sorry, no standalone toolchain right now) from http://www.atmel.no/beta_ware/ . Note also that avr32-gcc will silently revert to soft floats unless you specific an FPU-equipped part with --mpart. Example:

avr32-gcc -mhard-float -mpart=uc3c264c -c -o float.o float.c
 
 View user's profile Send private message  
Reply with quote Back to top
hce
PostPosted: Dec 16, 2010 - 06:20 AM
Raving lunatic


Joined: Jan 07, 2003
Posts: 4580
Location: Oslo, Norway

You can compile more generic as well, by setting -march=ucr3fp.
 
 View user's profile Send private message  
Reply with quote Back to top
PerIves
PostPosted: Feb 10, 2011 - 03:53 PM
Rookie


Joined: Aug 07, 2007
Posts: 30


Here is the toolchain that I have when installing AVR32Studio 2.7:
avr32-gcc (AVR_Toolchain_3.0_124) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

The option that you indicate -march=ucr3fp does not work. Only the previous one -mhard-float is working.

Any idea?
 
 View user's profile Send private message  
Reply with quote Back to top
asomers
PostPosted: Feb 11, 2011 - 02:37 AM
Rookie


Joined: Dec 13, 2010
Posts: 35


It works for me using the below command line. What exactly are you trying to do?

avr32-gcc -march=ucr3fp -mhard-float -c -o float.o float.c
 
 View user's profile Send private message  
Reply with quote Back to top
PerIves
PostPosted: Feb 11, 2011 - 02:51 PM
Rookie


Joined: Aug 07, 2007
Posts: 30


Sorry I used the wrong GCC version.
With the AVR32Studio 2.7, here is the report of $avr32-gcc --version command
avr32-gcc (AVR_Toolchain_3.1.0_166) 4.3.3
And it works!
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits