This patch lowers the maskl and maskr intrinsics from F2008.
The first argument to the intrinsic is I which is the number of bits on the left/right to be set in the result.
If I == 0, no bits will be set in the result
If I == BIT_SIZE(KIND), all bits will be set in the result
If I < 0 or I > BIT_SIZE(KIND), the result will always be 0.
where KIND is optionally provided as an argument to MASK* and is the default integer kind if left unspecified.
I am surprised you have to do that here. the KIND argument, if present, must already be represented in the resultType that semantics selected for the intrinsic. So I think you should be able to remove this case (otherwise, this would indicate some bug with resultType).