Open p0nce opened 3 years ago
The spec classify UB as illegal, say it in the DDoc.
intel-intrinsics allows some instruction to shift by more than size in bits, because it has actually no runtime cost in inline optimized code. Not sure how evil that is.
The question (with regards to shifting) is that D says it's UB, but the x86 instruction is well defined. And I've said at Dconf that "intel-intrinsics semantics is always modelled on the instruction they are supposed to emulate" but that may not be true, some instruction are different from their intrinsic (_mm_comieq_ss) MMMmmmmm...
Also same question with _mm_alignr_pi8 / _mm_alignr_epi8 with larger counts. If we make this UB, might be better for arm vs x86.
Need to see if the shift instruction agree between arm and x86, making it UB would be more correct in arm perhaps
=> document them