[raspi-internals] Re: QPU Tutorials/Samples

  • From: Herman Hermitage <hermanhermitage@xxxxxxxxxxx>
  • To: "raspi-internals@xxxxxxxxxxxxx" <raspi-internals@xxxxxxxxxxxxx>
  • Date: Sun, 16 Feb 2014 17:10:45 +1200

Ok,

I've added support for constant 2-bit vectors and rotator on the mul sources:

/* Assembled Program */
/* 0x00000000: */ 0x00000000, 0xe6020827, /* ldi r0, 
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] */
/* 0x00000008: */ 0x00001111, 0xe6020827, /* ldi r0, 
[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0] */
/* 0x00000010: */ 0x0000ffff, 0xe6020827, /* ldi r0, 
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] */
/* 0x00000018: */ 0xffff0000, 0xe6020827, /* ldi r0, 
[2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2] */
/* 0x00000020: */ 0xedb65b6d, 0xe6020827, /* ldi r0, 
[1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,2] */
/* 0x00000028: */ 0x00030000, 0xe2020827, /* ldi r0, [-2, -2, 0, 0, 
0,0,0,0,0,0,0,0,0,0,0,0] */
/* 0x00000030: */ 0x809f4009, 0xd00049e0, /* nop; mov r0, r1>> 4 */
/* 0x00000038: */ 0x809f0009, 0xd00049e0, /* nop; mov r0, r1>> r5 */

I also added some support for /* */ and // comments.

If a line starts with:
  /* addr: word0 word1 */
then the assembler also verifies that the assembled version has the same word 
values.

Syntax wise I think I should support:
  ldi r0/r1, 0x12345678
  bra r0/r1, target

As i think both ldi and bra/r can write to two registers at once.  I think / 
works better than , or ; as they lead to issues with the slots or args - who 
knows I'll see what drops out.                                          

Other related posts: