9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "rob pike" <rob@plan9.bell-labs.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] p9/linux/fbsd compiler shootout
Date: Tue, 26 Feb 2002 09:18:36 -0500	[thread overview]
Message-ID: <c1a1c2a6f971c9fbe256fe84f23cb152@plan9.bell-labs.com> (raw)

Again, and strongly, there was little effort made to make the Plan 9
C compilers generate good floating point code.  I predict much less
difference using normal, integer code - such as the kernel - which
did receive some optimization attention.

Also, the kernel spends most of its time in memmove and memset,
both of which are written in assembler and therefore are not affected
by the compiler.  I doubt the quality of complation of the kernel has a
minor effect on runtime of the compiler itself.

Russ Cox points out that:

	the linux guys
	decided that the default floating-point
	precision should be 80-bit in-register
	precision but with 64-bit in-memory
	precision.  i realize that this is sometimes
	desirable if you know what you're doing,
	but they made it the default.  so code 
	ends up behaving differently (usually
	incorrectly) based on what gcc registerizes
	and what overflows into memory.

	#include <stdio.h>
	#include <stdlib.h>
	#include <math.h>
	
	void
	main(void)
	{
		double x, y;
	
		x = sqrt(3.0);
		y = sqrt(3.0) - x;
	
		if(y)
			printf("buggered\n");
	}



-rob



             reply	other threads:[~2002-02-26 14:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-26 14:18 rob pike [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-02-26 15:02 andrey mirtchovski
2002-02-26 16:02 ` Wilhelm B. Kloke
2002-02-26 18:00   ` splite
2002-02-26 16:04 ` Matt H
2002-03-04 10:04 ` Gaute B Strokkenes
2002-02-26 14:20 rob pike
2002-02-26 16:07 ` Sean Quinlan
2002-02-26 11:15 forsyth
2002-02-26  3:10 rob pike
2002-02-26 10:26 ` Thomas Bushnell, BSG
2002-02-26  3:05 andrey mirtchovski
2002-02-26 10:27 ` Thomas Bushnell, BSG
2002-02-26 10:27 ` Thomas Bushnell, BSG

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c1a1c2a6f971c9fbe256fe84f23cb152@plan9.bell-labs.com \
    --to=rob@plan9.bell-labs.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).