Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v-spec 0.7.1 support #303

Merged
merged 17 commits into from
Jun 18, 2019
Merged

Conversation

chihminchao
Copy link
Contributor

Based on 0.7.1

The implementation supports
by arch

  • RV32 and RV64
  • Vector register length (VLEN): 32 bits to 4096 bits, power by 2 (doesn’t test more than 4096 bits)
  • Vector element length (ELEN): 32 bits to VLEN, power by 2
  • Vector strip length(SLEN): 32 bits to 512 bits, power by 2 (doesn’t test more than 512 bits)

by instruction category

  • integer/fixed-point/mask/reduction/permutation
    sections: 12/13/15.1 ~ 15.2/16/17
    element size: 8/16/32/64
    support ediv: 1
  • load/store
    section: 7
    element size: 8/16/32/64
  • floating-point
    sections: 14/15.3 ~ 15.4
    element size: 32

vector unit tests need identical floating library to generate golden
pattern

Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
It is preparatory commit for vector extension.
v-ext has hundresds of new instructions and mixing them with scalar instructions
messes up code.

Separate each extension into different list to make thing clean

Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
@aswaterman aswaterman self-requested a review June 11, 2019 08:35
@aswaterman
Copy link
Collaborator

Cool. Will review and provide feedback over the next day or so.

riscv/execute.cc Outdated Show resolved Hide resolved
riscv/execute.cc Outdated Show resolved Hide resolved
riscv/insns/csrrc.h Outdated Show resolved Hide resolved
riscv/insns/vfadd_vf.h Outdated Show resolved Hide resolved
@aswaterman
Copy link
Collaborator

Okay. We can fix this later if people complain. Can you update the autoconf/configure scripts to check for a 64-bit host, and issue a useful error message if the host is 32-bit?

@myftptoyman
Copy link

How to test these vector instructions ? Current assembler can't compile vector instructions

@aswaterman
Copy link
Collaborator

aswaterman commented Jun 13, 2019 via email

@jim-wilson
Copy link

You can find rvv 0.7.1 binutils sources in the rvv branch at
github.com/sifive/riscv-binutils-gdb
These have been publicly visible for a few months, though they haven't been "stable" until now. Pass -march=rv64gcv or similar to the assembler to enable vector instruction support.

We should create a branch in riscv/riscv-gnu-toolchain to hold this, and some minimal gcc patches to support the vector extension, but I'm swamped with work and haven't gotten around to it yet. Plus I wasn't sure what exactly was happening with the spike work.

There is an existing rvv branch in riscv/riscv-gnu-toolchain, but it holds rvv 0.6 support. I don't know if that is useful to anyone anymore, so I don't know if it is safe to overwrite that or not. I could alternatively create a rvv-0.7 branch for the new work to avoid conflicting with the old work and avoid conflicts with possible future work.

I'd rather not have non-upstream patches on riscv-gnu-toolchain master, and I'd rather not upstream patches that aren't an official standard yet, so I don't have any better suggestion than creating an rvv specific branch.

also remove duplicated one in fesvr

Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
It is a preparatory commit.
vector extension has supported segment load/store which have
the same prefix and a serial number as suffix.
ex:
  base :
    vlsegb.v
  variation:
    vlseg2.v, vlseg3b ... vlseg8b

dynamic string can reduce the typing effort

Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
support most of vector instruction except for AMO extension

Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
1. configure option "--with-varch"
the option defines the default u-arch implementatiton-decided parameter

  VLEN:  vector register length in bit
  SLEN:  striping distance in bit
  ELEN:  max element size in bit

  ex: --with-vector=v128:e32:s128

2. add __int128_t type checking

3. add --varch command option and help message

  ex: --varch=v512:e64:s512

Signed-off-by: Dave Wen <dave.wen@sifive.com>
Signed-off-by: Bruce Hoult <bruce@hoult.org>
Signed-off-by: Dave Wen <dave.wen@sifive.com>
the default vector parameters are defined in configuration time but can
be changed throught command-line option

Signed-off-by: Dave Wen <dave.wen@sifive.com>
@chihminchao
Copy link
Contributor Author

Changes

  1. separate vfunary0/vfunary1
  2. check 128 bit integer support in autoconf
  3. rollback vector control register change
  4. remove some unused define
  5. remove register change feature in interactive mode

@aswaterman
Copy link
Collaborator

Thank you for addressing all these requests! I think it is @palmer-dabbelt's turn to review the code.

@myftptoyman
Copy link

I have builld success the rvv Spike and binutils rvv 0.7.1 and run on gcc inline assembly. It is look very good. I will try some algorithm on this platform. Thank you.

palmer-dabbelt
palmer-dabbelt previously approved these changes Jun 16, 2019
@palmer-dabbelt palmer-dabbelt dismissed their stale review June 16, 2019 07:15

I don't understand the github interface

}else if(sew == e64){ \
VV_PARAMS(e64); \
BODY; \
} \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should fail on an unknown SEW. There's a bunch of these.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're checking the unsupported SEW at very begging of each instruction. Please reference the decode.h:460.

riscv/interactive.cc Outdated Show resolved Hide resolved
add command to show vector register in debug mode

Signed-off-by: Bruce Hoult <bruce@hoult.org>
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
1. add integer signed add/subu and unsigend add/sub saturation function
2. merge these with mulhi helper

Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Signed-off-by: Bruce Hoult <bruce@hoult.org>
Signed-off-by: Dave Wen <dave.wen@sifive.com>
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
based on v-spec 0.7.1, support
  sections: 12/13/15.1 ~ 15.2/16/17
  element size: 8/16/32/64
  support ediv: 1

Signed-off-by: Bruce Hoult <bruce@hoult.org>
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Signed-off-by: Dave Wen <dave.wen@sifive.com>
based on v-spec 0.7.1, support
  section: 7
  element size: 8/16/32/64

Signed-off-by: Bruce Hoult <bruce@hoult.org>
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Signed-off-by: Dave Wen <dave.wen@sifive.com>
Signed-off-by: Zakk Chen <zakk.chen@sifive.com>
based on v-spec 0.7.1, support
  sections: 14/15.3 ~ 15.4
  element size: 32

Signed-off-by: Bruce Hoult <bruce@hoult.org>
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Signed-off-by: Dave Wen <dave.wen@sifive.com>
the tool can parse the instruction name from spike debug log to help
dsp kernel designer check what instructions have been used

Signed-off-by: Jerry Shih <bignose1007@gmail.com>
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
@chihminchao
Copy link
Contributor Author

Changes:

  1. fix vext signed extension issue
  2. refine register checking
  3. add register overlapping checking for vslide1up and vslideup
  4. follow review's suggestion to refine register dump function.

@aswaterman
Copy link
Collaborator

I think this version of the patch is mergeable; any objections?

@palmer-dabbelt
Copy link
Contributor

palmer-dabbelt commented Jun 18, 2019 via email

@aswaterman
Copy link
Collaborator

Thanks @chihminchao!

@aswaterman aswaterman merged commit 49eb5a5 into riscv-software-src:master Jun 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants