-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
2e29219
commit 0e5eef6
Showing
3 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
; RUN: llc -mtriple=riscv32 -mcpu=ventus-gpgpu -verify-machineinstrs < %s \ | ||
; RUN: | FileCheck -check-prefix=VENTUS %s | ||
|
||
; Function Attrs: convergent norecurse nounwind | ||
define dso_local i32 @sumpi(i32 noundef %a) { | ||
; VENTUS-LABEL: sumpi: | ||
; VENTUS: # %bb.0: # %entry | ||
; VENTUS-NEXT: vadd.vi v0, v0, 5 | ||
; VENTUS-NEXT: ret | ||
entry: | ||
%add = add i32 %a, 5 | ||
ret i32 %add | ||
} | ||
|
||
; Function Attrs: convergent norecurse nounwind | ||
define dso_local i32 @sumni(i32 noundef %a) { | ||
; VENTUS-LABEL: sumni: | ||
; VENTUS: # %bb.0: # %entry | ||
; VENTUS-NEXT: vsub12.vi v0, v0, 5 | ||
; VENTUS-NEXT: ret | ||
entry: | ||
%add = add i32 %a, -5 | ||
ret i32 %add | ||
} | ||
|