some question about Extended Asm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear all:
I write an assembly in c at the end of letter.
I try to
  "or %0, count\n", where count is $a1.
so I write %1 as count and write
  "or %0, %1\n" and assign %1 as count in input section.

But the result is not what I expect.
the result is "   or      v1,v1,v0"
Did I miss something or the only way to meet what I need is directly write
 "or %0, $a1\n"?
appreciate your help,
miloody

void cpuperformanceEvent11_initial(unsigned int mode,unsigned count)
{
bf0106d8:       27bdfff0        addiu   sp,sp,-16
bf0106dc:       afbe0008        sw      s8,8(sp)
bf0106e0:       03a0f021        move    s8,sp
bf0106e4:       afc40010        sw      a0,16(s8)
bf0106e8:       afc50014        sw      a1,20(s8)
        unsigned int temp;
        asm(
bf0106ec:       8fc30010        lw      v1,16(s8)
bf0106f0:       8fc20014        lw      v0,20(s8)
bf0106f4:       4003c801        mfc0    v1,c0_perfcnt,1
bf0106f8:       00621825        or      v1,v1,v0
bf0106fc:       4083c801        mtc0    v1,c0_perfcnt,1
                "mfc0 %0, $25, 1\n"
                "or %0, %1\n"
                "mtc0 %0, $25, 1\n"
                :
                :"r" (mode), "r" (count)
        );
}


void cpuperformanceEvent0_initial(unsigned int mode,unsigned count)
{
	unsigned int temp;
	asm(
		"mfc0 %0, $25, 1\n"
		"or %0, %1\n"
		"mtc0 %0, $25, 1\n"
		:
		:"r" (mode), "r" (count)
	);
}


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux