Summary: This commit enables some of the arithmetic instructions for Nios2 ISA (for both R1 and R2 revisions), implements facilities required to emit those instructions and provides LIT tests for added instructions. Reviewed By: hfinkel Differential Revision: https://reviews.llvm.org/D41236 Author: belickim <mateusz.belicki@intel.com> llvm-svn: 322069
27 lines
528 B
LLVM
27 lines
528 B
LLVM
; RUN: llc < %s -march=nios2 2>&1 | FileCheck %s
|
|
; RUN: llc < %s -march=nios2 -target-abi=nios2r2 2>&1 | FileCheck %s
|
|
|
|
define i32 @sll_reg(i32 %a, i32 %b) nounwind {
|
|
entry:
|
|
; CHECK: sll_reg:
|
|
; CHECK: sll r2, r4, r5
|
|
%c = shl i32 %a, %b
|
|
ret i32 %c
|
|
}
|
|
|
|
define i32 @srl_reg(i32 %a, i32 %b) nounwind {
|
|
entry:
|
|
; CHECK: srl_reg:
|
|
; CHECK: srl r2, r4, r5
|
|
%c = lshr i32 %a, %b
|
|
ret i32 %c
|
|
}
|
|
|
|
define i32 @sra_reg(i32 %a, i32 %b) nounwind {
|
|
entry:
|
|
; CHECK: sra_reg:
|
|
; CHECK: sra r2, r4, r5
|
|
%c = ashr i32 %a, %b
|
|
ret i32 %c
|
|
}
|