Skip to content

[DO NOT MERGE] Add subtraction, rounding avx instrs - #42

Merged
alexcrichton merged 5 commits into
rust-lang:masterfrom
AdamNiederer:master
Sep 27, 2017
Merged

[DO NOT MERGE] Add subtraction, rounding avx instrs#42
alexcrichton merged 5 commits into
rust-lang:masterfrom
AdamNiederer:master

Conversation

@AdamNiederer

@AdamNiederer AdamNiederer commented Sep 26, 2017

Copy link
Copy Markdown
Contributor

Hi all,
I've implemented subpd256, subps256, roundpd256, ceilpd256, floorpd256, and their associated tests. It's still a bit of a work in progress

I'll try to iron those out tomorrow.

Adds subpd256, subps256, roundpd256, ceilpd256, floorpd256, and associated tests
We can use the generic operators instead
@alexcrichton

Copy link
Copy Markdown
Member

Thanks for the PR! What do the test failures look like if you add assert_instr?

@AdamNiederer

AdamNiederer commented Sep 26, 2017

Copy link
Copy Markdown
Contributor Author
LLVM ERROR: Cannot select: intrinsic %llvm.x86.avx.round.pd.256

My intrinsics reference says there is something for VROUNDPD, though

let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86."
  ...
  def int_x86_avx_round_pd_256 : GCCBuiltin<"__builtin_ia32_roundpd256">,
        Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
                  llvm_i32_ty], [IntrNoMem]>;
}

https://gist.githubusercontent.com/anonymous/a25d3e3b4c14ee68d63bd1dcb0e1223c/raw/fb798be53a7b29f9b28a0c7a9e2b9a16ae915f71/allintrinsics

I'm not 100% sure how I should proceed; I've tried some permutations on the name of the intrinsic.

@alexcrichton

Copy link
Copy Markdown
Member

I think this means that the argument must be an immediate? Right now it takes an i32, but should it take a byte instead?

@AdamNiederer

Copy link
Copy Markdown
Contributor Author

I've tried it with both an i8 and a u8, which both fail to compile. It looks like the icc intrinsic takes a c-int (http://www.felixcloutier.com/x86/ROUNDPD.html). Does the immediate have to be a constant expression?

@alexcrichton

Copy link
Copy Markdown
Member

Ah yeah you'll find a few macros (I think constify* style) in the rest of the codebase to turn variables into immediates

@AdamNiederer

Copy link
Copy Markdown
Contributor Author

@alexcrichton We should be good to go now; the broken appveyor build appears to be unrelated to this change.

@alexcrichton
alexcrichton merged commit c15d3a7 into rust-lang:master Sep 27, 2017
@alexcrichton

Copy link
Copy Markdown
Member

Looks great, thanks @AdamNiederer!

github-actions Bot pushed a commit that referenced this pull request Aug 18, 2025
…n, r=petrochenkov

Prevent name collisions with internal implementation details

The implementation of the linkage attribute inside extern blocks defines symbols starting with _rust_extern_with_linkage_. If someone tries to also define this symbol you will get a symbol conflict or even an ICE. By adding an unpredictable component to the symbol name, this becomes less of an issue.

Spawned from the discussion at [#t-compiler > About static variables &#96;_rust_extern_with_linkage_&#42;&#96;](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/About.20static.20variables.20.60_rust_extern_with_linkage_*.60) cc `@ywxt`

Fixes rust-lang/rust#144940
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants