GithubHelp home page GithubHelp logo

Comments (7)

JustasMasiulis avatar JustasMasiulis commented on May 23, 2024

Looking into this.

I think I had similar issue earlier and may have fixed it in some other project of mine already.

from inline_syscall.

lIIIIIIIIl avatar lIIIIIIIIl commented on May 23, 2024

Changing it into "re" or "rZ" or "reZ" works for me so far.

https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html

asdf

from inline_syscall.

JustasMasiulis avatar JustasMasiulis commented on May 23, 2024

So I looked into this and it seems to compile just fine on godbolt with clang and gcc, but it does seem to be broken on clang-cl on my machine. I'd say this is probably a compiler bug.

Furthermore the e and Z constraints don't really make sense since your value is not something that fits into 32 bits and is being sign extended, however it still generates correct assembly so 🤷

I tested just replacing "rn" with "reZ" on my private projects (with clang-cl that is broken in this case) and it seemed to not change codegen in any way on a release build.

Will probably make the change, although I'm a bit afraid I might break it on actual clang/gcc.

from inline_syscall.

lIIIIIIIIl avatar lIIIIIIIIl commented on May 23, 2024

Sorry I don't really understand how constraints works. I was typing random letters into the constraints string. "re" and "rZ" and "reZ" are the only ones I found that works so far for this instruction movq %[x], 48(%%rsp)
https://godbolt.org/z/6jbrWW

Do you happen to know any good tutorial on how to write gcc extended asm, or assembly in general?

from inline_syscall.

JustasMasiulis avatar JustasMasiulis commented on May 23, 2024

Should be fixed.

Concerning the learning part I learned assembly mostly trough experience reading about instructions when debugging with tools like x64dbg and for extended asm the GCC docs for it are pretty good

from inline_syscall.

lIIIIIIIIl avatar lIIIIIIIIl commented on May 23, 2024

I think it needs to be "re", not "reZ". https://godbolt.org/z/6cfYnc

from inline_syscall.

JustasMasiulis avatar JustasMasiulis commented on May 23, 2024

Changed it

from inline_syscall.

Related Issues (5)

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.