Quantcast

assembler vs extension words

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

assembler vs extension words

David W. Schultz
I am having some trouble using the rpt functionality of the CPUX. While
attempting to assemble some code for the msp430fr5969 I was surprised
with this error:

repeat count cannot be used with rrux

In response to:
rpt r15 { rrux.w r6

This was surprising because the example in slau367 for rrux shows it
being used with a repeat. After some fiddling around I was able to
generate code that worked but I had to bang it in using .word
directives. objdump produced:

rpt r15 { rrcx.w r6

Which is almost but not quite correct because it ignores the little
detail of the extension word having the ZC bit set. I tried doing the
same thing using the rrux.w instruction but for some reason that seems
to be ignoring the repeat count and always shifted by one bit.


Which brings up another problem. Not only is the use of rpt not
documented for the GNU assembler, there isn't any hint of how to set the
ZC bit in the extension word.

slau367 is a bit thin in describing the repeat feature as well. It
barely gets a mention in the description of the extension word and
appears a few times in examples. Other than that there is nothing.


--
David W. Schultz
http://home.earthlink.net/~david.schultz
Returned for Regrooving



------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: assembler vs extension words

nick clifton
Hi David,

> I am having some trouble using the rpt functionality of the CPUX. While
> attempting to assemble some code for the msp430fr5969 I was surprised
> with this error:
>
> repeat count cannot be used with rrux
>
> In response to:
> rpt r15 { rrux.w r6


Oops - this is definitely a bug.  You should report it ... :-)

The problem is that RRUX is a synthetic instruction, and GAS is incorrectly checking it as if it were RRUM, which does not accept a RPT count.

> After some fiddling around I was able to
> generate code that worked but I had to bang it in using .word
> directives. objdump produced:
>
> rpt r15 { rrcx.w r6
>
> Which is almost but not quite correct because it ignores the little
> detail of the extension word having the ZC bit set.

True - this is really the same bug.  GAS is not encoding RRUX correctly, so it is not being decoded correctly either.


> Which brings up another problem. Not only is the use of rpt not
> documented for the GNU assembler,

This is because there is no real documentation from TI describing how the RPT pseudo-instruction ought to work.  I assumed that they must have an "assembler programming for the MSP430 " guide somewhere that described this feature, and that I have just not seen it.  In my opinion the GNU assembler documentation should not be documenting features that are supposed to be a
standard part of the architecture's assembler.

> there isn't any hint of how to set the
> ZC bit in the extension word.

It has to be through the use of different opcode mnemonics, ie RRUX vs RRCX.


> slau367 is a bit thin in describing the repeat feature as well. It
> barely gets a mention in the description of the extension word and
> appears a few times in examples. Other than that there is nothing.

Agreed - it is very frustrating.

There is also very little documentation on synthetic instructions and how they ought to be implemented.

Anyway, please try out the attached patch and let me know if it works for you.

Cheers
   Nick




------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: assembler vs extension words

Peter Bigot
Just to note: this list doesn't transport patches.  Sorry.

Peter (still lurking, no longer active)

On Wed, Feb 3, 2016 at 6:29 AM, Nick Clifton <[hidden email]> wrote:

> Hi David,
>
> I am having some trouble using the rpt functionality of the CPUX. While
>> attempting to assemble some code for the msp430fr5969 I was surprised
>> with this error:
>>
>> repeat count cannot be used with rrux
>>
>> In response to:
>> rpt r15 { rrux.w r6
>>
>
>
> Oops - this is definitely a bug.  You should report it ... :-)
>
> The problem is that RRUX is a synthetic instruction, and GAS is
> incorrectly checking it as if it were RRUM, which does not accept a RPT
> count.
>
> After some fiddling around I was able to
>> generate code that worked but I had to bang it in using .word
>> directives. objdump produced:
>>
>> rpt r15 { rrcx.w        r6
>>
>> Which is almost but not quite correct because it ignores the little
>> detail of the extension word having the ZC bit set.
>>
>
> True - this is really the same bug.  GAS is not encoding RRUX correctly,
> so it is not being decoded correctly either.
>
>
> Which brings up another problem. Not only is the use of rpt not
>> documented for the GNU assembler,
>>
>
> This is because there is no real documentation from TI describing how the
> RPT pseudo-instruction ought to work.  I assumed that they must have an
> "assembler programming for the MSP430 " guide somewhere that described this
> feature, and that I have just not seen it.  In my opinion the GNU assembler
> documentation should not be documenting features that are supposed to be a
> standard part of the architecture's assembler.
>
> there isn't any hint of how to set the
>> ZC bit in the extension word.
>>
>
> It has to be through the use of different opcode mnemonics, ie RRUX vs
> RRCX.
>
>
> slau367 is a bit thin in describing the repeat feature as well. It
>> barely gets a mention in the description of the extension word and
>> appears a few times in examples. Other than that there is nothing.
>>
>
> Agreed - it is very frustrating.
>
> There is also very little documentation on synthetic instructions and how
> they ought to be implemented.
>
> Anyway, please try out the attached patch and let me know if it works for
> you.
>
> Cheers
>   Nick
>
>
>
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
> _______________________________________________
> Mspgcc-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>
>

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: assembler vs extension words

nick clifton
Hi Peter,

> Just to note: this list doesn't transport patches.  Sorry.

Darn.

David - would you be willing to file a binutils bug report about this problem here:

https://sourceware.org/bugzilla/

Then I can respond, upload the patch and you can test it out to make sure that I have not missed anything.

Cheers
   Nick


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: assembler vs extension words

David W. Schultz
In reply to this post by nick clifton
On 02/03/2016 06:29 AM, Nick Clifton wrote:
>> directives. objdump produced:
>>
>> rpt r15 { rrcx.w    r6
>>
>> Which is almost but not quite correct because it ignores the little
>> detail of the extension word having the ZC bit set.
>
> True - this is really the same bug.  GAS is not encoding RRUX correctly,
> so it is not being decoded correctly either.

I didn't phrase that well. The code executes as expected for all the
shift counts I tested but objdump doesn't decode and display the ZC flag.

As for the synthetic instruction thing, there is a table of extended
emulated instructions but rrcx isn't included. When I look at the
instruction encoding, rrcx.w has the same encoding as the non-extended
rrc.w instruction but has a register mode extension word in front of it:

    52aa:       cf 19 06 10     rpt r15 { rrcx.w        r6
    52ae:       06 10           rrc     r6              ;
    52b0:       40 18 06 10     rrcx.w  r6

On the other hand, rrux.w gets encoded as a single word instruction from
the new extended instruction group:

   52b4:       56 03           rrum    #1,     r6

I can't find any hint of these details  in the documentation. I wonder
where someone writing an assembler is supposed to find this stuff.


(I forgot to include the as version before: 2.24.51.20140505)

The patch might have been of some use to me if I had built as from
sources. It has been a long time since I have done that.

--
David W. Schultz
http://home.earthlink.net/~david.schultz
Returned for Regrooving



------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Loading...