Comments (10)
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.
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.
Well, there are two possibilities if I consider bug on asmjit side:
- Incorrect machine code generated by assembler
- 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.
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.
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.
Hi Ivan,
please check out master and let me know the commit above fixed the issue.
from asmjit.
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.
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.
Hmm, I don't see explicit problems anymore...
from asmjit.
Let me know if you face any problem again.
from asmjit.
Related Issues (20)
- Deployed docs do not match source code HOT 2
- Inline comment is dropped when instruction has a label binding HOT 4
- Whether the contents of the compiler or function node can be cached in the local file HOT 6
- vmxoff instruction HOT 3
- NetBSD: erlang using asmjit fails with `Internal error: jit: Cannot allocate executable memory. Use the interpreter instead.` HOT 58
- Shaping new JIT allocator API HOT 11
- CI Service for RISC-V port HOT 2
- How to call a external function with x86::Compiler?
- How can I convert a byte array to assembly code? HOT 3
- parse "faddp st1, st0" and "fsubp st1, st0" instruction failed HOT 1
- Unexpected error when load label address to register in AArch64 HOT 3
- InvalidDisplacement error when use loop instruction HOT 3
- Calling void function on a64 (android) not working HOT 2
- LAHF issue with x86_64 compiler HOT 2
- Return "Segmentation fault" when use std instruction HOT 4
- Jmp to label size HOT 3
- How to load the address of a label to a register? HOT 1
- "memfd_create() called without MFD_EXEC or MFD_NOEXEC_SEAL set" HOT 9
- No matter what I do. I am not able to get it working in my C++ CLI project. HOT 3
- Build Problem: Android Ndk build failed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asmjit.