<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57602>57602</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [Flang] Compile spec2017 without using pgmath
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          kiranchandramohan
      </td>
    </tr>
</table>

<pre>
    Spec benchmark contains calls to several math functions. Recent work incorporated lowerings to the math dialect of MLIR to handle floating point and integer math intrinsic functions. The complex intrinsic functions continue to rely on the pgmath library. Ideally, in the default mode, we should use the MLIR complex dialect or calls to libm functions or custom calls to flang runtime functions to handle complex math functions.

List of pgmath functions currently being called in spec.
```
wrf:
ld.lld: error: undefined symbol: __fc_sqrt_1
ld.lld: error: undefined symbol: __fc_exp_1
ld.lld: error: undefined symbol: __fz_sqrt_1
ld.lld: error: undefined symbol: __fz_powi_1
ld.lld: error: undefined symbol: __fz_log_1

cam4:
ld.lld: error: undefined symbol: __fz_sqrt_1
ld.lld: error: undefined symbol: __fz_powi_1
ld.lld: error: undefined symbol: __fz_exp_1
ld.lld: error: undefined symbol: __fz_pow_1

fotonik:
ld.lld: error: undefined symbol: __fz_exp_1
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy9VE1v2zAM_TX2RVigKI4TH3zYWhQo0F263QNZom2tsuTpo2n660cpTZMOuzSHGYZlSuTje5SozspD-2MGQTowYpy4eyLCmsCV8URwrT0Jlnh4Bsc1mXgYSR-NCMoavyCPIMAEsrcYpYywbraOB5BE2z04ZYYcHUY4RkrFNYhAbE--P9w_prWRG6mB9NrygP5ktgoBcRLxAgzgjpFoIJxX4jL7T8QVdpo1vPzLIetQJkLK40AfiDWZyzxkTK06x91hQe4loNBDwW4QJntI6HnUgUxWQpreA_GjjVqS6CF7ZP6n5O-63LlkiD5dcElL0Qc7nT16zVGwi0hyggvXc1VO-H-VvaC3Bf16_D4on-v5pulCfHQO9wZVd5AKm9JCqirxuNsnjJq-vdncu75YvQFrudBaoknAOevSTzRYF2UQxR-mzuo0t9v1Yud_u7Bbfj4OXubPh71eme51N9u9uiZO2-EUdvwKPlVXFOr_M7-ywJjuo-DeBmvU01WaLzi8H7cS2mVds3VVV82qlO1KNquGl0EFDW2x_naXWqNY35Ib7ACFnZDOLKPLDdmrgI0YsA_zbZFPfRmdbscQZp8Isjt8B3SL3QIbCA2tn0_Dl9nZX9iqaCrvI3j8WW9qysqx3TLZUNpDVzNZCc7qetXgs-ZN13W8bkrNO9A-8SsYy92LI7IsVcsoY7ShmyVl2-VqQZtlVTe92NJtBXS7KSoKE1d6kTgsrBtK12Y6XRw8LmrsYn9e5N6rwUAuRcLnEUW79kk5jnc03g2OTxbHMmtos4A_ebHv1g">