crystal-lang / crystal

The Crystal Programming Language
https://crystal-lang.org
Apache License 2.0
19.36k stars 1.62k forks source link

Expose LLVM instruction builder for `neg` and `fneg` #14774

Closed JarnaChao09 closed 1 month ago

JarnaChao09 commented 3 months ago

Purpose

Exposes the LLVM-C API to build neg and fneg instructions

Reason

While the neg instruction is just a "super instruction" to 0 - self, fneg as an instruction maintains NaN-ness inside of the floating point representation which may not be kept by performing 0 - self.

Notes