AUTOSAR CP SWS MFXLibrary
AUTOSAR CP SWS MFXLibrary
AUTOSAR CP R23-11
4
AUTOSAR
2018-10-31 4.4.0 Release • Editorial changes
Management
• Added requirement tracing information
for SWS_Mfx_00024
• Clarifications
• Updated SWS_Mfx_00017 for shift value
AUTOSAR of Function ID 0x200 to 0x205 from 64 to
2015-07-31 4.2.2 Release 63
Management
• Updated SWS_Mfx_00001 under
Section 5.1 File Structure
AUTOSAR
2014-10-31 4.2.1 Release • Minor corrections and clarifications
Management
AUTOSAR
2014-03-31 4.1.3 Release • Editorial Changes
Management
AUTOSAR • Corrections and removals of duplicate
Release functions
2013-10-31 4.1.2
Management • Editorial changes
AUTOSAR
2013-03-15 4.1.1 • Editorial Changes
Administration
5
4
• Addition to the list of function for
AUTOSAR consistency and completeness
2011-12-22 4.0.3
Administration
• Fix typing errors in document
• New API created to achieve completion
of the need
AUTOSAR
2010-09-30 3.1.5
Administration • File structure has been detailed for what
concerns naming conventions
AUTOSAR
2010-02-02 3.1.4 • Initial Release
Administration
Disclaimer
This work (specification and/or software implementation) and the material contained in
it, as released by AUTOSAR, is for the purpose of information only. AUTOSAR and the
companies that have contributed to it shall not be liable for any use of the work.
The material contained in this work is protected by copyright and other types of intel-
lectual property rights. The commercial exploitation of the material contained in this
work requires a license to such intellectual property rights.
This work may be utilized or reproduced without any modification, in any form or by
any means, for informational purposes only. For any other purpose, no part of the work
may be utilized or reproduced, in any form or by any means, without permission in
writing from the publisher.
The work has been developed for automotive applications only. It has neither been
developed, nor tested for non-automotive applications.
The word AUTOSAR and the AUTOSAR logo are registered trademarks.
Contents
1 Introduction and functional overview 8
3 Related documentation 10
3.1 Input documents & related standards and norms . . . . . . . . . . . . . 10
3.2 Related specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4 Constraints and assumptions 11
4.1 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.2 Applicability to car domains . . . . . . . . . . . . . . . . . . . . . . . . . 11
5 Dependencies to other modules 12
5.1 File structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
6 Requirements Tracing 13
7 Functional specification 15
7.1 Error classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
7.1.1 Development Errors . . . . . . . . . . . . . . . . . . . . . . . . 15
7.1.2 Runtime Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
7.1.3 Transient Faults . . . . . . . . . . . . . . . . . . . . . . . . . . 15
7.1.4 Production Error . . . . . . . . . . . . . . . . . . . . . . . . . . 15
7.1.5 Extended Production Errors . . . . . . . . . . . . . . . . . . . . 15
7.2 Initialization and shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . 16
7.3 Using Library API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
7.4 Library implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
8 API specification 18
8.1 Imported types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
8.2 Type definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
8.3 Comment about rounding . . . . . . . . . . . . . . . . . . . . . . . . . . 19
8.4 Comment about routines optimization . . . . . . . . . . . . . . . . . . . . 19
8.4.1 Optimized with constants . . . . . . . . . . . . . . . . . . . . . 19
8.5 Mathematical routines definitions . . . . . . . . . . . . . . . . . . . . . . 20
8.5.1 Additions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
8.5.2 Subtractions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
8.5.3 Absolute value . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
8.5.4 Absolute value of a difference . . . . . . . . . . . . . . . . . . 24
8.5.5 Multiplications . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
8.5.6 Divisions rounded towards 0 . . . . . . . . . . . . . . . . . . . 28
8.5.7 Divisions rounded off . . . . . . . . . . . . . . . . . . . . . . . 30
8.5.8 Combinations of multiplication and division rounded towards 0 32
8.5.9 Combinations of multiplication and division rounded off . . . . 34
8.5.10 Combinations of multiplication and shift right . . . . . . . . . . 36
10 Configuration specification 69
10.1 How to read this chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
10.2 Containers and configuration parameters . . . . . . . . . . . . . . . . . . 69
10.3 Published Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
3 Related documentation
[1] Glossary
AUTOSAR_FO_TR_Glossary
[2] ISO/IEC 9899:1990 Programming Language - C
https://www.iso.org
[3] General Specification of Basic Software Modules
AUTOSAR_CP_SWS_BSWGeneral
[4] General Requirements on Basic Software Modules
AUTOSAR_CP_SRS_BSWGeneral
[5] Requirements on Libraries
AUTOSAR_CP_SRS_Libraries
4.1 Limitations
• No requirements on Service library can be implemented in multiple ways. Many
small routines can be combined into one implementation file. For bigger routines,
one file shall contain one routine implementation. Generally one routine per ob-
ject file is recommended from linker optimization point of view. For Bit handling
routines more routines can contribute to form one object file. This kind of group-
ing is not achieved in Release 4.0, Rev001 and will be addressed in Release 4.0,
rev002
6 Requirements Tracing
The following tables reference the requirements specified in [4], [5] and links to the
fulfillment of these. Please note that if column “Satisfied by” is empty for a specific
requirement this means that this requirement is not fulfilled by this document.
Requirement Description Satisfied by
[SRS_BSW_00003] All software modules shall provide [SWS_Mfx_00215]
version and identification information
[SRS_BSW_00007] All Basic SW Modules written in C [SWS_Mfx_00209]
language shall conform to the MISRA
C 2012 Standard.
[SRS_BSW_00304] All AUTOSAR Basic Software [SWS_Mfx_00212]
Modules shall use only AUTOSAR
data types instead of native C data
types
[SRS_BSW_00306] AUTOSAR Basic Software Modules [SWS_Mfx_00213]
shall be compiler and platform
independent
[SRS_BSW_00318] Each AUTOSAR Basic Software [SWS_Mfx_00215]
Module file shall provide version
numbers in the header file
[SRS_BSW_00321] The version numbers of AUTOSAR [SWS_Mfx_00215]
Basic Software Modules shall be
enumerated according specific rules
[SRS_BSW_00348] All AUTOSAR standard types and [SWS_Mfx_00211]
constants shall be placed and
organized in a standard type header
file
[SRS_BSW_00374] All Basic Software Modules shall [SWS_Mfx_00214]
provide a readable module vendor
identification
[SRS_BSW_00378] AUTOSAR shall provide a boolean [SWS_Mfx_00212]
type
[SRS_BSW_00379] All software modules shall provide a [SWS_Mfx_00214]
module identifier in the header file
and in the module XML description
file.
[SRS_BSW_00402] Each module shall provide version [SWS_Mfx_00214]
information
[SRS_BSW_00407] Each BSW module shall provide a [SWS_Mfx_00215] [SWS_Mfx_00216]
function to read out the version
information of a dedicated module
implementation
[SRS_BSW_00411] All AUTOSAR Basic Software [SWS_Mfx_00216]
Modules shall apply a naming rule for
enabling/disabling the existence of
the API
[SRS_BSW_00437] Memory mapping shall provide the [SWS_Mfx_00210]
possibility to define RAM segments
which are not to be initialized during
startup
[SRS_LIBS_00001] The functional behavior of each [SWS_Mfx_00218]
library functions shall not be
configurable
5
4
Requirement Description Satisfied by
[SRS_LIBS_00002] A library shall be operational before [SWS_Mfx_00200]
all BSW modules and application
SW-Cs
[SRS_LIBS_00003] A library shall be operational until the [SWS_Mfx_00201]
shutdown
[SRS_LIBS_00004] Using libraries shall not pass through [SWS_Mfx_00203]
a port interface
[SRS_LIBS_00005] Each library shall provide one header [SWS_Mfx_00001] [SWS_Mfx_91001]
file with its public interface
[SRS_LIBS_00007] Using a library should be documented [SWS_Mfx_00205]
[SRS_LIBS_00009] All library functions shall be re-entrant [SWS_Mfx_91001]
[SRS_LIBS_00011] All function names and type names [SWS_Mfx_91001]
shall start with "Library short name_"
[SRS_LIBS_00015] It shall be possible to configure the [SWS_Mfx_00206]
microcontroller so that the library
code is shared between all callers
[SRS_LIBS_00017] Usage of macros should be avoided [SWS_Mfx_00207]
[SRS_LIBS_00018] A library function may only call library [SWS_Mfx_00208]
functions
Table 6.1: RequirementsTracing
7 Functional specification
8 API specification
It is observed that since the sizes of the integer types provided by the C language are
implementation-defined, the range of values that may be represented within each of
the integer types will vary between implementations.
Thus, in order to improve the portability of the software, these types are defined in
Platform_Types.h [6].The following mnemonics are used in the library routine names.
Size Platform Type Mnemonic
signed 8-Bit sint8 s8
signed 16-Bit sint16 s16
signed 32-Bit sint32 s32
unsigned 8-Bit uint8 u8
unsigned 16-Bit uint16 u16
unsigned 32-Bit uint32 u32
As described in [6], the ranges for each of the base types are shown in Table 2.
Base Type Range
uint8 [ 0, 255 ]
sint8 [ -128, 127 ]
uint16 [ 0, 65535 ]
sint16 [ -32768, 32767 ]
uint32 [ 0, 4294967295 ]
sint32 [ -2147483648, 2147483647 ]
8.5.1 Additions
c()
[SWS_Mfx_00006] dThis routine makes an addition between the two arguments:
Return-value = x_value + y_valuec()
[SWS_Mfx_00007] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
[SWS_Mfx_00008] dHere is the list of implemented functions.c()
Function ID[hex] Function prototype
0x001 uint8 Mfx_Add_u8u8_u8( uint8 , uint8);
0x002 uint8 Mfx_Add_u8s8_u8( uint8 , sint8);
0x003 sint8 Mfx_Add_u8s8_s8( uint8 , sint8);
0x004 uint8 Mfx_Add_s8s8_u8( sint8 , sint8);
0x005 sint8 Mfx_Add_s8s8_s8( sint8 , sint8);
0x006 uint16 Mfx_Add_u16u16_u16( uint16 , uint16);
0x007 uint16 Mfx_Add_u16s16_u16( uint16 , sint16);
0x008 sint16 Mfx_Add_u16s16_s16( uint16 , sint16);
0x009 uint8 Mfx_Add_s16s16_u8( sint16 , sint16);
0x00A sint8 Mfx_Add_s16s16_s8( sint16 , sint16);
0x00B uint16 Mfx_Add_s16s16_u16( sint16 , sint16);
0x00C sint16 Mfx_Add_s16s16_s16( sint16 , sint16);
0x00D sint8 Mfx_Add_u32u32_s8( uint32 , uint32);
0x00E sint16 Mfx_Add_u32u32_s16( uint32 , uint32);
5
4
Function ID[hex] Function prototype
0x00F uint32 Mfx_Add_u32u32_u32( uint32 , uint32);
0x010 sint32 Mfx_Add_u32u32_s32( uint32 , uint32);
0x011 uint32 Mfx_Add_u32s32_u32( uint32 , sint32);
0x012 sint32 Mfx_Add_u32s32_s32( uint32 , sint32);
0x013 uint32 Mfx_Add_s32s32_u32( sint32 , sint32);
0x014 sint32 Mfx_Add_s32s32_s32( sint32 , sint32);
0x015 uint8 Mfx_Add_s32s32_u8( sint32 , sint32);
0x016 sint8 Mfx_Add_s32s32_s8( sint32 , sint32);
0x017 uint16 Mfx_Add_s32s32_u16( sint32 , sint32);
0x018 sint16 Mfx_Add_s32s32_s16( sint32 , sint32);
0x019 sint16 Mfx_Add_u32s32_s16( uint32 , sint32);
0x01A sint8 Mfx_Add_u32s32_s8( uint32 , sint32);
0x01B uint16 Mfx_Add_u32s32_u16( uint32 , sint32);
0x01C uint8 Mfx_Add_u32s32_u8( uint32 , sint32);
0x01D uint16 Mfx_Add_u32u32_u16( uint32 , uint32);
0x01E uint8 Mfx_Add_u32u32_u8( uint32 , uint32);
0x01F sint16 Mfx_Add_u16u16_s16( uint16 , uint16);
0x020 uint8 Mfx_Add_u16u16_u8( uint16 , uint16);
0x021 uint8 Mfx_Add_u16s16_u8( uint16 , sint16);
0x022 sint8 Mfx_Add_u16u16_s8( uint16 , uint16);
0x023 sint8 Mfx_Add_u16s16_s8( uint16 , sint16);
0x024 sint8 Mfx_Add_u8u8_s8( uint8 , uint8);
8.5.2 Subtractions
c()
4
Function ID[hex] Function prototype
0x04B sint8 Mfx_Sub_u32u32_s8( uint32 , uint32);
0x04C uint8 Mfx_Sub_u32u32_u8( uint32 , uint32);
0x04D uint16 Mfx_Sub_s16u16_u16( sint16 , uint16);
0x04E uint8 Mfx_Sub_u16s16_u8( uint16 , sint16);
0x04F uint8 Mfx_Sub_s16u16_u8( sint16 , uint16);
0x050 sint8 Mfx_Sub_u16s16_s8( uint16 , sint16);
0x051 sint8 Mfx_Sub_s16u16_s8( sint16 , uint16);
0x052 uint8 Mfx_Sub_s8u8_u8( sint8 , uint8);
0x053 uint8 Mfx_Sub_s8s8_u8( sint8 , sint8);
0x054 sint8 Mfx_Sub_u8s8_s8( uint8 , sint8);
c()
[SWS_Mfx_00014] dThis routine computes the absolute value of a signed value:
Return-value = | x_value |c()
[SWS_Mfx_00015] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
[SWS_Mfx_00016] dHere is the list of implemented functions.c()
c()
[SWS_Mfx_00018] dThis routine computes the absolute value of a difference between
2 values:
Return-value = | x_value - y_value |c()
[SWS_Mfx_00019] dReturn-value shall be saturated to boundary values in the event
of overflow.c()
[SWS_Mfx_00020] dHere is the list of implemented functions.c()
8.5.5 Multiplications
c()
[SWS_Mfx_00022] dThis routine makes a multiplication between the two arguments:
Return-value = x_value * y_valuec()
[SWS_Mfx_00023] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
c()
[SWS_Mfx_00026] dThese routines make a division between the two arguments:
Return-value = x_value / y_valuec()
[SWS_Mfx_00027] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
[SWS_Mfx_00028] dThe result after division by zero is defined by:
* If x_value ≥ 0 then the function returns the maximum value of the output type
* If x_value < 0 then the function returns the minimum value of the output typec()
[SWS_Mfx_00030] dThe result is rounded towards 0.c()
[SWS_Mfx_00031] dHere is the list of implemented functions.c()
Function ID[hex] Function prototype
0x0A8 uint8 Mfx_Div_u8u8_u8( uint8 , uint8);
0x0A9 uint8 Mfx_Div_s8u8_u8( sint8 , uint8);
0x0AA uint8 Mfx_Div_u8s8_u8( uint8 , sint8);
0x0AB uint8 Mfx_Div_s8s8_u8( sint8 , sint8);
0x0AC sint8 Mfx_Div_u8s8_s8( uint8 , sint8);
0x0AD sint8 Mfx_Div_s8u8_s8( sint8 , uint8);
0x0AE sint8 Mfx_Div_s8s8_s8( sint8 , sint8);
0x0AF uint16 Mfx_Div_u16u16_u16( uint16 , uint16);
0x0B0 uint16 Mfx_Div_s16u16_u16( sint16 , uint16);
5
4
Function ID[hex] Function prototype
0x0B1 uint16 Mfx_Div_u16s16_u16( uint16 , sint16);
0x0B2 sint16 Mfx_Div_u16s16_s16( uint16 , sint16);
0x0B3 sint16 Mfx_Div_s16u16_s16( sint16 , uint16);
0x0B4 uint16 Mfx_Div_s16s16_u16( sint16 , sint16);
0x0B5 uint8 Mfx_Div_s16s16_u8( sint16 , sint16);
0x0B6 sint8 Mfx_Div_s16s16_s8( sint16 , sint16);
0x0B7 sint16 Mfx_Div_s16s16_s16( sint16 , sint16);
0x0B8 sint16 Mfx_Div_s32u32_s16( sint32 , uint32);
0x0B9 uint32 Mfx_Div_u32u32_u32( uint32 , uint32);
0x0BA uint32 Mfx_Div_s32u32_u32( sint32 , uint32);
0x0BB uint32 Mfx_Div_u32s32_u32( uint32 , sint32);
0x0BC sint32 Mfx_Div_u32s32_s32( uint32 , sint32);
0x0BD sint32 Mfx_Div_s32u32_s32( sint32 , uint32);
0x0BE uint32 Mfx_Div_s32s32_u32( sint32 , sint32);
0x0BF uint8 Mfx_Div_s32s32_u8( sint32 , sint32);
0x0C0 sint8 Mfx_Div_s32s32_s8( sint32 , sint32);
0x0C1 uint16 Mfx_Div_s32s32_u16( sint32 , sint32);
0x0C2 sint16 Mfx_Div_s32s32_s16( sint32 , sint32);
0x0C3 sint32 Mfx_Div_s32s32_s32( sint32 , sint32);
0x0C4 sint8 Mfx_Div_u32u32_s8( uint32 , uint32);
0x0C5 sint16 Mfx_Div_u32u32_s16( uint32 , uint32);
0x0C6 sint32 Mfx_Div_u32u32_s32( uint32 , uint32);
0x0C7 sint8 Mfx_Div_s32u32_s8( sint32 , uint32);
0x0C8 uint16 Mfx_Div_s32u32_u16( sint32 , uint32);
0x0C9 uint8 Mfx_Div_s32u32_u8( sint32 , uint32);
0x0CA sint16 Mfx_Div_u32s32_s16( uint32 , sint32);
0x0CB sint8 Mfx_Div_u32s32_s8( uint32 , sint32);
0x0CC uint16 Mfx_Div_u32s32_u16( uint32 , sint32);
0x0CD uint8 Mfx_Div_u32s32_u8( uint32 , sint32);
0x0CE uint16 Mfx_Div_u32u32_u16( uint32 , uint32);
0x0CF uint8 Mfx_Div_u32u32_u8( uint32 , uint32);
0x0D0 sint16 Mfx_Div_u16u16_s16( uint16 , uint16);
0x0D1 uint8 Mfx_Div_u16u16_u8( uint16 , uint16);
0x0D2 uint8 Mfx_Div_u16s16_u8( uint16 , sint16);
0x0D3 uint8 Mfx_Div_s16u16_u8( sint16 , uint16);
0x0D4 sint8 Mfx_Div_u16u16_s8( uint16 , uint16);
0x0D5 sint8 Mfx_Div_u16s16_s8( uint16 , sint16);
0x0D6 sint8 Mfx_Div_s16u16_s8( sint16 , uint16);
0x0D7 sint8 Mfx_Div_u8u8_s8( uint8 , uint8);
c()
[SWS_Mfx_00033] dThese routines make a division between the two arguments:
Return-value = x_value / y_valuec()
[SWS_Mfx_00034] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
[SWS_Mfx_00035] dThe result after division by zero is defined by:
* If x_value ≥ 0 then the function returns the maximum value of the output type
* If x_value < 0 then the function returns the minimum value of the output typec()
[SWS_Mfx_00037] dThe result is rounded off.c()
[SWS_Mfx_00038] dHere is the list of implemented functions.c()
Function ID[hex] Function prototype : RDiv
0x0D8 uint8 Mfx_RDiv_u8u8_u8( uint8 , uint8);
0x0D9 uint8 Mfx_RDiv_s8u8_u8( sint8 , uint8);
0x0DA uint8 Mfx_RDiv_u8s8_u8( uint8 , sint8);
0x0DB uint8 Mfx_RDiv_s8s8_u8( sint8 , sint8);
0x0DC sint8 Mfx_RDiv_u8s8_s8( uint8 , sint8);
0x0DD sint8 Mfx_RDiv_s8u8_s8( sint8 , uint8);
0x0DE sint8 Mfx_RDiv_s8s8_s8( sint8 , sint8);
0x0DF uint16 Mfx_RDiv_u16u16_u16( uint16 , uint16);
0x0E0 uint16 Mfx_RDiv_s16u16_u16( sint16 , uint16);
0x0E1 uint16 Mfx_RDiv_u16s16_u16( uint16 , sint16);
5
4
Function ID[hex] Function prototype : RDiv
0x0E2 sint16 Mfx_RDiv_u16s16_s16( uint16 , sint16);
0x0E3 sint16 Mfx_RDiv_s16u16_s16( sint16 , uint16);
0x0E4 uint16 Mfx_RDiv_s16s16_u16( sint16 , sint16);
0x0E5 uint8 Mfx_RDiv_s16s16_u8( sint16 , sint16);
0x0E6 sint8 Mfx_RDiv_s16s16_s8( sint16 , sint16);
0x0E7 sint16 Mfx_RDiv_s16s16_s16( sint16 , sint16);
0x0E8 sint16 Mfx_RDiv_s32u32_s16( sint32 , uint32);
0x0E9 uint32 Mfx_RDiv_u32u32_u32( uint32 , uint32);
0x0EA uint32 Mfx_RDiv_s32u32_u32( sint32 , uint32);
0x0EB uint32 Mfx_RDiv_u32s32_u32( uint32 , sint32);
0x0EC sint32 Mfx_RDiv_u32s32_s32( uint32 , sint32);
0x0ED sint32 Mfx_RDiv_s32u32_s32( sint32 , uint32);
0x0EE uint32 Mfx_RDiv_s32s32_u32( sint32 , sint32);
0x0EF uint8 Mfx_RDiv_s32s32_u8( sint32 , sint32);
0x0F0 sint8 Mfx_RDiv_s32s32_s8( sint32 , sint32);
0x0F1 uint16 Mfx_RDiv_s32s32_u16( sint32 , sint32);
0x0F2 sint16 Mfx_RDiv_s32s32_s16( sint32 , sint32);
0x0F3 sint32 Mfx_RDiv_s32s32_s32( sint32 , sint32);
0x0F4 sint8 Mfx_RDiv_u32u32_s8( uint32 , uint32);
0x0F5 sint16 Mfx_RDiv_u32u32_s16( uint32 , uint32);
0x0F6 sint32 Mfx_RDiv_u32u32_s32( uint32 , uint32);
0x0F7 sint8 Mfx_RDiv_s32u32_s8( sint32 , uint32);
0x0F8 uint16 Mfx_RDiv_s32u32_u16( sint32 , uint32);
0x0F9 uint8 Mfx_RDiv_s32u32_u8( sint32 , uint32);
0x0FA sint16 Mfx_RDiv_u32s32_s16( uint32 , sint32);
0xoFB sint8 Mfx_RDiv_u32s32_s8( uint32 , sint32);
0x0FC uint16 Mfx_RDiv_u32s32_u16( uint32 , sint32);
0x0FD uint8 Mfx_RDiv_u32s32_u8( uint32 , sint32);
0x0FE uint16 Mfx_RDiv_u32u32_u16( uint32 , uint32);
0x0FF uint8 Mfx_RDiv_u32u32_u8( uint32 , uint32);
0x100 sint16 Mfx_RDiv_u16u16_s16( uint16 , uint16);
0x101 uint8 Mfx_RDiv_u16u16_u8( uint16 , uint16);
0x102 uint8 Mfx_RDiv_u16s16_u8( uint16 , sint16);
0x103 uint8 Mfx_RDiv_s16u16_u8( sint16 , uint16);
0x104 sint8 Mfx_RDiv_u16u16_s8( uint16 , uint16);
0x105 sint8 Mfx_RDiv_u16s16_s8( uint16 , sint16);
0x106 sint8 Mfx_RDiv_s16u16_s8( sint16 , uint16);
0x107 sint8 Mfx_RDiv_u8u8_s8( uint8 , uint8);
c()
[SWS_Mfx_00040] dThese routines make a multiplication between the two arguments
and a division by the third argument:
Return-value = x_value * y_value / z_valuec()
[SWS_Mfx_00041] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
[SWS_Mfx_00042] dThe result after division by zero is defined by:
* If x_value*y_value ≥ 0 then the function returns the maximum value of the output
type
* If x_value*y_value < 0 then the function returns the minimum value of the output typec
()
[SWS_Mfx_00044] dThe result is rounded towards 0.c()
[SWS_Mfx_00045] dHere is the list of implemented functions.c()
Function ID[hex] Function prototype : Div
0x108 uint16 Mfx_MulDiv_s32s32s32_u16( sint32 , sint32 , sint32);
0x109 sint16 Mfx_MulDiv_s32s32s32_s16( sint32 , sint32 , sint32);
0x10A uint16 Mfx_MulDiv_u32u32u16_u16( uint32 , uint32 ,
uint16);
5
4
Function ID[hex] Function prototype : Div
0x10B sint16 Mfx_MulDiv_s32s32s16_s16( sint32 , sint32 , sint16);
0x10C uint16 Mfx_MulDiv_s16u16s16_u16( sint16 , uint16 , sint16);
0x10D uint16 Mfx_MulDiv_s16u16u16_u16( sint16 , uint16 , uint16);
0x10E uint16 Mfx_MulDiv_u16u16u16_u16( uint16 , uint16 ,
uint16);
0x10F sint16 Mfx_MulDiv_s16u16s16_s16( sint16 , uint16 , sint16);
0x110 sint16 Mfx_MulDiv_s16s16u16_s16( sint16 , sint16 , uint16);
0x111 sint16 Mfx_MulDiv_s16u16u16_s16( sint16 , uint16 , uint16);
0x112 sint16 Mfx_MulDiv_s16s16s16_s16( sint16 , sint16 , sint16);
0x113 uint32 Mfx_MulDiv_u32u32u32_u32( uint32 , uint32 ,
uint32);
0x114 uint32 Mfx_MulDiv_u32u32s32_u32( uint32 , uint32 , sint32);
0x115 uint32 Mfx_MulDiv_u32s32u32_u32( uint32 , sint32 , uint32);
0x116 uint32 Mfx_MulDiv_u32s32s32_u32( uint32 , sint32 , sint32);
0x117 sint32 Mfx_MulDiv_s32s32u32_s32( sint32 , sint32 , uint32);
0x118 sint32 Mfx_MulDiv_s32u32s32_s32( sint32 , uint32 , sint32);
0x119 sint32 Mfx_MulDiv_s32u32u32_s32( sint32 , uint32 , uint32);
0x11A sint32 Mfx_MulDiv_s32s32s32_s32( sint32 , sint32 , sint32);
0x11B uint16 Mfx_MulDiv_u32u32u32_u16( uint32 , uint32 ,
uint32);
0x11C uint16 Mfx_MulDiv_u16s16s16_u16( uint16 , sint16 , sint16);
0x11D uint16 Mfx_MulDiv_u16s16u16_u16( uint16 , sint16 , uint16);
0x11E sint16 Mfx_MulDiv_u16s16s16_s16( uint16 , sint16 , sint16);
0x11F sint16 Mfx_MulDiv_u16s16u16_s16( uint16 , sint16 , uint16);
0x120 sint32 Mfx_MulDiv_u32s32s32_s32( uint32 , sint32 , sint32);
0x121 sint32 Mfx_MulDiv_u32s32u32_s32( uint32 , sint32 , uint32);
Note : The redundancy due to commutativity will be reduced in the next version
c()
[SWS_Mfx_00047] dThese routines make a multiplication between the two arguments
and a division by the third argument:
Return-value = x_value * y_value / z_valuec()
[SWS_Mfx_00048] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
[SWS_Mfx_00049] dThe result after division by zero is defined by:
* If x_value*y_value ≥ 0 then the function returns the maximum value of the output
type
* If x_value*y_value < 0 then the function returns the minimum value of the output typec
()
[SWS_Mfx_00051] dThe result is rounded off.c()
[SWS_Mfx_00052] dHere is the list of implemented functions.c()
Function ID[hex] Function prototype : RDiv
0x122 uint16 Mfx_RMulDiv_s32s32s32_u16( sint32 , sint32 ,
sint32);
0x123 sint16 Mfx_RMulDiv_s32s32s32_s16( sint32 , sint32 ,
sint32);
5
4
Function ID[hex] Function prototype : RDiv
0x124 uint16 Mfx_RMulDiv_u32u32u16_u16( uint32 , uint32 ,
uint16);
0x125 sint16 Mfx_RMulDiv_s32s32s16_s16( sint32 , sint32 ,
sint16);
0x126 uint16 Mfx_RMulDiv_s16u16s16_u16( sint16 , uint16 ,
sint16);
0x127 uint16 Mfx_RMulDiv_s16u16u16_u16( sint16 , uint16 ,
uint16);
0x128 uint16 Mfx_RMulDiv_u16u16u16_u16( uint16 , uint16 ,
uint16);
0x129 sint16 Mfx_RMulDiv_s16u16s16_s16( sint16 , uint16 ,
sint16);
0x12A sint16 Mfx_RMulDiv_s16s16u16_s16( sint16 , sint16 ,
uint16);
0x12B sint16 Mfx_RMulDiv_s16u16u16_s16( sint16 , uint16 ,
uint16);
0x12C sint16 Mfx_RMulDiv_s16s16s16_s16( sint16 , sint16 ,
sint16);
0x12D uint32 Mfx_RMulDiv_u32u32u32_u32( uint32 , uint32 ,
uint32);
0x12E uint32 Mfx_RMulDiv_u32u32s32_u32( uint32 , uint32 ,
sint32);
0x12F uint32 Mfx_RMulDiv_u32s32u32_u32( uint32 , sint32 ,
uint32);
0x130 uint32 Mfx_RMulDiv_u32s32s32_u32( uint32 , sint32 ,
sint32);
0x131 sint32 Mfx_RMulDiv_s32s32u32_s32( sint32 , sint32 ,
uint32);
0x132 sint32 Mfx_RMulDiv_s32u32s32_s32( sint32 , uint32 ,
sint32);
0x133 sint32 Mfx_RMulDiv_s32u32u32_s32( sint32 , uint32 ,
uint32);
0x134 sint32 Mfx_RMulDiv_s32s32s32_s32( sint32 , sint32 ,
sint32);
0x135 uint16 Mfx_RMulDiv_u32u32u32_u16( uint32 , uint32 ,
uint32);
0x136 uint16 Mfx_RMulDiv_u16s16s16_u16( uint16 , sint16 ,
sint16);
0x137 uint16 Mfx_RMulDiv_u16s16u16_u16( uint16 , sint16 ,
uint16);
0x138 sint16 Mfx_RMulDiv_u16s16s16_s16( uint16 , sint16 ,
sint16);
0x139 sint16 Mfx_RMulDiv_u16s16u16_s16( uint16 , sint16 ,
uint16);
0x13A sint32 Mfx_RMulDiv_u32s32s32_s32( uint32 , sint32 ,
sint32);
0x13B sint32 Mfx_RMulDiv_u32s32u32_s32( uint32 , sint32 ,
uint32);
Note : The redundancy due to commutativity will be reduced in the next version
c()
[SWS_Mfx_00054] dThis routine makes a multiplication between the two arguments
and applies a shift right defined by the third argument:
Return-value = (x_value * y_value) >> shiftc()
[SWS_Mfx_00055] dWe precise that for the shift right of a negative number, we always
keep the bit of sign.c()
[SWS_Mfx_00056] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
[SWS_Mfx_00057] dHere is the list of implemented functions.c()
Function ID[hex] Function prototype Associated
maximum shift
0x13C uint8 Mfx_MulShRight_s16s16u8_u8( 30
sint16 , sint16 , uint8 );
0x13D sint8 Mfx_MulShRight_s16s16u8_s8( 30
sint16 , sint16 , uint8 );
0x13E sint16 Mfx_MulShRight_s16s16u8_ 30
s16( sint16 , sint16 , uint8 );
0x13F uint16 Mfx_MulShRight_s16s16u8_ 30
u16( sint16 , sint16 , uint8 );
5
4
Function ID[hex] Function prototype Associated
maximum shift
0x140 uint8 Mfx_MulShRight_u32s32u8_u8( 63
uint32 , sint32 , uint8 );
0x141 sint8 Mfx_MulShRight_u32s32u8_s8( 63
uint32 , sint32 , uint8 );
0x142 uint16 Mfx_MulShRight_u32s32u8_ 63
u16( uint32 , sint32 , uint8 );
0x143 sint16 Mfx_MulShRight_u32s32u8_ 63
s16( uint32 , sint32 , uint8 );
0x144 uint32 Mfx_MulShRight_u32s32u8_ 63
u32( uint32 , sint32 , uint8 );
0x145 sint32 Mfx_MulShRight_u32s32u8_ 63
s32( uint32 , sint32 , uint8 );
0x146 sint8 Mfx_MulShRight_s32s32u8_s8( 62
sint32 , sint32 , uint8 );
0x147 uint8 Mfx_MulShRight_s32s32u8_u8( 62
sint32 , sint32 , uint8 );
0x148 sint16 Mfx_MulShRight_s32s32u8_ 62
s16( sint32 , sint32 , uint8 );
0x149 uint16 Mfx_MulShRight_s32s32u8_ 62
u16( sint32 , sint32 , uint8 );
0x14A uint32 Mfx_MulShRight_s32s32u8_ 62
u32( sint32 , sint32 , uint8 );
0x14B sint32 Mfx_MulShRight_s32s32u8_ 62
s32( sint32 , sint32 , uint8 );
0x14C uint8 Mfx_MulShRight_u32u32u8_u8( 63
uint32 , uint32 , uint8 );
0x14D sint8 Mfx_MulShRight_u32u32u8_s8( 63
uint32 , uint32 , uint8 );
0x14E uint16 Mfx_MulShRight_u32u32u8_ 63
u16( uint32 , uint32 , uint8 );
0x14F sint16 Mfx_MulShRight_u32u32u8_ 63
s16( uint32 , uint32 , uint8 );
0x150 uint32 Mfx_MulShRight_u32u32u8_ 63
u32( uint32 , uint32 , uint8 );
0x151 sint32 Mfx_MulShRight_u32u32u8_ 63
s32( uint32 , uint32 , uint8 );
If you want to see an example of the use of these functions, see subsection 8.7.1 .
c()
[SWS_Mfx_00059] dThis routine applies a shift left defined by the third argument to
the first argument, and then makes a division by the second argument:
Return-value = (x_value << shift) / y_valuec()
[SWS_Mfx_00060] dWe precise that for the shift left of a negative number, we always
keep the bit of sign.c()
[SWS_Mfx_00061] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
[SWS_Mfx_00062] dThe result after division by zero is defined by:
* If x_value ≥ 0 then the function returns the maximum value of the output type
* If x_value < 0 then the function returns the minimum value of the output typec()
[SWS_Mfx_00064] dHere is the list of implemented functions.c()
Function ID[hex] Function prototype Associated maximum shift
0x152 uint8 Mfx_DivShLeft_u8u8u8_u8( uint8 8
, uint8 , uint8 );
0x153 uint8 Mfx_DivShLeft_u16u16u8_u8( 16
uint16 , uint16 , uint8 );
5
4
Function ID[hex] Function prototype Associated maximum shift
0x154 uint16 Mfx_DivShLeft_u16u16u8_u16( 16
uint16 , uint16 , uint8 );
0x155 sint16 Mfx_DivShLeft_s16s16u8_s16( 16
sint16 , sint16 , uint8 );
0x156 sint16 Mfx_DivShLeft_s16u16u8_s16( 16
sint16 , uint16 , uint8 );
0x157 uint16 Mfx_DivShLeft_u32u32u8_u16( 31
uint32 , uint32 , uint8 );
0x158 uint32 Mfx_DivShLeft_u32u32u8_u32( 31
uint32 , uint32 , uint8 );
0x159 sint32 Mfx_DivShLeft_s32s32u8_s32( 31
sint32 , sint32 , uint8 );
0x15A sint32 Mfx_DivShLeft_s32u32u8_s32( 31
sint32 , uint32 , uint8 );
0x15B uint8 Mfx_DivShLeft_u32s32u8_u8( 31
uint32 , sint32 , uint8 );
0x15C sint8 Mfx_DivShLeft_u32s32u8_s8( 31
uint32 , sint32 , uint8 );
0x15D uint16 Mfx_DivShLeft_u32s32u8_u16( 31
uint32 , sint32 , uint8 );
0x15E sint16 Mfx_DivShLeft_u32s32u8_s16( 31
uint32 , sint32 , uint8 );
0x15F uint32 Mfx_DivShLeft_u32s32u8_u32( 31
uint32 , sint32 , uint8 );
0x160 sint32 Mfx_DivShLeft_u32s32u8_s32( 31
uint32 , sint32 , uint8 );
0x161 sint8 Mfx_DivShLeft_s32s32u8_s8( 31
sint32 , sint32 , uint8 );
0x162 uint8 Mfx_DivShLeft_s32s32u8_u8( 31
sint32 , sint32 , uint8 );
0x163 sint16 Mfx_DivShLeft_s32s32u8_s16( 31
sint32 , sint32 , uint8 );
0x164 uint16 Mfx_DivShLeft_s32s32u8_u16( 31
sint32 , sint32 , uint8 );
0x165 uint32 Mfx_DivShLeft_s32s32u8_u32( 31
sint32 , sint32 , uint8 );
0x166 uint8 Mfx_DivShLeft_u32u32u8_u8( 31
uint32 , uint32 , uint8 );
0x167 sint8 Mfx_DivShLeft_u32u32u8_s8( 31
uint32 , uint32 , uint8 );
0x168 sint16 Mfx_DivShLeft_u32u32u8_s16( 31
uint32 , uint32 , uint8 );
0x169 sint32 Mfx_DivShLeft_u32u32u8_s32( 31
uint32 , uint32 , uint8 );
0x16A uint8 Mfx_DivShLeft_s32u32u8_u8( 31
sint32 , uint32 , uint8 );
0x16B sint8 Mfx_DivShLeft_s32u32u8_s8( 31
sint32 , uint32 , uint8 );
0x16C uint16 Mfx_DivShLeft_s32u32u8_u16( 31
sint32 , uint32 , uint8 );
0x16D sint16 Mfx_DivShLeft_s32u32u8_s16( 31
sint32 , uint32 , uint8 );
0x16E uint32 Mfx_DivShLeft_s32u32u8_u32( 31
sint32 , uint32 , uint8 );
If you want to see an example of the use of these functions, see subsection 8.7.2 .
8.5.12 Modulo
c()
[SWS_Mfx_00066] dIf y_value is zero, the result is zero.c()
[SWS_Mfx_00068] dIn other cases, Return-value = x_value mod y_valuec()
[SWS_Mfx_00069] dThe sign of the remainder is the same than the sign of x_value.c
()
[SWS_Mfx_00070] dHere is the list of implemented functions.c()
Function ID[hex] Function prototype
0x16F uint8 Mfx_Mod_u8( uint8 , uint8);
0x170 sint8 Mfx_Mod_s8( sint8 , sint8);
0x171 uint16 Mfx_Mod_u16( uint16 , uint16);
0x172 sint16 Mfx_Mod_s16( sint16 , sint16);
0x173 uint32 Mfx_Mod_u32( uint32 , uint32);
0x174 sint32 Mfx_Mod_s32( sint32 , sint32);
0x175 uint8 Mfx_Mod_u32u32_u8( uint32 , uint32)
0x176 sint8 Mfx_Mod_s32s32_s8( sint32 , sint32)
0x177 uint16 Mfx_Mod_u32u32_u16( uint32 , uint32)
0x178 sint16 Mfx_Mod_s32s32_s16( sint32 , sint32)
8.5.13 Limiting
c()
[SWS_Mfx_00074] dReturn-value = min_value if value < min_valuec()
[SWS_Mfx_00075] dReturn-value = max_value if value > max_valuec()
[SWS_Mfx_00076] dReturn-value = value in the other casesc()
[SWS_Mfx_00079] dHere is the list of implemented functions.c()
Function ID[hex] Function prototype
0x179 uint8 Mfx_Limit_u8( uint8 , uint8, uint8);
0x17A sint8 Mfx_Limit_s8( sint8 , sint8, sint8);
0x17B uint16 Mfx_Limit_u16( uint16 , uint16, uint16);
0x17C sint16 Mfx_Limit_s16( sint16 , sint16, sint16);
0x17D uint32 Mfx_Limit_u32( uint32 , uint32, uint32);
0x17E sint32 Mfx_Limit_s32( sint32 , sint32, sint32);
8.5.14 Limitations with only one value for minimum and maximum
c()
[SWS_Mfx_00091] dReturn-value = x_value if x_value < y_valuec()
[SWS_Mfx_00092] dReturn-value = y_value in the other casec()
[SWS_Mfx_00093] Definition of API function Mfx_Max_<TypeMn> d
Service Name Mfx_Max_<TypeMn>
Syntax <Type> Mfx_Max_<TypeMn> (
<Type> x_value,
<Type> y_value
)
Service ID [hex] 0x18B to 0x190
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) x_value First argument
y_value Second argument
Parameters (inout) None
Parameters (out) None
Return value <Type> Result of the calculation
Description This routine returns the maximum between two values.
Available via Mfx.h
c()
[SWS_Mfx_00094] dReturn-value = x_value if x_value > y_valuec()
[SWS_Mfx_00095] dReturn-value = y_value in the other casec()
[SWS_Mfx_00096] dHere is the list of implemented functions.c()
A Radix will always be a signed integer on 16 bits (sint16). For that reason, the
mnemonic will not appear in the name of the functions in order to have shorter names.
For all operations, the valid range is given for information. Indeed, operations with
parameters outside of the valid range will be saturated within the range of the output
type. It can help for optimization purpose.
8.6.1 Conversion
c()
[SWS_Mfx_00101] dThe function returns the integer value of the fixed point conversion
(C), determined by C = 2ˆ(c-a) * x.c()
[SWS_Mfx_00102] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
[SWS_Mfx_00103] dIf it is necessary to round the result of this equation, it is rounded
toward zero.c()
[SWS_Mfx_00104] dHere is the list of implemented functions.c()
Function ID[hex] Function prototype
0x191 uint8 Mfx_ConvertP2_u16_u8(uint16 x, sint16 a, sint16 c)
0x192 sint8 Mfx_ConvertP2_s16_s8(sint16 x, sint16 a, sint16 c)
c()
[SWS_Mfx_00107] dThe function returns the integer value of the fixed point conversion
(C), determined by C = 2ˆ(c-a) * x.c()
[SWS_Mfx_00108] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
[SWS_Mfx_00109] dIf it is necessary to round the result of this equation, it is rounded
toward zero.c()
[SWS_Mfx_00110] dHere is the list of implemented functions.c()
Function ID[hex] Function prototype
0x193 uint16 Mfx_ConvertP2_u8_u16(uint8 x, sint16 a, sint16 c)
0x194 sint16 Mfx_ConvertP2_s8_s16 (sint8 x, sint16 a, sint16 c)
c()
[SWS_Mfx_00113] dThe function returns the integer value of the fixed point conversion
(C), determined by C = 2ˆ(c-a) * x.c()
[SWS_Mfx_00114] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
[SWS_Mfx_00115] dIf it is necessary to round the result of this equation, it is rounded
toward zero.c()
[SWS_Mfx_00116] dHere is the list of implemented functions.c()
Function ID[hex] Function prototype
0x195 uint16 Mfx_ConvertP2_u32_u16 (uint32 x, sint16 a, sint16 c)
0x196 sint16 Mfx_ConvertP2_s32_s16 (sint32 x, sint16 a, sint16 c)
c()
[SWS_Mfx_00119] dThe function returns the integer value of the fixed point conversion
(C), determined by C = 2ˆ(c-a) * x.c()
[SWS_Mfx_00120] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
[SWS_Mfx_00121] dIf it is necessary to round the result of this equation, it is rounded
toward zero.c()
[SWS_Mfx_00122] dHere is the list of implemented functions.c()
Function ID[hex] Function prototype
0x197 uint32 Mfx_ConvertP2_u16_u32(uint16 x, sint16 a, sint16 c)
0x198 sint32 Mfx_ConvertP2_s16_s32(sint16 x, sint16 a, sint16 c)
8.6.2 Multiplication
c()
[SWS_Mfx_00125] dThe function returns the integer value of the fixed point multiplica-
tion (C), determined by C = 2ˆ(c-b-a) * [x * y].c()
[SWS_Mfx_00126] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
[SWS_Mfx_00127] dIf it is necessary to round the result of this equation, it is rounded
toward zero.c()
[SWS_Mfx_00128] dHere is the list of implemented functions.c()
Function ID[hex] Function prototype
0x199 uint16 Mfx_MulP2_u16u16_u16(uint16 x, uint16 y, sint16 a,
sint16 b, sint16 c)
0x19A uint16 Mfx_MulP2_u16s16_u16(uint16 x, sint16 y, sint16 a,
sint16 b, sint16 c)
5
4
Function ID[hex] Function prototype
0x19B uint16 Mfx_MulP2_s16s16_u16(sint16 x, sint16 y, sint16 a,
sint16 b, sint16 c)
0x19C sint16 Mfx_MulP2_u16u16_s16(uint16 x, uint16 y, sint16 a,
sint16 b, sint16 c)
0x19D sint16 Mfx_MulP2_u16s16_s16(uint16 x, sint16 y, sint16 a,
sint16 b, sint16 c)
0x19E sint16 Mfx_MulP2_s16s16_s16(sint16 x, sint16 y, sint16 a,
sint16 b, sint16 c)
c()
[SWS_Mfx_00131] dThe function returns the integer value of the fixed point multiplica-
tion (C), determined by C = 2ˆ(c-b-a) * [x * y].c()
[SWS_Mfx_00132] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
[SWS_Mfx_00133] dIf it is necessary to round the result of this equation, it is rounded
toward zero.c()
8.6.3 Division
c()
[SWS_Mfx_00137] dThe function returns the integer value of the fixed point quotient
(C), determined by C = [2ˆ(c+b-a) * x] / y.c()
[SWS_Mfx_00138] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
[SWS_Mfx_00139] dIf the divisor, y, is zero, the result is defined by:
* If x ≥ 0 then the function returns the maximum value of the output type
* If x < 0 then the function returns the minimum value of the output typec()
[SWS_Mfx_00141] dIf it is necessary to round the result of this equation, it is rounded
toward zero.c()
[SWS_Mfx_00142] dHere is the list of implemented functions.c()
Function ID[hex] Function prototype
0x1A5 uint16 Mfx_DivP2_u16u16_u16(uint16 x, uint16 y, sint16 a,
sint16 b, sint16 c)
0x1A6 uint16 Mfx_DivP2_u16s16_u16(uint16 x, sint16 y, sint16 a,
sint16 b, sint16 c)
0x1A7 uint16 Mfx_DivP2_s16u16_u16(sint16 x, uint16 y, sint16 a,
sint16 b, sint16 c)
0x1A8 uint16 Mfx_DivP2_s16s16_u16(sint16 x, sint16 y, sint16 a,
sint16 b, sint16 c)
0x1A9 sint16 Mfx_DivP2_u16u16_s16(uint16 x, uint16 y, sint16 a,
sint16 b, sint16 c)
0x1AA sint16 Mfx_DivP2_u16s16_s16(uint16 x, sint16 y, sint16 a,
sint16 b, sint16 c)
0x1AB sint16 Mfx_DivP2_s16u16_s16(sint16 x, uint16 y, sint16 a,
sint16 b, sint16 c)
0x1AC sint16 Mfx_DivP2_s16s16_s16(sint16 x, sint16 y, sint16 a,
sint16 b, sint16 c)
c()
[SWS_Mfx_00145] dThe function returns the integer value of the fixed point quotient
(C), determined by C = [2ˆ(c+b-a) * x] / y.c()
[SWS_Mfx_00146] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
[SWS_Mfx_00147] dIf the divisor, y, is zero, the result is defined by:
* If x ≥ 0 then the function returns the maximum value of the output type
* If x < 0 then the function returns the minimum value of the output typec()
[SWS_Mfx_00149] dIf it is necessary to round the result of this equation, it is rounded
toward zero.c()
[SWS_Mfx_00150] dHere is the list of implemented functions.c()
8.6.4 Addition
4
Description The routine adds two 16-bit integers with scaling factors set by input parameters.
Available via Mfx.h
c()
[SWS_Mfx_00153] dThe function returns the integer value of the fixed point sum (C),
determined by
a ≥ b: C = 2ˆ(c-a) * [x + (y * 2ˆ(a-b))],
a < b: C = 2ˆ(c-b) * [(x * 2ˆ(b-a)) + y].c()
[SWS_Mfx_00154] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
[SWS_Mfx_00155] dIf it is necessary to round the result of this equation, it is rounded
toward zero.c()
[SWS_Mfx_00156] dHere is the list of implemented functions.c()
Function ID[hex] Function prototype
0x1B5 uint16 Mfx_AddP2_u16u16_u16(uint16 x, uint16 y, sint16 a,
sint16 b, sint16 c)
0x1B6 uint16 Mfx_AddP2_u16s16_u16(uint16 x, sint16 y, sint16 a,
sint16 b, sint16 c)
0x1B7 uint16 Mfx_AddP2_s16s16_u16(sint16 x, sint16 y, sint16 a,
sint16 b, sint16 c)
0x1B8 sint16 Mfx_AddP2_u16u16_s16(uint16 x, uint16 y, sint16 a,
sint16 b, sint16 c)
0x1B9 sint16 Mfx_AddP2_u16s16_s16(uint16 x, sint16 y, sint16 a,
sint16 b, sint16 c)
0x1BA sint16 Mfx_AddP2_s16s16_s16(sint16 x, sint16 y, sint16 a,
sint16 b, sint16 c)
c()
[SWS_Mfx_00159] dThe function returns the integer value of the fixed point sum (C),
determined by
a ≥ b: C = 2ˆ(c-a) * [x + (y * 2ˆ(a-b))],
a < b: C = 2ˆ(c-b) * [(x * 2ˆ(b-a)) + y]c()
[SWS_Mfx_00160] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
[SWS_Mfx_00161] dIf it is necessary to round the result of this equation, it is rounded
toward zero.c()
8.6.5 Subtraction
c()
[SWS_Mfx_00165] dThe function returns the integer value of the fixed point difference
(C), determined by
a ≥ b: C = 2ˆ(c-a) * [x - (y * 2ˆ(a-b))],
a < b: C = 2ˆ(c-b) * [(x * 2ˆ(b-a)) - y]c()
[SWS_Mfx_00166] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
[SWS_Mfx_00167] dIf it is necessary to round the result of this equation, it is rounded
toward zero.c()
[SWS_Mfx_00168] dHere is the list of implemented functions.c()
Function ID[hex] Function prototype
0x1C1 uint16 Mfx_SubP2_u16u16_u16(uint16 x, uint16 y, sint16 a,
sint16 b, sint16 c)
0x1C2 uint16 Mfx_SubP2_u16s16_u16(uint16 x, sint16 y, sint16 a,
sint16 b, sint16 c)
0x1C3 uint16 Mfx_SubP2_s16u16_u16(sint16 x, uint16 y, sint16 a,
sint16 b, sint16 c)
0x1C4 uint16 Mfx_SubP2_s16s16_u16(sint16 x, sint16 y, sint16 a,
sint16 b, sint16 c)
0x1C5 sint16 Mfx_SubP2_u16u16_s16(uint16 x, uint16 y, sint16 a,
sint16 b, sint16 c)
0x1C6 sint16 Mfx_SubP2_u16s16_s16(uint16 x, sint16 y, sint16 a,
sint16 b, sint16 c)
0x1C7 sint16 Mfx_SubP2_s16u16_s16(sint16 x, uint16 y, sint16 a,
sint16 b, sint16 c)
0x1C8 sint16 Mfx_SubP2_s16s16_s16(sint16 x, sint16 y, sint16 a,
sint16 b, sint16 c)
c()
[SWS_Mfx_00171] dThe function returns the integer value of the fixed point difference
(C), determined by
a ≥ b: C = 2ˆ(c-a) * [x - (y * 2ˆ(a-b))],
a < b: C = 2ˆ(c-b) * [(x * 2ˆ(b-a)) - y].c()
[SWS_Mfx_00172] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
[SWS_Mfx_00173] dIf it is necessary to round the result of this equation, it is rounded
toward zero.c()
4
Description The routine subtracts and takes the absolute value of two 16-bit integers with scaling factors set
by input parameters.
Available via Mfx.h
c()
[SWS_Mfx_00177] dThe function returns the integer value of the fixed point absolute
difference (C), determined by
a ≥ b: C = 2ˆ(c-a) * |x - (y * 2ˆ(a-b))|,
a < b: C = 2ˆ(c-b) * |(x * 2ˆ(b-a)) - y|.c()
[SWS_Mfx_00178] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
[SWS_Mfx_00179] dIf it is necessary to round the result of this equation, it is rounded
toward zero.c()
[SWS_Mfx_00180] dHere is the list of implemented functions.c()
Function ID[hex] Function prototype
0x1D1 uint16 Mfx_AbsDiffP2_u16u16_u16(uint16 x, uint16 y, sint16
a, sint16 b, sint16 c)
0x1D2 uint16 Mfx_AbsDiffP2_u16s16_u16(uint16 x, sint16 y, sint16
a, sint16 b, sint16 c)
0x1D3 uint16 Mfx_AbsDiffP2_s16s16_u16(sint16 x, sint16 y, sint16
a, sint16 b, sint16 c)
0x1D4 sint16 Mfx_AbsDiffP2_u16u16_s16(uint16 x, uint16 y, sint16
a, sint16 b, sint16 c)
0x1D5 sint16 Mfx_AbsDiffP2_u16s16_s16(uint16 x, sint16 y, sint16
a, sint16 b, sint16 c)
0x1D6 sint16 Mfx_AbsDiffP2_s16s16_s16(sint16 x, sint16 y, sint16
a, sint16 b, sint16 c)
c()
[SWS_Mfx_00183] dThe function returns the integer value of the fixed point absolute
value (C), deter-mined by C = 2ˆ(c-a) * |x|.c()
[SWS_Mfx_00184] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
[SWS_Mfx_00185] dIf it is necessary to round the result of this equation, it is rounded
toward zero.c()
[SWS_Mfx_00186] dHere is the list of implemented functions.c()
Function ID[hex] Function prototype
()
()
0x1D7 uint16 Mfx_AbsP2_s16_u16(sint16 x, sint16 a, sint16 c)
0x1D8 sint16 Mfx_AbsP2_s16_s16(sint16 x, sint16 a, sint16 c)
c()
[SWS_Mfx_00189] dThe function returns the integer value of the fixed point absolute
value (C), deter-mined by C = 2ˆ(c-a) * |x|.c()
[SWS_Mfx_00190] dReturn-value shall be saturated to boundary values in the event
of negative or positive overflow.c()
[SWS_Mfx_00191] dIf it is necessary to round the result of this equation, it is rounded
toward zero.c()
[SWS_Mfx_00192] dHere is the list of implemented functions.c()
Function ID[hex] Function prototype
0x1D9 uint32 Mfx_AbsP2_s32_u32(sint32 x, sint16 a, sint16 c)
0x1DA sint32 Mfx_AbsP2_s32_s32(sint32 x, sint16 a, sint16 c)
The function that multiplies an argument by a factor of a given range can be interpreted
as the combination of multiplication and shift right.
If we consider the factor that is a power of two : 2n1
If we consider the maximum of the type used to code the factor : 2n2-1
Then, the shift right we shall apply to the result of the multiplication is given by :
(n2-n1)
For example, we multiply a s8 value (argument1) by a factor of 1 (20) coded with an u8
(Max(u8)=28-1).
The physical range of the factor is [0 , 0.996]
The result is :
Mfx_MulShRight_s16s16u8_s8(argument1, factor, 8)
In the domain of power train, the function that divides two arguments to compute a
factor of a given range can be interpreted as the combination of division and shift left.
If we consider the factor that is a power of two : 2n1
If we consider the maximum of the type used to code the result (factor) : 2n2-1
Then, the shift left we shall apply to the result of the division is given by : (n2-n1)
For example, we divide two u16 values (argument1 and argument2) to obtain a factor
of 1 (20) coded with an u16 (Max(u16)=216-1).
The physical range of the result is [0 , 0.999985]
The result is :
Mfx_DivShLeft_u16u16u8_u16(argument1, argument2, 16)
8.8.1 Mfx_GetVersionInfo
None.
None.
None.
9 Sequence diagrams
Not applicable.
10 Configuration specification
In general, this chapter defines configuration parameters and their clustering into con-
tainers. In order to support the specification Chapter 10.1 describes fundamentals.
It also specifies a template (table) you shall use for the parameter specification. We
intend to leave Chapter 10.1 in the specification to guarantee comprehension.
Chapter 10.2 specifies the structure (containers) and the parameters of the module
MFXLibrary.
Chapter 10.3 specifies published information of the module MFXLibrary.
none
none
none