Stream: git-cranelift

Topic: cranelift / PR #1174 Tls support for ELF and MachO


view this post on Zulip GitHub (Jan 26 2020 at 13:18):

bjorn3 edited PR #1174 from tls_support to master:

This adds TLS (thread local storage) support for ELF targets to Cranelift

Fixes #963

cc @philipc https://github.com/bjorn3/rustc_codegen_cranelift/issues/388#issuecomment-526909856
cc @abrown Because you implemented SIMD support for x86, I think you know enough of x86 encodings to verify that the encodings are correct.

view this post on Zulip GitHub (Feb 13 2020 at 19:52):

bjorn3 updated PR #1174 from tls_support to master:

This adds TLS (thread local storage) support for ELF targets to Cranelift

Fixes #963

cc @philipc https://github.com/bjorn3/rustc_codegen_cranelift/issues/388#issuecomment-526909856
cc @abrown Because you implemented SIMD support for x86, I think you know enough of x86 encodings to verify that the encodings are correct.

view this post on Zulip GitHub (Feb 14 2020 at 14:04):

bjorn3 updated PR #1174 from tls_support to master:

This adds TLS (thread local storage) support for ELF targets to Cranelift

Fixes #963

cc @philipc https://github.com/bjorn3/rustc_codegen_cranelift/issues/388#issuecomment-526909856
cc @abrown Because you implemented SIMD support for x86, I think you know enough of x86 encodings to verify that the encodings are correct.

view this post on Zulip GitHub (Feb 14 2020 at 15:23):

bjorn3 updated PR #1174 from tls_support to master:

This adds TLS (thread local storage) support for ELF targets to Cranelift

Fixes #963

cc @philipc https://github.com/bjorn3/rustc_codegen_cranelift/issues/388#issuecomment-526909856
cc @abrown Because you implemented SIMD support for x86, I think you know enough of x86 encodings to verify that the encodings are correct.

view this post on Zulip GitHub (Feb 24 2020 at 17:45):

sunfishcode submitted PR Review.

view this post on Zulip GitHub (Feb 24 2020 at 17:45):

sunfishcode submitted PR Review.

view this post on Zulip GitHub (Feb 24 2020 at 17:45):

sunfishcode created PR Review Comment:

Instead of having a tls_value instruction, would it work to just continue to use symbol_value here, and use the tls flag of gv to determine whether it's TLS or not? You could add a is_tls_data predicate function which could work the same way as is_colocated_data, FormatPredicateKind::IsColocatedData, and so on, and then define_entity_ref in cranelift-codegen/meta/src/isa/x86/encodings.rs could use that to decide when to apply the TLS legalizations.

view this post on Zulip GitHub (Feb 24 2020 at 17:45):

sunfishcode created PR Review Comment:

The ELF and Mach-O instructions here have the same signature, and essentially represent the same functionality, except that they record which target to codegen for. Would it simplify the code to just have one instruction, and move the target check into the encoding phase?

view this post on Zulip GitHub (Feb 24 2020 at 17:53):

abrown assigned PR #1174.

view this post on Zulip GitHub (Feb 24 2020 at 18:47):

bjorn3 edited PR #1174 (assigned to abrown) from tls_support to master:

This adds TLS (thread local storage) support for ELF targets to Cranelift

Fixes #963

cc @philipc https://github.com/bjorn3/rustc_codegen_cranelift/issues/388#issuecomment-526909856
cc @abrown Because you implemented SIMD support for x86, I think you know enough of x86 encodings to verify that the encodings are correct.

view this post on Zulip GitHub (Feb 24 2020 at 18:47):

bjorn3 edited PR #1174 (assigned to abrown) from tls_support to master:

This adds TLS (thread local storage) support for ELF targets to Cranelift

Fixes #963

cc @philipc https://github.com/bjorn3/rustc_codegen_cranelift/issues/388#issuecomment-526909856
cc @abrown Because you implemented SIMD support for x86, I think you know enough of x86 encodings to verify that the encodings are correct.

view this post on Zulip GitHub (Feb 24 2020 at 19:06):

bjorn3 created PR Review Comment:

Both x86_elf_tls_get_addr and x86_macho_tls_get_addr happen to clobber a register. I am currently representing this as an extra output value. In the future there may be other TLS models added that don't clobber exactly one, but zero, two or more registers. In that case a separate instruction is needed. For symmetry I think it would be nice to keep separate instructions for ELF and Mach-O too.

view this post on Zulip GitHub (Feb 24 2020 at 19:06):

bjorn3 submitted PR Review.

view this post on Zulip GitHub (Feb 24 2020 at 19:06):

sunfishcode submitted PR Review.

view this post on Zulip GitHub (Feb 24 2020 at 19:06):

sunfishcode created PR Review Comment:

Makes sense!

view this post on Zulip GitHub (Feb 24 2020 at 19:14):

bjorn3 submitted PR Review.

view this post on Zulip GitHub (Feb 24 2020 at 19:14):

bjorn3 created PR Review Comment:

symbol_value can directly be encoded, while tls_value needs to be legalized to the correct instruction for the respective object format. See comment below for why. As far as I know, unlike an encoding, there is no way to predicate a legalization.

view this post on Zulip GitHub (Feb 25 2020 at 20:18):

bjorn3 updated PR #1174 (assigned to abrown) from tls_support to master:

This adds TLS (thread local storage) support for ELF targets to Cranelift

Fixes #963

cc @philipc https://github.com/bjorn3/rustc_codegen_cranelift/issues/388#issuecomment-526909856
cc @abrown Because you implemented SIMD support for x86, I think you know enough of x86 encodings to verify that the encodings are correct.

view this post on Zulip GitHub (Feb 25 2020 at 20:21):

bjorn3 updated PR #1174 (assigned to abrown) from tls_support to master:

This adds TLS (thread local storage) support for ELF targets to Cranelift

Fixes #963

cc @philipc https://github.com/bjorn3/rustc_codegen_cranelift/issues/388#issuecomment-526909856
cc @abrown Because you implemented SIMD support for x86, I think you know enough of x86 encodings to verify that the encodings are correct.

view this post on Zulip GitHub (Feb 26 2020 at 01:49):

abrown submitted PR Review.

view this post on Zulip GitHub (Feb 26 2020 at 01:50):

abrown merged PR #1174.


Last updated: Nov 22 2024 at 16:03 UTC