• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CodeWarrior-style inline assembly help...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CodeWarrior-style inline assembly help...


  • Subject: Re: CodeWarrior-style inline assembly help...
  • From: Jeremy Sagan <email@hidden>
  • Date: Thu, 04 Aug 2005 15:25:37 -0400


This looks like you should be using high level and not assembler.

Try this
register double foo1, foo2, foo3;

foo1 = _usm_constants[0];
foo2 = _usm_constants[1];
foo3 = _usm_constants[2];

then if you need to manipulate those values in assembler, instead of using explicit register like fp3 use foo2.

Also this assumes that  the _usm_constants array are doubles and not UInt32's.

static const double _usm_constants[]= {0.0, etc, etc,};


On Aug 4, 2005, at 11:10 AM, Dave Thorup wrote:



Here's the code:

373:   lwz        r4,_usm_constants(RTOC)  // <== Error here
374:   li         r3,0                     // r3 = 0
375:   lfd        fp0,0(r4)                // fp0 = 0.0
376:   lfd        fp3,8(r4)                // fp3 = 2**32
377:   lfd        fp4,16(r4)               // fp4 = 2**31

_usm_constants is declared as:

static const unsigned long _usm_constants[] = {
        0x00000000, 0x00000000,        // 0.0
        0x41F00000, 0x00000000,        // 2**32
        0x41E00000, 0x00000000,        // 2**31
        0x43300000, 0x00000000,        //
};

So basically all the code is doing is loading some double-precision floating point constants.  GCC doesn't seem to like the _usm_constants(RTOC) part of line 373.  Does anyone know of a better way to load constants into floating point registers?  Or does anyone know how to get this to work as it is?  If there's a better way then I'd rather use that, but I'd just like to get it working.


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: CodeWarrior-style inline assembly help...
      • From: Dave Thorup <email@hidden>
References: 
 >CodeWarrior-style inline assembly help... (From: Dave Thorup <email@hidden>)

  • Prev by Date: Re: Template Problems
  • Next by Date: Re: Template Problems
  • Previous by thread: CodeWarrior-style inline assembly help...
  • Next by thread: Re: CodeWarrior-style inline assembly help...
  • Index(es):
    • Date
    • Thread