Explicitly handle platforms with partial/no atomic support. - #46
Conversation
|
I don't even think this would help considering all atomics have been removed from your mentioned target: rust-lang/rust#149241. I think instead the code should probably only check that we have |
Sorry if I wasn't very clear, but that's what this PR does, except it just also allows using |
|
Ah. Are there any existing targets which have a smaller atomic but not |
|
Ok so I dumped out the Large Markdown TableGenerated using: echo "target,target_pointer_width,target_has_atomic\"8\",target_has_atomic\"16\",target_has_atomic\"32\",target_has_atomic\"64\",target_has_atomic\"128\",target_has_atomic\"ptr\""
for t in `rustc +nightly --print target-list`; do
cfg=`rustc +nightly --print cfg --target $t`
pointer_width=`echo "$cfg" | grep -Po '(?<=target_pointer_width=")\d+(?=")'`
aptr=`echo "$cfg" | grep -Po '(?<=target_has_atomic=")ptr(?=")'`
a8=`echo "$cfg" | grep -Po '(?<=target_has_atomic=")8(?=")'`
a16=`echo "$cfg" | grep -Po '(?<=target_has_atomic=")16(?=")'`
a32=`echo "$cfg" | grep -Po '(?<=target_has_atomic=")32(?=")'`
a64=`echo "$cfg" | grep -Po '(?<=target_has_atomic=")64(?=")'`
a128=`echo "$cfg" | grep -Po '(?<=target_has_atomic=")128(?=")'`
echo "$t,$pointer_width,$a8,$a16,$a32,$a64,$a128,$aptr";
done
Importantly, every target that has any atomic support has
|
2d1b109 to
f65f091
Compare
|
I don't want to go beyond |
|
Fair enough, I'll strip that out too. |
f65f091 to
5305032
Compare
orlp
left a comment
There was a problem hiding this comment.
Two nitpicks then I think we're ready to go.
5305032 to
fef1ce5
Compare
Targets without atomic pointer support currently fail to compile (e.g.,
thumbv4t-none-eabi). This PR allows those targets to compile by more explicitly choosing an atomic type forPER_HASHER_NONDETERMINISM. If no atomic support is present, allow the result fromgen_per_hasher_seedto have degraded nondeterminism.