Comment by burntsushi
8 years ago
I'm not experienced enough in compilers at this level to make a prescriptive argument here. My comment was just intended to be descriptive. I think it would be well worth the effort to dig into the LLVM side of things here to root out the specific reasons for UB. Intuitively though, it makes sense to me that it would be UB. I'd be surprised if it weren't. It seems like it should be reasonable for compilers to assume that the execution of an instruction implies that instruction is supported on the current CPU.
Your type system idea works great for simple cases. It was the very first thing I did in my own SIMD code.
No comments yet
Contribute on Hacker News ↗