title: How to count average of 3 integers via mmx?
body: <p>I have a problem, hope that you will help. 
  I have a task to perform grayscaling of image (sent from Java) using mmx, xmm or sse commands. I've already done this in C and asm (taking R, G and b using logics and then finding avg), now I need to use mmx/xmm/sse AND to increase performance (otherwise, professor refuses to take it, and tomorrow is an exam day).</p>
  
  <p>Grayscaling is taking R,G and B of one pixel and replacing them with average of R, G and B. It's easy to do this by simply combining three and doing idiv, but there is no division in mmx, so I need to improvise, and I have no ideas.</p>
  
  <p>The problem with xmm is that simple "movaps xmm0, [rel v1]" gives me crash, and I have kinda no time to explore it, so it would be nice to do this via mmx only.</p>
  
  <p>Yesterday I've written something that uses mmx, but it worked 30x slower than C code :(
  Well, I do not need epic performance neither-just something that works okay.</p>
  
  <p>Any ideas? Maybe division can be done via shifting or something like this? Would really appreciate help, and thanks.</p>