Add vp.fptoui, vp.uitofp, vp.fptrunc, vp.fpext, vp.trunc, vp.zext, vp.sext, vp.ptrtoint, vp.inttoptr intrinsic and docs.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Verifier.cpp needs to be updated to verify the element counts match between the source and destination and that they have integer/fp types where they should. fpext, fptrunc, trunc, zext, and sext also need to verify that the element size is increasing/decreasing like its supposed to.
| llvm/docs/LangRef.rst | ||
|---|---|---|
| 20686 | "type then" -> "type, then" | |
| 20687 | Here too | |
| 20742 | "pointer then" -> "pointer, then" | |
| 20743 | Here too | |
| llvm/include/llvm/IR/VPIntrinsics.def | ||
| 302 | Usually you shouldn't make formatting changes to code you aren't touching. If you want to extract this from this patch and just commit it, that would be fine. | |
| 327 | Same here | |
I do not appear to have commit access. I am applying recently. Could you land this for me?
For Author: yanming <ming.yan@terapines.com>
| llvm/docs/LangRef.rst | ||
|---|---|---|
| 20233 | must be vectors | |
| 20234 | in trunc we explicitly say it cannot be a no-op cast. Should we say that here too? | |
| 20257 | these select ops should be <4 x i32> | |
| 20285 | vectors again. | |
| 20348 | trunc -> fptrunc | |
| 20379 | v16f64.v16f32? | |
| 20380 | other way round - nxv4f64.nxv4f32? | |
| 20477 | select operands should be <4 x i32> (I just pushed cc67a8fcf148 to fix it in vp.fptosi.) | |
| llvm/include/llvm/IR/VPIntrinsics.def | ||
| 264 | Can't we have HELPER_REGISTER_INT_CAST_VP or something? This just makes it harder to navigate the codebase imo. | |
| llvm/lib/IR/Verifier.cpp | ||
| 5604 ↗ | (On Diff #419307) | I'd like to see some tests in test/Verifier/invalid-vp-intrinsics.ll for this |
| 5607 ↗ | (On Diff #419307) | You don't need {} in any of these switch cases |
| llvm/test/Verifier/vp-intrinsics.ll | ||
| 60–61 | Feels to me like the name test_vp_int_fp_conversions implies it's testing only int<->fp conversions. Maybe we should have test_vp_int_conversions for sext/zext/trunc/ptrtoint/inttoptr and test_vp_fp_conversions for fpext/fptrunc? | |
| llvm/docs/LangRef.rst | ||
|---|---|---|
| 20234 | vp.trunc must not be a no-op cast, but this is vp.zext, its behavior should be consistent with the basic zext instruction. The basic zext instruction document does not indicate whether it is no-op cast. My understanding is that different targets have different operations. | |
| 20257 | sorry, this is my carelessness. | |
| llvm/include/llvm/IR/VPIntrinsics.def | ||
| 264 | I will separate this macro, thanks. | |
| llvm/lib/IR/Verifier.cpp | ||
| 5607 ↗ | (On Diff #419307) | This is my personal code style, I will remove it. |
| llvm/test/Verifier/vp-intrinsics.ll | ||
| 60–61 | I want to use test_vp_conversions to include all, is OK? | |
must be vectors