Welcome, Guest. Please login or register.

Author Topic: GCC 4.5.0 Amigaos 68k Compiler CYGWIN Hostet  (Read 10484 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: GCC 4.5.0 amigaos 68k Compiler CYGWIN hostet
« on: May 12, 2010, 12:09:50 AM »
Nice :)

When you say it's "without C++", do you mean it doesn't include any precompiled standard C++ libraries for m68k, or something else?
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: GCC 4.5.0 amigaos 68k Compiler CYGWIN hostet
« Reply #1 on: May 13, 2010, 10:23:12 PM »
That code looks like a dog's dinner, I can see no reason whatsoever for the fdiv / fabs operations. x*x is always positive for all real x anyway.

The inlined version further up is pretty much what I'd write. The only thing in the longer version that makes immediate sense is the test for the sum of the squares being zero and skipping the square root in that case. However, that's a pretty pointless optimisation in my mind. I know that x*x tends to zero quickly for small x, but in reality how often is it likely to occur that the sum is fully zero?

Incidentally, I thought returning a double in fp0 was legal under the existing ABI. What's with the d0/d1 return?
« Last Edit: May 13, 2010, 10:28:22 PM by Karlos »
int p; // A