1900|0

3836

帖子

19

TA的资源

纯净的硅(中级)

楼主
 

解析dsp c6000 MVK 指令 [复制链接]

MVK/MVKL - Move a Signed Constant into a Register and Sign-Extend  ('C64x)

Syntax

MVK (.unit) cst, dst
.unit = .L1 or .L2, .S1 or .S2, .D1 or .D2

//c6000 dsp 结构中包括寄存器文件A 和寄存器文件B,其中A包括单元.L1 .S1 .M1 .D1 B包括.D2 .M2 .S2 .L2
Opcode map field used... For operand type Unit Opfield
cst
dst scst16
sint .S1, .S2
cst
dst scst5
sint .L1, .L2 00101
cst
dst scst5
sint .D1, .D2 000000

//上述表示操作16bit 的常数时要使用单元.S1 .S2,操作5bit常数时要使用.L1 .L2 或者.D1 .D2
Opcode

.S Unit
 
.L Unit
 
.D Unit
 

Description

In the MVK/MVKL instruction, the cst (constant) is sign extended and placed in dst. The .S unit form allows for a 16-bit signed constant. This is the same MVK instruction that is found on the C62x but with the added flexibility of being able to perform this operation not only on the .S unit but also on the .L and .D units when the constant is limited to a 5-bit signed constant.
Since many non-address constants fall into a 5-bit sign constant range, this allows the flexibility to schedule the MVK instruction on the .L or .D units. In the .D unit form, the constant is in the position normally used by src1, as for address math. Only the MVK instruction is supported on the .L or .D units. The .S unit supports both MVK and MVKL.

In most cases, the C6000 assembler and linker issue a warning or an error when a constant is outside the range supported by the instruction. In the case of MVK .S, a warning is issued whenever the constant is outside the signed 16-bit range, ?2768 to 32767 (or 0XFFFF8000 to 0x 00007FFF).
For example:

MVK  .S1   0x00008000X, A0

will generate a warning, whereas

MVK  .S1  0 x FFFF8000, A0

will not generate a warning.
The MVKL instruction is equivalent to the MVK instruction, except that the MVKL disables the constant range checking normally performed by the assembler/linker. This allows MVKL to be paired with MVKH to generate 32-bit constants.
To load 32-bit constants, such as 0x1234 ABCD, use the following pair of instructions:

 MVKL  S1 0x0ABCD, A4 MVKLH .S1 0x1234, A4

This could also be used:

 MVKL  .S1 0x1234ABCD, A4 MVKH  .S1 0x1234ABCD, A4

Use this to load the address of a label:

 MVKL .S2 label, B5 MVKH .S2 label, B5

Execution

if (cond) scst ?dst
else nop

Pipeline

Pipeline
Stage E1
Read
Written dst
Unit in use  .L, .S, or .D
Instruction Type

Single Cycle

Delay Slots

0

See Also

MVKH, MVKLH

Example 1

MVK .L2 ?,B8

 

Example 2

MVK .D2 14,B8

 

Example 3

MVKL .S1 5678h,A8

 

Example 4

MVKL .S1 0C678h,A8

点赞 关注
 

回复
举报
您需要登录后才可以回帖 登录 | 注册

查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/9 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表