• 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: asm-blocks: please tell me why I'm being thick :-)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: asm-blocks: please tell me why I'm being thick :-)


  • Subject: Re: asm-blocks: please tell me why I'm being thick :-)
  • From: Nigel Perry <email@hidden>
  • Date: Sun, 28 Mar 2004 08:46:52 +1200

At 10:58 am +0000 25/3/04, Alastair Houghton wrote:
> I'm actually after the asm functions as they don't include a
 prelude/postlude while the above does. For every simple functions
 dropping these is worth it. However I'll take any reliable method!

You can easily use a separate assembler source file, or you can write

I am hoping to avoid that as it will be part of a large system with system #ifdef's - so it's #ifdef X86 C++ function #ifdef PPC asm function version (the PPC verison needs to do endian swapping and there is a PPC instruction to do it)


GCC-style asms (which work).  GCC-style asm, BTW, works fine at
top-level in a file, so you can quite happily write

	int bazC(int arg1);

	asm("
				.globl _bazC
	_bazC:
	0:			li		r4,4*89
				nand.	r5,r3,r4
				ble-	0b
	otherlab:	nop
				mr		r3,r5
				blr
	");

The only slightly unfortunate thing is that you can't easily declare a
static function of that kind without triggering a warning... and
removing the .globl without writing "static" before the declaration
will cause linking problems.

Poking around I found a function to *demangle* a C++ name, does anyone know of one to *mangle* one. What I want to do is the above in C++:


	int foo::baz(int arg1);

	asm(" .globl <mangled foo::baz>...

Yes I can work it out each time and it will work provided the scheme doesn't change (it did gcc 2 -> 3)m but given there is a demangler...

TIA,
	Nigel

--
Nigel Perry, New Zealand
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.


References: 
 >asm-blocks: please tell me why I'm being thick :-) (From: Nigel Perry <email@hidden>)
 >Re: asm-blocks: please tell me why I'm being thick :-) (From: Gerard Iglesias <email@hidden>)
 >Re: asm-blocks: please tell me why I'm being thick :-) (From: Gerard Iglesias <email@hidden>)
 >Re: asm-blocks: please tell me why I'm being thick :-) (From: Nigel Perry <email@hidden>)
 >Re: asm-blocks: please tell me why I'm being thick :-) (From: Alastair Houghton <email@hidden>)

  • Prev by Date: problems with Expression in debugger
  • Next by Date: Re: Prebinding problems with shared framework
  • Previous by thread: Re: asm-blocks: please tell me why I'm being thick :-)
  • Next by thread: Re: asm-blocks: please tell me why I'm being thick :-)
  • Index(es):
    • Date
    • Thread