|
From: Дмитрий Д. <di...@gm...> - 2013-02-03 12:48:18
|
Fedora 17/x64
gcc-4.7.2 -O2 -S tst.c
typedef struct {
unsigned regno : 27;
unsigned class : 4;
unsigned virtual : 1;
} HReg;
static inline int cmp_Hreg(const HReg* lhs, const HReg* rhs)
{
const int a = *(int*)lhs;
const int b = *(int*)rhs;
return a == b;
}
int foo(const HReg* lhs, const HReg* rhs)
{
return cmp_Hreg(lhs, rhs);
}
.globl foo
.type foo, @function
foo:
.LFB1:
.cfi_startproc
movl (%rsi), %eax
cmpl %eax, (%rdi)
sete %al
movzbl %al, %eax
ret
Tnanks,
Dmitry
2013/2/3 Eric Pouech <eri...@or...>:
> Le 01/02/2013 21:26, Florian Krohm a écrit :
>> On 01/31/2013 11:50 AM, Florian Krohm wrote:
>>> Hmm, maybe we should bite the bullet and make HReg a struct after all.
>>> Let me see how generated code looks like....
>>>
>> I looked at two implementation choices:
>>
>> 1) make HReg a proper struct
>>
>> typedef struct {
>> UInt regno : 24;
>> HRegClass class : 4;
>> Bool virtual : 1;
>> } HReg;
> and what does sameHReg: toBool(*(UInt*)&r1 == *(UInt*)&r2)) provides ?
> (assuming sizeof(HReg)==sizeof(UInt))
> A+
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_jan
> _______________________________________________
> Valgrind-developers mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-developers
|