Skip to content
  • Jack Carter's avatar
    Mips specific inline asm operand modifier 'D' · b04e357d
    Jack Carter authored
    Modifier 'D' is to use the second word of a double integer.
    
    We had previously implemented the pure register varient of 
    the modifier and this patch implements the memory reference.
    
    
    
    #include "stdio.h"
    
    int b[8] = {0,1,2,3,4,5,6,7};
    void main()
    {
        int i;
        
        // The first word. Notice, no 'D'
        {asm (
        "lw    %0,%1;"
        : "=r" (i)
        : "m" (*(b+4))
        );}
        
        printf("%d\n",i);
    
        // The second word
        {asm (
        "lw    %0,%D1;"
        : "=r" (i)
        : "m" (*(b+4))
        );}
        
        printf("%d\n",i);
    }
    
    llvm-svn: 179135
    b04e357d
Loading