about summary refs log tree commit diff
path: root/compiler/rustc_target/src/asm
AgeCommit message (Collapse)AuthorLines
2021-09-01Rollup merge of #88350 - programmerjake:add-ppc-cr-xer-clobbers, r=AmanieuMara Bos-10/+61
add support for clobbering xer, cr, and cr[0-7] for asm! on OpenPower/PowerPC Fixes #88315
2021-08-28Auto merge of #88245 - Sl1mb0:s390-asm, r=Amanieubors-0/+131
S390x inline asm This adds register definitions and constraint codes for the s390x general and floating point registers necessary for fixing #85931; as well as a few tests. Further testing is needed, but I am a little unsure of what specific tests should be added to `src/test/assembly/asm/s390x.rs` to address this.
2021-08-25add support for clobbering xer, cr, and cr[0-7] for asm! on OpenPower/PowerPCJacob Lifshay-10/+61
Fixes #88315
2021-08-23Fix: made suggested changelinux1-1/+1
2021-08-23Refactor: disabled frame pointer; consolidated unsupported register errors; ↵linux1-68/+18
added register prefix
2021-08-22Fix: appeased x.py test tidy --blesslinux1-6/+6
2021-08-22Feat: further testing & support for i64 general register uselinux1-1/+1
2021-08-22Feat: added s390x reg-definitions, constraint codes, and testslinux1-26/+26
2021-08-22Feat: added inline asm support for s390xlinux1-0/+181
2021-08-22Fix typos “a”→“an”Frank Steffahn-1/+1
2021-08-12Add support for clobber_abi to asm!Amanieu d'Antras-0/+182
2021-07-11Auto merge of #86416 - Amanieu:asm_clobber_only, r=nagisabors-36/+116
Add clobber-only register classes for asm! These are needed to properly express a function call ABI using a clobber list, even though we don't support passing actual values into/out of these registers.
2021-07-10Add AArch64 z* registers as aliases for v* registersAmanieu d'Antras-32/+32
2021-07-10Add clobber-only register classes for asm!Amanieu d'Antras-4/+84
These are needed to properly express a function call ABI using a clobber list, even though we don't support passing actual values into/out of these registers.
2021-05-23Add support for BPF inline assemblyAlessandro Decina-0/+154
2021-05-16Auto merge of #85312 - ehuss:macro_use-unused-attr, r=petrochenkovbors-3/+0
Fix unused attributes on macro_rules. The `unused_attributes` lint wasn't firing on attributes of `macro_rules` definitions. The consequence is that many attributes are silently ignored on `macro_rules`. The reason is that `unused_attributes` is a late-lint pass, and only has access to the HIR, which does not have macro_rules definitions. My solution here is to change `non_exported_macro_attrs` to be `macro_attrs` (a list of all attributes used for `macro_rules`, instead of just those for `macro_export`), and then to check this list in the `unused_attributes` lint. There are a number of alternate approaches, but this seemed the most reliable and least invasive. I am open to completely different approaches, though. One concern is that I don't fully understand the implications of extending `non_exported_macro_attrs` to include non-exported macros. That list was originally added in #62042 to handle stability attributes, so I suspect it was just an optimization since that was all that was needed. It was later extended to be included in SVH in #83901. #80641 also added a use to check for `invalid` attributes, which seems a little odd to me (it didn't validate non-exported macros, and seems highly specific). Overall, there doesn't seem to be a clear story of when `unused_attributes` should be used versus an error like E0518. I considered alternatively using an "allow list" of built-in attributes that can be used on macro_rules (allow, warn, deny, forbid, cfg, cfg_attr, macro_export, deprecated, doc), but I feel like that could be a pain to maintain. Some built-in attributes already present hard-errors when used with macro_rules. These are each hard-coded in various places: - `derive` - `test` and `bench` - `proc_macro` and `proc_macro_derive` - `inline` - `global_allocator` The primary motivation is that I sometimes see people use `#[macro_use]` in front of `macro_rules`, which indicates there is some confusion out there (evident that there was even a case of it in rustc).
2021-05-15Fix unused attributes on macro_rules.Eric Huss-3/+0
2021-05-13Add asm!() support for PowerPC64Dr. Chat-5/+15
2021-05-11Add initial asm!() support for PowerPCDr. Chat-0/+171
This includes GPRs and FPRs only
2021-05-01Reserve x18 on AArch64 and un-reserve x16Amanieu d'Antras-3/+3
2021-04-28Be stricter about rejecting LLVM reserved registers in asm!Amanieu d'Antras-9/+42
2021-04-05Disallow the use of high byte registes as operands on x86_64Amanieu d'Antras-11/+3
They are still allowed on x86 though. Fixes #83495
2021-03-14Address review commentsAmanieu d'Antras-7/+7
2021-03-13Always lower asm! to valid HIRAmanieu d'Antras-0/+14
2021-02-21New pass to deduplicate blocksSimon Vandel Sillesen-5/+38
2020-12-10Use Symbol for inline asm register class namesArlie Davis-29/+22
This takes care of one "FIXME": // FIXME: use direct symbol comparison for register class names Instead of using string literals, this uses Symbol for register class names.
2020-12-01Add wasm32 support to inline asmGus Caplan-0/+67
2020-11-12Rollup merge of #78950 - khyperia:spirv-asm, r=AmanieuMara Bos-0/+67
Add asm register information for SPIR-V As discussed in [zulip](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Defining.20asm!.20for.20new.20architecture), we at [rust-gpu](https://github.com/EmbarkStudios/rust-gpu) would like to support `asm!` for our SPIR-V backend. However, we cannot do so purely without frontend support: [this match](https://github.com/rust-lang/rust/blob/d4ea0b3e46a0303d5802b632e88ba1ba84d9d16f/compiler/rustc_target/src/asm/mod.rs#L185) fails and so `asm!` is not supported ([error reported here](https://github.com/rust-lang/rust/blob/d4ea0b3e46a0303d5802b632e88ba1ba84d9d16f/compiler/rustc_ast_lowering/src/expr.rs#L1095)). To resolve this, we need to stub out register information for SPIR-V to support getting the `asm!` content all the way to [`AsmBuilderMethods::codegen_inline_asm`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_codegen_ssa/traits/trait.AsmBuilderMethods.html#tymethod.codegen_inline_asm), at which point the rust-gpu backend can do all the parsing and codegen that is needed. This is a pretty weird PR - adding support for a backend that isn't in-tree feels pretty gross to me, but I don't see an easy way around this. ``@Amanieu`` said I should submit it anyway, so, here we are! Let me know if this needs to go through a more formal process (MCP?) and what I should do to help this along. I based this off the [wasm asm PR](https://github.com/rust-lang/rust/pull/78684), which unfortunately this PR conflicts with that one quite a bit, sorry for any merge conflict pain :( --- Some open questions: - What do we call the register class? Some context, SPIR-V is an SSA-based IR, there are "instructions" that create IDs (referred to as `<id>` in the spec), which can be referenced by other instructions. So, `reg` isn't exactly accurate, they're SSA IDs, not re-assignable registers. - What happens when a SPIR-V register gets to the LLVM backend? Right now it's a `bug!`, but should that be a `sess.fatal()`? I'm not sure if it's even possible to reach that point, maybe there's a check that prevents the `spirv` target from even reaching that codepath.
2020-11-11Change capitalization of Spirv to SpirVkhyperia-18/+18
This matches the capitalization of RiscV
2020-11-11Add asm register information for SPIR-Vkhyperia-0/+67
2020-11-08Collapse all uses of `target.options.foo` into `target.foo`Vadim Petrochenkov-1/+1
with an eye on merging `TargetOptions` into `Target`. `TargetOptions` as a separate structure is mostly an implementation detail of `Target` construction, all its fields logically belong to `Target` and available from `Target` through `Deref` impls.
2020-10-30Fix even more clippy warningsJoshua Nelson-4/+1
2020-10-04Removes reg aliases since there are many ABIs: o32/n32/n64Lzu Tao-32/+32
2020-10-04Add asm! support for mips64Lzu Tao-7/+12
2020-10-04mips32: Add f64 hard-float supportLzu Tao-1/+1
co-authored-by: Amanieu <amanieu@gmail.com>
2020-09-27Add MIPS asm! supportLzu Tao-0/+157
This patch also: * Add soft-float supports: only f32 * zero-extend i8/i16 to i32 because MIPS only supports register-length arithmetic. * Update table in asm! chapter in unstable book.
2020-08-30mv compiler to compiler/mark-0/+1719