128 {
return ! ( lhs == rhs ); }
152 #define DEF_BUILTIN(A) \
153 namespace { static inline const IdString & a_##A () { static IdString _str(#A); return _str; } } \
154 const Arch Arch_##A( a_##A() )
247 typedef std::unordered_set<CompatEntry> Set;
248 typedef Set::iterator iterator;
249 typedef Set::const_iterator const_iterator;
252 static ArchCompatSet & instance()
254 static ArchCompatSet _instance;
261 const Arch::CompatEntry & assertDef(
const std::string & archStr_r )
262 {
return *
_compatSet.insert( Arch::CompatEntry( archStr_r ) ).first; }
264 const Arch::CompatEntry & assertDef( IdString archStr_r )
265 {
return *
_compatSet.insert( Arch::CompatEntry( archStr_r ) ).first; }
267 const_iterator begin()
const
270 const_iterator end()
const
275 int operator()(
const CompatEntry & lhs,
const CompatEntry & rhs )
const
276 {
return lhs._idBit.value() < rhs._idBit.value(); }
279 std::ostream &
dumpOn( std::ostream &
str )
const
281 str <<
"ArchCompatSet:";
283 ov.sort( DumpOnCompare() );
284 for_( it, ov.begin(), ov.end() )
286 str << endl <<
' ' << *it;
298 _compatSet.insert( Arch::CompatEntry( a_noarch(), 0 ) );
305 defCompatibleWith( a_i386(), a_noarch() );
306 defCompatibleWith( a_i486(), a_noarch(),a_i386() );
307 defCompatibleWith( a_i586(), a_noarch(),a_i386(),a_i486() );
308 defCompatibleWith( a_i686(), a_noarch(),a_i386(),a_i486(),a_i586() );
309 defCompatibleWith( a_athlon(), a_noarch(),a_i386(),a_i486(),a_i586(),a_i686() );
310 defCompatibleWith( a_x86_64(), a_noarch(),a_i386(),a_i486(),a_i586(),a_i686(),a_athlon() );
312 defCompatibleWith( a_pentium3(), a_noarch(),a_i386(),a_i486(),a_i586(),a_i686() );
313 defCompatibleWith( a_pentium4(), a_noarch(),a_i386(),a_i486(),a_i586(),a_i686(),a_pentium3() );
315 defCompatibleWith( a_ia64(), a_noarch(),a_i386(),a_i486(),a_i586(),a_i686() );
317 defCompatibleWith( a_s390(), a_noarch() );
318 defCompatibleWith( a_s390x(), a_noarch(),a_s390() );
320 defCompatibleWith( a_ppc(), a_noarch() );
321 defCompatibleWith( a_ppc64(), a_noarch(),a_ppc() );
322 defCompatibleWith( a_ppc64p7(), a_noarch(),a_ppc(),a_ppc64() );
324 defCompatibleWith( a_ppc64le(), a_noarch() );
326 defCompatibleWith( a_alpha(), a_noarch() );
327 defCompatibleWith( a_alphaev5(), a_noarch(),a_alpha() );
328 defCompatibleWith( a_alphaev56(), a_noarch(),a_alpha(),a_alphaev5() );
329 defCompatibleWith( a_alphapca56(), a_noarch(),a_alpha(),a_alphaev5(),a_alphaev56() );
330 defCompatibleWith( a_alphaev6(), a_noarch(),a_alpha(),a_alphaev5(),a_alphaev56(),a_alphapca56() );
331 defCompatibleWith( a_alphaev67(), a_noarch(),a_alpha(),a_alphaev5(),a_alphaev56(),a_alphapca56(),a_alphaev6() );
333 defCompatibleWith( a_sparc(), a_noarch() );
334 defCompatibleWith( a_sparcv8(), a_noarch(),a_sparc() );
335 defCompatibleWith( a_sparcv9(), a_noarch(),a_sparc(),a_sparcv8() );
336 defCompatibleWith( a_sparcv9v(), a_noarch(),a_sparc(),a_sparcv8(),a_sparcv9() );
338 defCompatibleWith( a_sparc64(), a_noarch(),a_sparc(),a_sparcv8(),a_sparcv9() );
339 defCompatibleWith( a_sparc64v(), a_noarch(),a_sparc(),a_sparcv8(),a_sparcv9(),a_sparcv9v(),a_sparc64() );
341 defCompatibleWith( a_armv3l(), a_noarch() );
342 defCompatibleWith( a_armv4l(), a_noarch(),a_armv3l() );
343 defCompatibleWith( a_armv4tl(), a_noarch(),a_armv3l(),a_armv4l() );
344 defCompatibleWith( a_armv5l(), a_noarch(),a_armv3l(),a_armv4l(),a_armv4tl() );
345 defCompatibleWith( a_armv5tl(), a_noarch(),a_armv3l(),a_armv4l(),a_armv4tl(),a_armv5l() );
346 defCompatibleWith( a_armv5tel(), a_noarch(),a_armv3l(),a_armv4l(),a_armv4tl(),a_armv5l(),a_armv5tl() );
347 defCompatibleWith( a_armv5tejl(), a_noarch(),a_armv3l(),a_armv4l(),a_armv4tl(),a_armv5l(),a_armv5tl(),a_armv5tel() );
348 defCompatibleWith( a_armv6l(), a_noarch(),a_armv3l(),a_armv4l(),a_armv4tl(),a_armv5l(),a_armv5tl(),a_armv5tel(),a_armv5tejl() );
349 defCompatibleWith( a_armv7l(), a_noarch(),a_armv3l(),a_armv4l(),a_armv4tl(),a_armv5l(),a_armv5tl(),a_armv5tel(),a_armv5tejl(),a_armv6l() );
351 defCompatibleWith( a_armv6hl(), a_noarch() );
352 defCompatibleWith( a_armv7hl(), a_noarch(),a_armv6hl() );
353 defCompatibleWith( a_armv7hnl(), a_noarch(),a_armv7hl(),a_armv6hl() );
355 defCompatibleWith( a_armv7nhl(), a_noarch(),a_armv7hnl(),a_armv7hl(),a_armv6hl() );
357 defCompatibleWith( a_armv7thl(), a_noarch(),a_armv7hl() );
358 defCompatibleWith( a_armv7tnhl(), a_noarch(),a_armv7hl(),a_armv7nhl(),a_armv7thl() );
360 defCompatibleWith( a_aarch64(), a_noarch() );
362 defCompatibleWith( a_riscv64(), a_noarch() );
364 defCompatibleWith( a_sh3(), a_noarch() );
366 defCompatibleWith( a_sh4(), a_noarch() );
367 defCompatibleWith( a_sh4a(), a_noarch(),a_sh4() );
369 defCompatibleWith( a_m68k(), a_noarch() );
371 defCompatibleWith( a_mips(), a_noarch() );
372 defCompatibleWith( a_mipsel(), a_noarch() );
373 defCompatibleWith( a_mips64(), a_noarch() );
374 defCompatibleWith( a_mips64el(), a_noarch() );
392 ZYPP_THROW( Exception(
"Need more bits to encode architectures.") );
401 const CompatEntry & assertCompatSetEntry( IdString archStr_r )
402 {
return *
_compatSet.insert( Arch::CompatEntry( archStr_r, nextIdBit() ) ).first; }
406 void defCompatibleWith( IdString targetArch_r,
408 IdString arch1_r = IdString(),
409 IdString arch2_r = IdString(),
410 IdString arch3_r = IdString(),
411 IdString arch4_r = IdString(),
412 IdString arch5_r = IdString(),
413 IdString arch6_r = IdString(),
414 IdString arch7_r = IdString(),
415 IdString arch8_r = IdString(),
416 IdString arch9_r = IdString() )
418 const CompatEntry & target( assertCompatSetEntry( targetArch_r ) );
419 target.addCompatBit( assertCompatSetEntry( arch0_r )._idBit );
420 #define SETARG(N) if ( arch##N##_r.empty() ) return; target.addCompatBit( assertCompatSetEntry( arch##N##_r )._idBit )
449 : _entry( &ArchCompatSet::instance().assertDef( a_noarch() ) )
453 : _entry( &ArchCompatSet::instance().assertDef(
IdString(id_r) ) )
457 : _entry( &ArchCompatSet::instance().assertDef( idstr_r ) )
461 : _entry( &ArchCompatSet::instance().assertDef( str_r ) )
465 : _entry( &ArchCompatSet::instance().assertDef( cstr_r ) )
534 if ( cset.size() > 2 )
536 return *(++cset.rbegin());
558 for ( ArchCompatSet::const_iterator it = ArchCompatSet::instance().begin();
559 it != ArchCompatSet::instance().end(); ++it )
561 if ( it->compatibleWith( *targetArch_r.
_entry ) )
563 ret.insert(
Arch(*it) );