Giter Site home page Giter Site logo

Comments (4)

kobalicek avatar kobalicek commented on May 29, 2024

Here are my comments:

  1. JitRuntime already provides a properly setup environment, never do rt._environment.xxx
  2. Use error handling and make sure there are no errors.
  3. Use logging, creating issues without any kind of log means I cannot really help
  4. I think it's undefined behavior to alter the direction flag in a function and to not change it back

So, I'm not sure whether you have encountered error while executing cc.std() or whether you got error after executing the JIT compiled code, please clarify.

from asmjit.

nick31072002 avatar nick31072002 commented on May 29, 2024

Hi,

I think my error is after executing the JIT compiled code in LINUX OS, but the same code in WIN10 OS is fine.

Here are my description:

  1. JitRuntime already provides a properly setup environment, never do rt._environment.xxx
    -> I want to use X64 instruction, but have no idea how to do it.
    After do "rt._environment.setArch(Arch::kX64);", it's working.
  2. Use error handling and make sure there are no errors.
    The error handling didn't show error at this scenario.
  3. Use logging, creating issues without any kind of log means I cannot really help
    Log in logger file
  L1:
  nop
  nop
  nop
  std
  nop
  nop
  nop
  L0:
  ret
  1. I think it's undefined behavior to alter the direction flag in a function and to not change it back
    Is it means can't use JIT to change CF(direction flag) ?
    I want to test string instrction, so i have to change CF.

from asmjit.

kobalicek avatar kobalicek commented on May 29, 2024

The requirement is that: "The direction flag DF in the %rFLAGS register must be clear (set to "forward" direction) on function entry and return" - this is specified in ABI.

If you change DF to 1 and exit from function, you have entered the world of undefined behavior and as you see, it will crash when the first instruction that relies on DF==0 is executed.

from asmjit.

nick31072002 avatar nick31072002 commented on May 29, 2024

Thank you for the information about DF, it's helpful for me.

from asmjit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.