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 |
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.
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: SyncScopeAttr,
) -> Self
pub fn new( ctx: &mut Context, ptr: Value, cmp: Value, new_val: Value, success_ordering: AtomicOrderingAttr, failure_ordering: AtomicOrderingAttr, syncscope: SyncScopeAttr, ) -> Self
Create a new AtomicCmpxchgOp.
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 moreimpl Copy for AtomicCmpxchgOp
impl Eq for AtomicCmpxchgOp
Source§impl Hash for AtomicCmpxchgOp
impl Hash for AtomicCmpxchgOp
Source§impl NOpdsInterface<3> for AtomicCmpxchgOp
impl NOpdsInterface<3> for AtomicCmpxchgOp
§fn get_operand_i(&self, ctx: &Context, i: LessThanN<N>) -> Value
fn get_operand_i(&self, ctx: &Context, i: LessThanN<N>) -> Value
i’th operand.§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
§fn get_result(&self, ctx: &Context) -> Value
fn get_result(&self, ctx: &Context) -> Value
§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
§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,
impl OperandNOfType<0, PointerType> for AtomicCmpxchgOp
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 StructuralPartialEq for AtomicCmpxchgOp
Source§impl SyncScopeInterface for AtomicCmpxchgOp
impl SyncScopeInterface for AtomicCmpxchgOp
Source§fn syncscope(&self, ctx: &Context) -> SyncScopeAttrwhere
Self: Sized,
fn syncscope(&self, ctx: &Context) -> SyncScopeAttrwhere
Self: Sized,
Source§fn set_syncscope(&self, ctx: &Context, syncscope: SyncScopeAttr)where
Self: Sized,
fn set_syncscope(&self, ctx: &Context, syncscope: SyncScopeAttr)where
Self: Sized,
Auto Trait Implementations§
impl !RefUnwindSafe for AtomicCmpxchgOp
impl !UnwindSafe for AtomicCmpxchgOp
impl Freeze for AtomicCmpxchgOp
impl Send for AtomicCmpxchgOp
impl Sync for AtomicCmpxchgOp
impl Unpin for AtomicCmpxchgOp
impl UnsafeUnpin 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.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.