search for: vpt_data

Displaying 13 results from an estimated 13 matches for "vpt_data".

2018 Apr 18
4
A struct {i8,i64} has size == 12, clang says size 16
...t. This is for the system triple "x86_64-linux-gnu" What could be causing this difference in alignment and how can I fix it? I'm verifying the native ABI with:     // clang -emit-llvm ll_struct_arg.c -S -o /dev/tty     #include <stddef.h>     typedef struct vpt_data {         _Bool c;         long int b;     } vpt_data;     int main() {         vpt_data v;         vpt_test(v);         auto a = sizeof(v);         auto off = offsetof(vpt_data,b);     } 16 is stored to `a` and 8 to `off`. -- edA-qa mort-ora-y http://mortoray.com/ Creator of t...
2018 Apr 18
2
Why does clang do a memcpy? Is the cast not enough? (ABI function args)
I'm implementing function arguments and tested this code in C:     // clang -emit-llvm ll_struct_arg.c -S -o /dev/tty     typedef struct vpt_data {         char a;         int b;         float c;     } vpt_data;         void vpt_test( vpt_data vd ) {     }     int main() {         vpt_data v;         vpt_test(v);     } This emits an odd LLVM structure that casts to the desired struct type, but also memcpy's to a temporary structure. I&...
2018 Apr 18
0
A struct {i8, i64} has size == 12, clang says size 16
...riple "x86_64-linux-gnu" > What could be causing this difference in alignment and how can I fix it? > I'm verifying the native ABI with: > // clang -emit-llvm ll_struct_arg.c -S -o /dev/tty > #include <stddef.h> > typedef struct vpt_data { > _Bool c; > long int b; > } vpt_data; > int main() { > vpt_data v; > vpt_test(v); > auto a = sizeof(v); > auto off = offsetof(vpt_data,b); > } > 16 is stored to `a` and 8 to `off`. > -- >...
2018 Apr 18
2
Why does clang do a memcpy? Is the cast not enough? (ABI function args)
...e: > On 18 Apr 2018, at 18:40, edA-qa mort-ora-y via llvm-dev <llvm-dev at lists.llvm.org> wrote: >> I'm implementing function arguments and tested this code in C: >> >> // clang -emit-llvm ll_struct_arg.c -S -o /dev/tty >> typedef struct vpt_data { >> char a; >> int b; >> float c; >> } vpt_data; >> >> void vpt_test( vpt_data vd ) { >> } >> >> int main() { >> vpt_data v; >> vpt_test(v); >> } >> >> Th...
2018 Apr 18
0
Why does clang do a memcpy? Is the cast not enough? (ABI function args)
On 18 Apr 2018, at 18:40, edA-qa mort-ora-y via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > I'm implementing function arguments and tested this code in C: > > // clang -emit-llvm ll_struct_arg.c -S -o /dev/tty > typedef struct vpt_data { > char a; > int b; > float c; > } vpt_data; > > void vpt_test( vpt_data vd ) { > } > > int main() { > vpt_data v; > vpt_test(v); > } > > This emits an odd LLVM structure that casts to the desi...
2018 Apr 18
2
Why does clang do a memcpy? Is the cast not enough? (ABI function args)
...ra-y via llvm-dev >>> <llvm-dev at lists.llvm.org> wrote: >>>> I'm implementing function arguments and tested this code in C: >>>> >>>>      // clang -emit-llvm ll_struct_arg.c -S -o /dev/tty >>>>      typedef struct vpt_data { >>>>          char a; >>>>          int b; >>>>          float c; >>>>      } vpt_data; >>>> >>>>      void vpt_test( vpt_data vd ) { >>>>      } >>>> >>>>      int main() { >>>&gt...
2018 Apr 18
2
A struct {i8, i64} has size == 12, clang says size 16
...inux-gnu" >> What could be causing this difference in alignment and how can I fix it? > >> I'm verifying the native ABI with: >> // clang -emit-llvm ll_struct_arg.c -S -o /dev/tty >> #include <stddef.h> >> typedef struct vpt_data { >> _Bool c; >> long int b; >> } vpt_data; >> int main() { >> vpt_data v; >> vpt_test(v); >> auto a = sizeof(v); >> auto off = offsetof(vpt_data,b); >> } > >> 16 is s...
2018 Apr 18
0
Why does clang do a memcpy? Is the cast not enough? (ABI function args)
...2018, at 18:40, edA-qa mort-ora-y via llvm-dev <llvm-dev at lists.llvm.org> wrote: >>> I'm implementing function arguments and tested this code in C: >>> >>> // clang -emit-llvm ll_struct_arg.c -S -o /dev/tty >>> typedef struct vpt_data { >>> char a; >>> int b; >>> float c; >>> } vpt_data; >>> >>> void vpt_test( vpt_data vd ) { >>> } >>> >>> int main() { >>> vpt_data v; >>>...
2018 Apr 18
3
Why does clang do a memcpy? Is the cast not enough? (ABI function args)
...;llvm-dev at lists.llvm.org> wrote: >>>>>> I'm implementing function arguments and tested this code in C: >>>>>> >>>>>>       // clang -emit-llvm ll_struct_arg.c -S -o /dev/tty >>>>>>       typedef struct vpt_data { >>>>>>           char a; >>>>>>           int b; >>>>>>           float c; >>>>>>       } vpt_data; >>>>>> >>>>>>       void vpt_test( vpt_data vd ) { >>>>>>       } >&...
2018 Apr 18
0
Why does clang do a memcpy? Is the cast not enough? (ABI function args)
...>>> <llvm-dev at lists.llvm.org> wrote: >>>>> I'm implementing function arguments and tested this code in C: >>>>> >>>>>      // clang -emit-llvm ll_struct_arg.c -S -o /dev/tty >>>>>      typedef struct vpt_data { >>>>>          char a; >>>>>          int b; >>>>>          float c; >>>>>      } vpt_data; >>>>> >>>>>      void vpt_test( vpt_data vd ) { >>>>>      } >>>>> >>>...
2018 Apr 19
0
A struct {i8, i64} has size == 12, clang says size 16
...hat could be causing this difference in alignment and how can I fix it? > > > >> I'm verifying the native ABI with: > >> // clang -emit-llvm ll_struct_arg.c -S -o /dev/tty > >> #include <stddef.h> > >> typedef struct vpt_data { > >> _Bool c; > >> long int b; > >> } vpt_data; > >> int main() { > >> vpt_data v; > >> vpt_test(v); > >> auto a = sizeof(v); > >> auto off = offsetof(vpt_data,b...
2018 Apr 19
0
Why does clang do a memcpy? Is the cast not enough? (ABI function args)
...lvm.org> wrote: > >>>>>> I'm implementing function arguments and tested this code in C: > >>>>>> > >>>>>> // clang -emit-llvm ll_struct_arg.c -S -o /dev/tty > >>>>>> typedef struct vpt_data { > >>>>>> char a; > >>>>>> int b; > >>>>>> float c; > >>>>>> } vpt_data; > >>>>>> > >>>>>> void vpt_test( vpt_data vd ) { > &gt...
2018 Apr 14
0
Creating a C-ABI compatible function signature with a struct
Is there some way to create a target-specific C-ABI compatible function signature using LLVM? For example, this C-Code:     typedef struct vpt_data {         char x;         int a;         char c;         float b;     } vpt_data;         void vpt_test( vpt_data vd ) { Generates a function:     define void @vpt_test(i64 %vd.coerce0, i64 %vd.coerce1) #0 { And also packs/unpacks the structure values when calling/being called. If I cre...