Permit {s,u}{div,rem}_imm instructions to be potentially trapping.
The documentation for these instructions suggests that immediate values which could lead to trapping should be invalid. While it seems nice to have these instructions be always non-trapping, it's also nice to say that the `_imm` forms of instructions are interchangeable with the corresponding non-`_imm` forms accompanied by `iconst` instructions.
This commit is contained in:
@@ -1016,7 +1016,7 @@ udiv_imm = Instruction(
|
||||
'udiv_imm', """
|
||||
Unsigned integer division by an immediate constant.
|
||||
|
||||
This instruction never traps because a divisor of zero is not allowed.
|
||||
This operation traps if the divisor is zero.
|
||||
""",
|
||||
ins=(x, Y), outs=a)
|
||||
|
||||
@@ -1024,15 +1024,17 @@ sdiv_imm = Instruction(
|
||||
'sdiv_imm', """
|
||||
Signed integer division by an immediate constant.
|
||||
|
||||
This instruction never traps because a divisor of -1 or 0 is not
|
||||
allowed. """,
|
||||
This operation traps if the divisor is zero, or if the result is not
|
||||
representable in :math:`B` bits two's complement. This only happens
|
||||
when :math:`x = -2^{B-1}, Y = -1`.
|
||||
""",
|
||||
ins=(x, Y), outs=a)
|
||||
|
||||
urem_imm = Instruction(
|
||||
'urem_imm', """
|
||||
Unsigned integer remainder with immediate divisor.
|
||||
|
||||
This instruction never traps because a divisor of zero is not allowed.
|
||||
This operation traps if the divisor is zero.
|
||||
""",
|
||||
ins=(x, Y), outs=a)
|
||||
|
||||
@@ -1040,8 +1042,8 @@ srem_imm = Instruction(
|
||||
'srem_imm', """
|
||||
Signed integer remainder with immediate divisor.
|
||||
|
||||
This instruction never traps because a divisor of 0 or -1 is not
|
||||
allowed. """,
|
||||
This operation traps if the divisor is zero.
|
||||
""",
|
||||
ins=(x, Y), outs=a)
|
||||
|
||||
irsub_imm = Instruction(
|
||||
|
||||
Reference in New Issue
Block a user