Repository navigation
Conversation
2d75bd8 to
b2cf59a
Compare
1e2d57b to
272df92
Compare
|
@Amanieu @folkertdev what do you think, can/should this be merged now, considering the LLVM bugs, or should we wait until the fixes merge? |
|
I don't have strong feelings about it. I'm assuming this won't really see practical usage? On the other hand we might be adding some test coverage to potentially catch regressions next LLVM upgrade. So I guess I'm fine with merging, but I don't think it matters much really. |
This comment has been minimized.
This comment has been minimized.
f9ffb64 to
778deff
Compare
This comment has been minimized.
This comment has been minimized.
e7b7a70 to
8e46686
Compare
92c1a63 to
19b762d
Compare
bb485b2 to
065fb0a
Compare
|
r? @Amanieu rustbot has assigned @Amanieu. Use Why was this reviewer chosen?The reviewer was selected based on:
|
| #[unstable(feature = "stdarch_x86_avx10_2", issue = "153417")] | ||
| #[cfg_attr(all(test, not(target_vendor = "apple")), assert_instr(vmovrsb))] | ||
| pub unsafe fn _mm_maskz_loadrs_epi8(k: __mmask16, p: *const i8) -> __m128i { | ||
| _mm_maskz_mov_epi8(k, _mm_loadrs_epi8(p)) |
There was a problem hiding this comment.
I think this is incorrect: we shouldn't be loading from masked-off elements. This matters when the masked off elements are past the end of a page boundary.
There was a problem hiding this comment.
LLVM doesn't provide masked movrs intrinsics. So I will just remove the masked versions for now, and file an LLVM issue (since clang also does the same thing currently)
| )] | ||
| pub fn _mm512_maskz_ipcvtts_roundph_epi8<const SAE: i32> |
There was a problem hiding this comment.
Do we need static bounds-checks for these? They are both just aliases for i32.
There was a problem hiding this comment.
sorry I am not getting what you want to say. bounds-checks for what?
edit: oh sorry github ui is showing your comment on a different line. I think we should have a bounds-check for these, since llvm will probably panic if the intrinsic is invoked with out-of-bounds values.
There was a problem hiding this comment.
i spotted that we use uimm_bits(4) for norm in avx512f, even though the doc says that the normalization is determined by imm8[1:0], and the sign control by imm8[3:2]. I used uimm_bits(2) here. Can we even fix the avx512f ones anymore?
This implementation can cause problems due to page boundaries, and LLVM doesn't have masked movrs intrinsics yet
Tracking Issue: rust-lang/rust#153417
minmaxminmaxAVX10_V1_AUXintrinsicsThese instructions are supported in a subset of AVX10.2, but neither GCC nor LLVM supports this feature yet.
TODO: Modify the
#[target_feature]attribute once LLVM starts supporting this.edit: it seems like LLVM does not want to support them, they've added
avx10_v2_auxwithoutavx10_v1_aux.BF16 Operations
A few BF16 intrinsics (
add,sub,mul,div,sqrt,cmpand FMA) require support fromcore::intrinsics::simd. Since thef16btype is not supported incg_llvm/intrinsic.rsyet, we can't do them nowExtra Clang Intrinsics
Clang actually supports quite a few more bf16 intrinsics (e.g. set, load, store etc). I have currently not implemented them, I have just implemented the GCC set. Once these are in the Intrinsics Guide, we can modify as needed.
intrinsic-testIntegrationI'd love to see these tested via
intrinsic-test, but the problem is these are not in the Intrinsics Guide yet. I'll see if I can somehow rig upintrinsic-testto test these (in a future PR).#[rustc_legacy_const_generics]I have not added this to any of the intrinsics. @Amanieu let me know if I should add them, or should we stop using this for new ISAs
LLVM Bugs
single-elementminmaxinstructions: Miscompilation ofVMINMAXS{H,S,D}intrinsics llvm/llvm-project#184245saturating float->int8 conversions: Miscompilation ofVCVT{T}P{H,S}2I{U}BSintrinsics llvm/llvm-project#184251hf8->float16 conversions: Miscompilation ofcvthf8_psintrinsics llvm/llvm-project#184651