We taped out a chip with our RV32EC core in it this week. The core is commercially available.
Cheers,
PA
Note that RV32E has not been officially locked down yet, so changes of this kind may still be acceptable. Also, for what it's worth, there are no commercial RV32E implementations yet in silicon as far as I know.
-- Peter Ashenden, CTO IC Design, ASTC
That loses the useful property that all valid RV32E programs (which do
not attempt to execute an undefined instruction) are valid RV32I
programs. That is, once you used a RV32E core for your application, you
couldn't upgrade later to a RV32I if you needed more power (without
recompiling or even rewriting your code).
--
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/90141d86-e516-4981-802c-952f7499a1d9%40groups.riscv.org.
We taped out a chip with our RV32EC core in it this week. The core is commercially available.
First a better approach to achieve what you’re suggesting here might be to work with the B extension (bit manipulation) group to make sure that standard includes whatever additions are necessary to efficiently work with smaller integer sizes in the general purpose registers, and then use macro-op fusion to achieve efficient execution of these primitives. If the case can be made, perhaps some C space could be allocated to compactly specify these instructions across all RV32 code targets.
Second, straying a little from your suggestion I wonder if it makes sense to modify the V vector extension for fixed point and integer arithmetic. [...]
That loses the useful property that all valid RV32E programs (which do
not attempt to execute an undefined instruction) are valid RV32I
programs. That is, once you used a RV32E core for your application, you
couldn't upgrade later to a RV32I if you needed more power (without
recompiling or even rewriting your code)
--
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/8471fbb3-6cb5-4866-b48b-c16d6998d32c%40groups.riscv.org.
--
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/e4f8d2b2-ed22-910c-f497-1435ba9e224d%40astc-design.com.
The slides I've seen doesn't explicitly mandate fixed point, but it is pretty clear about how different formats can be added in as custom extensions.
Integer and floating point formats are spec'ed (by IEEE for FP and by every processor in existence for intenger). There isn't "a" fixed point format - there are lots of them.
At 11:17 PM -0600 11/30/17, Jacob Bachmeyer wrote:
>--
>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/5A20E5F2.6070307%40gmail.com.
--
**************************************************
* Allen Baum tel. (908)BIT-BAUM *
* 248-2286 *
**************************************************
--
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/p06240812d646a0877750%40%5B192.168.1.50%5D.
--
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/34331ad7-0eee-4365-87ee-a7f5d17ac3af%40groups.riscv.org.
--
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/5A20E469.1070108%40gmail.com.
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/34331ad7-0eee-4365-87ee-a7f5d17ac3af%40groups.riscv.org.
--
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/d7cc35d4-0f88-e382-aefe-f5533ccde3db%40gmail.com.
For the optional C extension, I propose the following instructions be changed when used with RV32E:
111 uimm[0|4:3] rs1' uimm[2:1] rd' 00 - C.SBU (replaces C.FSW)
111 uimm[5:0] rs2 10 - C.SBUSP (replaces C.FSWSP)
Due to lack of space, only unsigned byte and signed halfword load/stores get compressed encodings. Loads/stores of signed bytes and of unsigned hafwords must use the normal full-size instructions.
I’m interested in the problems that these are supposed to solve,
because it might be a suboptimal solution to a common problem.
It looks as if these are intended to help port 8-bit and 16-bit embedded code.
It’s true that such code often grows when naively ported to a 32-bit load-store machine.
The compiler does masking & whatever to support the smaller data and arithmetic.
A better porting approach is to go through the code and convert all the 8-bit and 16-bit
variables and parameters to “int”.
The code shrinks, becomes more robust and portable, and the CPU runs as it should.
Also, it isn’t hard to do this.
From: Rogier Brussee [mailto:rogier....@gmail.com]
Sent: Wednesday, December 06, 2017 4:26 AM
To: RISC-V ISA Dev <isa...@groups.riscv.org>
Subject: [isa-dev] Re: Possible RV32E modifications
Op donderdag 30 november 2017 21:35:08 UTC+1 schreef John Hauser:
At the recent RISC-V workshop in Milpitas, some claims were made that the RV32I instruction set may be less than optimal for RV32E, due to low-end applications making greater use of byte and halfword data types to conserve memory. I offer here a suggestion for modifying the RV32E ISA to address such concerns.
Note that RV32E has not been officially locked down yet, so changes of this kind may still be acceptable. Also, for what it's worth, there are no commercial RV32E implementations yet in silicon as far as I know. The instructions I'm proposing here would be defined only for RV32E. Other standard RISC-V variants such as RV32I are not touched.
First, I propose that RV32E augment the RV32I instruction set with a very regular group of ADD and SUB instructions that operate the same way that ADDW and SUBW do for RV64I, except for types B, H, BU, and HU instead of W. The instructions and their proposed encodings would be:
0000 uimm[7:0] rs1 000 rd 0011011 - ADDIB
imm[11:0] rs1 001 rd 0011011 - ADDIH
0000 uimm[7:0] rs1 100 rd 0011011 - ADDIBU
imm[11:0] rs1 101 rd 0011011 - ADDIHU
0000000 rs2 rs1 000 rd 0111011 - ADDB
0100000 rs2 rs1 000 rd 0111011 - SUBB
0000000 rs2 rs1 001 rd 0111011 - ADDH
0100000 rs2 rs1 001 rd 0111011 - SUBH
0000000 rs2 rs1 100 rd 0111011 - ADDBU
0100000 rs2 rs1 100 rd 0111011 - SUBBU
0000000 rs2 rs1 101 rd 0111011 - ADDHU
0100000 rs2 rs1 101 rd 0111011 - SUBHU
These encodings overlap existing RV64I instructions, which are presumed to be forever irrelevant to RV32E. I've set the funct3 field to match the data type that's encoded in existing load/store instructions.
Are all these additions (in particular the immediate versions) worth it? I can see that it would be convenient to always work with normalised values but remember that arithmetic with bytes and halves is just modular arithmetic mod (1 << 8) resp. (1 << 16) . Hence the compiler could use add and addi and don't care about the upper bits. If you ignore the upper bits you have to be careful, however, about equality, comparisons and (implicit or explicit) "casts" to W and WU i.e sign and zero extension (i.e. in C terms, casts to signed and unsigned long). In other words you must make sure to do the proper sign extension but _only_ when needed e.g. before testing equality, comparison, use as indexes/pointer arithmetic and (because it is in the ELF spec) the parameters of a function call .
In fact, I suspect the compiler is doing exactly this already.
Moreover if you have C and C.ZEXT{BH} and C.SEXT{BH}, you can use the C.ADD and C.SUB and _always_ sign or zero extend
and _still_ have same program size as with all the extra 32 bit add{[I]BH[U]} and sub instructions barring use of t1, t2 or
doing proper adds (as opposed to li = add rd zero imm) with immediates larger than 6 bit.
But maybe these instructions for smaller size use less power?
To give an example, ADDIB would add the instruction's unsigned immediate to the source operand and then sign-extend bit 7 of the sum (the most significant bit of the lower byte) into bits 31:8. SUBHU subtracts its two source operands and then "zero-extends" the lower halfword by zeroing bits 31:16. Hopefully everyone gets the idea.
For the optional C extension, I propose the following instructions be changed when used with RV32E:
001 uimm[5:3] rs1' uimm[2:1] rd' 00 - C.LH (replaces C.FLD)
011 uimm[0|4:3] rs1' uimm[2:1] rd' 00 - C.LBU (replaces C.FLW)
101 uimm[5:3] rs1' uimm[2:1] rd' 00 - C.SH (replaces C.FSD)
111 uimm[0|4:3] rs1' uimm[2:1] rd' 00 - C.SBU (replaces C.FSW)
100111 rd' 00 rs2' 01 - C.SEXT.B (replaces C.SUBW)
100111 rd' 01 rs2' 01 - C.SEXT.H (replaces C.ADDW)
100111 rd' 10 rs2' 01 - C.ZEXT.B (normally reserved)
100111 rd' 11 rs2' 01 - C.ZEXT.H (normally reserved)
001 uimm[5] rd uimm[4:1|6] 10 - C.LHSP (replaces C.FLDSP)
011 uimm[5] rd uimm[4:0] 10 - C.LBUSP (replaces C.FLWSP)
101 uimm[5:1|6] rs2 10 - C.SHSP (replaces C.FSDSP)
111 uimm[5:0] rs2 10 - C.SBUSP (replaces C.FSWSP)
Instructions C.SEXT.* and C.ZEXT.* (zero-extend) are special cases of the new ADD*/SUB* instructions from above.
Since E is defined to be softfloat only, using the SF and DF opcodes for loading/storing halves and bytes makes
a lot of sense to me. I am slightly less sure about the SP versions though. Are bytes and halves on the
stack actually saved as B or H instructions or do they use W size instructions?
If you are willing to tred on "reserved" territory, the remaining slot in the C spec, leaves room
for 32 register register instructions of the 3rd'/rs1' 3rs2' 5 func kind,
Maybe that is a better place for the SEXT and ZEXT instructions, allowing you to also
have C versions of the additional add{BH[U]}s and sub{BH[U]} if you still feel
they are needed.
Due to lack of space, only unsigned byte and signed halfword load/stores get compressed encodings. Loads/stores of signed bytes and of unsigned hafwords must use the normal full-size instructions.
I hope those who are most interested in implementing and using the RV32E variant can give their feedback on this proposal.
- John Hauser
--
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/59914246-8c93-48a7-9995-c7dc9991ceea%40groups.riscv.org.
C99 defines uint8_fast_t and uint8_least_t in <stdint.h>
for this kind of purpose - portable code which will run fast and
consume little memory of 8, 16 and 32 bit CPUs. (And ditto for
signed ints, and for 16, 32 bits).
--
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/MWHPR20MB15816E82E508232A4D2862E4F0190%40MWHPR20MB1581.namprd20.prod.outlook.com.
I’m interested in the problems that these are supposed to solve,
because it might be a suboptimal solution to a common problem.
It looks as if these are intended to help port 8-bit and 16-bit embedded code.
It’s true that such code often grows when naively ported to a 32-bit load-store machine.
The compiler does masking & whatever to support the smaller data and arithmetic.
A better porting approach is to go through the code and convert all the 8-bit and 16-bit
variables and parameters to “int”.
The code shrinks, becomes more robust and portable, and the CPU runs as it should.
Also, it isn’t hard to do this.
At the recent RISC-V workshop in Milpitas, some claims were made that the RV32I instruction set may be less than optimal for RV32E, due to low-end applications making greater use of byte and halfword data types to conserve memory. I offer here a suggestion for modifying the RV32E ISA to address such concerns.
Note that RV32E has not been officially locked down yet, so changes of this kind may still be acceptable. Also, for what it's worth, there are no commercial RV32E implementations yet in silicon as far as I know. The instructions I'm proposing here would be defined only for RV32E. Other standard RISC-V variants such as RV32I are not touched.
First, I propose that RV32E augment the RV32I instruction set with a very regular group of ADD and SUB instructions that operate the same way that ADDW and SUBW do for RV64I, except for types B, H, BU, and HU instead of W. The instructions and their proposed encodings would be:
0000 uimm[7:0] rs1 000 rd 0011011 - ADDIB
imm[11:0] rs1 001 rd 0011011 - ADDIH
0000 uimm[7:0] rs1 100 rd 0011011 - ADDIBU
imm[11:0] rs1 101 rd 0011011 - ADDIHU
0000000 rs2 rs1 000 rd 0111011 - ADDB
0100000 rs2 rs1 000 rd 0111011 - SUBB
0000000 rs2 rs1 001 rd 0111011 - ADDH
0100000 rs2 rs1 001 rd 0111011 - SUBH
0000000 rs2 rs1 100 rd 0111011 - ADDBU
0100000 rs2 rs1 100 rd 0111011 - SUBBU
0000000 rs2 rs1 101 rd 0111011 - ADDHU
0100000 rs2 rs1 101 rd 0111011 - SUBHU
These encodings overlap existing RV64I instructions, which are presumed to be forever irrelevant to RV32E. I've set the funct3 field to match the data type that's encoded in existing load/store instructions.