Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
test files for rotate right immediate (rori) are added
  • Loading branch information
Borainan authored Feb 21, 2023
1 parent 0678fbe commit f69acb8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/rori.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@


#define XLEN 32
#include<stdint.h>
#define uint_xlen_t uint32_t

uint_xlen_t rotimm(uint_xlen_t rs1)
{
uint_xlen_t a = 0;
a = ((rs1>>2) | (rs1<<(XLEN-2)));
return a;
}
16 changes: 16 additions & 0 deletions test/rori.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.text
.attribute 4, 16
.attribute 5, "rv32i2p0_m2p0_a2p0_c2p0_zbb1p0"
.file "rori.c"
.globl rotimm
.p2align 1
.type rotimm,@function
rotimm:
rori a0, a0, 2
ret
.Lfunc_end0:
.size rotimm, .Lfunc_end0-rotimm

.ident "Ubuntu clang version 14.0.0-1ubuntu1"
.section ".note.GNU-stack","",@progbits
.addrsig

0 comments on commit f69acb8

Please sign in to comment.