Skip to contentSkip to conversation

ARM: Add comments why -msoft-float is used.

PATCH New Alexander Holler 3 participants 8 messages Feb 20, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: Add comments why -msoft-float is used.

Without -msoft-float the compiler would be allowed to use certain floating-point instructions (VFP/NEON) e.g. for optimizations, which would require additional code, for example to save contexts for interrupts. Add a comment which describes this in short words.

---
 arch/arm/cpu/arm1136/config.mk           |    2 ++
 arch/arm/cpu/arm1176/config.mk           |    2 ++
 arch/arm/cpu/arm1176/s3c64xx/config.mk   |    2 ++
 arch/arm/cpu/arm720t/config.mk           |    1 +
 arch/arm/cpu/arm920t/config.mk           |    1 +
 arch/arm/cpu/arm925t/config.mk           |    1 +
 arch/arm/cpu/arm926ejs/config.mk         |    1 +
 arch/arm/cpu/arm926ejs/davinci/config.mk |    1 +
 arch/arm/cpu/arm946es/config.mk          |    1 +
 arch/arm/cpu/arm_intcm/config.mk         |    1 +
 arch/arm/cpu/armv7/config.mk             |    2 ++
 arch/arm/cpu/armv7/omap-common/config.mk |    2 ++
 arch/arm/cpu/ixp/config.mk               |    1 +
 arch/arm/cpu/lh7a40x/config.mk           |    1 +
 arch/arm/cpu/pxa/config.mk               |    1 +
 arch/arm/cpu/s3c44b0/config.mk           |    1 +
 arch/arm/cpu/sa1100/config.mk            |    1 +
 17 files changed, 22 insertions(+), 0 deletions(-)
arch/arm/cpu/arm1136/config.mk +2 -0
index 3e68535..e2c32c0 100644
@@ -20,6 +20,8 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
 #
+
+# -msoft-float forces the compiler to not use any fp-related instructions.
 PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
 
 # Make ARMv5 to allow more compilers to work, even though its v6.
arch/arm/cpu/arm1176/config.mk +2 -0
index 14346cf..a9a36b4 100644
@@ -20,6 +20,8 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
 #
+
+# -msoft-float forces the compiler to not use any fp-related instructions.
 PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
 
 # Make ARMv5 to allow more compilers to work, even though its v6.
arch/arm/cpu/arm1176/s3c64xx/config.mk +2 -0
index 14346cf..a9a36b4 100644
@@ -20,6 +20,8 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
 #
+
+# -msoft-float forces the compiler to not use any fp-related instructions.
 PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
 
 # Make ARMv5 to allow more compilers to work, even though its v6.
arch/arm/cpu/arm720t/config.mk +1 -0
index 3844c62..1d59f60 100644
@@ -22,6 +22,7 @@
 # MA 02111-1307 USA
 #
 
+# -msoft-float forces the compiler to not use any fp-related instructions.
 PLATFORM_RELFLAGS +=  -fno-common -ffixed-r8 -msoft-float
 
 PLATFORM_CPPFLAGS += -march=armv4 -mtune=arm7tdmi
arch/arm/cpu/arm920t/config.mk +1 -0
index 8f6c1a3..b595088 100644
@@ -21,6 +21,7 @@
 # MA 02111-1307 USA
 #
 
+# -msoft-float forces the compiler to not use any fp-related instructions.
 PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
 
 PLATFORM_CPPFLAGS += -march=armv4
arch/arm/cpu/arm925t/config.mk +1 -0
index 8f6c1a3..b595088 100644
@@ -21,6 +21,7 @@
 # MA 02111-1307 USA
 #
 
+# -msoft-float forces the compiler to not use any fp-related instructions.
 PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
 
 PLATFORM_CPPFLAGS += -march=armv4
arch/arm/cpu/arm926ejs/config.mk +1 -0
index f8ef90f..fb83862 100644
@@ -21,6 +21,7 @@
 # MA 02111-1307 USA
 #
 
+# -msoft-float forces the compiler to not use any fp-related instructions.
 PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
 
 PLATFORM_CPPFLAGS += -march=armv5te
arch/arm/cpu/arm926ejs/davinci/config.mk +1 -0
index 565adda..081c13d 100644
@@ -21,6 +21,7 @@
 # MA 02111-1307 USA
 #
 
+# -msoft-float forces the compiler to not use any fp-related instructions.
 PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
 
 PLATFORM_CPPFLAGS += -march=armv5te
arch/arm/cpu/arm946es/config.mk +1 -0
index e783f69..f7db925 100644
@@ -21,6 +21,7 @@
 # MA 02111-1307 USA
 #
 
+# -msoft-float forces the compiler to not use any fp-related instructions.
 PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
 
 PLATFORM_CPPFLAGS +=  -march=armv4
arch/arm/cpu/arm_intcm/config.mk +1 -0
index e783f69..f7db925 100644
@@ -21,6 +21,7 @@
 # MA 02111-1307 USA
 #
 
+# -msoft-float forces the compiler to not use any fp-related instructions.
 PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
 
 PLATFORM_CPPFLAGS +=  -march=armv4
arch/arm/cpu/armv7/config.mk +2 -0
index 49ac9c7..03ec32b 100644
@@ -20,6 +20,8 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
 #
+
+# -msoft-float forces the compiler to not use any fp-related instructions.
 PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
 
 # Make ARMv5 to allow more compilers to work, even though its v7a.
arch/arm/cpu/armv7/omap-common/config.mk +2 -0
index 49ac9c7..03ec32b 100644
@@ -20,6 +20,8 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
 #
+
+# -msoft-float forces the compiler to not use any fp-related instructions.
 PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
 
 # Make ARMv5 to allow more compilers to work, even though its v7a.
arch/arm/cpu/ixp/config.mk +1 -0
index deca3f4..9634615 100644
@@ -24,6 +24,7 @@
 
 BIG_ENDIAN = y
 
+# -msoft-float forces the compiler to not use any fp-related instructions.
 PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float -mbig-endian
 
 PLATFORM_CPPFLAGS += -mbig-endian -march=armv5te -mtune=strongarm1100
arch/arm/cpu/lh7a40x/config.mk +1 -0
index 47b2b7b..6c4fa54 100644
@@ -21,6 +21,7 @@
 # MA 02111-1307 USA
 #
 
+# -msoft-float forces the compiler to not use any fp-related instructions.
 PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
 
 PLATFORM_CPPFLAGS += -march=armv4
arch/arm/cpu/pxa/config.mk +1 -0
index a05d69c..45405d6 100644
@@ -22,6 +22,7 @@
 # MA 02111-1307 USA
 #
 
+# -msoft-float forces the compiler to not use any fp-related instructions.
 PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
 
 PLATFORM_CPPFLAGS += -march=armv5te -mtune=xscale
arch/arm/cpu/s3c44b0/config.mk +1 -0
index 7454d72..6a374a7 100644
@@ -22,6 +22,7 @@
 # MA 02111-1307 USA
 #
 
+# -msoft-float forces the compiler to not use any fp-related instructions.
 PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
 
 PLATFORM_CPPFLAGS += -march=armv4 -mtune=arm7tdmi -msoft-float
arch/arm/cpu/sa1100/config.mk +1 -0
index 6f21f41..e52e8b0 100644
@@ -22,6 +22,7 @@
 # MA 02111-1307 USA
 #
 
+# -msoft-float forces the compiler to not use any fp-related instructions.
 PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
 
 PLATFORM_CPPFLAGS += -march=armv4 -mtune=strongarm1100
Signature · 1 line
1.7.3.4
#1 lore raw

PATCH 1/1 ARM: Add comments why -msoft-float is used.

Dear Alexander Holler,

Quoted 4 lines · In message <[email protected]> you wrote:

Without -msoft-float the compiler would be allowed to use certain floating-point instructions (VFP/NEON) e.g. for optimizations, which would require additional code, for example to save contexts for interrupts. Add a comment which describes this in short words.

Hm... why do you see a need to explain this for ARM, but not so for the other architectrures, say for PowerPC?

If you really want to add this, then it should probably be somewhere in the REAME or another central place of documentation (instead of distributed over tons of Makefiles), and to make your message understood you might want to add "additional code" may mean that additional function blocks in the respective SoC may need to be initialized and, for example, clocked, which may for example significantly increase the power dissipation of the system.

Quoted 1 line

+# -msoft-float forces the compiler to not use any fp-related instructions.

Well, now this is a commonplace that says about nothing and can be leftout as well.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"How is this place run - is it an anarchy?"
"No, I wouldn't say so; it is not that well organised..."
#2 lore raw

PATCH 1/1 ARM: Add comments why -msoft-float is used.

Am 20.02.2011 09:42, schrieb Wolfgang Denk:

Quoted 10 lines

Dear Alexander Holler,

Quoted 4 lines · In message<[email protected]> you wrote:

Without -msoft-float the compiler would be allowed to use certain floating-point instructions (VFP/NEON) e.g. for optimizations, which would require additional code, for example to save contexts for interrupts. Add a comment which describes this in short words.

Hm... why do you see a need to explain this for ARM, but not so for the other architectrures, say for PowerPC?

I don't know how other the compiler behaves for other architectures and if those are having the need to save fp-contexts for irqs.

Quoted 4 lines

If you really want to add this, then it should probably be somewhere in the REAME or another central place of documentation (instead of distributed over tons of Makefiles), and to make your message

I prefer comments where they are usefull. Hiding them somewhere is useless.

Quoted 9 lines

understood you might want to add "additional code" may mean that additional function blocks in the respective SoC may need to be initialized and, for example, clocked, which may for example significantly increase the power dissipation of the system.

Quoted 1 line

+# -msoft-float forces the compiler to not use any fp-related instructions.

Well, now this is a commonplace that says about nothing and can be leftout as well.

# -msoft-float forces the compiler to avoid any fp-related instructions for optimizations.

Would that be better?

Regards,

Alexander

#3 lore raw

PATCH 1/1 ARM: Add comments why -msoft-float is used.

Am 20.02.2011 10:39, schrieb Alexander Holler:

Quoted 4 lines

# -msoft-float forces the compiler to avoid any fp-related instructions for optimizations.

Would that be better?

Anyway, I don't care about that patch. I now know the reason. ;)

Btw, isn't soft-float useless on ARM when armv5 is used as architecture?

Regards,

Alexander

#4 lore raw

PATCH 1/1 ARM: Add comments why -msoft-float is used.

Am 20.02.2011 10:52, schrieb Alexander Holler:

Quoted 10 lines

Am 20.02.2011 10:39, schrieb Alexander Holler:

Quoted 4 lines

# -msoft-float forces the compiler to avoid any fp-related instructions for optimizations.

Would that be better?

Anyway, I don't care about that patch. I now know the reason. ;)

Btw, isn't soft-float useless on ARM when armv5 is used as architecture?

To answer myself: No.

See
http://www.arm.com/products/processors/technologies/vector-floating-point.php

Regards,

Alexander

#5 lore raw

PATCH 1/1 ARM: Add comments why -msoft-float is used.

In reply to Alexander Holler

Dear Alexander Holler,

Quoted 3 lines · In message <[email protected]> you wrote:

I don't know how other the compiler behaves for other architectures and if those are having the need to save fp-contexts for irqs.

I thought I had explained this again in recent postings, not to mention the times I did that before; you probably can find this in the archives.

Quoted 4 lines

# -msoft-float forces the compiler to avoid any fp-related instructions for optimizations.

Would that be better?

No, not at all, because the only additional information about what -msoft-float does (not using FP instructions) in the "for optimizations" part - but that does not help much if you don;t have the background we discussed here again.

So if you want to document this, then please provide a more complete explanation about the reasons for using -msoft-float, summarizing the recent discussion.

Keep in mind that it does not only apply to ARM Makefiles, but to all other architectures as well. And instead of adding it to all ~30 affected files (which also gives no guarantee that it will be documented in any newly created config.mk files), please add it to some central doc file - either to the README, or feel free to create a doc/README.toolchain or similar that can then also be used to document things like linker options, information about known issues, etc.

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Remember, an int is not always 16 bits. I'm  not  sure,  but  if  the
80386  is one step closer to Intel's slugfest with the CPU curve that
is aymptotically approaching a real machine, perhaps an int has  been
implemented as 32 bits by some Unix vendors...?       - Derek Terveer
#6 lore raw

PATCH 1/1 ARM: Add comments why -msoft-float is used.

Quoted 3 lines · Wolfgang Denk

[...] or feel free to create a doc/README.toolchain or similar that can then also be used to document things like linker options, information about known issues, etc.

+1 for a README.toolchain file.

Signature · 1 line
Eric Cooper             e c c @ c m u . e d u
#7 lore raw

PATCH 1/1 ARM: Add comments why -msoft-float is used.

In reply to Wolfgang Denk
Quoted 1 line · Wolfgang Denk

No, not at all, because the only additional information about what

Thanks, at least I tried it.

Regards,

Alexander