Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22006

error : unknown use of instruction mnemonic without a size suffix

$
0
0

Here the entire source code

void asmFunction() {
    unsigned char threshold[16];
    initArray(threshold, 75-128, 16);
    unsigned char counterC2[16];
    initArray(counterC2, 128, 16);
    unsigned char buffer[SIZE];

    FILE *fp;
    fp = fopen(FILE_INPUT, "rb");
    FILE *foutput;
    foutput = fopen(FILE_OUTPUT_ASM, "wb");

    fread(buffer, sizeof(unsigned char), SIZE, fp);
    fclose(fp);
    __asm__(

            "mov $65536, %%edx\n""mov %[thr], %%eax\n" // <--- this line
            "mov %[buf], %%ebx\n""mov %[cc2], %%ecx\n""movdqu (%%ecx), %%xmm2;\n""movdqu (%%eax), %%xmm0;\n""loop: movdqu (%%ebx), %%xmm1;\n""psubb %%xmm2, %%xmm1;\n""pcmpgtb %%xmm0, %%xmm1;\n""movdqu %%xmm1, (%%ebx);\n""add $16, %%ebx;\n""sub $1, %%edx;\n""mov $0, %%esi;\n""cmp %%edx, %%esi;\n""jnz loop;\n"
            : "=m" (buffer) // Output
            : [thr]"r" (threshold), [buf]"r" (buffer), [cc2]"r" (counterC2)
            : "xmm0", "eax", "ebx", "ecx"
        );

    fwrite(buffer, sizeof(unsigned char), SIZE, foutput);
    fclose(foutput);
}

But I get the following error and I don't understand why:

unknown use of instruction mnemonic without a size suffix "mov %[thr], %%eax\n"

Can someone help me?


Viewing all articles
Browse latest Browse all 22006

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>