Re: [klibc 04/31] alpha support for klibc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Henderson wrote:
On Tue, Jun 27, 2006 at 10:17:04PM -0700, H. Peter Anvin wrote:
+# Special CFLAGS for the divide code
+DIVCFLAGS = $(KLIBCREQFLAGS) $(KLIBCARCHREQFLAGS) \
+	-O3 -fomit-frame-pointer -fcall-saved-1 -fcall-saved-2 \
+	-fcall-saved-3 -fcall-saved-4 -fcall-saved-5 -fcall-saved-6 \
+	-fcall-saved-7 -fcall-saved-8 -ffixed-15 -fcall-saved-16 \
+	-fcall-saved-17 -fcall-saved-18 -fcall-saved-19 -fcall-saved-20 \
+	-fcall-saved-21 -fcall-saved-22 -ffixed-23 -fcall-saved-24 \
+	-ffixed-25 -ffixed-27

These routines absolutely cannot be written in C.  The return value
goes in a different register, which you cannot modify via compiler
flags.  Please use the hand-coded assembly from linux/arch/alpha/lib/.


Funny, we had this discussion a couple of years ago...

What the above does is generate a calling convention with the right number of (various types of) registers. Then the Makefile swaps the registers that the compiler outputs. It's a bit of a hack, but it's reliable and works. The resulting code isn't as compact at divide.S, though.

However, I've tried to keep the code under the BSD license, mostly for the benefit of the standalone klibc version (static linkage being the norm, after all); so I don't want to crib kernel code unless the owner consents to relicensing. I have cribbed some NetBSD code in some places, though.

	-hpa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux