We would previously include a header inside the `swift::impl` namespace,
which would prevent the proper declaration of the functions and
enumerators. This corrects the location of the header inclusion to fix
this issue.
Credit for the cmake fix here goes to Saleem Abdulrasool.
The substantive fix is embarrassing; I didn't pay close attention
to the intrinsic's argument order and just assumed that the first
argument for the replacement value was the low half (the part
you'd find at index 0 if it were an array), but in fact it's the
high half (the part you'd find at index 1).
I also change the code to be much more reinterpret_casty, which
isolates the type-punning mostly "within" the intrinsic, and
which seems to match how other code uses it.
Update the instances of checks for architectures to be more broad for different
spellings of the architecture macro. Certain targets use `_M_ARM` and others
use `__arm__`. Similarly, arm64/aarch64 has `_M_ARM64`, `__arm64__` and
`__aarch64__` as spellings. This just mechanically goes through and encodes the
various spellings.
Take the opportunity to replace some raw checks with `defined` checks which
avoids a pedantic warning due to the undefined macro when performing the check
as the preprocessor may warn about an undefined condition evaluating to `0`.