命令セット

擬似命令


fhalf(101100) rd(26-21) rs(20-16) rd=rs/2
3/06追加命令
[111110](31-26) andi rd rt Imm rd = rt & Imm
[011001](31-26) in rd 外部からの入力
[011010](31-26) outb rs 出力(Byte) 下位1Byteをcharで出力
[011100](31-26) outw rs 出力(4Byte)下位4Byteをintで出力
[111101](31-26) floor rd rs rd = rs切捨て

move rd rs add rd rs r0
neg rd rs sub rd r0 rs
以下3/03廃止
li rd Imm llo rd Lo(Imm)
lhi rd Hi(Imm)
ll label llo rd Lo(Address[label])
lhi rd Hi(Address[label])

命令


ビット表現 アセンブリ 実行内容
fabs(111010) $rd,$rs rd = abs(rs)
fiszero(111001) $rd(25-21), $rs(20-16) if rs = 0 then $rd = 1(0x1) else $rd = 0(0x0)
fispos(111000) $rd(25-21), $rs(20-16) if rs >= 0 then $rd = 1(0x1) else $rd = 0(0x0)
fisneg(111011) $rd(25-21), $rs(20-16) if rs < 0 then $rd = 1(0x1) else $rd = 0(0x0)
fless(111100) $rd(25-21), $rs(20-16), $rt(15-11) if rs < rt then $rd = 1(0x1) else $rd = 0(0x0)
setl $rd(31-26), label(25-0) (000011) $rd = label
3/03追加(lhi,llo)
[011110](31-26) lhi rd Imm Hi(rd) = Imm
[011111](31-26) llo rd Imm Lo(rd) = Imm
3/03追加
[101111] fneg rd rs rd = -.rs

000001(31-26) rs(25-21) rt(20-16) rd(15-11) add rd rs rt rd = rs + rt
000010(31-26) rs(25-21) rt(20-16) Imm(15-0) addi rt rs Imm rt = rs + Imm
[001110] sub rd rs rt rd = rs - rt
[001111] subi rd rs Imm rd = rs - Imm
mov rd = rs(addi)
[010000](31-26) rs(25-21) rd(20-16) Imm(15-0) slli rd rs Imm rd = rs << Imm
[010001](31-26) rs(25-21) rd(20-21) Imm(15-0) lw rs Imm(rd) rs = mem[rd + Imm](修正しました)
[010010](31-26) rs(25-21) rd(20-16) Imm(15-0) sw rs Imm(rd) mem[rd + Imm] = rs
[100001](31-26) rs(25-21) rt(20-16) rd(15-11) fadd rd rs rt rd = rs + rt
[100010] [100011] [100100] fsub fmul fdiv
fmov rd rs rd = rs(結局movと同じ?)
001101(31-26) jr pc = ra
|001100(31-26) target(19-0)|jall target|ra = [pc+1]; pc = target|(jalとjallを入れ替えた!?)
[010011](31-26) (25-21) jal rs pc = rs
000111(31-26) rs(25-21) rt(20-16) cmp rs rt cr = cond[rs - rt]
[010100](31-26) rs(25-21) Imm(15-0) cmpi rs Imm cr = cond[rs - Imm]
000100(31-26) target(19-0) jl target pc = target
[010101](31-26) rs(25-21) j rs pc = rs
001000(31-26) target(19-0) be target (if [cr = Equal]) pc = target
001011(31-26) target(19-0) bne target ...
001001(31-26) target(19-0) bg target ...
001010(31-26) target(19-0) bl target ...
[010110](31-26) target(19-0) ble target ...
[010111](31-26) target(19-0) bge target ...
[100101](31-26) rs(25-21) rt(20-16) fcmp rs rt cr = cond[rs - rt]
[100110](31-26) target(19-0) fble target
[100111] [101000] [101001] fbg fbe fbne
nop イラネ
000101(31-26) rd(25-21) led rd ピカーソ
000110(31-26) STOP

2/27追加
jmp(31-26) rd(25-21) jmp rd pc = [rd] レジスタを引数に取るジャンプ


ライブラリ用命令

[011000](31-26) rd(25-21) dec rd rd--
[101010](31-26) rd(25-21) rs(20-16) ftoi rd rs
[101011](31-26) rd(25-21) rs(20-16) itof rd rs


sparcだとプリミティブな命令

putchar
printf
fprintf
fputc
scanf
cos
sin
atan
floor

タグ:

+ タグ編集
  • タグ:

このサイトはreCAPTCHAによって保護されており、Googleの プライバシーポリシー利用規約 が適用されます。

最終更新:2007年03月14日 17:37
ツールボックス

下から選んでください:

新しいページを作成する
ヘルプ / FAQ もご覧ください。