Hi everyone, I was looking at the @llvm.memset.* documentation and something seemed a bit off. The <len> argument type seems wrong. It's the same as the <val> type, but it would seem to me that only being able to memset 255 bytes in an i8 array is a bit limiting. :) declare void @llvm.memset.i8(i8 * <dest>, i8 <val>, i8 <len>, i32 <align>) declare void @llvm.memset.i16(i8 * <dest>, i8 <val>, i16 <len>, i32 <align>) declare void @llvm.memset.i32(i8 * <dest>, i8 <val>, i32 <len>, i32 <align>) declare void @llvm.memset.i64(i8 * <dest>, i8 <val>, i64 <len>, i32 <align>) It takes i32 for <len> just fine btw. Cheers, Jean-Paul Kogelman -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100227/7d142133/attachment.html>
On Feb 27, 2010, at 12:53 AM, Jean-Paul Kogelman wrote:> Hi everyone, > I was looking at the @llvm.memset.* documentation and something seemed a bit off. The <len> argument type seems wrong. It's the same as the <val> type, but it would seem to me that only being able to memset 255 bytes in an i8 array is a bit limiting. :)It is right, the size isn't tied to the value. The value is always i8, the size can be any integer type: http://llvm.org/docs/LangRef.html#int_memset -Chris> > declare void @llvm.memset.i8(i8 * <dest>, i8 <val>, i8 <len>, i32 <align>) > declare void @llvm.memset.i16(i8 * <dest>, i8 <val>, i16 <len>, i32 <align>) > declare void @llvm.memset.i32(i8 * <dest>, i8 <val>, i32 <len>, i32 <align>) > declare void @llvm.memset.i64(i8 * <dest>, i8 <val>, i64 <len>, i32 <align>) > > It takes i32 for <len> just fine btw. > > Cheers, > > Jean-Paul Kogelman > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100227/89771fd6/attachment.html>
Reasonably Related Threads
- [LLVMdev] Call to non-constant memset() being generated where libc is not available
- [LLVMdev] Call to non-constant memset() being generated where libc is not available
- [LLVMdev] Specify the volatile access behaviour of the memcpy, memmove and memset intrinsics
- Objects of MemoryLocation class are created for ‘llvm.memset.*‘ intrinsics
- [LLVMdev] [cfe-commits] [PATCH] [llvm+clang] memset for non-8-bit bytes