[dpdk-dev] [PATCH v3 1/1] eal: add 128-bit compare exchange (x86-64 only)

Eads, Gage gage.eads at intel.com
Thu Mar 28 17:22:44 CET 2019


> 04/03/2019 21:51, Gage Eads:
> > --- a/lib/librte_eal/common/include/generic/rte_atomic.h
> > +++ b/lib/librte_eal/common/include/generic/rte_atomic.h
> > +#if defined(RTE_ARCH_X86_64)
> > +/**
> > + * 128-bit integer structure.
> > + */
> > +RTE_STD_C11
> > +typedef struct {
> > +       RTE_STD_C11
> > +       union {
> > +               uint64_t val[2];
> > +               __int128 int128;
> > +       };
> > +} __rte_aligned(16) rte_int128_t;
> 
> Why adding an arch-specific definition in a generic file?
> Can we move it to the x86_64 file?
> 

We can. I put it in the generic header in anticipation of other ISA implementations coming later, and since the atomic operations are documented in the generic header (although that ifdef appears to prevent it from being included in doxygen output).

I'll move it to x86/rte_atomic_64.h if that's preferred, and we can consider moving it back to generic as other implementations are added.

Thanks,
Gage


More information about the dev mailing list