Widen to next multiple of 32.
This can be later legalized using narrowScalar.
Details
Diff Detail
Event Timeline
I’ve been avoiding doing this since it’s really a workaround for narrowScalar not understanding what to do. Would it make more sense for narrow scalar to widen to the next multiple of 32 itself?
Would it make more sense for narrow scalar to widen to the next multiple of 32 itself?
Probably yes, at least for add, sub and mul. It could calculate required scalar size and call widenScalar instead on reporting UnableToLegalize.
I am not so sure if this would be correct in general, maybe some opcodes prefer next-power-of-2 instead of multiple of NarrowSize?
I’ve been avoiding doing this since it’s really a workaround for narrowScalar not understanding what to do. Would it make more sense for narrow scalar to widen to the next multiple of 32 itself?
This isn't a general property of widenScalar itself, but the add/sub/mul handling knows it can produce the requested size by widening, those implementations can be responsible for inserting an extend to the intermediate size it requires