Giter VIP home page Giter VIP logo

Comments (5)

ChristianMoesl avatar ChristianMoesl commented on May 8, 2024

Should we forbid this specific case?

from selfie.

alexkollert avatar alexkollert commented on May 8, 2024

In the branch elf I had to handle theses cases like you suggest, so that selfie can be executed on the qemu emulator. Negative Operands are first converted to positive before Division and converted back to negative after division. But this seemed to cause issues with clang vs. gcc. Still investigating that issue

from selfie.

ckirsch avatar ckirsch commented on May 8, 2024

@ChristianMoesl I am not sure why this happens. We do use / for implementing the DIVU instruction and thus for implementing / in turn, right?

from selfie.

ChristianMoesl avatar ChristianMoesl commented on May 8, 2024

@ckirsch A integer literal in C -1 or 1 has a signed integer type. Therefore signed division is used when calculating with literals, before they were casted to a uint64_t type (because of the assignment).
In Selfie every integer literal gets immediately "converted" into a a uint64_t type and afterwards calculated.

from selfie.

ckirsch avatar ckirsch commented on May 8, 2024

Interesting! Please create a filesemantics.md on root level for gathering all cases of C* semantics that are different from C semantics. This one should be the first but there is probably more.

from selfie.

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.