Click here to Skip to main content
15,880,972 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do I mask a less than in MMX intrinsics?
I only see "greater than" intrinsic in MMX intrinsic instructions.
C++
if (x <20)
  b =y+f;
else
  b =y;
Posted
Updated 13-Oct-10 2:16am
v2

If you have the "greater than" intrinsic, why don't you swap the operands?

C++
if (20 > x) // Same than x < 20 but using the greater than operator :-)
   b = y + f;
else
   b = y;
 
Share this answer
 
v4
Comments
CPallini 13-Oct-10 8:39am    
Sure! My (now deleted) answer was probably driven by caffeine shortage!
LittleYellowBird 14-Oct-10 3:45am    
Hi, this is not quite right as it does not take into account == 20, you either need to check for == or change 20 to 19. :)
Sauro Viti 14-Oct-10 4:41am    
Sorry, but I don't agree with you: to test "x < 20" or "20 > x" is absolutely the same. What you are talking about is "x <= 20" which is the same than "21 > x"; or implementing "x < 20" as "!(x >= 20)".
Hi,

I am not very familiar with MMX intrinsics and there does not appear to be a 'less than', but surely if you check for 'greater than' and 'equal to' then the else is 'less than'?

Hope this helps :)
 
Share this answer
 

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