Re: How do I choose the correct primative?

2014-01-06 Thread Jake Thomas
On Sunday, 5 January 2014 at 08:23:45 UTC, TheFlyingFiddle wrote: On Sunday, 5 January 2014 at 06:31:38 UTC, Jake Thomas wrote: And got 86,421 lines of assembly!! I expected a load instruction to load whatever was at loadMe's location into r0 (the return register) and not much else. Maybe 10

Re: How do I choose the correct primative?

2014-01-06 Thread Jake Thomas
Ok, I figured out how to use obj2asm. The trick is to cd to the directory holding the file you wish to dissassemble and _not_ specify the whole path, or else it throws a confusing Fatal error: unrecognized flag error. I ran: obj2asm intLoadTest.o intLoadTest.d intLoadTest.s and got this:

Re: How do I choose the correct primative?

2014-01-06 Thread Jake Thomas
Oh, and that was made from: int main() { int loadMe = 10; return loadMe; }

Re: How do I choose the correct primative?

2014-01-06 Thread TheFlyingFiddle
On Monday, 6 January 2014 at 20:08:27 UTC, Jake Thomas wrote: Things like Object.factory also pulls in it's fair share due to not being able to remove classes. So we get alot of fluff in small programs. What do you mean by not being able to remove classes? Isn't the whole point of

Re: How do I choose the correct primative?

2014-01-06 Thread Jake Thomas
Well since you could potentially create classes through Object.factory at runtime the code for unused classes will be compiled into the binary anyways this is even if you never use Object.factory directly in the code. I am not 100% sure but i think the main problem is ModuleInfo that keeps

Re: How do I choose the correct primative?

2014-01-05 Thread TheFlyingFiddle
On Sunday, 5 January 2014 at 06:31:38 UTC, Jake Thomas wrote: And got 86,421 lines of assembly!! I expected a load instruction to load whatever was at loadMe's location into r0 (the return register) and not much else. Maybe 10 lines - tops - due to compiler fluffiness. I got about 8,641 times

Re: How do I choose the correct primative?

2014-01-04 Thread TheFlyingFiddle
On Saturday, 4 January 2014 at 03:14:35 UTC, Jake Thomas wrote: So, short-term, it seems like one would want to use my native/unative technique. But long-term, hopefully not only does this get fixed, but the default behavior for the compiler be to pad things out to the native word size without

Re: How do I choose the correct primative?

2014-01-04 Thread Jake Thomas
According to this (http://msdn.microsoft.com/en-us/library/windows/hardware/ff561499(v=vs.85).aspx) 32-bit registers are automatically zero extended on x64 architecture while 16-bit and 8-bit registers are not. Operations that output to a 32-bit subregister are automatically zero-extended

Re: How do I choose the correct primative?

2014-01-03 Thread Jake Thomas
We have size_t defined as uint on 32bit and ulong on 64bit. ptrdiff_t for int/long. I don't know how dmd handles it, although you do have the ability to align variables. You may want to consider gdc or ldc more than dmd as they have better optimization. Sorry for the delayed response -

Re: How do I choose the correct primative?

2014-01-03 Thread Jake Thomas
Keep in mind that RAM access is slow compared to how fast CPUs run. It can be beneficial to have slower data types if they allow more data to fit into the CPU cache. Abosolutely fantastic point, Marco! Except if everything still fits in cache as fast types, it'd be worth having faster types.

Re: How do I choose the correct primative?

2014-01-03 Thread Jake Thomas
On Friday, 3 January 2014 at 05:25:49 UTC, Casper Færgemand wrote: On Wednesday, 1 January 2014 at 04:17:30 UTC, Jake Thomas wrote: snip Are you looking for something like int_fast32_t and the likes from Boost? If you don't care terribly much for when your numbers overflow, then as others

Re: How do I choose the correct primative?

2014-01-02 Thread Casper Færgemand
On Wednesday, 1 January 2014 at 04:17:30 UTC, Jake Thomas wrote: snip Are you looking for something like int_fast32_t and the likes from Boost? If you don't care terribly much for when your numbers overflow, then as others suggested, size_t and pttwhatever work fine.

Re: How do I choose the correct primative?

2014-01-01 Thread Marco Leise
C compilers like D compilers will pack a struct of two 16-bit words into a 32-bit type if you don't force an alignment: http://dlang.org/attribute.html#align What you should avoid is having a data type start at an address that is not a multiple of its size, especially when it comes to SIMD.

Re: How do I choose the correct primative?

2014-01-01 Thread TheFlyingFiddle
I'm a little OCD - who cares about memory to that degree anymore when we have gigabytes of RAM? This might not even come into play on the Raspberry Pi. Memory is very important when it comes to performance, the moving of memory is the single most energy demanding task the CPU (and the GPU

How do I choose the correct primative?

2013-12-31 Thread Jake Thomas
First, let me say that I am iextremely/i enthused about D. I did research on it last year for a project and absolutely fell in love with it. But praise should go in another thread... My question comes down to: Does dmd pack non-array primative variables in memory such that they are touching,

Re: How do I choose the correct primative?

2013-12-31 Thread Rikki Cattermole
On Wednesday, 1 January 2014 at 04:17:30 UTC, Jake Thomas wrote: First, let me say that I am iextremely/i enthused about D. I did research on it last year for a project and absolutely fell in love with it. But praise should go in another thread... My question comes down to: Does dmd pack