[flang] [llvm] [flang] Register and lower SECNDS (stubbed implementation) (PR #151878)

Peter Klausler via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 6 13:17:38 PDT 2025


klausler wrote:

> @mlir-maiden , I submitted runtime implementation for `secnds()` upstream. You can now test end-to-end with trying to make the actual function call.
> 
> In my implementation I defined runtime wrapper function for `secnds()` as follows:
> 
> ```
> float RTNAME(Secnds)(float *refTime, const char *sourceFile, int line) {
>   Terminator terminator{sourceFile, line};
>   RUNTIME_CHECK(terminator, refTime != nullptr);
>   return FORTRAN_PROCEDURE_NAME(secnds)(refTime);
> }
> ```
> 
> Feel free to modify, if that doesn't work for you.
> 
> Peter also asked me to make the core implementation of `secnds` runtime into a template, so that it could be instantiated with `double` in case we want to also add `DSECNDS()`. (If you end up implementing `DSECNDS()`, I recommend you do that as a separate PR.)

It's `SECNDSD` and it might be just a PGI extension (also in "classic" flang).

https://github.com/llvm/llvm-project/pull/151878


More information about the llvm-commits mailing list