5

Add simd_bswap, simd_bitreverse, simd_ctlz, and simd_cttz intrinsics by calebzul...

 1 year ago
source link: https://github.com/rust-lang/rust/pull/114156
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Add simd_bswap, simd_bitreverse, simd_ctlz, and simd_cttz intrinsics #114156

Conversation

Collaborator

r? @compiler-errors

(rustbot has picked a reviewer for you, use r? to override)

rustbot

added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

labels

Jul 28, 2023

This comment has been minimized.

This comment has been minimized.

Contributor

Intrinsic has incorrect argument type!
<4 x i32> (<4 x i32>, i8)* @llvm.ctlz.v4i32
Intrinsic has incorrect argument type!
<4 x i32> (<4 x i32>, i8)* @llvm.ctlz.v4i32
Intrinsic has incorrect argument type!
<4 x i32> (<4 x i32>, i8)* @llvm.cttz.v4i32
Intrinsic has incorrect argument type!
<4 x i32> (<4 x i32>, i8)* @llvm.cttz.v4i32
LLVM ERROR: Broken module found, compilation aborted!

well
that won't do.

Member

Author

Is that LLVM 14 specific? I'm pretty sure the bump to 15 is imminent.

Member

Author

Ah, actually, the problem is that it's encoding the last argument as i8 instead of i1. Why does it work elsewhere?

Contributor

Is that LLVM 14 specific? I'm pretty sure the bump to 15 is imminent.

I don't thiiink so?

Contributor

Is that LLVM 14 specific? I'm pretty sure the bump to 15 is imminent.

I don't thiiink so?

#114148 8 hours ago ;-)

calebzulawski reacted with thumbs up emoji

Contributor

@Urgau I mean that I don't think the issue is LLVM 14 specific, I could be wrong.

Urgau reacted with eyes emoji

Contributor

@Urgau I mean that I don't think the issue is LLVM 14 specific, I could be wrong.

Oh, yeah sorry. As for the issue here, I would just note that type_bool() is indeed i8 not i1; to have i1 you should call type_i1().

calebzulawski reacted with thumbs up emoji

Member

cg_clif and cg_gcc will need these intrinsics too.

calebzulawski reacted with thumbs up emoji

Member

Author

Is that LLVM 14 specific? I'm pretty sure the bump to 15 is imminent.

I don't thiiink so?

It compiles on newer LLVM so at some point it became flexible enough to accept i8.

cg_clif and cg_gcc will need these intrinsics too.

@bjorn3 do you expect that to be part of this PR, or just making a note of it?

Member

Mostly making a note. I can implement it on the cg_clif side myself. I don't know what @antoyo prefers for cg_gcc.

calebzulawski reacted with heart emoji

Contributor

I'm also taking note for cg_gcc and I'll implement it myself.

calebzulawski reacted with heart emoji

Member

Author

@Urgau I mean that I don't think the issue is LLVM 14 specific, I could be wrong.

Oh, yeah sorry. As for the issue here, I would just note that type_bool() is indeed i8 not i1; to have i1 you should call type_i1().

It looks like this worked!

Contributor

pushpin Commit ce4a48f has been approved by compiler-errors

It is now in the queue for this repository.

bors

added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

labels

Jul 29, 2023

Member

Any chance someone could make a PR to also implement these in Miri? :) Let me know if you need any pointers for getting started. The existing SIMD intrinsics are probably a good template.

Contributor

hourglass Testing commit ce4a48f with merge 03a5725...

Contributor

sunny Test successful - checks-actions
Approved by: compiler-errors
Pushing 03a5725 to master...

bors

added the merged-by-bors This PR was explicitly merged by bors label

Jul 29, 2023

bors

merged commit 03a5725 into

rust-lang:master

Jul 29, 2023

12 checks passed

Collaborator

Finished benchmarking commit (03a5725): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 652.746s -> 651.287s (-0.22%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

compiler-errors

compiler-errors approved these changes
Labels
merged-by-bors This PR was explicitly merged by bors S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects

None yet

Milestone

1.73.0

Development

Successfully merging this pull request may close these issues.

None yet

11 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK