afonso360 opened issue #5165:
:wave: Hey,
While implementing
iadd_cout
for aarch64 I realized that the output of the carry bit depends on signedness of the operation. If we implement it as unsigned we only signal overflow on0xFF
+ 1, and if we implement it as signed we signal overflow on0x7F
+ 1Thus should we rename this operation to
sadd_cout
to keep consistency with our other operations that depend on signedness (i.e.sdiv
/udiv
)? The operation seems to be signed based on the existing test suite.Does the existence of
sadd_cout
also imply that we should haveuadd_cout
?The same question applies for
iadd_carry
, but not foriadd_cin
.
bjorn3 commented on issue #5165:
Makes sense. I would have expected iadd_cout to be unsigned. As the name carry is often used for unsigned overflow AFAIK. For example x86 has the carry and overflow flags for unsigned cq signed overflow.
Does the existence of sadd_cout also imply that we should have uadd_cout?
IMO yes there should be.
afonso360 commented on issue #5165:
It looks like we also discussed the naming of the new
iadd_overflow_trap
instruction last week, and it got renamed touadd_overflow_trap
.And it looks like folks preferred
uadd_overflow_trap
instead ofuadd_carry_trap
, so maybe we should apply the same naming convention here? (I'd be in favor of this.)
afonso360 edited a comment on issue #5165:
It looks like we also discussed the naming of the new
iadd_overflow_trap
instruction last week, and it got renamed touadd_overflow_trap
.And it looks like folks preferred
uadd_overflow_trap
instead ofuadd_carry_trap
, so maybe we should apply the same naming convention here? (I'd also be in favor of this.)
afonso360 edited a comment on issue #5165:
It looks like we also discussed the naming of the new
iadd_overflow_trap
instruction last week, and it got renamed touadd_overflow_trap
.And it looks like folks preferred
uadd_overflow_trap
instead ofuadd_carry_trap
, so maybe we should apply the same naming convention here? (I'd be in favor of this.)
afonso360 commented on issue #5165:
This was fixed in #5784 and #6198.
afonso360 closed issue #5165:
:wave: Hey,
While implementing
iadd_cout
for aarch64 I realized that the output of the carry bit depends on signedness of the operation. If we implement it as unsigned we only signal overflow on0xFF
+ 1, and if we implement it as signed we signal overflow on0x7F
+ 1Thus should we rename this operation to
sadd_cout
to keep consistency with our other operations that depend on signedness (i.e.sdiv
/udiv
)? The operation seems to be signed based on the existing test suite.Does the existence of
sadd_cout
also imply that we should haveuadd_cout
?The same question applies for
iadd_carry
, but not foriadd_cin
.
Last updated: Nov 22 2024 at 16:03 UTC