pub struct ShRSIOperation<'c> { /* private fields */ }Expand description
A shrsi operation. Signed integer right-shift.
The shrsi operation shifts an integer value of the first operand to the right
by the value of the second operand. The first operand is interpreted as signed,
and the second operand is interpreter as unsigned. The high order bits in the
output are filled with copies of the most-significant bit of the shifted value
(which means that the sign of the value is preserved). If the value of the second
operand is greater or equal than bitwidth of the first operand, then the operation
returns poison.
If the exact attribute is present, the result value of shrsi is a poison
value if any of the bits shifted out are non-zero.
Example:
%1 = arith.constant 160 : i8 // %1 is 0b10100000
%2 = arith.constant 3 : i8
%3 = arith.shrsi %1, %2 exact : i8 // %3 is 0b11110100
%4 = arith.constant 98 : i8 // %4 is 0b01100010
%5 = arith.shrsi %4, %2 : i8 // %5 is 0b00001100Implementations§
Source§impl<'c> ShRSIOperation<'c>
impl<'c> ShRSIOperation<'c>
Sourcepub fn as_operation(&self) -> &Operation<'c>
pub fn as_operation(&self) -> &Operation<'c>
Returns a generic operation.
Sourcepub fn builder(
context: &'c Context,
location: Location<'c>,
) -> ShRSIOperationBuilder<'c, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c>, ) -> ShRSIOperationBuilder<'c, Unset, Unset>
Creates a builder.
pub fn result(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn lhs(&self) -> Result<Value<'c, '_>, Error>
pub fn rhs(&self) -> Result<Value<'c, '_>, Error>
pub fn is_exact(&self) -> Result<Attribute<'c>, Error>
pub fn set_is_exact(&mut self, value: Attribute<'c>)
pub fn remove_is_exact(&mut self) -> Result<(), Error>
Trait Implementations§
Source§impl<'c> Clone for ShRSIOperation<'c>
impl<'c> Clone for ShRSIOperation<'c>
Source§fn clone(&self) -> ShRSIOperation<'c>
fn clone(&self) -> ShRSIOperation<'c>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'c> Debug for ShRSIOperation<'c>
impl<'c> Debug for ShRSIOperation<'c>
Source§impl<'b> From<ShRSIOperation<'b>> for ArithDialectOperation<'b>
impl<'b> From<ShRSIOperation<'b>> for ArithDialectOperation<'b>
Source§fn from(op: ShRSIOperation<'b>) -> Self
fn from(op: ShRSIOperation<'b>) -> Self
Converts to this type from the input type.
Source§impl<'c> From<ShRSIOperation<'c>> for Operation<'c>
impl<'c> From<ShRSIOperation<'c>> for Operation<'c>
Source§fn from(operation: ShRSIOperation<'c>) -> Self
fn from(operation: ShRSIOperation<'c>) -> Self
Converts to this type from the input type.
Source§impl<'c> PartialEq for ShRSIOperation<'c>
impl<'c> PartialEq for ShRSIOperation<'c>
Source§impl<'c> TryFrom<Operation<'c>> for ShRSIOperation<'c>
impl<'c> TryFrom<Operation<'c>> for ShRSIOperation<'c>
impl<'c> Eq for ShRSIOperation<'c>
impl<'c> StructuralPartialEq for ShRSIOperation<'c>
Auto Trait Implementations§
impl<'c> Freeze for ShRSIOperation<'c>
impl<'c> RefUnwindSafe for ShRSIOperation<'c>
impl<'c> !Send for ShRSIOperation<'c>
impl<'c> !Sync for ShRSIOperation<'c>
impl<'c> Unpin for ShRSIOperation<'c>
impl<'c> UnwindSafe for ShRSIOperation<'c>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more