12.07.2015 Views

RealView 编译工具编译器参考指南 - ARM Information Center

RealView 编译工具编译器参考指南 - ARM Information Center

RealView 编译工具编译器参考指南 - ARM Information Center

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

编 译 器 特 有 的 功 能ptr指 向 要 写 入 到 内 存 中 的 数 据 的 地 址 。 若 要 指 定 要 写 入 的 数 据 的 大小 , 请 将 参 数 类 型 转 换 为 相 应 的 整 型 。表 4-14 __swp 内 在 函 数 支 持 的 访 问 宽 度指 令 加 载 的 数 据 大 小 C 类 型 转 换SWPB 无 符 号 字 节 (char *)SWP 字 (int *)返 回 值在 val 覆 盖 以 前 位 于 ptr 所 指 向 的 内 存 地 址 中 的 数 据 值 之 前 , __swp 内 在 函 数 将返 回 该 值 。示 例int foo(void){int loc=0xff;return(__swp(0x20, (volatile int *)loc));}编 译 此 代 码 时 , 将 生 成 以 下 内 容 :||foo|| PROCMOV r1, #0xffMOV r0, #0x20SWP r0, r0, [r1]BX lrENDP另 请 参 阅• 《 汇 编 器 指 南 》 中 第 4-38 页 的 SWP 和 SWPB。4.7.40 __usat此 内 在 函 数 在 编 译 器 生 成 的 指 令 流 中 插 入 USAT 指 令 。 它 允 许 从 C 或 C++ 代 码 中饱 和 无 符 号 值 。语 法int __usat(unsigned int val, unsigned int sat)4-100 Copyright © 2007-2009 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0348BCNon-Confidential, Unrestricted AccessID090708

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!