summaryrefslogtreecommitdiffstats
path: root/image/test/reftest/pngsuite-ancillary/qcms-asm-check.js
blob: 32e4434aa72fc3e6dfb3f4096f418d39688688e0 (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
// This is a workaround for bug 465088, that the qcms assembly doesn't
// quite match the non-assembly output.

function check_qcms_has_assembly()
{
    // We have assembly code on x86 and x86_64 architectures.
    // Unfortunately, detecting that is a little complicated.

    if (navigator.platform == "MacIntel") {
        return true;
    }

    if (navigator.platform.indexOf("Win") == 0 || navigator.platform == "OS/2") {
        // Assume all Windows and OS/2 is x86 or x86_64.  We don't
        // expose any way for Web content to check.
        return true;
    }

    // On most Unix-like platforms, navigator.platform is basically
    // |uname -sm|.
    if (navigator.platform.match(/(i[3456]86|x86_64|amd64|i86)/)) {
        return true;
    }

    return false;
}

var qcms_has_assembly = check_qcms_has_assembly();