Week7 - Implement intrinsic & Bug Fixes
Implement intrinsic & Bug Fixes
Date: July 2, 2023.
Hello! Welcome to the seventh blog of my GSoC '23 journey. This week I implemented `max0` instrinsic, helped in implementing intrinsic `min0`, and performed a sprint to get 403 of 409 files to compile to ASR.
Let's start with `max0` intrinsic. This intrinsic is used to find the maximum of two or more values. It is a generic intrinsic and can be used with real and integer type. The way intrinsic architecture is designed, it is fairly simple to implement any new intrinsic. All we need to do is to create a new namespace in `intrinsic_registry.h` and add `eval_*`, `create_*` and `instantiate_*` functions.
For `max0` intrinsic, I created a new namespace `max0` in `intrinsic_registry.h` and added `eval_max0`, `create_max0` and `instantiate_max0` functions. `eval_max0` is used to evaluate the intrinsic, `create_max0` is used to create the intrinsic and `instantiate_max0` is used to instantiate the intrinsic for runtime values. More details about the implementation can be found in PR: 1762
I would like to thank Sarthak having initial implementation of `max0` intrinsic, Thirumalai for helping me resolve the issue I was facing while implementing `max0` intrinsic and Harshita for implementing `min0` intrinsic.
Thereafter I performed a sprint to get Issue: 1891, Issue: 1892, Issue: 693, Issue: 766, Issue: 768, Issue: 1896, Issue: 1914, and many more.
All in all with 20 hours of work I was able to get 403 of 409 files to compile to ASR. For the next week I am planning to get all files compiled to ASR and then setup ASR test suite on CI, and will proceed on to LLVM.
I would like to thank Ondřej Čertík for taking out time and helping me when I was stuck. Looking forward to many more commits.