I noticed that there was a lot of duplicated code for unary intrinsics in translateKnownIntrinsic, and thought it would be nice to factor it out into its own function.
This adds a function and a lookup table which contains the currently supported simple unary intrinsics. I figured the lookup table would be nice, because if we add one of these, then all we have to do is add the intrinsic and its generic opcode to the mapping.
Also, it would get us out of writing code like this, which seems a little redundant IMO:
case intrinsicA: translateFooIntrinsic(OpcodeForA...); case intrinsicB: translateFooIntrinsic(OpcodeForB...); case intrinsicC: translateFooIntrinsic(OpcodeForC...);
Why a map instead of a simple switch function?