pub struct AtomicCmpxchgOp { /* private fields */ }Expand description
Equivalent to LLVM’s cmpxchg: atomically compares the value at a pointer
with cmp and, if equal, stores new. Returns a { value, i1 } pair of the
loaded value and whether the swap succeeded.
§Operands
| operand | description |
|---|---|
ptr | PointerType |
cmp | expected value |
new | value to store on success |
§Result(s):
| result | description |
|---|---|
res | { value, i1 } (loaded value, success flag) |
§Attribute(s):
Note: Only attributes defined directly as part of this operation are listed here. There may be others, not listed here, defined by interface implementations.
| Name | Static Name Identifier | Type |
|---|---|---|
llvm_cas_success_ordering | ATTR_KEY_LLVM_CAS_SUCCESS_ORDERING | AtomicOrderingAttr |
llvm_cas_failure_ordering | ATTR_KEY_LLVM_CAS_FAILURE_ORDERING | AtomicOrderingAttr |
llvm_cas_syncscope | ATTR_KEY_LLVM_CAS_SYNCSCOPE | StringAttr |
Implementations§
Source§impl AtomicCmpxchgOp
impl AtomicCmpxchgOp
pub fn get_operand_ptr(&self, ctx: &Context) -> Value
pub fn get_operand_cmp(&self, ctx: &Context) -> Value
pub fn get_operand_new_val(&self, ctx: &Context) -> Value
Source§impl AtomicCmpxchgOp
impl AtomicCmpxchgOp
Sourcepub fn get_attr_llvm_cas_success_ordering<'a>(
&self,
ctx: &'a Context,
) -> Option<Ref<'a, AtomicOrderingAttr>>
pub fn get_attr_llvm_cas_success_ordering<'a>( &self, ctx: &'a Context, ) -> Option<Ref<'a, AtomicOrderingAttr>>
Get a Ref to the value of the attribute named llvm_cas_success_ordering.
The Ref is a borrow of the containing Operation object.
Sourcepub fn set_attr_llvm_cas_success_ordering(
&self,
ctx: &Context,
value: AtomicOrderingAttr,
)
pub fn set_attr_llvm_cas_success_ordering( &self, ctx: &Context, value: AtomicOrderingAttr, )
Set the value of the attribute named llvm_cas_success_ordering.
Sourcepub fn get_attr_llvm_cas_failure_ordering<'a>(
&self,
ctx: &'a Context,
) -> Option<Ref<'a, AtomicOrderingAttr>>
pub fn get_attr_llvm_cas_failure_ordering<'a>( &self, ctx: &'a Context, ) -> Option<Ref<'a, AtomicOrderingAttr>>
Get a Ref to the value of the attribute named llvm_cas_failure_ordering.
The Ref is a borrow of the containing Operation object.
Sourcepub fn set_attr_llvm_cas_failure_ordering(
&self,
ctx: &Context,
value: AtomicOrderingAttr,
)
pub fn set_attr_llvm_cas_failure_ordering( &self, ctx: &Context, value: AtomicOrderingAttr, )
Set the value of the attribute named llvm_cas_failure_ordering.
Sourcepub fn get_attr_llvm_cas_syncscope<'a>(
&self,
ctx: &'a Context,
) -> Option<Ref<'a, StringAttr>>
pub fn get_attr_llvm_cas_syncscope<'a>( &self, ctx: &'a Context, ) -> Option<Ref<'a, StringAttr>>
Get a Ref to the value of the attribute named llvm_cas_syncscope.
The Ref is a borrow of the containing Operation object.
Sourcepub fn set_attr_llvm_cas_syncscope(&self, ctx: &Context, value: StringAttr)
pub fn set_attr_llvm_cas_syncscope(&self, ctx: &Context, value: StringAttr)
Set the value of the attribute named llvm_cas_syncscope.
Source§impl AtomicCmpxchgOp
impl AtomicCmpxchgOp
Sourcepub fn new(
ctx: &mut Context,
ptr: Value,
cmp: Value,
new_val: Value,
success_ordering: AtomicOrderingAttr,
failure_ordering: AtomicOrderingAttr,
syncscope: Option<String>,
) -> Self
pub fn new( ctx: &mut Context, ptr: Value, cmp: Value, new_val: Value, success_ordering: AtomicOrderingAttr, failure_ordering: AtomicOrderingAttr, syncscope: Option<String>, ) -> Self
Create a new AtomicCmpxchgOp. syncscope is None for the system scope.
Trait Implementations§
Source§impl Clone for AtomicCmpxchgOp
impl Clone for AtomicCmpxchgOp
Source§fn clone(&self) -> AtomicCmpxchgOp
fn clone(&self) -> AtomicCmpxchgOp
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Hash for AtomicCmpxchgOp
impl Hash for AtomicCmpxchgOp
Source§impl NOpdsInterface<3> for AtomicCmpxchgOp
impl NOpdsInterface<3> for AtomicCmpxchgOp
Source§fn operand_type_i(&self, ctx: &Context, i: LessThanN<N>) -> TypeHandle
fn operand_type_i(&self, ctx: &Context, i: LessThanN<N>) -> TypeHandle
i’th operand.Source§impl OneResultInterface for AtomicCmpxchgOp
impl OneResultInterface for AtomicCmpxchgOp
Source§fn result_type(&self, ctx: &Context) -> TypeHandle
fn result_type(&self, ctx: &Context) -> TypeHandle
Source§impl Op for AtomicCmpxchgOp
impl Op for AtomicCmpxchgOp
Source§fn get_operation(&self) -> Ptr<Operation>
fn get_operation(&self) -> Ptr<Operation>
Source§fn get_opid_static() -> OpId
fn get_opid_static() -> OpId
Source§fn get_concrete_op_info() -> (fn(Ptr<Operation>) -> OpBox, TypeId)where
Self: Sized,
fn get_concrete_op_info() -> (fn(Ptr<Operation>) -> OpBox, TypeId)where
Self: Sized,
Source§impl Parsable for AtomicCmpxchgOp
impl Parsable for AtomicCmpxchgOp
Source§type Arg = Vec<(Identifier, Location)>
type Arg = Vec<(Identifier, Location)>
Source§fn parse<'__pliron_parse>(
state_stream: &mut StateStream<'__pliron_parse>,
arg: Self::Arg,
) -> ParseResult<'__pliron_parse, Self::Parsed>
fn parse<'__pliron_parse>( state_stream: &mut StateStream<'__pliron_parse>, arg: Self::Arg, ) -> ParseResult<'__pliron_parse, Self::Parsed>
into on [Parser::parse_stream] to get the final ParseResult.
Use state_stream.state as necessary.Source§impl PartialEq for AtomicCmpxchgOp
impl PartialEq for AtomicCmpxchgOp
Source§fn eq(&self, other: &AtomicCmpxchgOp) -> bool
fn eq(&self, other: &AtomicCmpxchgOp) -> bool
self and other values to be equal, and is used by ==.Source§impl Printable for AtomicCmpxchgOp
impl Printable for AtomicCmpxchgOp
impl Copy for AtomicCmpxchgOp
impl Eq for AtomicCmpxchgOp
impl OperandNOfType<0, PointerType> for AtomicCmpxchgOp
impl StructuralPartialEq for AtomicCmpxchgOp
Auto Trait Implementations§
impl Freeze for AtomicCmpxchgOp
impl !RefUnwindSafe for AtomicCmpxchgOp
impl Send for AtomicCmpxchgOp
impl Sync for AtomicCmpxchgOp
impl Unpin for AtomicCmpxchgOp
impl UnsafeUnpin for AtomicCmpxchgOp
impl !UnwindSafe for AtomicCmpxchgOp
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.