Patrik Hägglund H
2012-Oct-19 18:43 UTC
[LLVMdev] [llvm-commits] [cfe-commits] [PATCH] [llvm+clang] memset for non-8-bit bytes
> I'm a bit confused by this concept.For the term byte, I use the "archaic" definition in the C (and C++) standard (section 3.6): addressable unit of data storage large enough to hold any member of the basic character set of the execution environment /Patrik Hägglund -----Original Message----- From: Jakob Stoklund Olesen [mailto:stoklund at 2pi.dk] Sent: den 19 oktober 2012 18:28 To: Patrik Hägglund H Cc: Chris Lattner; llvmdev at cs.uiuc.edu Subject: Re: [llvm-commits] [cfe-commits] [PATCH] [llvm+clang] memset for non-8-bit bytes On Oct 19, 2012, at 2:24 AM, Patrik Hägglund H <patrik.h.hagglund at ericsson.com> wrote:>> non-8-bit byteI'm a bit confused by this concept. I'm aware of the archaic meaning of the word byte, but it has meant 8 bits for the last 30 years. There's even an ISO/IEC standard. I know of architectures like Texas' C55x DSPs that address 16 bits at a time, but even their data sheets state: . 256K Bytes Zero-Wait State On-Chip RAM, Composed of: . - 64K Bytes of Dual-Access RAM (DARAM), 8 Blocks of 4K x 16-Bit . - 192K Bytes of Single-Access RAM (SARAM), 24 Blocks of 4K x 16-Bit Perhaps you could begin by defining more accurately what you're talking about? /jakob
Owen Anderson
2012-Oct-19 19:45 UTC
[LLVMdev] [llvm-commits] [cfe-commits] [PATCH] [llvm+clang] memset for non-8-bit bytes
On Oct 19, 2012, at 11:43 AM, Patrik Hägglund H <patrik.h.hagglund at ericsson.com> wrote:>> I'm a bit confused by this concept. > > For the term byte, I use the "archaic" definition in the C (and C++) standard (section 3.6): > > addressable unit of data storage large enough to hold any member of the basic character > set of the execution environmentThat definition isn't really relevant to LLVM, though. You can define char to be (say) 16 bits, and your frontend (clang?) just needs to set CHAR_BIT properly, and generate code with i16 whenever you wrote char. I suspect what you want to talk about, and the part that is relevant to LLVM as opposed to clang, is supporting architectures where the minimum addressable unit is not 8 bits in size. --Owen
Eli Friedman
2012-Oct-19 19:59 UTC
[LLVMdev] [llvm-commits] [cfe-commits] [PATCH] [llvm+clang] memset for non-8-bit bytes
On Fri, Oct 19, 2012 at 12:45 PM, Owen Anderson <resistor at mac.com> wrote:> > On Oct 19, 2012, at 11:43 AM, Patrik Hägglund H <patrik.h.hagglund at ericsson.com> wrote: > >>> I'm a bit confused by this concept. >> >> For the term byte, I use the "archaic" definition in the C (and C++) standard (section 3.6): >> >> addressable unit of data storage large enough to hold any member of the basic character >> set of the execution environment > > That definition isn't really relevant to LLVM, though. You can define char to be (say) 16 bits, and your frontend (clang?) just needs to set CHAR_BIT properly, and generate code with i16 whenever you wrote char.That's not true; SimplifyLibCalls, for example, would perform all sorts of bad optimizations if CHAR_BIT is not 8.> I suspect what you want to talk about, and the part that is relevant to LLVM as opposed to clang, is supporting architectures where the minimum addressable unit is not 8 bits in size.There's also this. -Eli
Patrik Hägglund H
2012-Oct-19 20:38 UTC
[LLVMdev] [llvm-commits] [cfe-commits] [PATCH] [llvm+clang] memset for non-8-bit bytes
> You can define char to be (say) 16 bits, and your > frontend (clang?) just needs to set CHAR_BIT properly, and > generate code with i16 whenever you wrote char.Sorry, but this is naive. As a starting point (many more changes are needed), I suggest you take a look at this patch (not provided by me) refered in my originial email: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120702/146050.html /Patrik Hägglund -----Original Message----- From: Owen Anderson [mailto:resistor at mac.com] Sent: den 19 oktober 2012 21:45 To: Patrik Hägglund H Cc: Jakob Stoklund Olesen; llvmdev at cs.uiuc.edu Subject: Re: [LLVMdev] [llvm-commits] [cfe-commits] [PATCH] [llvm+clang] memset for non-8-bit bytes On Oct 19, 2012, at 11:43 AM, Patrik Hägglund H <patrik.h.hagglund at ericsson.com> wrote:>> I'm a bit confused by this concept. > > For the term byte, I use the "archaic" definition in the C (and C++) standard (section 3.6): > > addressable unit of data storage large enough to hold any member of the basic character > set of the execution environmentThat definition isn't really relevant to LLVM, though. You can define char to be (say) 16 bits, and your frontend (clang?) just needs to set CHAR_BIT properly, and generate code with i16 whenever you wrote char. I suspect what you want to talk about, and the part that is relevant to LLVM as opposed to clang, is supporting architectures where the minimum addressable unit is not 8 bits in size. --Owen
Patrik Hägglund H
2012-Oct-20 05:20 UTC
[LLVMdev] [llvm-commits] [cfe-commits] [PATCH] [llvm+clang] memset for non-8-bit bytes
> That definition isn't really relevant to LLVM, though. > [...] the part that is relevant to LLVM as opposed to clang, is > supporting architectures where the minimum addressable unit is > not 8 bits in size.The C standard don't make any distinction between front-end and back-end parts of the implementation. Therefore, this is not excluded. Having a different byte size in the C implementation than supported by the ISA is mostly of theoretical value, and not what I intended here. /Patrik Hägglund -----Original Message----- From: Owen Anderson [mailto:resistor at mac.com] Sent: den 19 oktober 2012 21:45 To: Patrik Hägglund H Cc: Jakob Stoklund Olesen; llvmdev at cs.uiuc.edu Subject: Re: [LLVMdev] [llvm-commits] [cfe-commits] [PATCH] [llvm+clang] memset for non-8-bit bytes On Oct 19, 2012, at 11:43 AM, Patrik Hägglund H <patrik.h.hagglund at ericsson.com> wrote:>> I'm a bit confused by this concept. > > For the term byte, I use the "archaic" definition in the C (and C++) standard (section 3.6): > > addressable unit of data storage large enough to hold any member of the basic character > set of the execution environmentThat definition isn't really relevant to LLVM, though. You can define char to be (say) 16 bits, and your frontend (clang?) just needs to set CHAR_BIT properly, and generate code with i16 whenever you wrote char. I suspect what you want to talk about, and the part that is relevant to LLVM as opposed to clang, is supporting architectures where the minimum addressable unit is not 8 bits in size. --Owen
Seemingly Similar Threads
- [LLVMdev] [llvm-commits] [cfe-commits] [PATCH] [llvm+clang] memset for non-8-bit bytes
- [LLVMdev] [llvm-commits] [cfe-commits] [PATCH] [llvm+clang] memset for non-8-bit bytes
- [LLVMdev] [llvm-commits] [cfe-commits] [PATCH] [llvm+clang] memset for non-8-bit bytes
- [LLVMdev] [llvm-commits] [cfe-commits] [PATCH] [llvm+clang] memset for non-8-bit bytes
- [LLVMdev] [cfe-commits] [PATCH] [llvm+clang] memset for non-8-bit bytes