www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - instruction set module

reply "nobody_" <spam spam.spam> writes:
I might sound really ignorant, so please tell me if I do.

Instruction sets are only accessible throught assembler, right?
Would it be possible to write an module which makes some of the more general 
instructions available through functions?
Or is D already fully uptimized in such a way that this would not yield any 
performance increase?
Oct 11 2006
parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"nobody_" <spam spam.spam> wrote in message 
news:egioi6$1482$1 digitaldaemon.com...
I might sound really ignorant, so please tell me if I do.

 Instruction sets are only accessible throught assembler, right?
 Would it be possible to write an module which makes some of the more 
 general instructions available through functions?
 Or is D already fully uptimized in such a way that this would not yield 
 any performance increase?

Do you mean something like std.intrinsic: http://www.digitalmars.com/d/phobos/std_intrinsic.html ?
Oct 11 2006
parent reply "nobody_" <spam spam.spam> writes:
 Do you mean something like std.intrinsic: 
 http://www.digitalmars.com/d/phobos/std_intrinsic.html ?

Yup somthing like that :) But those aren't all instructions.. I think ;)
Oct 11 2006
parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"nobody_" <spam spam.spam> wrote in message 
news:egj832$1ka6$1 digitaldaemon.com...
 Do you mean something like std.intrinsic: 
 http://www.digitalmars.com/d/phobos/std_intrinsic.html ?

Yup somthing like that :) But those aren't all instructions.. I think ;)

Well, what instructions are you looking to use? This theoretical module would also be quite platform-dependent, if you're looking to use things like SSE3 or something.. If you'd like, you could write your own functions to wrap the assembly instructions you'd like to use, like: // useless function void Move(int* dest, int* src) { asm { mov EBX, src; mov EAX, [EBX]; mov EBX, dest; mov [EBX], EAX; } }
Oct 11 2006
parent "nobody_" <spam spam.spam> writes:
Thx
I've been looking through all the instruction sets and, yes, it would be 
really platform-dependent.
And the most interesting are still to come: SSE4 :)



 Well, what instructions are you looking to use?  This theoretical module 
 would also be quite platform-dependent, if you're looking to use things 
 like SSE3 or something..

 If you'd like, you could write your own functions to wrap the assembly 
 instructions you'd like to use, like:

 // useless function
 void Move(int* dest, int* src)
 {
    asm
    {
        mov EBX, src;
        mov EAX, [EBX];
        mov EBX, dest;
        mov [EBX], EAX;
    }
 }

Oct 11 2006