On Sep 12, 2011, at 1:19 PM, Michael Büsch wrote:

> On Mon, 12 Sep 2011 12:58:52 +0200
> [email protected] wrote:
> 
>> On Sep 12, 2011, at 12:35 PM, Michael Büsch wrote:
>> 
>>> On Mon, 12 Sep 2011 12:09:01 +0200
>>> [email protected] wrote:
>>> 
>>>> but trying on a = 0x8000 and b = 0x7fff helped me understanding. a - b = 
>>>> 0x8000 + 2'(0x7fff) = 0x0001 > 0. While 0x8000 < 0x7fff.
>>> 
>>> I don't get it.
>>> Can you write simple pseudocode for your instruction?
>> Will try for jdn.
>> 
>>> For example, for jls, we have this pseudocode:
>>> 
>>> if (xxx < yyy)
>>>   pc := jjj
>>> (where xxx and yyy are two's complement)
>>> 
>> 
>> ** jump if difference is negative
>> 
>> 0d6 xxx yyy jjj
>> 
>> if ( xxx - yyy < 0 )
>>      pc := jjj
>> 
>> C-pseudocode for jdn
>> 
>>      short c = xxx - yyy;
>>      if ( c < 0 )
>>              goto jjj;
> 
> Ok. So the existing signed-compare jumps look at the carry of the subtraction
> operation, but the new jdX instructions look at bit 0x8000 of the subtraction
> result. (if set -> negative, otherwise positive). jdX ignores the carry.
Exactly. For instance for jdn we have

0d6 xxx yyy jjj
        tmp := xxx - yyy;
        if( tmp & 0x8000 )
                pc := jjj

        or alternatively

        tmp := xxx - yyy;
        if( tmp < 0 )
                pc := jjj

Tested both in the firmware and they are the same.

Do you agree with those names?

Thanks,
-Francesco
_______________________________________________
b43-dev mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/b43-dev

Reply via email to