版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、«i电大学廿算机学院卄算机系统结构课程实验2015年4月实验三DLX处理器程序设计、X、实验类别:综合型实验目的:学习使用DLX汇编语言编程,进一步分析相关现象实验学时:4四、实验组人1/1五、实验设备环境:DLX汇编语言环境穴、实验原理:掌握向量运算算法和编程方法。七、教学要点与学习难点:DLX汇编语言八、实验容和要求:自编一段汇编代码,完成两双精度浮自一维向量的加法(或乘除 法)运算,并输出结果。向量K®>=16。观察程序中出规的数据/控 制/结构相关九、实验步骤:(1 )熟悉DLX汇编语言。(2) 编写两双精度浮点一维向量的HII法运算程序。(3) 对此程序完成
2、上面实验二中1 )、2)、3)、4)方面的分析。程序代码.data向量长厦为205.5,647.3,&2,9.1,5.5,667.7,889.8,1resultis;初始化两个用于松加的一维向量(双精度浮点敛),Ia:. double1.9,2.1,3.7,4.6,10.1,11.2,12.3,13.4,14.5,15.6,16.7,17.8,18.9,19.0,20.2b:.double1.1,2.2,3.3,4.4,10.9,11.8,12.7,13.6,14.5,15.4,16.3,17.2,18.1,19.9,20.8PrintfFormat:.asciizhThe.align
3、 2PrintfPar:.word PrintfFormatr:. space200;r为保存相加给果的向量空间 .text.global mainmain:addi r1,r0,0 ;Hit数相 1®的次数addui r4,r0,8 ;r4 为常数 8loop:;備坏it算向量ft!加给杲subi r2,r1,20 ;r1=20 时,跳转到 finishbeqz r2,finishmultu r3,r1,r4;r3为当甫分量相对于向量基址的|務(毎个分量占8B)Idf0,a(r3) ;® a中第门个分量Idf2,b(r3);取1)中第r1个分量adddf4,f0,f2内加
4、结果放在f4中sd r(r3),f4;将相#1结果放入结果向量r中addi r1,r1,1;下一分量j loopfinish:;输出向量Hl加的结果addi r14srO,PrintfPartrap 5trap 0运行结果C DLX-Standard-I/OOKThe result is3.0000004.3000007.0000009.00000011.00000013.00000015.00000017.00000018.90000021.00000023.00000025.00000027.00000029.00000031.00000033.00000035.00000037.0000
5、0038.90000041.000000Statistics可以看到具体数据情况和产生相关的比例等-LLJJ XITotal:179 Cyde|s) exeojted.ID executed ty 187 Inljvclioofs).2 ln$Uuctior($l curenlly in Pipelne.Hardware configuration: Memoiy cize 927G8 IddcEX-Stagei;. 1. requied Cycfe: 2 fmjIEX-Sfdce' 1. required Cycles: 5 fdi/EX-Stcgcs: 1 z rouircd Cy
6、cles: 19 Fawaidna disabledStalls:RAW Halle: 263 (55022 of al Cycles) WAW skals; 0 (0.00% ol ell Cyctei) Sbuctural state: 0 (QCOX of all Cycles) Conlrd 火Ils: 21 (4.99% of oil Cycles) Frap6 1.26% cf all CyclesTotal: 29051(3)(6167 of allCycke)Condit ional Branches):T okl: 21 (11.23% of dl Instiuctions)
7、. thered: taken 1 (476% of all cord Brencke not token 20 (£6.24% of dl cond D torches)Load/S t ore-1n© truution缶:T otal: 50 (32.08% of dl Iniuctions, iherecf:Loads 40 (G£G7 of Load7Store-ln2tnjctions)Stores: 20 (33.33% of Load/Store-lnstiuctiDn)F1omting pcint ©tage inst:ruutiono
8、:T otal: 40 (21.394 o( dl Instiuctions thereof:Addtio”: 23 (50.002 d Floalirg point 荻age inst) Multiplications: 20 (50. COS of Fbatng port stage inst.) OMsion?- 0(0 CO of Roathg pont stege inst.)Trars:Traps: 2(1.07 ol dl Instiuctbns)结果分林1. 数据相关由Statistics中的知道,发生7 55.02%的数据相关。查看可以发现, 产生的相关都为RW读写相关。它们
9、分别为:addi r1,r0,0subi r2,r1,20 subi r2,r1,20beqz r2,finish multu r3,r1,r4Id fOta(r3)Id f2,b(3)addd f4,f0,f2addd f4,f0,f2sd r(,f4IT Gode OtU Own-lQlxJ±Jb«qs CjiuhOdilon.才iMoai勿2. 控胃相关由Statistics中的可以看到,发生了 4.39%的控制相关。系貌按照预消成功来执行指令,执行一条指令后马上将其下条指令trap读进来。3. 结构相关由干程序只简单的做了一次JJU法,所以没有结构相关产生。4. 増
10、加浮点运算册件对牲能的影喑下图分别为浮点运算部件为1和4的时候数据情况对比! statistics |LJ X|Total473 Cycfell 他 OH 刖ID weculed S187 Instr ucri|t|. 2lnstfuct>0fi|2j cmetM妙 h Ppeir»*Hrdvare configurat LanMowiv32恋I By©(RcEGStag 話 1.阳 quied C冗切 2ImdEX-Slajn 1, irquid Cydes 5 frfv>>Sws攵 l.reqirjCyclBsr 19For/Astdrg d話bted
11、.Stalls:RAW rtak 263 |羽 02Z ol al Cpctes) 切AS 勿站 0(0.03 dal Cy:M Siiucludl itak 0 (0 CO ; o! Nl 3 能 I Ccnltd italr 21 |4.39X & al CyckiJ Troo 次灰 6(1.25 c(alC*:fes) TcUl 2 £Q%)(6Q6挨 d al CychdCondi tioad.l Braxiches):Tctat 21 (11.237: cf d Indrucbcnx) Iherecf taken 114.76幺 of al cond Bfaicbe
12、e) not later). 33 向.24% ol al ccrid 8rarch«)Lod-/S t oxe-Instructions.Tclal 60(32.0Ki dInsbucbcns lherecf Lo対夂 3(66.673 & Lad7Skrc In如加曲) Stoiei; 20 (33.33 c4Lce/Slc&lrr细 ucbow)Floating point stage iastructioas:T cUl 4。.3及 d el IntbucbcnsJ, Ibcrecf. 幼ctwsr 刃(W nccFloohrg g"如RirwU 忆
13、BbBict": 20 (50.03 cf Fbairig pcit We in次 J rvisbra 0(0.OJX cf Fbaliigpcenl stage inrt )Txap.Trap if 2(1 07% ol 1 lrdlimthns|nsiflomcs IxVotal:1478 Cydef) executedID cxecvtcd ty 18? I冋rudb何2 lnsbuclhr(sj cunerfiy n Fpeire1 Hardware configuration1 Meroiy xce jC?7688/wGd1EXSi岂®: <feqUiedC
14、yde 2 frrrjEX $tao3« l.rGQuradCjch S (drvEX-S lages: 4, requted Cdes: 19Fccwaidrqd 価 bdStalls:ROW .dte. 23 P5.02u(dl Cyvi) «AW 勿別玄 OfO.OCofalCiides) Stiucfird atailr 0 (0 ODX ol al Cydei"Cor<rd 泅尿 21 |4 59% d 目IC隔*Trap 及灰:6 方N o! al Cycles) IoW: 293 StdbKEO 6 怎少皿 CyctedCondicional
15、Branchss): "Told: 21 |11.23 ol ol Imlructbm). iterccf 以代 1 (4.763; ol al con.8 is由斶 rwl 曲 Eti: 23 (S5 24 龙 & dl cond 引 ancb&m)LgocI-S toze-I ns t ructionsTM 60132.03 ot al IhUruoliohsl ibarec Lob诊 0(66 67 & Locd7S»crd r«lnjd:ion| Staiec 33 (3233 d Load- lcce-lnxliucbcns|FL
16、coting point stage instxvetions:IaW: 40 忆1.29怎 ol al Instruclhns). IbsiecfAdciii:)也 201510 血 of Fbsbro羽 a h$i.)M UtpIcaliDns: ED 15叮JZ ot FbAng part stag inst) Drv»icn: 0(QOG d Fhng pci-i rfege iraljTrops:7reps: 2(1.0?/ol al Inxliuzlicnsj由上图的对比可知,当浮点运算部件个数给边后统廿结果均相同,也就是其数量对该函数没有任何性能方面的改进。分期其原因为
17、,这主要是因为函数中没有连续的浮点加指令,乘、除指令。5. « M forward SJ件对性能的影响下图左侧为没有勾选enable forwarding吋的运行数摒结果,右侧为使用 T forwarding 技术。 rustics |LJ| 八ITotal:47C Cyb(s) executed.ID e»?cuted t$i 187 lnitiuctDn($)2 lrtsauaior($) cuferitl/ m Fipeire.Hardvare con f igxirat ion: Memory size 32738 B>tes faidEX-Stag: 4.
18、required Cycig 2 fmUEX-Skgsi. 4. requred Cyfei; 5 fdvGX-Stage 4Z requred Cycles: 19 Forwarding di油led.Stalls:RAW ddk: 260 (55.02% of ol C>cb) WAW 0 (O OOX of 剖匚阳同 Sljuctucl 玖alls. C (0.00% of al Cycles) Control staik 21 (4 29 of dl Cjicles) T idp sials: 6 (1.26% of dl Cycles) Total: 2S0 StdlH(GQG
19、7 of all Cycles)Conditiono1 Eronches):I obi 21 ('123 d all InstruclonsJ. thefeot taken; 1 (4.76 of dl cond. Brorchcs) rot taken 20 (95.2伐 d all cond. Bf«rtche?)Load-St cxe-Instruot ionm: r otal 60 32.0% cf all lnstructbn$L thereot Lords 40 (GG.G7% of Lood /S tore Instrudion$| Stores 20 (23
20、33X of Load-TStoie-lnstructionsJFloatiriT peint mtmgm instruction©:Total 40 (21.38 cf alllnstrucfonsLthereotA&kicm: 20 (500% ol Flowing pant ztago insl) Multplcahcns: 20 (50 OOX of Floating cont stage inst J DWisicn?: 0(0.00鬼 of Fbotng point 血gc imtjTraps: T rape: 2 (1.07 cf alllndructionc)
21、 swngJLWJJSJTotal:356 Cycle(纣 ©xecUed.ID ewcU.od187 Injtiuclion(s).21nstruchcn(s) current n Ppeline.Hardvaxe coni iquratLon:Memory size: 32768 By2今 fadJEX-Stages 1 z required Cycles 2 fnulFX Stages 1Z requred Cycles?: 5 fdivEHI Gtagcs: 1Z requred Cycles: 19 For/vardina enabled.Stalls:RAW stalk
22、141 (29 G1/i d all Cjide?). thereof: LD 如s 20 (14.1 Q% of RAW 如对 Branch/Jun 21 (14.89 ol RAW FloDbng poirt stalk: 1 CO (70.92宠 of RfiM otalb)WAW aallc: 9(000 of al CycleslStrudud ddk: 0 (0.00 of all Cycle?)Contiol skals: 21 (6 COZ of al Cycles)T rep stdlh: 6 (1.68Z of Wl C>cte$)Total 168 Stal(s)
23、(47.19% of dl C烛幼Conditional Branches>:Tuidl 21 (11 23% ofallln$Uuaicn$),lh&eof. taken: 1 (4 76X of al cond. Branches! not token: 20 (95.24% ol oil cond. Branches)Load-S tore-1 ne t xuo 匕 i one:Total 60 (32 08% of all ln$trucxicnz thereof: Loack: 413(65 67 d Lead-JStore-lnstruclicns) Stores; 20(33.33% of Load7Slc(e-lnstruelienj)Floatinm point ©tag© inetruotionm:Total 40 (21 39X of all ln$tructicn$)z thereDf:Adriilicns: 20 (5QCO of Roatng pant saje inst) Mdliplcations; 20 (53.00% cf Flowing point stage inst) Divisions: (I lO OOX of Floeting point stage ircs
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 小班消防主题教育
- 黄雨伞创新设计思路
- 团员意识的教育
- 慢病高钾管理共识精要
- 露营活动策划书
- 教育机构对比研究框架
- 模拟打靶器系统教学课件
- 理想职业教育体系构建
- 北京绿研公益发展中心:规制公海转载:以金枪鱼区域渔业管理组织为例
- 店铺促销活动方案设计
- 2026年水利安全生产考核b证题库附参考答案详解【培优】
- 2026四川泸州北方化学工业有限公司社会招聘保卫人员8人笔试备考题库及答案详解
- 2026年喀什地区“才聚喀什·智惠丝路”春季招才引智(824人)考试模拟试题及答案解析
- 2026教科版(新教材)小学科学三年级下册期中复习检测试卷及答案(共三套)
- 施工现场实名制奖惩制度
- 4.1《权利与义务相统一》课件 2025-2026 学年统编版道德与法治 八年级下册
- 功与功率课件2025-2026学年高一下学期物理人教版必修第二册
- AAV血友病基因治疗应用
- (一模)2026年深圳市高三年级第一次调研考试数学试卷(含官方答案及解析)
- AI助力网格员信息统计与上报
- 静脉治疗血管解剖知识
评论
0/150
提交评论