--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+unsubscribe@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/64Gn11pyCTCo9nARXanQovr2p8xOs08KAodpwjIliUp%40local.
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+unsubscribe@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/D7578234-C99D-4F40-BA95-8C4C39DA7BC1%40mac.com.
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+unsubscribe@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/6dcxNumjr2IRvxFnjUXPfih9WSjIg4jfloyRmCfVzsA%40local.
On Thursday, 1 March 2018 12:28:19 PST Michael Clark wrote:
> There would need to be a new RV32X ABI that is somewhat like x32 on x86_64.
> A 32-bit ABI on RV64 may be practical but RV32 is likely not going to
> change as the Base ISA is frozen. As you mentioned, the compressed
> extension is different.
This is notably different from x32, in that the new ABI will run on 32-bit
processors, while x32 runs only in long mode. If anything, this is bringing
RISC-V closer to SPARC's approach (of making 32-bit programs execute
unmodified under 64-bit mode). In addition, this does not change the calling
convention _at all_ compared to RV32. x32 does.
It stops short of that (due to the C extension), but IMO it's a very
interesting design point.
Not being able to execute RV32 code natively in RV64 (and RV128 for that matter) is a big drawback.
I’ve voiced my concerns about this from the beginning. I am mostly concerned about legacy software that will emerge.
Richard
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+u...@groups.riscv.org.
To post to this group, send email to
isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/CAMU%2BEkwH1aPq5Wh0JnvgLYQXOsZ8wLXsunyKDLqbZSGeswkQEA%40mail.gmail.com.
On Mar 5, 2018, at 01:04 , Richard Herveille <richard....@roalogic.com> wrote:
Not being able to execute RV32 code natively in RV64 (and RV128 for that matter) is a big drawback.I’ve voiced my concerns about this from the beginning. I am mostly concerned about legacy software that will emerge.Richard
<image001.png>
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/B9989910-9746-4CEF-A40D-B733BFA09C81%40roalogic.com.
<image001.png>
Besides that there are other systems than Linux …
The RISC-V ISA has the potential of natively running RV32I (probably RV32IMA) on an RV64 or RV128 CPU.
However due to some minor choices this is not possible. For example the ADD instruction ix XLEN sized. So ADD on an RV32 CPU behaves differently than on an RV64 CPU. However RV32-ADD and RV64-ADDW behave the same.
So why not fix the opcode such that RV32 always uses ADDW instead of ADD? If that’s done consequently (ie for other conflicting opcodes), then RV32 code runs on an RV64 CPU (and RV128 CPU for that matter).
Richard
Implementing the UXL field adds complexity, which is bad for embedded CPUs.
Besides, there are systems without HSU mode that might benefit from running RV32 code natively.
Not being able to execute RV32I(MA) natively is a mistake.
Richard
From: Jacob Bachmeyer <jcb6...@gmail.com>
Reply-To: "jcb6...@gmail.com" <jcb6...@gmail.com>
Date: Wednesday, 7 March 2018 at 04:34
To: Alex Elsayed <etern...@gmail.com>
Cc: "isa...@groups.riscv.org" <isa...@groups.riscv.org>
Subject: Re: [isa-dev] Proposal to remove the need for binary translation for RV32G to RV64G
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+u...@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/5A9F5DCC.7080200%40gmail.com.
- For embedded systems, it's hard to see why running RV32 binaries on
RV64 systems is compelling. For these systems, you can nearly always
just recompile the code. Furthermore, the memory map and other
platform details tend to be baked into the binary, and these will
differ between RV32 and RV64 systems; the instruction encoding is the
least of one's concerns. Finally, if you know you want to deploy RV32
software in a power constrained system, you should just use an RV32
core.
[rih] This is simply not true.
RISC-V is a young architecture and there isn’t much legacy software out there at the moment, but there will be.
In the embedded world it is very common to buy libraries from 3rd parties.
If a user, at some point in the future, wants to upgrade from an RV32 to an RV64 CPU then the incompatibility makes this impossible.
- For Unixy systems, the processors are already sufficiently complex
that supporting UXL is a blip on the complexity radar. (And note, the
hardware cost is very low. It may be a pain to implement, but it
takes few gates.)
[rih] This argument holds no value in my opinion.
If RV64 would natively run RV32 code none of this would be necessary in the first place. Hence even less gates and no pain to implement.
To this point, consider also that there are AArch64 server processors
incapable of natively executing ARMv7 programs. AFAIK this has not
proven problematic, since there isn't a long history of ARMv7 Linux
servers.
[rih] You’re comparing apples and pears
RISC-V is supposed to be unique in that the architecture supports small microcontroller type implementations all the way up to mega servers.
If that’s not the case, then we need to split.
Implementing the UXL field adds complexity, which is bad for embedded
CPUs.
How much complexity does UXL add, given that RV64 is already supported?
[rih] Well,
I don’t have an exact number and it won’t be a major contributor. But when every gate counts, this just seems a waste while it could have been avoided.
Also, embedded systems are not running "just any" software, but a
unified and known firmware image, so build-time translation (or simply
"always compile for the actual processor you are targeting") is not
unreasonable.
[rih] Yes and no. This same argument is used over and over.
My counter-argument is 3rd party libraries. Paying (sometimes a lot of money) for a library and not being able to use it when upgrading the processor (from RV32 to RV64) seems wrong and limits the use case for RISC-V.
Besides, there are systems without HSU mode that might benefit from
running RV32 code natively.
While slightly trickier, for this there is the MXL field in misa.
[rih] Isn’t that just a fudge?!
IMO MXL, UXL are just kludges to fix the issue. Running RV32 natively on RV64 voids all of this.
Not being able to execute RV32I(MA) natively is a mistake.
While I agree that it looks like a poor choice, I suspect that some
other constraint drove that decision
[rih] I am pretty sure there are. But we’re trying to move the RISC-V architecture from the academic world into the commercial world. Different decisions matter.
Why would that be? Wouldn't you just run RV32 apps in RV32 mode on Linux
[rih] There are other systems besides unox.
like you currently can run 32-bit apps on a 64-bit processor. I fail to understand
what the big deal is here and when this would ever be useful.
[rih] RISC-V is different in this aspect than other 64bit processors.
For x86 the 64bit opcodes are an extension of the 32bit CPU (which is an extension of the 16bit 8086).
MIPS32 code can run on MIPS64 and behaves the same as it would on an MIPS32-CPU.
There are issues when calling MIPS32 code from a MIPS64 CPU, because the 32bit code only save the lower part of the registers.
This is what I hoped would be fixed by RISC-V, but instead it went the exact opposite way.
Load/Store use specify the width, meaning RV32 uses LW to load a word. And RV64 uses LD to load a double. Whereas ADD has a different behavior on RV32 and RV64.
Having a LOAD which loads XLEN bits and a STORE which stores XLEN bits would have solved the ‘calling 32bit code on a 64bit CPU’ issue. And specifying the width for ALU operations (i.e. ADDW for RV32) would have ensured RV32 bit code would behave the same on an RV32 and RV64 CPU.
There are issues when calling MIPS32 code from a MIPS64 CPU, because the
32bit code only save the lower part of the registers.
This is what I hoped would be fixed by RISC-V, but instead it went the
exact opposite way.
Load/Store use specify the width, meaning RV32 uses LW to load a word.
And RV64 uses LD to load a double. Whereas ADD has a different behavior
on RV32 and RV64.
Having a LOAD which loads XLEN bits and a STORE which stores XLEN bits
would have solved the ‘calling 32bit code on a 64bit CPU’ issue. And
specifying the width for ALU operations (i.e. ADDW for RV32) would have
ensured RV32 bit code would behave the same on an RV32 and RV64 CPU.
I apologize if I'm missing something obvious, but how would a load/store
of XLEN bits help in the scenario where 64-bit code calls 32-bit code?
Suppose the 64-bit code has something in register s0, and 32-bit code
wants to save that value. If XLEN is 32 bits, it needs a 4-byte save
area; if XLEN is 64 bits, it needs an 8-byte save area. If the 32-bit
code always allocates a 4-byte save area, a XLEN-sized store will
overflow it when run on a 64-bit processor; if the 32-bit code always
allocates an 8-byte save area, it will be wasting space when run a
32-bit processor (and 32-bit processors usually have less memory).
[rih] XLEN is determined by the CPU, not the program code.
When passing values from 64bit code to 32bit code, the value can only be 32bits large of course. Also the value must be located in the lower 32bits of the register.
That’s not where an XLEN bits load/store helps. It helps when saving registers during the pre-/post-amble.
Support S0 contains some value that must be restored after the function call. XLEN=64bits, so a STORE would write all 64bits to memory, since the CPU is an RV64. The 32bit program only uses the 32LSBs of S0. After the call completes, S0 is restored using a LOAD. All 64bits are loaded from memory, thus restoring the original value.
When the 32bit function is called on an RV32, 32bits are stored and loaded, again restoring the original value.
Also, what about pointers? The 32-bit code might receive a pointer from
the 64-bit code; to work well for that case, the 32-bit code would need
to use 64-bit pointers on every data structure, once again wasting space
in a 32-bit processor.
[rih] No, 32bit code can only address 32bit space. So an RV64 CPU calling 32bit code must ensure the pointers fit in the ±2GB address space.
Richard
From: Alex Elsayed <etern...@gmail.com>
Date: Thursday, 8 March 2018 at 16:58
To: RISC-V ISA Dev <isa...@groups.riscv.org>
Subject: Re: [isa-dev] Proposal to remove the need for binary translation for RV32G to RV64G
That sounds like a reasonable argument.
However since ABIs are software I am sure we can come up with a way to handle this without wasting loads of stack space.
Assuming now that RV128 is the final variant is shortsighted too.
Also, what about pointers? The 32-bit code might receive a pointer from
the 64-bit code; to work well for that case, the 32-bit code would need
to use 64-bit pointers on every data structure, once again wasting space
in a 32-bit processor.
No, 32bit code can only address 32bit space. So an RV64 CPU calling
32bit code must ensure the pointers fit in the ±2GB address space.
Except that the userspace RV64 code doing the calling _does not control this_
- this is controlled by `malloc`, which itself usually boils down to `mmap`,
which has _zero_ awareness of the code's intent to _eventually_ pass the
pointer to RV32 code.
Well I was initially referring to embedded code, where one has some stricter control over what goes where.
And again, there are other systems besides Linux.
It is not unknown for 32bit code to run on 64bit machines (other CPUs support this). I am sure they solved this particular issue.
In addition, Richard, your nonstandard quoting style is _intensely_
problematic. It is difficult to read (hard to tell where your comments end and
a subsequent piece you are responding to begins), nonstandard (and thus
requires much more conscious parsing, and is unsupported by mail clients'
display logic), and worst of all _does not list the name of the person you are
responding to_.
Sorry about that. I am fighting my email client. Too many accounts with all different requirements.
Is this better??
Richard