Code Monkey home page Code Monkey logo

Comments (4)

aswaterman avatar aswaterman commented on July 20, 2024

I'm confused, the example still looks correct to me (and gcc agrees).

from riscv-elf-psabi-doc.

aswaterman avatar aswaterman commented on July 20, 2024

That is, in the second case (in RV64), f is passed in a0[31:0], g is passed in a0[63:32], and h is passed in a1[31:0]. In the first case, g[0].f[0] is passed in a0[31:0], g[1].f[0] is passed in a0[63:32], and h is passed in a1[31:0].

from riscv-elf-psabi-doc.

asb avatar asb commented on July 20, 2024

Sorry, the confusion is mine. For some reason it wasn't clear to me that the array of structs was your intent, which it obviously is. That said, perhaps an example that degrades to the integer calling convention isn't the best? Surely what you're trying to show is that the FP calling convention rules regarding a struct containing 2 fp elements, or 1fp+1int apply regardless of any nesting. Perhaps struct { struct { float f[1]; } g[2];} is a better example of this, which would result in two FPRs if the struct is properly flattened, but you might imagine could be passed according to the integer calling convention in a buggy implementation.

If you prefer it how it is, no big deal. I just read that example and then re-read the FP calling convention several times to try to see if I missed a way it would be handled differently with the hard FP.

from riscv-elf-psabi-doc.

aswaterman avatar aswaterman commented on July 20, 2024

Good point, I forgot the context. It would make quite a bit more sense if the example used in the hardware FP calling convention was actually passed in FP registers.

Can you make a PR changing the examples to use 2 fp or 1 fp + 1 int, whichever you think gets the point across more clearly?

from riscv-elf-psabi-doc.

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.