Jump to content

julkas

Members
  • Content Count

    28
  • Joined

  • Last visited

Community Reputation

7 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. julkas

    Chess board

    Check also: https://forum.lazarus.freepascal.org/index.php/topic,14956.0.html https://wiki.freepascal.org/fpChess
  2. julkas

    KC Chess

    Yet another old chess program written in TP5.5. https://github.com/JulStrat/kcchess
  3. julkas

    NERO5 chess engine

    It's old chess engine written in Turbo Pascal. It's good for beginners and not only. You can increase / decrease engine default thinking time with + / -. Executable created on Windows 10 with Delphi Community Edition is in the folder Delphi. So just enjoy chess and power of great Turbo Pascal. I think it's clear.
  4. julkas

    NERO5 chess engine

    Nero 5 is a chess program written in Pascal by Jari Huikari.
  5. Another generics collection (with TimSort) - https://github.com/avk959/LGenerics I don't know about Delphi support.
  6. Interesting. BTW I use always Merge Sort and Tim Sort.
  7. julkas

    Multiple two UInt64 modulo

    Thanks all for replies. Please see question - https://www.quora.com/What-are-the-10-biggest-prime-numbers-below-2-64 Here is my last solution - https://ideone.com/oO83MV Can you do it faster using only Miller Rabin test? If - yes,, provide your solution. BTW - My pure Object Pascal implementation is here - https://github.com/JulStrat/primesieve-pas/blob/mult/mult/modar.pas
  8. julkas

    PyPy support

    Any plans for PyPy JIT compiler support? Best regards.
  9. julkas

    Multiple two UInt64 modulo

    OK. Please provide example of a, b, m (m <> 0) where my last solution is wrong.
  10. julkas

    Multiple two UInt64 modulo

    I like portable code. But sometimes I need fast ASM Intel 64-bit Object Pascal implementation.
  11. julkas

    Multiple two UInt64 modulo

    Revised - program mulmod; {$IF Defined(FPC)}{$MODE Delphi}{$ASMMODE Intel}{$ENDIF} function MulModASM(a, b: UInt64; m: UInt64): UInt64; label CHECK_B, MUL_MOD; asm MOV RCX, m MOV RAX, a CMP RAX, RCX JB CHECK_B XOR RDX, RDX DIV RCX MOV RAX, RDX CHECK_B: MOV R8, RAX MOV RAX, b CMP RAX, RCX JB MUL_MOD XOR RDX, RDX DIV RCX MOV RAX, RDX MUL_MOD: XOR RDX, RDX MUL R8 DIV RCX MOV @Result, RDX end; var a, b, m: UInt64; begin m := $FFFFFFFFFFFFFFFF; a := 3; b := m - 1; WriteLn(a, ' ', b, ' ', m); WriteLn(' ASM - ', MulModASM(a, b, m)); WriteLn(' ASM - ', MulModASM(3, 12, 9)); WriteLn(' ASM - ', MulModASM(m, m, 9)); WriteLn('Pascal - ', (a * b) mod m); WriteLn('Pascal - ', (m * m) mod 9); end.
  12. julkas

    Multiple two UInt64 modulo

    ZZZ! My initial solution has bug - we must first reduce a and b modulo m.
  13. julkas

    Multiple two UInt64 modulo

    Hiere is my ASM code for (a * b) mod m, where a, b, m - UInt64. Can it be done better ? Thanks. Online - https://ideone.com/LKNjMM. program mulmod; {$IF Defined(FPC)}{$MODE Delphi}{$ASMMODE Intel}{$ENDIF} function MulModASM(a, b: UInt64; m: UInt64): UInt64; asm MOV RAX, a MOV RCX, m MUL b DIV RCX MOV @Result, RDX end; var a, b, m: UInt64; begin m := $FFFFFFFFFFFFFFFF; a := 3; b := m - 1; WriteLn(a, ' ', b, ' ', m); WriteLn(' ASM - ', MulModASM(a, b, m)); WriteLn('Pascal - ', (a * b) mod m); end.
  14. I have created Rosetta code entry for Object Pascal - http://www.rosettacode.org/wiki/Pseudo-random_numbers/Splitmix64#Object_Pascal
  15. Domain of application - number theory algorithms (Pollard Rho, Brent, ...)
×