This is not possible.
I faced the same issue …
Richard
--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
To post to this group, send email to sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/490d01d0-3f97-42f8-be21-15dda4de118e%40groups.riscv.org.
This is specified in Privileged Spec 1.10 and beyond.
Richard
--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
To post to this group, send email to sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/
.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/eb1eaa58-b838-4ddf-9e12-ceccfea3e34c%40groups.riscv.org.
On 26/04/2018, 13:12, "Tommy Murphy" <tommy_...@hotmail.com> wrote:
On Thursday, 26 April 2018 11:27:06 UTC+1, Cesar Eduardo Barros wrote:
Em 26-04-2018 06:38, Vinod Ganesan escreveu:
The solution people arrived at is to make it possible to switch the base
ISA between RV64 and RV32. If the processor you are using supports it,
see the MXL field in the MISA register (for M-mode), and the SXL and UXL
fields in the MSTATUS/SSTATUS registers (for S-mode and U-mode).
--
Cesar Eduardo Barros
ces...@cesarb.eti.br
Was this discussed somewhere?
I don't recall seeing anything about it on the mailing lists.
This is specified in Privileged Spec 1.10 and beyond.
Richard
--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+unsubscribe@groups.riscv.org.
To post to this group, send email to
sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.
To view this discussion on the web visit
--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+unsubscribe@groups.riscv.org.
To post to this group, send email to sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/B79DEA4B-9DE1-431C-8E0E-099B08CED765%40roalogic.com.
Correct, a plain RV64 CPU, without the M/S/UXL bits implemented, cannot run native RV32 code.
Richard
When compiling your program what -march and -mabi are you referring to?
-march=rv32i -mabi=ilp32 or something else?
The OP was specifically asking for -march=rv64 and -mabi=ilp32, which is not a supported combination, at least not that I am aware off.
If the *XL bits can be used to support rv32 on rv64 (as seems to be suggested by the priv spec) then something will presumably need to change the *XL bit(s) before the rv32 program starts running?
Yeah, you’ll need to write a piece of firmware to set the bits.
If the 32bit application makes low-level calls, then those bits need to be set/reset depending on the environment.
For task switch they would need to be preserved, assuming the OS doesn’t keep track of the application’s nature.
I am still in dubio, and this is where a SW guy needs to provide their insights, what happens with callee saved registers.
If an RV64 is switched to RV32 mode does it still push the entire register? I assume not, from the previous discussion I learned that messes up the stack (pointer).
So that would imply that, when in RV32 mode, the upper 32bits of the register are not changed? Kind of like ‘ax’ versus ‘eax’ in i32?
Richard
On 26/04/2018, 13:43, "Tommy Murphy" <tommy_...@hotmail.com> wrote:
When compiling your program what -march and -mabi are you referring to?
-march=rv32i -mabi=ilp32 or something else?
The OP was specifically asking for -march=rv64 and -mabi=ilp32, which is not a supported combination, at least not that I am aware off.
If the *XL bits can be used to support rv32 on rv64 (as seems to be suggested by the priv spec) then something will presumably need to change the *XL bit(s) before the rv32 program starts running?
Yeah, you’ll need to write a piece of firmware to set the bits.
If the 32bit application makes low-level calls, then those bits need to be set/reset depending on the environment.
For task switch they would need to be preserved, assuming the OS doesn’t keep track of the application’s nature.
I am still in dubio, and this is where a SW guy needs to provide their insights, what happens with callee saved registers.
If an RV64 is switched to RV32 mode does it still push the entire register? I assume not, from the previous discussion I learned that messes up the stack (pointer).
So that would imply that, when in RV32 mode, the upper 32bits of the register are not changed? Kind of like ‘ax’ versus ‘eax’ in i32?
Richard
On Thursday, 26 April 2018 12:24:29 UTC+1, Neel Gala wrote:Just to confirm, this enhancement will allow to me compile an application using the riscv32-unknown-* toolchain and then run the binary on a 64-bit core with MXL/SXL/UXL set to 1. Am I right?
--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+unsubscribe@groups.riscv.org.
To post to this group, send email to sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/A140466D-44B5-4CFA-9468-5AC6153A6B9D%40roalogic.com.
On Thu, Apr 26, 2018 at 5:20 PM, Richard Herveille <richard....@roalogic.com> wrote:
On 26/04/2018, 13:43, "Tommy Murphy" <tommy_...@hotmail.com> wrote:
When compiling your program what -march and -mabi are you referring to?
-march=rv32i -mabi=ilp32 or something else?
The OP was specifically asking for -march=rv64 and -mabi=ilp32, which is not a supported combination, at least not that I am aware off.
If the *XL bits can be used to support rv32 on rv64 (as seems to be suggested by the priv spec) then something will presumably need to change the *XL bit(s) before the rv32 program starts running?
Yeah, you’ll need to write a piece of firmware to set the bits.
If the 32bit application makes low-level calls, then those bits need to be set/reset depending on the environment.
For task switch they would need to be preserved, assuming the OS doesn’t keep track of the application’s nature.
I am still in dubio, and this is where a SW guy needs to provide their insights, what happens with callee saved registers.
If an RV64 is switched to RV32 mode does it still push the entire register? I assume not, from the previous discussion I learned that messes up the stack (pointer).
So that would imply that, when in RV32 mode, the upper 32bits of the register are not changed? Kind of like ‘ax’ versus ‘eax’ in i32?
But the spec explicit says that the operands need to be sign-extended while updating the XLEN bit registers. Upper data bits will be lost.
Yes exactly. But unless I am missing something …
In RV32-mode a callee saved register will only push/pop the 32LSBs to/from the stack.
If all operands are sign extended then the MSBs will end up to be either all ‘0’ or ‘1’.
Thus when the RV32 routine returns the original register contents won’t be correct.
So
I think (2) would be the nicest solution, but it has a hardware cost. I also believe that (2) is compatible with the specs as they currently are. The spec would need to specify that all operands operate at XLEN size only though.
Richard
Richard
On Thursday, 26 April 2018 12:24:29 UTC+1, Neel Gala wrote:Just to confirm, this enhancement will allow to me compile an application using the riscv32-unknown-* toolchain and then run the binary on a 64-bit core with MXL/SXL/UXL set to 1. Am I right?
--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
To post to this group, send email to
sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.
To view this discussion on the web visit