PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Gapidraw Xscale optimized?

Will or is the Gapidraw optimized for the Xscale processor? PPC2003 are now optimized for Xscale, how about this lib, anybody knowes?

/Totte - Sweden
GapiDraw 2.02 will be XScale optimized.
Will these optimization require PPC 2003? Are they significant?

--Eric
I would say that they are significant.. The new compiler supports intrinsic operations, which means that blitting small surface without effects will be significantly improved in performance.

Unfortunately it will require Pocket PC 2003 devices...
sbl wrote:The new compiler supports intrinsic operations [...]

Here's something else, "Intrinsic operations". I've learned so much new stuff since I use GapiDraw...

I don't want to be too much OOT, but what are intrinsic operations?

I tried to look it up on Google, but the results are so vague it smells like a conspiracy ;)

Thanks,

--Eric
Better would be to search the VC++ help. :) Basically some operations like "memcpy" will be inlined if the compiler supports intrinsic functions.
Johan wrote:

Unfortunately it will require Pocket PC 2003 devices...

Just to clarify... you aren't saying that the new version of GD will only run on 2K3 devices, are you?
of course not.. :) GapiDraw will soon be running on more devices than ever.. GD 2.02 will also include a dll that is specifically built for the PocketPC 2003 devices.
I didn't think so :) But if I didn't ask, then it WOULD have been that way, you know?!?
of course ;)
From what I can tell, my EVC3.0 is inlining memcpy() here. Am I hallucinating or does EVC4.0 does something more?
Johan wrote:Better would be to search the VC++ help. :) Basically some operations like "memcpy" will be inlined if the compiler supports intrinsic functions.

Wow, thanks. eVC 3 does seem to support inlining memcpy. I'll do some benchmarks just to be sure, but the docs seem to say so.

Update: Well, I tried to include "#pragma intrinsic(memcpy)" in a bunch of benchmarks, however the resulting listing file still show the memcpy as a function, not inline. I tried to change many of the optimization settings to no effect.

Thierry, have you verified the listing files under release mode to check the inlining of memcpy?

Thanks,

--Eric
I will double check this. I am certain the I saw memcpy() being inlined automatically (without any need to specify it as an intrinsic).

Maybe it was with the MIPS compiler when I was developping on the E125.

Maybe I spend too much time with VC6.

Will double check this.
The compiler intrinsics are enabled when /Oi is specified. This is different than using a CPU intrinsic routine such as CountLeadingZeros or __prefetch which are listed in cmnintrin.h.

Ideally, the compiler should generate inline code for memcpy when the calling overhead to the CRT routine becomes expensive relative to the number of bytes you're trying to copy (i.e. < 32 byte moves). If the compiler does generate inline code, it looks at the type of the argument passed to memcpy to determine what size mov operation to execute. If you pass a DWORD* it will generate code to move 32 bits at a whack. If you pass a BYTE* it will move single bytes. It must do this because of alignment issues on the ARM. And yes, before you ask, if you pass in an unaligned DWORD*, it will happily generate inline code that will cause a data misalignment exception, so consider this if you're relying on memcpy to handle unaligned data and you've specified /Oi. This is never a problem when calling the CRT implementation as it looks at the address at runtime and handles things accordingly.

IIRC, there was a bug in the eVC 4.0 ARM compiler that would always generate inline code for a byte-sized memcpy rather than call the CRT routine. I don't have eVC 4.0 installed, otherwise I'd verify this for you. It's something you might want to keep in mind though because if it's true, it would affect your performance quite noticably.