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 | ||
---|---|---|
20711 | "type then" -> "type, then" | |
20712 | Here too | |
20767 | "pointer then" -> "pointer, then" | |
20768 | Here too | |
llvm/include/llvm/IR/VPIntrinsics.def | ||
332 | 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. | |
356 | 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 | ||
---|---|---|
20258 | must be vectors | |
20259 | in trunc we explicitly say it cannot be a no-op cast. Should we say that here too? | |
20282 | these select ops should be <4 x i32> | |
20310 | vectors again. | |
20373 | trunc -> fptrunc | |
20404 | v16f64.v16f32? | |
20405 | other way round - nxv4f64.nxv4f32? | |
20502 | select operands should be <4 x i32> (I just pushed cc67a8fcf148 to fix it in vp.fptosi.) | |
llvm/include/llvm/IR/VPIntrinsics.def | ||
307 | 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 | I'd like to see some tests in test/Verifier/invalid-vp-intrinsics.ll for this | |
5607 | 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 | ||
---|---|---|
20259 | 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. | |
20282 | sorry, this is my carelessness. | |
llvm/include/llvm/IR/VPIntrinsics.def | ||
307 | I will separate this macro, thanks. | |
llvm/lib/IR/Verifier.cpp | ||
5607 | 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