Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
b70e7fd
Add inherent impls for unchecked math intrinsics
CAD97 Feb 3, 2020
2fcfd23
Redesign the Step trait
CAD97 Feb 18, 2020
f34322d
Adjust Step::forward_checked docs for large types
CAD97 Mar 14, 2020
e734e31
Small doc improvements.
Julian-Wollersberger Apr 25, 2020
23d880b
rustc_driver: factor out computing the exit code
RalfJung May 10, 2020
51e466d
rustc_driver::main: more informative return type
RalfJung May 10, 2020
00dcb66
cmdline: Make target features individually overridable
petrochenkov May 10, 2020
9111d8b
Fix the new capacity measurement in arenas.
nnethercote May 4, 2020
40d4868
Be less aggressive with `DroplessArena`/`TypedArena` growth.
nnethercote May 4, 2020
1be5d1e
Unified `unescape_{char,byte,str,byte_str,raw_str,raw_byte_str}` meth…
Julian-Wollersberger May 13, 2020
18cc63d
Unified `validate_{byte,str,raw_str,raw_byte_str}_escape` methods int…
Julian-Wollersberger May 13, 2020
43ae785
Replace some usages of the old `unescape_` functions in AST, clippy a…
Julian-Wollersberger May 13, 2020
cef616b
Improve comments in iter::Step
CAD97 May 13, 2020
90b1961
Improve Step::forward/backward for optimization
CAD97 May 13, 2020
d53068e
improve step_integer_impls macro
CAD97 May 14, 2020
32606d7
Rollup merge of #69659 - CAD97:step-rework-take-3, r=Amanieu
RalfJung May 15, 2020
afe4b8a
Rollup merge of #71872 - nnethercote:less-aggressive-arena-growth, r=…
RalfJung May 15, 2020
1df77aa
Rollup merge of #72047 - Julian-Wollersberger:literal_error_reporting…
RalfJung May 15, 2020
5b56f76
Rollup merge of #72090 - RalfJung:rustc_driver-exit-code, r=oli-obk
RalfJung May 15, 2020
7dc2c01
Rollup merge of #72094 - petrochenkov:overfeature, r=nikic
RalfJung May 15, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/doc/rustc/src/codegen-options/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,15 @@ machine. Each target has a default base CPU.

Individual targets will support different features; this flag lets you control
enabling or disabling a feature. Each feature should be prefixed with a `+` to
enable it or `-` to disable it. Separate multiple features with commas.
enable it or `-` to disable it.

Features from multiple `-C target-feature` options are combined. \
Multiple features can be specified in a single option by separating them
with commas - `-C target-feature=+x,-y`. \
If some feature is specified more than once with both `+` and `-`,
then values passed later override values passed earlier. \
For example, `-C target-feature=+x,-y,+z -Ctarget-feature=-x,+y`
is equivalent to `-C target-feature=-x,+y,+z`.

To see the valid options and an example of use, run `rustc --print
target-features`.
Expand Down
16 changes: 15 additions & 1 deletion src/librustc_session/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ macro_rules! options {
"one of supported relocation models (`rustc --print relocation-models`)";
pub const parse_tls_model: &str =
"one of supported TLS models (`rustc --print tls-models`)";
pub const parse_target_feature: &str = parse_string;
}

#[allow(dead_code)]
Expand Down Expand Up @@ -647,6 +648,19 @@ macro_rules! options {
}
true
}

fn parse_target_feature(slot: &mut String, v: Option<&str>) -> bool {
match v {
Some(s) => {
if !slot.is_empty() {
slot.push_str(",");
}
slot.push_str(s);
true
}
None => false,
}
}
}
) }

Expand Down Expand Up @@ -742,7 +756,7 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
"use soft float ABI (*eabihf targets only) (default: no)"),
target_cpu: Option<String> = (None, parse_opt_string, [TRACKED],
"select target processor (`rustc --print target-cpus` for details)"),
target_feature: String = (String::new(), parse_string, [TRACKED],
target_feature: String = (String::new(), parse_target_feature, [TRACKED],
"target specific attributes. (`rustc --print target-features` for details). \
This feature is unsafe."),

Expand Down
9 changes: 9 additions & 0 deletions src/test/codegen/target-feature-multiple.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// only-x86_64
// compile-flags: -C target-feature=+sse2,-avx,+avx2 -C target-feature=+avx,-avx2

#![crate_type = "lib"]

#[no_mangle]
pub fn foo() {
// CHECK: attributes #0 = { {{.*}}"target-features"="+sse2,-avx,+avx2,+avx,-avx2"{{.*}} }
}