tiflolinux.org - GNU Social
  • Login

Bienvenido

  • Public

    • Public
    • Network
    • Groups
    • Popular
    • People

Conversation

Notices

  1. s-ol (s_ol@merveilles.town)'s status on Sunday, 23-May-2021 23:55:35 CEST s-ol s-ol
    • Kartik Agaram

    Got back into my SubV (#riscv assembler / machine-code language modelled after @akkartik's SubX) codebase this weekend.

    I figured out pretty quickly that what seemed like a terrible problem and caused me to essentially drop it a year ago is actually... not a problem? So that's good news :)

    Had to stop for now, but long jumps (absolute/relative with lui/auipc+jalr) can be expressed now.

    In conversation Sunday, 23-May-2021 23:55:35 CEST from merveilles.town permalink
    • Kartik Agaram (akkartik@merveilles.town)'s status on Sunday, 23-May-2021 23:55:35 CEST Kartik Agaram Kartik Agaram
      in reply to

      @s_ol What was the problem?!

      Also, just in case you haven't looked at Mu code recently, here's what it looks like now: http://akkartik.github.io/mu/html/ex2.mu.html

      In conversation Sunday, 23-May-2021 23:55:35 CEST permalink

      Attachments

      1. No result found on File_thumbnail lookup.
        Mu - ex2.mu
    • s-ol (s_ol@merveilles.town)'s status on Sunday, 23-May-2021 23:55:35 CEST s-ol s-ol
      in reply to
      • Kartik Agaram

      @akkartikI still didn't arrive at Mu, but I'll try to catch up ;)

      I was under the impression that the two-instruction relative long-jump aiupc+jalr could only work if SubV would recognize the two-instruction construct and generate the correct offsets in a "smart" way.

      I think what I got wrong was that the PC is added in the "auipc" instruction, not when jalr is executed.

      In conversation Sunday, 23-May-2021 23:55:35 CEST permalink
    • s-ol (s_ol@merveilles.town)'s status on Sunday, 23-May-2021 23:55:35 CEST s-ol s-ol
      in reply to
      • Kartik Agaram

      @akkartik

      Now that I took another look I figure out that it can be expressed very cleanly without grouping opcoded and without any opcode-specific logic in "survey" by allowing offsets in label-references:

      # 32-bit relative jump# load upper 20 bits and add to PCauipc 5/rd/t0 label[31:12]/off32# jump, adding lower 12 bits jalr 0/rd/x0 5/rb/t0 label+4[11:0]/off32

      the +4 is to account for the fact that PC was "captured" in the auipc instruction

      In conversation Sunday, 23-May-2021 23:55:35 CEST permalink
    • s-ol (s_ol@merveilles.town)'s status on Sunday, 23-May-2021 23:55:35 CEST s-ol s-ol
      in reply to
      • Kartik Agaram

      @akkartik(typing this blind on my phone, so surely got some details wrong and the opcode instruction bits are missing. Also jalr's immediate argument is actually the [11:1] slice plus a sign bit)

      I want to make it so you can optionally specify the exact slices as above, or just write label/off32 and it will get the slices right automatically (including sign extension)

      In conversation Sunday, 23-May-2021 23:55:35 CEST permalink
    • Kartik Agaram (akkartik@merveilles.town)'s status on Sunday, 23-May-2021 23:55:35 CEST Kartik Agaram Kartik Agaram
      in reply to

      @s_ol Yeah that aiupc construct is a bit strange: https://stackoverflow.com/questions/55314747/risc-v-user-level-reference-or-reference-implementation

      Even outside of our weird notations 🙂 I'm struggling to understand how a compiler would use it. Are they expecting that functions are aligned at 4KB boundaries or something?

      Oh, this is only for far jumps. So that alignment constraint might actually be a reasonable choice.

      In conversation Sunday, 23-May-2021 23:55:35 CEST permalink
    • s-ol (s_ol@merveilles.town)'s status on Sunday, 23-May-2021 23:55:35 CEST s-ol s-ol
      in reply to
      • Kartik Agaram

      @akkartik btw it's very interesting to see you and the person who answered in the SO question to also misspell auipc as aiupc, which I have been struggling with a lot also!

      I wonder what it is about those three vowels that makes it hard to remember the right way? To my german brain, "aui" should actually be more familiar ("au" is a bigram with a specific sound, and aui is pronouncable) whereas aiu is just letter soup.

      In conversation Sunday, 23-May-2021 23:55:35 CEST permalink
    • Kartik Agaram (akkartik@merveilles.town)'s status on Sunday, 23-May-2021 23:55:35 CEST Kartik Agaram Kartik Agaram
      in reply to

      @s_ol Oh interesting! I see in my browser history that I actually searched for 'aiupc', which is probably why I got that page.

      Thanks for pointing it out. I get annoyed when people spell Gandhi as Ghandi 🙂

      In conversation Sunday, 23-May-2021 23:55:35 CEST permalink
    • s-ol (s_ol@merveilles.town)'s status on Monday, 24-May-2021 10:15:45 CEST s-ol s-ol
      • Ekaitz Zárraga 👹
      • Kartik Agaram

      @ekaitz_zarraga @akkartikyeah, that's what I've been doing for auipc now ;)

      In conversation Monday, 24-May-2021 10:15:45 CEST permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

tiflolinux.org - GNU Social is a social network, courtesy of tiflolinux.org. It runs on GNU social, version 2.0.1-beta0, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All tiflolinux.org - GNU Social content and data are available under the Creative Commons Attribution 3.0 license.