This commit removes the simm32 extractor from lowerings as it's not as useful as it was when it was first introduced. Nowadays an Imm64 needs to be interpreted with the type known as well to understand whether bits being masked off is significant or not. The old simm32 extractor only took Imm64 meaning that it was unable to do this and wouldn't match negative numbers. This is because the high 32 bits of Imm64 were always zero and simm64 would take the i64 value from Imm64 and try to convert it to an i32.
This commit replaces simm32, and uses of it, with a new extractor i32_from_iconst. This matches the preexisting i64_from_iconst and is able to take the type of the value into account and produce a correctly sign-extended value.
This commit removes the
simm32
extractor from lowerings as it's not as useful as it was when it was first introduced. Nowadays anImm64
needs to be interpreted with the type known as well to understand whether bits being masked off is significant or not. The oldsimm32
extractor only tookImm64
meaning that it was unable to do this and wouldn't match negative numbers. This is because the high 32 bits ofImm64
were always zero andsimm64
would take thei64
value fromImm64
and try to convert it to ani32
.This commit replaces
simm32
, and uses of it, with a new extractori32_from_iconst
. This matches the preexistingi64_from_iconst
and is able to take the type of the value into account and produce a correctly sign-extended value.cc #8706