summaryrefslogtreecommitdiffstats
path: root/waftools/detections/cpu.py
blob: 3a8615f259d9fe2d9101c4ca0e00fdaf15fb7af2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
def x86(ctx):
    ctx.define('ARCH_X86', 1)
    ctx.define('ARCH_X86_32', 1)

def x86_64(ctx):
    ctx.define('ARCH_X86', 1)
    ctx.define('ARCH_X86_64', 1)
    ctx.define('HAVE_FAST_64BIT', 1)

def ia64(ctx):
    ctx.define('HAVE_FAST_64BIT', 1)

def default(ctx):
    pass

def configure(ctx):
    ctx.define('ARCH_X86', 0)
    ctx.define('ARCH_X86_32', 0)
    ctx.define('ARCH_X86_64', 0)
    ctx.define('HAVE_FAST_64BIT', 0)

    ctx.define('HAVE_MMX',   'HAVE_ASM && ARCH_X86', quote=False)
    ctx.define('HAVE_MMX2',  'HAVE_ASM && ARCH_X86', quote=False)
    ctx.define('HAVE_SSE',   'HAVE_ASM && ARCH_X86', quote=False)
    ctx.define('HAVE_SSE2',  'HAVE_ASM && ARCH_X86', quote=False)
    ctx.define('HAVE_SSSE3', 'HAVE_ASM && ARCH_X86', quote=False)

    globals().get(ctx.env.DEST_CPU, default)(ctx)