Git Product home page Git Product logo

Comments (10)

kobalicek avatar kobalicek commented on May 6, 2024

Hi Ivan,

I checked out your code and it seems that you are using asmjit the right way, before we move on I would like to ask you to check if asmjit is running in debug mode (simply try ASMJIT_ASSERT(0) ), because a possible misuse would be highly probably catched by asmjit itself. If you are not running asmjit in debug mode try defining ASMJIT_DEBUG and see what happens.

Btw what do you mean if you remove "wrapper"? Maybe trying removing wrappers one-by-one and checking if things still work is a good idea, or do you have any integration code to test if the generated code is correct?

from asmjit.

Nekotekina avatar Nekotekina commented on May 6, 2024

Seems debug mode is enabled with debug mode of whole solution enabled.
There is valid high-level code that I try to call from inside of interpreter. My wrapper takes this code and generates call from inside of JIT. I often switch between wrapped code and asm. Unfortunately, I don't use anything more advanced.

from asmjit.

kobalicek avatar kobalicek commented on May 6, 2024

Well, there are two possibilities if I consider bug on asmjit side:

  1. Incorrect machine code generated by assembler
  2. Incorrect code generated by compiler

Checking assembler output is easy, just use a disassembler on the generated output and compare with the asmjit logger - perfect place is the place where it crashes, I fixed incorrect lea instruction generation recently by using this technique.

Checking compiler output is a bit tricky, I would recommend to use logger and log everything it emits, with liveness analysis it will be probably a huge output, but I think it's worth it.

Pasting output from logger for working version and non-working version can help as well

from asmjit.

Nekotekina avatar Nekotekina commented on May 6, 2024

Finally I found an error...

http://pastebin.com/zxWsk9JZ the whole function generated.

Second PSHUFB is wrong:

movdqa xmm2, oword ptr [rbp+576] ; 660F6F9540020000 | movdqa reg_3, [cpu+576]
pshufb xmm6, xmm0 ; 660F3800F0 | pshufb reg_3, reg_2

It's reg_3 that should be xmm2 but it's xmm6

from asmjit.

kobalicek avatar kobalicek commented on May 6, 2024

Hi Ivan,

I just checked it out and I think that I know where is the problem, it seems that pshufb instruction is incorrectly flagged in x86defs, give me around 1 hour and I will try to fix it if this is the issue.

Thanks for the report

from asmjit.

kobalicek avatar kobalicek commented on May 6, 2024

Hi Ivan,

please check out master and let me know the commit above fixed the issue.

from asmjit.

Nekotekina avatar Nekotekina commented on May 6, 2024

Thanks, seems pshufb works right now, but I was experiencing weird behaviour even without using pshufb at all. Maybe other similar issues could exist?

from asmjit.

kobalicek avatar kobalicek commented on May 6, 2024

Well, to be honest I think that you are hitting a bug in Compiler, but to track it down I would need more information and some output. Comparing asmjit output with disasm may also help to track invalid opcode generated, hard to say, I think important is if it's a register allocation issue or machine code generation issue.

from asmjit.

Nekotekina avatar Nekotekina commented on May 6, 2024

Hmm, I don't see explicit problems anymore...

from asmjit.

kobalicek avatar kobalicek commented on May 6, 2024

Let me know if you face any problem again.

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.