龙芯俱乐部开源技术社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 9731|回复: 5

有没有人有龙芯扩展指令集的详细描述?

[复制链接]

3

主题

7

帖子

305

积分

中级会员

Rank: 3Rank: 3

积分
305
发表于 2020-5-24 11:46:50 | 显示全部楼层 |阅读模式
想写个汇编器来玩玩,目前只弄了MIPS32 R2的,想把龙芯扩展指令加进去,论坛里有人有吗?
源码贴上,欢迎有兴趣的小伙伴一起学习改进!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x

46

主题

115

帖子

4146

积分

论坛元老

Rank: 8Rank: 8

积分
4146
发表于 2020-5-24 22:29:21 | 显示全部楼层
程序怎麼玩

3

主题

7

帖子

305

积分

中级会员

Rank: 3Rank: 3

积分
305
 楼主| 发表于 2020-5-25 18:22:37 | 显示全部楼层
本帖最后由 黑洞引擎 于 2020-5-25 18:24 编辑

make之后得到zhizhu主程序
然后就可以按照下面命令格式翻译汇编文件
./zhizhu -o test test.S
只支持mips文档里(mips32 r2)的指令和格式

46

主题

115

帖子

4146

积分

论坛元老

Rank: 8Rank: 8

积分
4146
发表于 2020-5-26 03:03:12 | 显示全部楼层
本帖最后由 cyberhero 于 2020-5-26 03:06 编辑

報錯

  1. $ Diligent\ Spider/zhizhu -o first first.s
  2. 文件:first.s 第1行 错误码:-1  无法识别的命令!
  3. .text
复制代码



  1.                 .text
  2.                 .global main
  3.                 .ent main
  4. main:                nop
  5.                 li $v0, 8
  6.                 jr $ra
  7.                 .end main
复制代码

3

主题

7

帖子

305

积分

中级会员

Rank: 3Rank: 3

积分
305
 楼主| 发表于 2020-5-26 19:59:49 | 显示全部楼层

目前只支持mips32 r2的指令格式,具体如下表
而且只实现单条指令的翻译,系统启动码跟接口都没有呢

abs.d fd, fsdi [rt]nor rd, rs, rt
abs.ps fd, fsdiv rs, rtor rd, rs, rt
abs.s fd, fsdiv.d fd, fs, ftori rt, rs, immediate
add rd, rs, rtdiv.s fd, fs, ftpause
add.d fd, fs, ftdivu rs, rtpll.ps fd, fs, ft
add.ps fd, fs, ftehbplu.ps fd, fs, ft
add.s fd, fs, ftei [rt]pref hint, offset(base)
addi rt, rs, immediateeretprefe hint, offset(base)
addiu rt, rs, immediateext rt, rs, pos, sizeprefx hint, index(base)
addu rd, rs, rtfloor.l.d fd, fspul.ps fd, fs, ft
alnv.ps fd, fs, ft, rsfloor.l.s fd, fspuu.ps fd, fs, ft
and rd, rs, rtfloor.w.d fd, fsrdhwr rt, rd
andi rt, rs, immediatefloor.w.s fd, fsrdpgpr rd, rt
b offsetins rt, rs, pos, sizerecip.d fd, fs
bal offsetj targetrecip.s fd, fs
bc1f [cc, ] offsetjal targetrotr rd, rt, sa
bc1t [cc, ] offsetjalr [rd,] rsrotrv rd, rt, rs
bc2f [cc, ] offsetjalr.hb [rd,] rsround.l.d fd, fs
bc2t [cc, ] offsetjalx targetround.l.s fd, fs
beq rs, rt, offsetjr rsround.w.d fd, fs
bgez rs, offsetjr.hb rsround.w.s fd, fs
bgezal rs, offsetlb rt, offset(base)rsqrt.d fd, fs
bgtz rs, offsetlbe rt, offset(base)rsqrt.s fd, fs
blez rs, offsetlbu rt, offset(base)sb rt, offset(base)
bltz rs, offsetlbue rt, offset(base)sbe rt, offset(base)
bltzal rs, offsetldc1 ft, offset(base)sc rt, offset(base)
bne rs, rt, offsetldc2 rt, offset(base)sce rt, offset(base)
break [code]ldxc1 fd, index(base)sdbbp [code]
c.eq.d [cc,] fs, ftlh rt, offset(base)sdc1 ft, offset(base)
c.eq.ps [cc,] fs, ftlhe rt, offset(base)sdc2 rt, offset(base)
c.eq.s [cc,] fs, ftlhu rt, offset(base)sdxc1 fs, index(base)
c.f.d [cc,] fs, ftlhue rt, offset(base)seb rd, rt
c.f.ps [cc,] fs, ftll rt, offset(base)seh rd, rt
c.f.s [cc,] fs, ftlle rt, offset(base)sh rt, offset(base)
c.le.d [cc,] fs, ftlui rt, immediateshe rt, offset(base)
c.le.ps [cc,] fs, ftluxc1 fd, index(base)sll rd, rt, sa
c.le.s [cc,] fs, ftlw rt, offset(base)sllv rd, rt, rs
c.lt.d [cc,] fs, ftlwc1 ft, offset(base)slt rd, rs, rt
c.lt.ps [cc,] fs, ftlwc2 rt, offset(base)slti rt, rs, immediate
c.lt.s [cc,] fs, ftlwe rt, offset(base)sltiu rt, rs, immediate
c.nge.d [cc,] fs, ftlwl rt, offset(base)sltu rd, rs, rt
c.nge.ps [cc,] fs, ftlwle rt, offset(base)sqrt.d fd, fs
c.nge.s [cc,] fs, ftlwr rt, offset(base)sqrt.s fd, fs
c.ngl.d [cc,] fs, ftlwre rt, offset(base)sra rd, rt, sa
c.ngl.ps [cc,] fs, ftlwxc1 fd, index(base)srav rd, rt, rs
c.ngl.s [cc,] fs, ftmadd rs, rtsrl rd, rt, sa
c.ngle.d [cc,] fs, ftmadd.d fd, fr, fs, ftsrlv rd, rt, rs
c.ngle.ps [cc,] fs, ftmadd.ps fd, fr, fs, ftssnop
c.ngle.s [cc,] fs, ftmadd.s fd, fr, fs, ftsub rd, rs, rt
c.ngt.d [cc,] fs, ftmaddu rs, rtsub.d fd, fs, ft
c.ngt.ps [cc,] fs, ftmfc0 rt, rd [, sel]sub.ps fd, fs, ft
c.ngt.s [cc,] fs, ftmfc1 rt, fssub.s fd, fs, ft
c.ole.d [cc,] fs, ftmfhc1 rt, fssubu rd, rs, rt
c.ole.ps [cc,] fs, ftmfhi rdsuxc1 fs, index(base)
c.ole.s [cc,] fs, ftmflo rdsw rt, offset(base)
c.olt.d [cc,] fs, ftmov.d fd, fsswc1 rt, offset(base)
c.olt.ps [cc,] fs, ftmov.ps fd, fsswc2 rt, offset(base)
c.olt.s [cc,] fs, ftmov.s fd, fsswe rt, offset(base)
c.seq.d [cc,] fs, ftmovf rd, rs, ccswl rt, offset(base)
c.seq.ps [cc,] fs, ftmovf.d fd, fs, ccswle rt, offset(base)
c.seq.s [cc,] fs, ftmovf.ps fd, fs, ccswr rt, offset(base)
c.sf.d [cc,] fs, ftmovf.s fd, fs, ccswre rt, offset(base)
c.sf.ps [cc,] fs, ftmovn rd, rs, rtswxc1 fs, index(base)
c.sf.s [cc,] fs, ftmovn.d fd, fs, rtsync [stype]
c.ueq.d [cc,] fs, ftmovn.ps fd, fs, rtsynci offset(base)
c.ueq.ps [cc,] fs, ftmovn.s fd, fs, rtsyscall [code]
c.ueq.s [cc,] fs, ftmovt rd, rs, ccteq rs, rt [,code]
c.ule.d [cc,] fs, ftmovt.d fd, fs, ccteqi rs, immediate
c.ule.ps [cc,] fs, ftmovt.ps fd, fs, cctge rs, rt [,code]
c.ule.s [cc,] fs, ftmovt.s fd, fs, cctgei rs, immediate
c.ult.d [cc,] fs, ftmovz rd, rs, rttgeiu rs, immediate
c.ult.ps [cc,] fs, ftmovz.d fd, fs, rttgeu rs, rt [,code]
c.ult.s [cc,] fs, ftmovz.ps fd, fs, rttlbinv
c.un.d [cc,] fs, ftmovz.s fd, fs, rttlbinvf
c.un.ps [cc,] fs, ftmsub rs, rttlbp
c.un.s [cc,] fs, ftmsub.d fd, fr, fs, fttlbr
cache op, offset(base)msub.ps fd, fr, fs, fttlbwi
cachee op, offset(base)msub.s fd, fr, fs, fttlbwr
ceil.l.d fd, fsmsubu rs, rttlt rs, rt [,code]
ceil.l.s fd, fsmtc0 rt, rd [, sel]tlti rs, immediate
ceil.w.d fd, fsmtc1 rt, fstltiu rs, immediate
ceil.w.s fd, fsmthc1 rt, fstltu rs, rt [,code]
cfc1 rt, fsmthi rstne rs, rt [,code]
clo rd, rsmtlo rstnei rs, immediate
clz rd, rsmul rd, rs, rttrunc.l.d fd, fs
ctc1 rt, fsmul.d fd, fs, fttrunc.l.s fd, fs
cvt.d.l fd, fsmul.ps fd, fs, fttrunc.w.d fd, fs
cvt.d.s fd, fsmul.s fd, fs, fttrunc.w.s fd, fs
cvt.d.w fd, fsmult rs, rtwait [code]
cvt.l.d fd, fsmultu rs, rtwrpgpr rd, rt
cvt.l.s fd, fsneg.d fd, fswsbh rd, rt
cvt.ps.s fd, fs, ftneg.ps fd, fsxor rd, rs, rt
cvt.s.d fd, fsneg.s fd, fsxori rt, rs, immediate
cvt.s.l fd, fsnmadd.d fd, fr, fs, ft
cvt.s.pl fd, fsnmadd.ps fd, fr, fs, ft
cvt.s.pu fd, fsnmadd.s fd, fr, fs, ft
cvt.s.w fd, fsnmsub.d fd, fr, fs, ft
cvt.w.d fd, fsnmsub.ps fd, fr, fs, ft
cvt.w.s fd, fsnmsub.s fd, fr, fs, ft
deretnop

4

主题

24

帖子

764

积分

版主

Rank: 7Rank: 7Rank: 7

积分
764
发表于 2020-7-5 17:44:06 | 显示全部楼层
https://github.com/FlyGoat/loong ... ter/loongson-ext.md
这类有一个非官方的 LoongEXT 文档可供参考
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|龙芯俱乐部开源技术社区

GMT+8, 2024-11-28 06:26 , Processed in 0.103587 second(s), 23 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表