Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-11790

C28 math.h exp2f/expf with --tmu_support=tmu1 and --fp_mode=relaxed generates incorrect results for negative inputs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • Code Generation Tools
    • CODEGEN-12534
    • Hide
      C2000_22.6.0.LTS
      C2000_21.6.0.LTS
      C2000_18.12.0.LTS
      C2000_20.2.0.LTS
      Show
      C2000_22.6.0.LTS C2000_21.6.0.LTS C2000_18.12.0.LTS C2000_20.2.0.LTS
    • Hide
      C2000_25.3.0.LTS*
      C2000_22.6.2.LTS*
      C2000_21.6.2.LTS*
      Show
      C2000_25.3.0.LTS* C2000_22.6.2.LTS* C2000_21.6.2.LTS*
    • default
    • Hide
      In math.h, replace exp2f/powf below with:
      #define exp2f __relaxed_exp2f
      __inline float __relaxed_exp2f(float x)
      {
          float iexp2f = __iexp2(x);
          if (x > 0.0f) return (1.0f / iexp2f);
          else return (iexp2f);
      }
      #define powf __relaxed_powf
      __inline float __relaxed_powf(float x, float y)
      {
        float log2ofx = __log2(x);
        float log2ofxtimesy = log2ofx * y;
        return exp2f(log2ofxtimesy);
      }
      Show
      In math.h, replace exp2f/powf below with: #define exp2f __relaxed_exp2f __inline float __relaxed_exp2f(float x) {     float iexp2f = __iexp2(x);     if (x > 0.0f) return (1.0f / iexp2f);     else return (iexp2f); } #define powf __relaxed_powf __inline float __relaxed_powf(float x, float y) {   float log2ofx = __log2(x);   float log2ofxtimesy = log2ofx * y;   return exp2f(log2ofxtimesy); }

      For C28, math.h implementations of exp2f(float x) and expf(float x) with --tmu_support=tmu1 and --fp_mode=relaxed generates incorrect results for negative inputs.

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: