Displaying 12 results from an estimated 12 matches for "ll_struct_arg".
2018 Apr 18
4
A struct {i8,i64} has size == 12, clang says size 16
...lang, for the same type are producing a size of 16,
with an alignment of 8, for the second element.
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 `of...
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 a...
2018 Apr 18
0
A struct {i8, i64} has size == 12, clang says size 16
...e producing a size of 16,
> with an alignment of 8, for the second element.
> 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 = of...
2018 Apr 18
2
Why does clang do a memcpy? Is the cast not enough? (ABI function args)
...ether I need to do the same thing.
On 18/04/18 19:13, Dimitry Andric wrote:
> 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;
>>...
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...
2018 Apr 18
2
Why does clang do a memcpy? Is the cast not enough? (ABI function args)
...18 19:13, Dimitry Andric wrote:
>>> 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 ) {
>>>> }
>...
2018 Apr 18
0
Why does clang do a memcpy? Is the cast not enough? (ABI function args)
...g.
>
>
> On 18/04/18 19:13, Dimitry Andric wrote:
>> 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 m...
2018 Apr 18
2
A struct {i8, i64} has size == 12, clang says size 16
...f 16,
>> with an alignment of 8, for the second element.
>> 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 = size...
2018 Apr 18
3
Why does clang do a memcpy? Is the cast not enough? (ABI function args)
...gt;>> 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;
>>>>>>
>>>>>> ...
2018 Apr 18
0
Why does clang do a memcpy? Is the cast not enough? (ABI function args)
...ric wrote:
>>>> 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 v...
2018 Apr 19
0
A struct {i8, i64} has size == 12, clang says size 16
...ignment of 8, for the second element.
> >> 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_...
2018 Apr 19
0
Why does clang do a memcpy? Is the cast not enough? (ABI function args)
...r 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;
> >>>>>>...