void test_fcmp(double a, double b)

{

    long eflags, fpus;



    fpu_clear_exceptions();

    asm("fcom %2\n"

        "fstsw %%ax\n"

        : "=a" (fpus)

        : "t" (a), "u" (b));

    printf("fcom(%f %f)=%04lx \n",

           a, b, fpus & (0x4500 | FPUS_EMASK));

    fpu_clear_exceptions();

    asm("fucom %2\n"

        "fstsw %%ax\n"

        : "=a" (fpus)

        : "t" (a), "u" (b));

    printf("fucom(%f %f)=%04lx\n",

           a, b, fpus & (0x4500 | FPUS_EMASK));

    if (TEST_FCOMI) {

        /* test f(u)comi instruction */

        fpu_clear_exceptions();

        asm("fcomi %3, %2\n"

            "fstsw %%ax\n"

            "pushf\n"

            "pop %0\n"

            : "=r" (eflags), "=a" (fpus)

            : "t" (a), "u" (b));

        printf("fcomi(%f %f)=%04lx %02lx\n",

               a, b, fpus & FPUS_EMASK, eflags & (CC_Z | CC_P | CC_C));

        fpu_clear_exceptions();

        asm("fucomi %3, %2\n"

            "fstsw %%ax\n"

            "pushf\n"

            "pop %0\n"

            : "=r" (eflags), "=a" (fpus)

            : "t" (a), "u" (b));

        printf("fucomi(%f %f)=%04lx %02lx\n",

               a, b, fpus & FPUS_EMASK, eflags & (CC_Z | CC_P | CC_C));

    }

    fpu_clear_exceptions();

    asm volatile("fxam\n"

                 "fstsw %%ax\n"

                 : "=a" (fpus)

                 : "t" (a));

    printf("fxam(%f)=%04lx\n", a, fpus & 0x4700);

    fpu_clear_exceptions();

}

void test_fcmp(double a, double b)

{

    long eflags, fpus;



    fpu_clear_exceptions();

    asm("fcom %2\n"

        "fstsw %%ax\n"

        : "=a" (fpus)

        : "t" (a), "u" (b));

    printf("fcom(%f %f)=%04lx \n",

           a, b, fpus & (0x4500 | FPUS_EMASK));

    fpu_clear_exceptions();

    asm("fucom %2\n"

        "fstsw %%ax\n"

        : "=a" (fpus)

        : "t" (a), "u" (b));

    printf("fucom(%f %f)=%04lx\n",

           a, b, fpus & (0x4500 | FPUS_EMASK));

    if (TEST_FCOMI) {

        

        fpu_clear_exceptions();

        asm("fcomi %3, %2\n"

            "fstsw %%ax\n"

            "pushf\n"

            "pop %0\n"

            : "=r" (eflags), "=a" (fpus)

            : "t" (a), "u" (b));

        printf("fcomi(%f %f)=%04lx %02lx\n",

               a, b, fpus & FPUS_EMASK, eflags & (CC_Z | CC_P | CC_C));

        fpu_clear_exceptions();

        asm("fucomi %3, %2\n"

            "fstsw %%ax\n"

            "pushf\n"

            "pop %0\n"

            : "=r" (eflags), "=a" (fpus)

            : "t" (a), "u" (b));

        printf("fucomi(%f %f)=%04lx %02lx\n",

               a, b, fpus & FPUS_EMASK, eflags & (CC_Z | CC_P | CC_C));

    }

    fpu_clear_exceptions();

    asm volatile("fxam\n"

                 "fstsw %%ax\n"

                 : "=a" (fpus)

                 : "t" (a));

    printf("fxam(%f)=%04lx\n", a, fpus & 0x4700);

    fpu_clear_exceptions();

}

void FUNC_0(double VAR_0, double VAR_1)

{

    long VAR_2, VAR_3;



    fpu_clear_exceptions();

    asm("fcom %2\n"

        "fstsw %%ax\n"

        : "=VAR_0" (VAR_3)

        : "t" (VAR_0), "u" (VAR_1));

    printf("fcom(%f %f)=%04lx \n",

           VAR_0, VAR_1, VAR_3 & (0x4500 | FPUS_EMASK));

    fpu_clear_exceptions();

    asm("fucom %2\n"

        "fstsw %%ax\n"

        : "=VAR_0" (VAR_3)

        : "t" (VAR_0), "u" (VAR_1));

    printf("fucom(%f %f)=%04lx\n",

           VAR_0, VAR_1, VAR_3 & (0x4500 | FPUS_EMASK));

    if (TEST_FCOMI) {

        

        fpu_clear_exceptions();

        asm("fcomi %3, %2\n"

            "fstsw %%ax\n"

            "pushf\n"

            "pop %0\n"

            : "=r" (VAR_2), "=VAR_0" (VAR_3)

            : "t" (VAR_0), "u" (VAR_1));

        printf("fcomi(%f %f)=%04lx %02lx\n",

               VAR_0, VAR_1, VAR_3 & FPUS_EMASK, VAR_2 & (CC_Z | CC_P | CC_C));

        fpu_clear_exceptions();

        asm("fucomi %3, %2\n"

            "fstsw %%ax\n"

            "pushf\n"

            "pop %0\n"

            : "=r" (VAR_2), "=VAR_0" (VAR_3)

            : "t" (VAR_0), "u" (VAR_1));

        printf("fucomi(%f %f)=%04lx %02lx\n",

               VAR_0, VAR_1, VAR_3 & FPUS_EMASK, VAR_2 & (CC_Z | CC_P | CC_C));

    }

    fpu_clear_exceptions();

    asm volatile("fxam\n"

                 "fstsw %%ax\n"

                 : "=VAR_0" (VAR_3)

                 : "t" (VAR_0));

    printf("fxam(%f)=%04lx\n", VAR_0, VAR_3 & 0x4700);

    fpu_clear_exceptions();

}

void FUNC_0(double VAR_0, double VAR_1)
{ long VAR_2, VAR_3; fpu_clear_exceptions(); asm("fcom %2\n"
"fstsw %%ax\n"
: "=VAR_0" (VAR_3)
: "t" (VAR_0), "u" (VAR_1)); printf("fcom(%f %f)=%04lx \n",
VAR_0, VAR_1, VAR_3 & (0x4500 | FPUS_EMASK)); fpu_clear_exceptions(); asm("fucom %2\n"
"fstsw %%ax\n"
: "=VAR_0" (VAR_3)
: "t" (VAR_0), "u" (VAR_1)); printf("fucom(%f %f)=%04lx\n",
VAR_0, VAR_1, VAR_3 & (0x4500 | FPUS_EMASK)); if (TEST_FCOMI) { fpu_clear_exceptions(); asm("fcomi %3, %2\n"
"fstsw %%ax\n"
"pushf\n"
"pop %0\n"
: "=r" (VAR_2), "=VAR_0" (VAR_3)
: "t" (VAR_0), "u" (VAR_1)); printf("fcomi(%f %f)=%04lx %02lx\n",
VAR_0, VAR_1, VAR_3 & FPUS_EMASK, VAR_2 & (CC_Z | CC_P | CC_C)); fpu_clear_exceptions(); asm("fucomi %3, %2\n"
"fstsw %%ax\n"
"pushf\n"
"pop %0\n"
: "=r" (VAR_2), "=VAR_0" (VAR_3)
: "t" (VAR_0), "u" (VAR_1)); printf("fucomi(%f %f)=%04lx %02lx\n",
VAR_0, VAR_1, VAR_3 & FPUS_EMASK, VAR_2 & (CC_Z | CC_P | CC_C)); } fpu_clear_exceptions(); asm volatile("fxam\n"
"fstsw %%ax\n"
: "=VAR_0" (VAR_3)
: "t" (VAR_0)); printf("fxam(%f)=%04lx\n", VAR_0, VAR_3 & 0x4700); fpu_clear_exceptions(); }