How to understand which constraints are not working in an inline code assembly?

Viewed 61

When I run the assembly code bellow it gets me the error: impossible constraint in ‘asm’.

int main(){
    int constant[4] = {0xff, 0xff, 0xff, 0xff};
    int source_image[8] = {10,56,54,88,61,250,80,157};
    int negative_image[8];
    int len = 8;
    asm(
        "movdqa xmm7, %[constant]"
        "mov %esi, %[source_image]"
        "mov %edi, %[negative_image]"
        "mov %ecx, %[len]"
        
        "movdqa %xmm0, [esi]"
        "movdqa %xmm1, [esi+16]"
        "movdqa %xmm2, [esi+32]"
        "movdqa %xmm3, [esi+48]"
        "PSUBS  %xmm0, %xmm7"
        "PSUBS  %xmm1, %xmm7"
        "PSUBS  %xmm2, %xmm7"
        "PSUBS  %xmm3, %xmm7"
        "movdqa [edi], %xmm0"
        "movdqa [edi+16], %xmm1"
        "movdqa [edi+32], %xmm2"
        "movdqa [edi+48], %xmm3"
        "add %esi, $64"
        "add %edi, $64"
        : [negative_image] "=x" (negative_image)
        : [len] "r" (len), [constant] "r" (constant), [source_image] "r" (source_image)
    );
    return 0;
}

how can I understand which constraint are not OK? And also another question is that how to use labels in assembly?

0 Answers
Related