Skip to content

Add fetch_neg/neg/fetch_not/not#54

Merged
bors[bot] merged 3 commits intomainfrom
more-ops
Dec 18, 2022
Merged

Add fetch_neg/neg/fetch_not/not#54
bors[bot] merged 3 commits intomainfrom
more-ops

Conversation

@taiki-e
Copy link
Copy Markdown
Owner

@taiki-e taiki-e commented Dec 18, 2022

Part of #48

  • Add AtomicI*::{fetch_neg,neg} and AtomicF*::fetch_neg methods.

    AtomicI*::neg are equivalent to the corresponding fetch_* methods, but do not return the previous value. They are intended for optimization on platforms that have atomic instructions for the corresponding operation, such as x86's lock neg.

    Currently, optimizations by these methods (neg) are only guaranteed for x86.

  • Add Atomic{I,U}*::{fetch_not,not} methods.

    Atomic{I,U}*::not are equivalent to the corresponding fetch_* methods, but do not return the previous value. They are intended for optimization on platforms that have atomic instructions for the corresponding operation, such as x86's lock not, MSP430's inv.

    Currently, optimizations by these methods (not) are only guaranteed for x86 and MSP430.

    (Note: AtomicBool already has fetch_not and not methods.)

@taiki-e taiki-e added O-x86 Target: x86/x64 processors O-msp430 Target: MSP430 labels Dec 18, 2022
@taiki-e taiki-e mentioned this pull request Dec 18, 2022
5 tasks
@taiki-e taiki-e force-pushed the more-ops branch 2 times, most recently from da034b0 to ef88e1c Compare December 18, 2022 08:01
@taiki-e taiki-e force-pushed the more-ops branch 3 times, most recently from db7db4e to 0c4a2d9 Compare December 18, 2022 10:08
@taiki-e
Copy link
Copy Markdown
Owner Author

taiki-e commented Dec 18, 2022

bors r+

bors bot added a commit that referenced this pull request Dec 18, 2022
54: Add fetch_neg/neg/fetch_not/not r=taiki-e a=taiki-e

Part of #48

- Add `AtomicI*::{fetch_neg,neg}` and `AtomicF*::fetch_neg` methods.

  `AtomicI*::neg` are equivalent to the corresponding `fetch_*` methods, but do not return the previous value. They are intended for optimization on platforms that have atomic instructions for the corresponding operation, such as x86's `lock neg`.

  Currently, optimizations by these methods (`neg`) are only guaranteed for x86.

- Add `Atomic{I,U}*::{fetch_not,not}` methods.

  `Atomic{I,U}*::not` are equivalent to the corresponding `fetch_*` methods, but do not return the previous value. They are intended for optimization on platforms that have atomic instructions for the corresponding operation, such as x86's `lock not`, MSP430's `inv`.

  Currently, optimizations by these methods (`not`) are only guaranteed for x86 and MSP430.

  (Note: `AtomicBool` already has `fetch_not` and `not` methods.)


Co-authored-by: Taiki Endo <te316e89@gmail.com>
@bors
Copy link
Copy Markdown
Contributor

bors bot commented Dec 18, 2022

Canceled.

@taiki-e
Copy link
Copy Markdown
Owner Author

taiki-e commented Dec 18, 2022

bors r+

@bors
Copy link
Copy Markdown
Contributor

bors bot commented Dec 18, 2022

@bors bors bot merged commit 6eb7ef0 into main Dec 18, 2022
@bors bors bot deleted the more-ops branch December 18, 2022 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-msp430 Target: MSP430 O-x86 Target: x86/x64 processors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant