Commit Graph

444452 Commits

Author SHA1 Message Date
zhoujingya 0a45eabde0 Revert "[VENTUS][RISCV][feat] Legalized vector parameters"
This reverts commit 7bd98c0ff8.
2023-10-08 17:31:53 +08:00
zhoujingya 8bea355dbe Revert "[VENTUS][RISCV][feat] Legalized vector parameters"
This reverts commit 12195ac947.
2023-10-08 17:31:09 +08:00
qinfan 80a3ef9b04 [VENTUS][RISCV][fix] Fix the float COPY instruction bug
Fix the translation error of the COPY instruction in IR. Previously,
the COPY instruction for float registers would be translated into vmv incorrectly.
This is because the GPRF class inherits from the GPR class, so float registers
were also considered GPR. Now an additional check has been added to translate
COPY instructions accurately.
2023-10-08 11:28:04 +08:00
qinfan 12195ac947 [VENTUS][RISCV][feat] Legalized vector parameters 2023-10-08 11:28:04 +08:00
qinfan 7bd98c0ff8 [VENTUS][RISCV][feat] Legalized vector parameters
Summary: LegaLegalized vector parameters, but not been added FileCheck now.

Test Plan: Legalized vector parameters

Differential Revision: http://www.tpt.com/D740
2023-10-08 11:28:04 +08:00
Aries b9fa6ff2d8 [VENTUS] Improve coding style and performance 2023-09-28 16:52:27 +08:00
qinfan e6937f5ead [VENTUS][RISCV][fix] Fix the undefined physical register bug
Fix the undefined physical register bug when inserting VMV_V_X instruction
in "checkJoinMBB" funtion to compile with "--verify-machineinstr" parameter.
2023-09-28 10:24:45 +08:00
zhoujingya 6630f81570 [VENTUS][NFC] Modify coding style 2023-09-26 15:49:25 +08:00
zhoujingya 9fa870aace [VENTUS][fix] Fix vmv.v instruction bug in JOIN MBB after BranchBB
When vmv instruction is in join block, need to check the register definition
are in both else&if predecessors or not
Github issue: https://github.com/THU-DSP-LAB/llvm-project/issues/16
2023-09-26 12:57:20 +08:00
zhoujingya f9c37399dd [VENTUS][fix] No need to move vmv.v instruction when MBB has only one predecessor 2023-09-20 19:41:21 +08:00
zhoujingya fb8e1be577 [VENTUS][fix] Fix illegal bitcast 2023-09-20 11:55:22 +08:00
zhoujingya 4bfde6aa71 [VENTUS][fix] Check vmv instruction position in JOIN block 2023-09-15 17:24:34 +08:00
zhoujingya 319e10771e [VENTUS][fix] Add `.rodata.ventus.resource` in linker script 2023-09-15 16:41:21 +08:00
zhoujingya dc788b8e36 [VENTUS][fix] Fix ra offset in workitem.s 2023-09-14 15:52:08 +08:00
zhoujingya dc3ffe70cf [VENTUS][fix] Fix getStackSize calculation bugs 2023-09-14 15:52:08 +08:00
zhoujingya 0e5eef6abb [VENTUS][fix] fix add instruction
Summary:
fix addi instruction, there will be a hardware error when immediate is
negative number.

Test Plan: fix add instruction

Reviewers: zhoujing

Subscribers: zhoujing

Differential Revision: http://www.tpt.com/D722

Signed-off-by: qinfan <qinfan.wang@terapines.com>
2023-09-08 10:32:17 +08:00
zhoujingya 2e292191ae
Merge pull request #11 from THU-DSP-LAB/dev 2023-09-08 09:43:11 +08:00
zhoujingya 6faba77dc3 [VENTUS][NFC] Update comments 2023-09-07 22:18:13 +08:00
zhoujingya c25d00552c [VENTUS][fix] Legalize vlw12.v instruction for variadic functions 2023-09-07 16:39:11 +08:00
zhoujingya b7b8fa50ba [VENTUS][fix] Fix load instruction selection pattern for vastart
In standard riscv vararg support, the varstart frame index will be stored in stack,
but because if the design of ventus, some code generation  will be like this
        vlw.v   v0, -44(v8)
        vadd.vi v1, v0, 4
        vsw.v   v1, -44(v8)
        \vlw12.v v0, 0(v0)
the last vlw12 instruction is actually illeagl, it should be vlw
2023-09-05 14:41:10 +08:00
zhoujingya 649f4da46a [VENTUS][fix] Fix load instruction selection pattern for vastart
In standard riscv vararg support, the varstart frame index will be stored in stack,
but because if the design of ventus, some code generation  will be like this
        vlw.v   v0, -44(v8)
        vadd.vi v1, v0, 4
        vsw.v   v1, -44(v8)
        \vlw12.v v0, 0(v0)
the last vlw12 instruction is actually illeagl, it should be vlw
2023-09-05 11:15:53 +08:00
zhoujingya 3a465aa795 [VENTUS][NFC] Modify build script and README 2023-09-04 10:25:09 +08:00
zhoujingya 236a1fbec6 [VENTUS][NFC] Modify build script and README 2023-09-03 18:52:34 +08:00
zhoujingya 7a9c36b852 Revert "[VENTUS][script] Modify pocl build options to install CL headers"
This reverts commit 07ce5da3e6.
2023-08-29 18:06:49 +08:00
zhoujingya 07ce5da3e6 [VENTUS][script] Modify pocl build options to install CL headers 2023-08-28 20:06:10 +08:00
zhoujing 6491bdfb02 Revert "[VENTUS][fix] No need to spill/restore callee saved registers for kernel function"
This reverts commit 85df9000bb.
2023-08-27 15:47:26 +08:00
zhoujing 2d8205dd54 [VENTUS][fix] Kernel function arguments are not divergent path 2023-08-21 16:14:21 +08:00
zhoujing 85df9000bb [VENTUS][fix] No need to spill/restore callee saved registers for kernel function 2023-08-21 14:44:45 +08:00
zhoujing d1e945bc8e [VENTUS][fix] Comment out echo information in assemble.sh 2023-08-17 10:46:11 +08:00
zhoujing 90698c8fb9 [VENTUS][fix] add epilog/prolog information in __builtin_riscv_global_linear_id 2023-08-16 15:04:05 +08:00
zhoujing 826c4cb599 Revert "[VENTUS][fix] Insert barrier instruction for function calling"
This reverts commit 7e4b7a6ae1.
2023-08-16 14:50:42 +08:00
zhoujing d40f4ec38d [VENTUS][fix] Change the sp initialization for different warp
In previous sp initialization, sp points to the same base address for different warps
When different warps ends in different time, the sp pointer in later ended warp will
be changed by former ended warp, we need to initialize sp pointer for different warp
2023-08-15 13:54:13 +08:00
zhoujing 63911b8554 [VENTUS][fix] fix operand order bugs in ternary operands instructions
Previous commit changed the order of operands in some three operands instructions, 09b6c28686
2023-08-15 13:53:13 +08:00
zhoujing 35f164a462 [VENTUS][libclc] Add more compiler-rt function support
Specially this commit is for later printf function support
2023-08-14 15:33:34 +08:00
qinfan 09b6c28686 [VENTUS][fix]Fix Instruction errors and add test files
1.Fix errors in VALUrVV class(llvm/lib/Target/RISCV/VentusInstrInfoV.td) where two source operand positions were reversed,
this is differnt from the conventional RISCV instruction.
2.Fix errors in VALUrVF class, same as above.
3.The instructions associated with the above two errors are "vfnmadd.vv", "vfnmadd.vf", etc.
4.Add MC level FileCheck test files to test V instructions.
2023-08-11 17:27:47 +08:00
zhoujing 758644eec1 [VENTUS][fix] Fix function calling pointer cast issuse
`void print_ints_uchar(param_t *p, const void *vals , int n, int is_unsigned)`
The second argument is a void pointer, but when we call this function with a non-void
pointer, in traditional C code, this action is legal, but when this pointer carrys different
address space, llvm will report error, we now just avoid this check
`print_ints_uchar(&p,  &val, vector_length, is_unsigned)`
2023-08-11 15:47:27 +08:00
zhoujing c09d292fad [VENTUS][fix] Fix call IR codegen
Since printf is writtn in c, the function calling has address space mapping issue
2023-08-10 15:01:54 +08:00
zhoujing 700020da1e [VENTUS][fix] Fix vastart builtin codegen 2023-08-09 17:07:15 +08:00
zhoujing 499956ea8d [VENTUS][fix] Change private memory base register to v8 register for variadic function 2023-08-08 17:58:18 +08:00
zhoujing 198eea9938 [VENTUS][feat] Support varadic function && enable address space in vastart/vaend 2023-08-08 15:45:41 +08:00
zhoujing e68d50e833 [VENTUS][fix] Add '+zfinx' attribute in objdump flag 2023-08-02 11:56:37 +08:00
Jules-Kong 78b9e9c855 [VENTUS][test] Add the regression tests
In order to prevent new errors from being introduced when modifying the code,
we add regression tests in the project build script and workflow. The
regression tests mainly includes some cases that come with gpu-rodinia and
pocl.
2023-08-02 10:23:28 +08:00
zhoujing 9b14cdb6b2 [VENTUS][NFC] Modify driver repository in README 2023-08-01 18:04:50 +08:00
zhoujing 88a22b9e90 [VENTUS][fix] Change vmv.s.x to vmv.v.x in workitem.S 2023-08-01 14:04:59 +08:00
zhoujing 50b23dc21a [VENTUS][fix] Deprecating vmv.s.x and use vmv.v.x instead
As required, vmv.s.x instruction may will later be deprecated
2023-08-01 13:25:24 +08:00
zhoujing 592d77cb76 [VENTUS][fix] Add vmslt(u)/vmsge(u) instructions' alias
Based on vspec-doc(https://github.com/riscv/riscv-v-spec/blob/master/v-spec.adoc)
ans Ventus design documentation
2023-08-01 13:06:49 +08:00
zhoujing f995792016 [VENTUS][test] Add resource usage information test file 2023-08-01 09:19:46 +08:00
zhoujing 229a1f95fb [VENTUS][fix] Disable vmslt.vi instruction codegen 2023-07-31 13:54:09 +08:00
zhoujing 7e4b7a6ae1 [VENTUS][fix] Insert barrier instruction for function calling
Stack space is shared between different warps, if two warps are executing
different functions, then the access to the return address will conflict,
which will lead the warp executing faster can not find the return address,
so we would like to add a barrier instruction after the lw and before the ret,
to ensure that the warps have the same scope of the sp pointer
2023-07-31 11:01:14 +08:00
zhoujing 98474922a4 [VENTUS][fix] Add LDS/PDS calculation
Later need to fix the local data declaration calculation
2023-07-27 11:58:31 +08:00