Coder Social home page Coder Social logo

better loop support about llvm-mctoll HOT 8 OPEN

microsoft avatar microsoft commented on May 11, 2024
better loop support

from llvm-mctoll.

Comments (8)

bharadwajy avatar bharadwajy commented on May 11, 2024

Thank you very much!

Would really appreciate if you could create PR once you are happy with your changes. Please add C test sources to test/smoke_test to verify the changes proposed. I'll be happy to pull the changes up to master.

from llvm-mctoll.

Trass3r avatar Trass3r commented on May 11, 2024

Btw what is the reason for that huge map? MCInst doesn't contain the width information?

from llvm-mctoll.

bharadwajy avatar bharadwajy commented on May 11, 2024

Btw what is the reason for that huge map? MCInst doesn't contain the width information?

Not at the time when I started the work. I did not see anything that indicates things have changed in that respect.

from llvm-mctoll.

Trass3r avatar Trass3r commented on May 11, 2024

Hmm odd how do they represent something like mov DWORD PTR [rbp-0x4], edi then?

from llvm-mctoll.

Trass3r avatar Trass3r commented on May 11, 2024

INC on memory is tricky though: inc DWORD PTR [rsp+rax*4-0x38]
Fails in

assert((SrcOp.isImm() || SrcOp.isReg()) &&
.
Operand 6 is "Metadata", 7 is register.
If I add

  if (MI.getOperand(SrcOpIndex).isMetadata())
    ++SrcOpIndex;

I get "Super register not found"
Any ideas?

from llvm-mctoll.

bharadwajy avatar bharadwajy commented on May 11, 2024

bool X86MachineInstructionRaiser::raiseMoveToMemInstr() is implemented to raise an instruction that moves to memory the content of an explicit source register or immediate value. So, that function is not designed to raise INCXXm instructions.

Support for INCXXm instructions is not yet implemented. That said, take a look at bool X86MachineInstructionRaiser::raiseNotOpMemInstr(). Basically that function generates an instruction to load from memory location, an operation (specifically, not) instruction and an instruction to store to the memory location. This may be an opportunity to expand the class NOT_OP_MEM (to say INPLACE_MEM_OP) to raise instructions that load, operate and store.

from llvm-mctoll.

bharadwajy avatar bharadwajy commented on May 11, 2024

Btw what is the reason for that huge map? MCInst doesn't contain the width information?

Not at the time when I started the work. I did not see anything that indicates things have changed in that respect.

However, eventually, I really want to get rid of the burden of maintaining this table and replace its services using LLVM APIs or some other tblgen based utility.

from llvm-mctoll.

Trass3r avatar Trass3r commented on May 11, 2024

This may be an opportunity to expand the class NOT_OP_MEM (to say INPLACE_MEM_OP) to raise instructions that load, operate and store.

Thanks that helped! Trass3r@f100b2e

I really want to get rid of the burden of maintaining this table and replace its services using LLVM APIs or some other tblgen based utility.

I experimented a bit with that (see my repo) but I think it would require some refactoring of the raise functions into something more generic working on general a = b op c instructions with common and transparent handling of reg/mem/imm operands.

from llvm-mctoll.

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.