Random number generators | www.agner.org
Begin New Subject | Flat View | Search | List | List Messageboards | Help |
MotherOfAll AsmLib code as inline function |
---|
Author: Mike Babigian | Date: 2016-03-03 12:09 |
Agner, I was hoping you could enlighten me on one more issue with Mother Of All. I'm trying to use your AsmLib code to build an inline Delphi function. You mentioned Delphi in some of your PDFs so I'm hoping this isn't an issue. I'm not very proficient in assembly and I'm not sure if I'm missing something obvious, or Delphi just doesn't want to properly align my data on the correct boundaries. I get an access violation due to alignment issues and changing movdqa to movdqu only moves the violation further down the function (to movq). Assuming this can be made to work, I'm assuming I'll have to initialize the Seed variable in reverse to have it match the Pascal version below. Is an inline function like the one below possible within Delphi's limitations? {$ALIGN 16} { This directive should make the compiler properly align } TMotherOfAll = class(TRandFuncs) {$IFDEF CPUX64} asm // I extracted this from your asmlib function TMotherOfAll.NextRandom32: UInt32; Var begin Thanks in advance for your input. |
Reply To This Message | Next Message |
MotherOfAll AsmLib code as inline function - Mike Babigian - 2016-03-03 |
MotherOfAll AsmLib code as inline function new - Agner - 2016-03-03 |
Begin New Subject | Flat View | Search | List | List Messageboards | Help |