6 IAR Intrinsic Functions

This section shows a summary of IAR intrinsic functions and the best MPLAB XC32 replacement where that is available. These intrinsic functions and their MPLAB XC32 equivalents are discussed in more detail in the sections that follow. Note that what is referred to as an intrinsic function by IAR documentation is known as a built-in function in the MPLAB XC context. It is recommended that you compare the relevant sections in the MPLAB® XC32 C/C++ Compiler User's Guide with those in your IAR C/C++ Compiler User Guide to ensure that migrated code will work as expected in all situations.

Table 6-1.  IAR Intrinsic Functions to MPLAB XC32 equivalents
IAR Intrinsic Function (links to explanatory section)Suggested MPLAB XC32 Migration
__arm_cdp, __arm_cdp2
__builtin_arm_cdp
__builtin_arm_cdp2
__arm_ldc, __arm_ldc2
__builtin_arm_ldc,
      __builtin_arm_ldc2
__arm_mcr, __arm_mcr2, __arm_mcrr, __arm_mcrr2
__builtin_arm_mcr
__builtin_arm_mcr2
__builtin_arm_mcrr
__builtin_arm_mcrr2
__arm_mrc, __arm_mrc2, __arm_mrrc, __arm_mrrc2
__builtin_arm_mrc
__builtin_arm_mrc2
__builtin_arm_mrrc
__builtin_arm_mrrc2
__arm_rsr, __arm_rsr64, __arm_rsrp Error by XC32
__arm_stc, __arm_stcl, __arm_stc2, __arm_stc2l
__builtin_arm_stc
__builtin_arm_stcl
__builtin_arm_stc2
__builtin_arm_stc2l
__arm_wsr, __arm_wsr64, __arm_wsrp No simple migration recommended
__CDP, __CDP2
__builtin_arm_cdp
__builtin_arm_cdp2
__CLREX __CLREX
__CLZ __CLZ
__crc32b, __crc32h, __crc32w, __crc32d
__builtin_arm_crc32b
__builtin_arm_crc32h
__builtin_arm_crc32w
__crc32cb, __crc32ch, __crc32cw, __crc32cd
__builtin_arm_crc32cb
__builtin_arm_crc32ch
__builtin_arm_crc32cw
__disable_debug No simple migration recommended
__disable_fiq Ignored by XC32
__disable_interrupt __set_PRIMASK(1)
__disable_irq Error by XC32
__disable_SError No simple migration recommended
__DMB __DMB
__DSB __DSB
__enable_debug Error by XC32
__enable_fiq Ignored by XC32
__enable_interrupt No simple migration recommended
__enable_irq Ignored by XC32
__enable_SError Error by XC32
__fma, __fmaf __builtin_fma
__get_BASEPRI __get_BASEPRI
__get_CONTROL __get_CONTROL
__get_CPSR Error by XC32
__get_FAULTMASK __get_FAULTMASK
__get_FPSCR __get_FPSCR
__get_interrupt_state Error by XC32
__get_IPSR __get_IPSR
__get_MSP __get_MSP
__get_PRIMASK __get_PRIMASK
__get_PSP __get_PSP
__get_PSR __get_PSR
__get_SB Not supported
__get_SP __get_MSP
__ISB__ISB
__LDC, __LDCL, __LDC2, __LDC2L Error by XC32
__LDC_noidx, __LDCL_noidx, __LDC2_noidx, __LDC2L_noidx Error by XC32
__LDREX, __LDREXB, __LDREXD, __LDREXH _LDREXB, _LDREXH, _LDREXW
__no_operation __NOP
__PKHBT __PKHBT
__PKHTB __PKHTB
__PLD, __PLDW Error by XC32
__PLI Error by XC32
__QADD, __QDADD, __QDSUB, __QSUB __QADD, __QSUB
__QADD8, __QADD16, __QASX, __QSAX, __QSUB8, __QSUB16
__QADD8 
__QADD16 
__QASX 
__QSAX 
__QSUB8 
__QSUB16
__QCFlag No simple migration recommended
__QDOUBLE No simple migration recommended
__QFlag No simple migration recommended
__RBIT __RBIT
__reset_Q_flag Error by XC32
__reset_QC_flag Error by XC32
__REV, __REV16, __REVSH __REV, __REV16, __REVSH
__rintn, __rintnf Not supported
__ROR __ROR
__RRX __RRX
__SADD8, __SADD16, __SASX, __SSAX, __SSUB8, __SSUB16 Use
__SADD8
__SADD16
__SASX
__SSAX
__SSUB8
__SSUB16
__SEL __SEL
__set_BASEPRI __set_BASEPRI
__set_CONTROL __set_CONTROL
__set_CPSR Not supported
__set_FAULTMASK __set_FAULTMASK
__set_FPSCR Not supported
__set_interrupt_state Not supported
__set_LR Not supported
__set_MSP __set_MSP
__set_PRIMASK __set_PRIMASK
__set_PSP __set_PSP
__set_SB Not supported
__set_SP __set_MSP
__SEV __SEV
__SHADD8, __SHADD16, __SHASX, __SHSAX, __SHSUB8, __SHSUB16
__SHADD8
__SHADD16
__SHASX
__SHSAX
__SHSUB8,
__SHSUB16
__SMLABB, __SMLABT, __SMLATB, __SMLATT, __SMLAWB, __SMLAWT Not supported
__SMLAD, __SMLADX, __SMLSD, __SMLSDX
__SMLAD
__SMLADX
__SMLSD
__SMLSDX
__SMLALBB, __SMLALBT, __SMLALTB, __SMLALTT Not supported
__SMLALD, __SMLALDX, __SMLSLD, __SMLSLDX
__SMLALD
__SMLALDX
__SMLSLD
__SMLSLDX
__SMMLA, __SMMLAR, __SMMLS, __SMMLSR __SMMLA
__SMMUL, __SMMULR Not supported
__SMUAD, __SMUADX, __SMUSD, __SMUSDX
__SMUAD
__SMUADX
__SMUSD
__SMUSDX
__SMUL Not supported
__SMULBB, __SMULBT, __SMULTB, __SMULTT, __SMULWB, __SMULWT Not supported
__sqrt, __sqrtf sqrt , sqrtf
__SSAT __SSAT
__SSAT16 __SSAT16
__STC, __STCL, __STC2, __STC2L Not supported
__STC_noidx, __STCL_noidx, __STC2_noidx, __STC2L_noidx Not supported
__STREX, __STREXB, __STREXD, __STREXH __STREXB, __STREXH
__SWP, __SWPB Not supported
__SXTAB, __SXTAB16, __SXTAH, __SXTB16 __SXTAB16, __SXTB16
__TT, __TTT, __TTA, __TTAT
cmse_TT
cmse_TTT
cmse_TTA
cmse_TTAT
__UADD8, __UADD16, __UASX, __USAX, __USUB8, __USUB16
__UADD8
__UADD16
__UASX
__USAX
__USUB8 
__USUB16
__UHADD8, __UHADD16, __UHASX, __UHSAX, __UHSUB8, __UHSUB16
__UHADD8
__UHADD16
__UHASX
__UHSAX
__UHSUB8  
__UHSUB16
__UMAAL Not supported
__UQADD8, __UQADD16, __UQASX, __UQSAX, __UQSUB8, __UQSUB16
__UQADD8
__UQADD16
__UQASX
__UQSAX
__UQSUB8
__UQSUB16
__USAD8, __USADA8 __USAD8, __USADA8
__USAT __USAT
__USAT16 __USAT16
__UXTAB, __UXTAB16, __UXTAH, __UXTB16 __UXTAB16, __UXTB16
__VFMA_F64, __VFMS_F64, __VFNMA_F64, __VFNMS_F64, __VFMA_F32, __VFMS_F32, __VFNMA_F32, __VFNMS_F32 Not supported
__VMINNM_F64, __VMAXNM_F64, __VMINNM_F32, __VMAXNM_F32 Not supported
__VRINTA_F64, __VRINTM_F64, __VRINTN_F64, __VRINTP_F64, __VRINTX_F64, __VRINTR_F64, __VRINTZ_F64, __VRINTA_F32, __VRINTM_F32, __VRINTN_F32, __VRINTP_F32, __VRINTX_F32, __VRINTR_F32, __VRINTZ_F32Not supported
__VSQRT_F64, __VSQRT_F32 Not supported
__WFE, __WFI, __YIELD __WFE, __WFI