以前のリビジョンの文書です
TI Sitara PRU (Programmable Real-time Unit)
TIのSitaraシリーズの一部には、PRUという32-bit RISCマイコンが2つ搭載されている。 メインプロセッサのARMとは独立して動作し、リアルタイム性の高い処理を実行するのに使うことができる。
詳しくは資料 SPRUHF8A を見ると良い。 ここでは上記資料のうち、命令セットなどを一覧できるようにして整理したものを掲載する。
テーブル内の表記
表記 | 意味 | 例 |
---|---|---|
REG, REG1, REG2, … | レジスタの8/16/32-bit領域 | r0 r1.w0 r3.b2 |
Rn, Rn1, Rn2, … | レジスタ(32-bit全体のみ) | r0 r1 |
Rn.tx | レジスタのうち特定の1ビット | r0.t23 r1.b1.t4 |
Cn, Cn1, Cn2, … | 32-bit定数テーブルの要素 | c0 c1 |
bn | ??r0のb0,b1,b2,b3のどれか | b0 |
LABEL | ジャンプラベル。 丸括弧を付けてもよい。 定数値でもよい。 | loop1 (loop1) 0 |
IM(n) | 定数値。 先頭にシャープを付けてもよい。 コンパイル時に定数になれば式でもよい。 ラベルやレジスタアドレスでもよい。 | #23 0b0110 2+2 &r3.w2 |
OP(n) | REGとIM(n)の組み合わせ | r0 r1.w0 #0x7f 1«3 loop1 &r1.w0 |
命令セット
カテゴリ | 命令 | 説明 | 動作 |
---|---|---|---|
算術 | ADD REG1, REG2, OP(255) | Unsigned Integer Add | REG1 = REG2 + OP(255) carry = ( ( REG2 + OP(255) ) » bitwidth(REG1) ) & 1 |
ADC REG1, REG2, OP(255) | Unsigned Integer Add with Carry | ||
SUB REG1, REG2, OP(255) | Unsigned Integer Subtract | REG1 = REG2 - OP(255) carry = ( ( REG2 - OP(255) ) » bitwidth(REG1) ) & 1 |
|
SUC REG1, REG2, OP(255) | Unsigned Integer Subtract with Carry | REG1 = REG2 - OP(255) - carry carry = ( ( REG2 - OP(255) - carry ) » bitwidth(REG1) ) & 1 |
|
RSB REG1, REG2, OP(255) | Reverse Unsigned Integer Subtract | REG1 = OP(255) - REG2 carry = ( ( OP(255) - REG2 ) » bitwidth(REG1) ) & 1 |
|
RSC REG1, REG2, OP(255) | Reverse Unsigned Integer Subtract with Carry | REG1 = OP(255) - REG2 - carry carry = ( ( OP(255) - REG2 - carry ) » bitwidth(REG1) ) & 1 |
|
論理 | LSL REG1, REG2, OP(31) | Logical Shift Left | REG1 = REG2 « ( OP(31) & 0x1f ) |
LSR REG1, REG2, OP(31) | Logical Shift Right | REG1 = REG2 » ( OP(31) & 0x1f ) | |
AND REG1, REG2, OP(255) | Bitwise AND | REG1 = REG2 & OP(255) | |
OR REG1, REG2, OP(255) | Bitwise OR | REG1 = REG2 | OP(255) | |
XOR REG1, REG2, OP(255) | Bitwise XOR | REG1 = REG2 ^ OP(255) | |
NOT REG1, REG2 | Bitwise NOT | REG1 = ~REG2 | |
算術 | MIN REG1, REG2, OP(255) | Copy Minimum | REG1 = (REG2 < OP(255)) ? REG2 : OP(255) |
MAX REG1, REG2, OP(255) | Copy Maximum | REG1 = (REG2 > OP(255)) ? REG2 : OP(255) | |
論理 | CLR REG1, REG2, OP(31) | Clear Bit | REG1 = REG2 & ~(1 « ( OP(31) & 0x1f) ) |
CLR REG1, OP(31) | REG1 &= ~(1 « ( OP(31) & 0x1f) ) | ||
CLR REG1, Rn.tx | REG1 = Rn & ~Rn.tx | ||
CLR Rn.tx | Rn &= ~Rn.tx | ||
SET REG1, REG2, OP(31) | Set Bit | REG1 = REG2 | (1 « ( OP(31) & 0x1f) ) | |
SET REG1, OP(31) | REG1 |= (1 « ( OP(31) & 0x1f) ) | ||
SET REG1, Rn.tx | REG1 = Rn | Rn.tx | ||
SET Rn.tx | Rn |= Rn.tx | ||
特殊 | LMBD REG1, REG2, OP(255) | Left-Most Bit Detect | OP(255)&1が0の場合 → REG1 = CountLeadingOnes(REG2) OP(255)&1が1の場合 → REG1 = CountLeadingZeros(REG2) |
NOPn REG1, REG2, OP(255) | NULL Operation | 何もしない or 実装依存の動作 |