mmx and friends with C# ?

  • Thread starter =?ISO-8859-1?Q?Sebastian_Kr=E4mer?=
  • Start date
?

=?ISO-8859-1?Q?Sebastian_Kr=E4mer?=

Hi there!

I was wondering if it is possible to (manually, on code level) use
optimizations like mmx, sse etc with C#. The idea came up at some place
where /unsafe is already used. Somehow I have the feeling that it isn't
possible though. :-/

Second: I read somewhere that the C# (or JIT?) compiler might do
likewise optimizations automatically, is that true?

Thanks in advance,

Sebastian
 
G

Guest

It's only JIT compile responsibility, and it use some process feature, like
SSE2.
In the clr group was discussion about it, try to goole.
I was wondering if it is possible to (manually, on code level) use
optimizations like mmx, sse etc with C#. The idea came up at some place
where /unsafe is already used. Somehow I have the feeling that it isn't
possible though. :-/

Second: I read somewhere that the C# (or JIT?) compiler might do
likewise optimizations automatically, is that true?

--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
C

Christoph Nahr

I was wondering if it is possible to (manually, on code level) use
optimizations like mmx, sse etc with C#. The idea came up at some place
where /unsafe is already used. Somehow I have the feeling that it isn't
possible though. :-/

Your feeling is correct. You'd have to use C++/CLI and use unmanaged
code blocks to get an optimizer that uses MMX/SSE automatically, or to
write inline assembler to use these features manually.
Second: I read somewhere that the C# (or JIT?) compiler might do
likewise optimizations automatically, is that true?

No. The C# compiler cannot know the hardware the program will be
executing on. The JIT compiler knows the hardware and could do such
optimizations but currently doesn't.
 
G

Guest

Michael said:
It's only JIT compile responsibility, and it use some process feature, like
SSE2.
In the clr group was discussion about it, try to goole.

Hello Michael,

thank you for the quick response. I found the thread.

@Christoph: Thanks for your response as well. I understand now why these
instructions don't make sense on c# compile level.

Sebastian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top