SPRACN6 July   2019 TMS320F28384D , TMS320F28384D-Q1 , TMS320F28384S , TMS320F28384S-Q1 , TMS320F28386D , TMS320F28386D-Q1 , TMS320F28386S , TMS320F28386S-Q1 , TMS320F28388D , TMS320F28388S , TMS320F28P550SJ , TMS320F28P559SJ-Q1 , TMS320F28P650DH , TMS320F28P650DK , TMS320F28P650SH , TMS320F28P650SK , TMS320F28P659DH-Q1 , TMS320F28P659DK-Q1 , TMS320F28P659SH-Q1

 

  1.   Fast Integer Division – A Differentiated Offering From C2000 Product Family
    1.     Trademarks
    2. 1 Introduction
    3. 2 Different Division Functions
      1. 2.1 Truncated Division or Traditional Division
      2. 2.2 Floored Division or Modulo Division
      3. 2.3 Euclidean Division
    4. 3 Intrinsic Support Through TI C2000 Compiler
      1. 3.1 Software Examples
    5. 4 Cycle Count
    6. 5 Summary
    7. 6 References

Software Examples

To ease development of applications using the Fast Integer Division (FID) unit, TI also provides demo examples inside the library section of C2000WARE (libraries\math\FASTINTDIV) [4] to showcase the usage of various integer division intrinsics. This example provides users with the usage of each of the 21 intrinsics. The cycles can be measured to see the significant gain provided by using the TI’s FID unit. The entire process of using the acceleration provided by the FID unit has been made very simple through the intrinsics and example provided. Table 3 provides the list of intrinsics and cycles.

Table 3. Intrinsics Supported and Cycles Using Fast Integer Division Unit on C28x

Division Type Intrinsic Cycles
16-bit by 16-bit traditional __traditional_div_i16byi16() or int/int 16
16-bit by 16-bit Euclidean __euclidean_div_i16byi16() 14
16-bit by 16-bit Modulo __modulo_div_i16byi16() 14
16-bit by 16-bit traditional unsigned __traditional_div_u16byu16() or uint16_t/uint16_t 14
32-bit by 32-bit traditional __traditional_div_i32byi32() or long/long 13
32-bit by 32-bit Euclidean __euclidean_div_i32byi32() 14
32-bit by 32-bit Modulo __modulo_div_i32byi32() 14
32-bit by 32-bit traditional - long/unsigned long __traditional_div_i32byu32() or long/unsigned long 14
32-bit by 32-bit Modulo __modul0_div_i32byu32() 14
32-bit by 32-bit traditional - unsigned long/unsigned long __traditional_div_u32byu32() or unsigned long/unsigned long 12
32-bit by 16-bit traditional __traditional_div_i32by16() or long/int 18
32-bit by 16-bit Euclidean __euclidean_div_i32bi16() 16
32-bit by 16-bit Modulo __modulo_div_i32byi16() 16
32-bit by 16-bit traditional unsigned long/unsigned int __traditional_div_u32byu16() or unsigned long/uint16_t 13
64-bit by 64-bit traditional __traditional_div_i64byi64() or long long/long long 42
64-bit by 64-bit Euclidean __euclidean_div_i64byi64() 42
32-bit by 64-bit Modulo __modulo_div_i64byi64() 42
64-bit by 64-bit traditional - long long/unsigned long long __traditional_div_i64byu64() or long long/unsigned long long 42
64-bit by 64-bit Modulo __euclidean_div_i64byu64() 42
64-bit by 64-bit Modulo __modulo_div_i64byu64() 42
64-bit by 64-bit traditional - unsigned long long/unsigned long long __traditional_div_u64byu64() or unsigned long long/unsigned long long 42