This reverts commit 87cef78fa1c7bf6efc544e990894a6062d56abec.
The issue in the original revert is that a lit test expecting a -nan
as an output was failing on M2. Since the IEEE 754-2008 standard does
not require the sign to be printed when displaying a nan, this
commit changes the CHECK for -nan to one that checks the result
value bitcasted to an i32 to ensure that input is being left
unchanged. This check should now be independent of platform being used
to run test.