diff --git a/docs/langref.rst b/docs/langref.rst index 99a6e1ca62..e42d82ecf4 100644 --- a/docs/langref.rst +++ b/docs/langref.rst @@ -674,14 +674,14 @@ Integer operations .. autoinst:: icmp .. autoinst:: iadd .. autoinst:: iadd_imm +.. autoinst:: iadd_cin +.. autoinst:: iadd_cout +.. autoinst:: iadd_carry .. autoinst:: isub .. autoinst:: isub_imm - -.. todo:: Integer overflow arithmetic - - Add instructions for add with carry out / carry in and so on. Enough to - implement larger integer types efficiently. It should also be possible to - legalize :type:`i64` arithmetic to terms of :type:`i32` operations. +.. autoinst:: isub_bin +.. autoinst:: isub_bout +.. autoinst:: isub_borrow .. autoinst:: imul .. autoinst:: imul_imm @@ -722,8 +722,11 @@ bitwise operations are working on the binary representation of the values. When operating on boolean values, the bitwise operations work as logical operators. .. autoinst:: band +.. autoinst:: band_imm .. autoinst:: bor +.. autoinst:: bor_imm .. autoinst:: bxor +.. autoinst:: bxor_imm .. autoinst:: bnot .. todo:: Redundant bitwise operators. @@ -740,10 +743,15 @@ type, and all the lanes are shifted the same amount. The shift amount is masked to the number of bits in a *lane*, not the full size of the vector type. .. autoinst:: rotl +.. autoinst:: rotl_imm .. autoinst:: rotr +.. autoinst:: rotr_imm .. autoinst:: ishl +.. autoinst:: ishl_imm .. autoinst:: ushr +.. autoinst:: ushr_imm .. autoinst:: sshr +.. autoinst:: sshr_imm The bit-counting instructions below are scalar only. diff --git a/meta/cretonne/base.py b/meta/cretonne/base.py index 150155d908..f7b6fb06e4 100644 --- a/meta/cretonne/base.py +++ b/meta/cretonne/base.py @@ -417,7 +417,7 @@ b_in = Operand('b_in', b1, doc="Input borrow flag") b_out = Operand('b_out', b1, doc="Output borrow flag") iadd_cin = Instruction( - 'iadd_cin', """ + 'iadd_cin', r""" Add integers with carry in. Same as :inst:`iadd` with an additional carry input. Computes: @@ -432,7 +432,7 @@ iadd_cin = Instruction( ins=(x, y, c_in), outs=a) iadd_cout = Instruction( - 'iadd_cout', """ + 'iadd_cout', r""" Add integers with carry out. Same as :inst:`iadd` with an additional carry output. @@ -448,7 +448,7 @@ iadd_cout = Instruction( ins=(x, y), outs=(a, c_out)) iadd_carry = Instruction( - 'iadd_carry', """ + 'iadd_carry', r""" Add integers with carry in and out. Same as :inst:`iadd` with an additional carry input and output. @@ -464,7 +464,7 @@ iadd_carry = Instruction( ins=(x, y, c_in), outs=(a, c_out)) isub_bin = Instruction( - 'isub_bin', """ + 'isub_bin', r""" Subtract integers with borrow in. Same as :inst:`isub` with an additional borrow flag input. Computes: @@ -479,7 +479,7 @@ isub_bin = Instruction( ins=(x, y, b_in), outs=a) isub_bout = Instruction( - 'isub_bout', """ + 'isub_bout', r""" Subtract integers with borrow out. Same as :inst:`isub` with an additional borrow flag output. @@ -495,7 +495,7 @@ isub_bout = Instruction( ins=(x, y), outs=(a, b_out)) isub_borrow = Instruction( - 'isub_borrow', """ + 'isub_borrow', r""" Subtract integers with borrow in and out. Same as :inst:`isub` with an additional borrow flag input and output.