Thread: Amd Mmx

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    95

    Amd Mmx

    I have a question.

    Does MMX work good with the latest AMD chips? I had a computer about 3 years ago with an AMD and MMX, but on all my games, it didn't read MMX, and went about 1 frame a second, on a good day. Does anybody know anything about this?
    Think out of the box! Open Source rules!

    -Breach23

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    403

    please ask this in a different forum

    not really Game Programming related, General Discussions would be much better

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    164
    I consider it game related since MMX is most used in games. I don't have an AMD processor but I now the Athlons supports MMX.
    // Gliptic

  4. #4
    Registered User
    Join Date
    Aug 2001
    Posts
    411
    MMX is similar to RISC in design, I dont see how it could matter what sort of processor you had. I think all MMX is for AGP though.

    Im still happy with a voodoo3.

  5. #5
    Registered User
    Join Date
    Sep 2001
    Posts
    164
    And what has MMX with AGP to do? Don't you know what MMX is? It has absolutly nothing to do with gfx cards.
    // Gliptic

  6. #6
    Registered User
    Join Date
    Aug 2001
    Posts
    411
    My mistake, I misunderstood what mmx was.

  7. #7
    Registered User
    Join Date
    Sep 2001
    Posts
    412
    1) Yes, the Athlons support MMX. Previously, AMD would only support its own 3dNow! instruction set.

    2) MMX is getting to be more and more useless. Now, I'm sure some people would disagree, but the arguments against it:

    * Requires the program to check for the availability of these instructions and use them
    * More and more, video computation is being done on the video card itself, not by the CPU, so it's not as useful.

    However, some things like the DirectX HEL I believe will check for 3DNow/MMX processors, so when they DO use software rendering, they use optimized instructions, allowing DirectX software rendering to be faster than non-MMX software renderers.

  8. #8
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    MMX is a great concept, but it was implemented too late. The video card architecture is just as fast or faster than any MMX instructions.

    I don't know why checking for MMX would slow the program down. Just check for MMX when the program starts. If it's there, set a flag and call the functions that use the MMX instructions. If it's not, clear the flag and call the functions that do not use the MMX instructions. I can assure you they do not check for MMX during the rendering process and on every pass through the pipeline.

  9. #9
    Registered User
    Join Date
    Oct 2001
    Posts
    95
    Okay, thank you all for your replies. Have fun arguing about the uses of MMX!
    Think out of the box! Open Source rules!

    -Breach23

  10. #10
    Registered User
    Join Date
    Sep 2001
    Posts
    164
    I use MMX regulary for non-3D graphics tasks. For example, you can't do data encryption using your videocard (unless I haven't missed something)!

    I've also done some MMX Alpha blending routines which uses alpha channels. I haven't found any alpha blending routines which uses alpha channels with MMX before.
    // Gliptic

  11. #11
    Registered User
    Join Date
    Sep 2001
    Posts
    412
    gliptic -- could you post some of your source code for MMX-enabled alpha blending, or point me to some good sources? I'm interested in learning and using this as a videocard-independant way of doing alpha blends, but have found little useful info on my own. I'd love to see and hear about how you've implemented it.
    Last edited by The V.; 10-24-2001 at 12:25 PM.

  12. #12
    Registered User
    Join Date
    Sep 2001
    Posts
    164
    Yes, I can mail you the sourcecode. I don't have it here but I'll bring it tomorrow.

    The source I have is for 16-bit videomodes but 32-bit is quite easy to implent also. The current routine runs at about 100000 pixels per millisecond when blitting 32x32 images on my 500Mhz computer (that's just a non-gfx test). It uses a special image format I invented which makes it faster to read in the source images. I haven't done a clipper for it yet but that shouldn't be a big deal, although I have to use the standard instruction set when blitting leftover pixels (the routine blits 4 pixels / iteration).

    BTW. Yesterday, I made a keycolor blitter which runs twice as fast as my hardware blitter, thanks to MMX!
    Last edited by gliptic; 10-23-2001 at 01:01 AM.
    // Gliptic

  13. #13
    Unregistered
    Guest
    Here is my keycolor blitting routine. I haven't tested it yet, but it should work.

    Code:
    movq mm5,KEYCOLOR	;mm5 = 1111111111111111 - The byte repeated 8 times
    
    mov eax,imagewidth
    mov ebx,imagewrap
    mov edx,screenpitch
    sub edx,screenwidth
    
    push ebp
    
    alphaloop:
    
    movq mm7,[esi]		;mm7 = 1122112211221122
    pcmpeqb mm7,mm5		;mm7 = FF00FF00FF00FF00
    movq mm6,mm7		;mm6 = FF00FF00FF00FF00
    pand mm7,[edi]		;mm7 = FF00FF00FF00FF00 & 3344334433443344 = 3300330033003300
    pandn mm6,[esi]		;mm6 = 00FF00FF00FF00FF & 1122112211221122 = 0022002200220022
    por mm6,mm7		;mm6 = 3300330033003300 | 0022002200220022 = 3322332233223322
    movq [edi],mm6		
    
    add edi,8
    add esi,8
    
    dec ecx
    jnz alphaloop
    
    add esi,ebx ;imagewrap
    add edi,edx ;screenwrap (pitch-width)
    
    mov ecx,eax ;imagewidth
    
    dec ebp
    jnz alphaloop
    
    pop ebp

  14. #14
    Registered User
    Join Date
    Sep 2001
    Posts
    164
    The last message was posted by me. I forgot that I haven't been on this forum on this computer.

  15. #15
    Registered User
    Join Date
    Sep 2001
    Posts
    412
    Thanks, I'll play around w/ it.

    BTW, what assembler do you use? I've used a few, wondering if you had any recommendations, although I suppose they're all the same.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. AMD striking back?
    By System_159 in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 10-07-2006, 08:26 AM
  2. amd stock fans suck!!
    By Kinasz in forum Tech Board
    Replies: 25
    Last Post: 05-05-2004, 09:14 AM
  3. Replies: 17
    Last Post: 10-12-2003, 12:09 AM
  4. Replies: 72
    Last Post: 11-25-2002, 05:55 PM
  5. Is EXTRA THERMAL SOLUTION must for AMD ?
    By Zeeshan in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 07-08-2002, 09:56 PM