Skip to content

Commit

Permalink
Rollup merge of #94292 - esp-rs:riscv32imc-esp-espidf-64bit-atomics, …
Browse files Browse the repository at this point in the history
…r=petrochenkov

riscv32imc_esp_espidf: set max_atomic_width to 64

For espidf targets without native atomics, there is atomic emulation inside [the newlib component of espidf](https://github.com/espressif/esp-idf/blob/master/components/newlib/stdatomic.c), this has been extended to support emulation up to 64bits therefore we are safe to increase the atomic width for the `riscv32imc_esp_espidf` target.

Closes esp-rs#107

cc: `@ivmarkov`
  • Loading branch information
matthiaskrgr authored Feb 24, 2022
2 parents ae27c4a + 65614e9 commit a93be6d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_target/src/spec/riscv32imc_esp_espidf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ pub fn target() -> Target {
cpu: "generic-rv32".to_string(),

// While the RiscV32IMC architecture does not natively support atomics, ESP-IDF does support
// the __atomic* and __sync* GCC builtins, so setting `max_atomic_width` to `Some(32)`
// the __atomic* and __sync* GCC builtins, so setting `max_atomic_width` to `Some(64)`
// and `atomic_cas` to `true` will cause the compiler to emit libcalls to these builtins.
//
// Support for atomics is necessary for the Rust STD library, which is supported by the ESP-IDF framework.
max_atomic_width: Some(32),
max_atomic_width: Some(64),
atomic_cas: true,

features: "+m,+c".to_string(),
Expand Down

3 comments on commit a93be6d

@elvismunyikiiru
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

frag

@elvismunyikiiru
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or fragment

@elvismunyikiiru
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the err should be neither nor and or but both
peace out

Please sign in to comment.