05.02.2013 Views

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The System Level Programmers’ Model<br />

When floating-point operation is disabled because FPEXC.EN is 0, all Advanced SIMD <strong>and</strong> VFP<br />

instructions are treated as Undefined Instructions except for:<br />

a VMSR to the FPEXC or FPSID register<br />

a VMRS from the FPEXC, FPSID, MVFR0, or MVFR1 register.<br />

These instructions can be executed only in privileged modes.<br />

Note<br />

When FPEXC.EN == 0, these operations are treated as Undefined Instructions:<br />

— a VMSR to the FPSCR<br />

— a VMRS from the FPSCR<br />

If a VFP implementation contains system registers additional to the FPSID, FPSCR, FPEXC,<br />

MVFR0, <strong>and</strong> MVFR1 registers, the behavior of VMSR instructions to them <strong>and</strong> VMRS instructions from<br />

them is SUBARCHITECTURE DEFINED.<br />

Pseudocode details of enabling the Advanced SIMD <strong>and</strong> VFP extensions<br />

The following pseudocode takes appropriate action if an Advanced SIMD or VFP instruction is used when<br />

the extensions are not enabled:<br />

// CheckAdvSIMDOrVFPEnabled()<br />

// ==========================<br />

CheckAdvSIMDOrVFPEnabled(boolean include_fpexc_check, boolean advsimd)<br />

if HaveSecurityExt() then<br />

// Check Non-secure Access Control Register for permission to use CP10/11.<br />

if NSACR.cp10 != NSACR.cp11 then UNPREDICTABLE;<br />

if SCR.NS == ‘1’ && NSACR.cp10 == ‘0’ then UNDEFINED;<br />

// Check Coprocessor Access Control Register for permission to use CP10/11.<br />

if CPACR.cp10 != CPACR.cp11 then UNPREDICTABLE;<br />

case CPACR.cp10 of<br />

when ‘00’ UNDEFINED;<br />

when ‘01’ if !CurrentModeIsPrivileged() then UNDEFINED; // else CPACR permits access<br />

when ‘10’ UNPREDICTABLE;<br />

when ‘11’ // CPACR permits access<br />

// If the Advanced SIMD extension is specified, check whether it is disabled.<br />

if advsimd && CPACR.ASEDIS == ‘1’ then UNDEFINED;<br />

// If required, check FPEXC enabled bit.<br />

if include_fpexc_check && FPEXC.EN == ‘0’ then UNDEFINED;<br />

return;<br />

// CheckAdvSIMDEnabled()<br />

// =====================<br />

CheckAdvSIMDEnabled()<br />

<strong>ARM</strong> DDI 0406B Copyright © 1996-1998, 2000, 2004-2008 <strong>ARM</strong> Limited. All rights reserved. B1-65

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

Saved successfully!

Ooh no, something went wrong!