Click here to Skip to main content
15,881,687 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The SSE intrinsic _mm_setzero_si128 is very handy to initialize a register with all zeroes and it translates to the single PXOR opcode taking twice the same register. It is the only SSE intrinsic taking no argument.

The similar _mm_setones_si128 intrinsic would be equivalently handy to initialize a register to all ones and it could translate to the single PCMPEQB opcode.

Unfortunately, this intrinsic does not exist and it is problematic to emulate it with _mm_cmpeq_epi8: code like
C++
__m128i AllOnes= _mm_cmpeq_epi8(AllOnes, AllOnes);

raises an unintialized variable warning at compile-time, and worse, raises a condition at run-time in a debug build.

Alternatives are to first initialize the variable with _mm_setzero_si128, use one of the _mm_set_epi... intrinsics or apply _mm_cmpeq_epi8 to another variable. None of these options please me as they will not translate to a single opcode.

Can I work around this by clever tricks ?
Can I hack some compiler files to achieve this effect ?
Can I contact the right person in the MSVC Developers Team to let them add this trivial but useful feature ?
Posted
Updated 17-Aug-12 0:26am
v2

1 solution

Can I work around this by clever tricks ?
Possibly, but I do not know of such a trick.

Can I hack some compiler files to achieve this effect ?
Most unlikely unless you know how to hack an exe or dll file successfully.

Can I contact the right person in the MSVC Developers Team to let them add this trivial but useful feature ?
Yes, but you would need to go to the Microsoft website to contact them.
 
Share this answer
 
Comments
YvesDaoust 18-Aug-12 4:29am    
What do you mean ?
Richard MacCutchan 18-Aug-12 5:06am    
What do I mean by what? I have given answers to your 3 questions; which of these do you not understand?
YvesDaoust 18-Aug-12 5:51am    
These are of no help. Why did you answer that ?
Richard MacCutchan 18-Aug-12 6:46am    
They are answers to your questions, which are basically asking how to change Microsoft's compiler; something that only Microsoft can help you with.
YvesDaoust 18-Aug-12 7:27am    
Microsoft's sites are a labyrinth. I need a way to address the right guy in the right team, or their "suggestion box".

I don't want them to solve this issue for myself (I have workarounds and I won't be waiting for the next VS release). I just want to make this suggestion with some probability that it is heard.

I am not sure it requires changing the compiler, rather updating the relevant table somewhere.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900