Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-4723

PATCH : allmul fixed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: ReactOS
      Platform: x86 Hardware

      Description

      allmul fixed

      allmul produced wrong results when the higher 32 bits of any of the 64 bit operands are not zero.
      As the comment correctly said the definition of param locations must change since esp was altered, but the definitions were not actually changed

      Patch follows

      file allmul_asm.s line 94:
      // must redefine A and B since esp has been altered

      -#define A2LO [esp + 4] // stack address of a
      +#define A2LO [esp + 8] // stack address of a
      -#define A2HI [esp + 8] // stack address of a
      +#define A2HI [esp + 12] // stack address of a
      -#define B2LO [esp + 12] // stack address of b
      +#define B2LO [esp + 16] // stack address of b
      -#define B2HI [esp + 16] // stack address of b
      +#define B2HI [esp + 20] // stack address of b

      test:
      i64 t1 = 12908046380;
      i64 t2 = 10000000;
      i64 t3;

      t3 = t1 * t2;
      DPRINT("t1=%016I64x=%I64d\n", t1, t1);
      DPRINT("t2=%016I64x=%I64d\n", t2, t2);
      DPRINT("t3=%016I64x=%I64d\n", t3, t3);
      return 0;

      t1=000000030161282c=12908046380
      t2=0000000000989680=10000000
      t3=01ca95ff783dde00=129080463800000000
      (before the patch t3 value was wrong)

        Attachments

          Activity

            People

            • Assignee:
              bug zilla Bug Zilla
              Reporter:
              jcatena jcatena
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: