unrecognized opcode `mtc0 $0,$9' from sde-gcc to mips-mti-elf-GCC

This topic contains 1 reply, has 2 voices, and was last updated by  ChrisImgtec 2 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #50048

    Ranga
    Member

    I am able to build following code with sde-GCC and that is working, but same thing if I build with mips-mti-elf-gcc is not working instead its through unrecognized opcode `mtc0 $0,$9′
    please if someone know what going wrong please help me in correcting and/or fixing the above issue.

    here is my code looks like
    v#if 1
    #define hal_getsr(val) \
    ({ \
    register unsigned __r; \
    asm volatile (“mfc0 %0,$12; nop; nop;” \
    : “=d” (__r)); \
    val = __r; \
    })

    #define hal_setsr(val) \
    ({ \
    register unsigned __r = (val); \
    asm volatile (“mtc0 %0,$12; nop; nop;” : : “d” (__r)); \
    __r; \
    })
    #endif

    #50841

    ChrisImgtec
    Moderator

    Here’s one I use:

    #define setsr(x) \
    ({ unsigned int X; \
    X=x; \
    __asm__ __volatile (“mtc0 %0, $%1, 0” : : “d” (X), “i” (C0_STATUS));})

Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.