News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

problems with some MMX instructions

Started by Klistron, December 27, 2004, 04:56:33 PM

Previous topic - Next topic

Klistron

Anyone please give me a key to such a problem:

some of the MMX instructions, e.g. psadbw (sum of absolute differences) and pshufw
do not work (I didn't invent them myself but took from Pentium III instruction set description). The result is the following message when batch launched:
"instruction or register not supported in current mode"

I have .686p and .mmx directives on
and use MASM 32 v 8.2 with service pack 1

Grateful in advance.

russian

try putting .xmm after .mmx:

.686
option casemap:none
.mmx
.xmm
.model flat, stdcall

don't forget to put option casemap:none before .mmx or else you will have to use all uppercase for mmx registers

Mark_Larson

Quote from: Klistron on December 27, 2004, 04:56:33 PM
Anyone please give me a key to such a problem:

some of the MMX instructions, e.g. psadbw (sum of absolute differences) and pshufw
do not work (I didn't invent them myself but took from Pentium III instruction set description). The result is the following message when batch launched:
"instruction or register not supported in current mode"

I have .686p and .mmx directives on
and use MASM 32 v 8.2 with service pack 1

Grateful in advance.

Both PSADBW and PSHUFW were added with the P3 and SSE.  So just enabling MMX isn't enough.  You have to enable SSE/SSE2 like russian showed above ( using .xmm).  I just wanted to explain why his answer was correct.
BIOS programmers do it fastest, hehe.  ;)

My Optimization webpage
htttp://www.website.masmforum.com/mark/index.htm