Currently CLIF allows instructions such as iadd_imm.i128 v0, 100. The immediate is limited to 64-bits, however. During legalization the *_imm instructions are replaced with constant+op, and there's a list of whether i128 immediates are sign or zero extended. Currently though it's a bit arbitrary as to which instructions are sign-extended (iadd, irsub, imul, sdiv, srem) and which aren't (bor, band, ...).
Personally I'd say that in both situations the desired 128-bit immediate could be either zero or sign extended so it's not necessarily always correct to infer from the instruction itself.
Should CLIF always sign extend? Always zero extend? Disallow the 128-bit type with these instructions?
Currently CLIF allows instructions such as
iadd_imm.i128 v0, 100. The immediate is limited to 64-bits, however. During legalization the*_imminstructions are replaced with constant+op, and there's a list of whether i128 immediates are sign or zero extended. Currently though it's a bit arbitrary as to which instructions are sign-extended (iadd,irsub,imul,sdiv,srem) and which aren't (bor,band, ...).Personally I'd say that in both situations the desired 128-bit immediate could be either zero or sign extended so it's not necessarily always correct to infer from the instruction itself.
Should CLIF always sign extend? Always zero extend? Disallow the 128-bit type with these instructions?