File tree Expand file tree Collapse file tree 3 files changed +41
-4
lines changed
Expand file tree Collapse file tree 3 files changed +41
-4
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,18 @@ operation(): |
2727 raise (ExceptionCode::IllegalInstruction, mode(), $encoding);
2828 }
2929
30+ XReg input = X[rs1];
31+ XReg output = 0;
32+
33+ for(U32 i=0; i<(xlen()-8); i = i+8) {
34+ for(U32 j=0; j<8; j = j+1) {
35+ output[(i*8)+(7-j)] = input[(i*8)+j];
36+ }
37+ }
38+
39+ X[rd] = output;
40+
41+ sail() : |
3042 result : xlenbits = EXTZ(0b0);
3143 foreach (i from 0 to sizeof(xlen) by 8) {
3244 result[i+7..i] = reverse_bits_in_byte(X(rs1)[i+7..i]);
Original file line number Diff line number Diff line change @@ -30,7 +30,20 @@ operation(): |
3030 raise (ExceptionCode::IllegalInstruction, mode(), $encoding);
3131 }
3232
33+ XReg input = X[rs1];
34+ XReg output = 0;
35+
36+ for(U32 i=0; i<(xlen()/2-1); i = i+1) {
37+ output[i] = input[2*i];
38+ output[i+xlen()/2] = input[2*i+1];
39+ }
40+
41+ X[rd] = output;
42+
43+
44+ sail() : |
45+
3346 foreach (i from 0 to xlen/2-1) {
34- X(rd)[i] = X(rs1)[2*i]
35- X(rd)[i+xlen/2] = X(rs1)[2*i+1]
47+ X(rd)[i] = X(rs1)[2*i];
48+ X(rd)[i+xlen/2] = X(rs1)[2*i+1];
3649 }
Original file line number Diff line number Diff line change @@ -30,7 +30,19 @@ operation(): |
3030 raise (ExceptionCode::IllegalInstruction, mode(), $encoding);
3131 }
3232
33+ XReg input = X[rs1];
34+ XReg output = 0;
35+
36+ for(U32 i=0; i<(xlen()/2-1); i = i+1){
37+ output[2*i] = input[i];
38+ output[2*i+1] = input[i+xlen()/2];
39+ }
40+
41+ X[rd] = output;
42+
43+ sail() : |
44+
3345 foreach (i from 0 to xlen/2-1) {
34- X(rd)[2*i] = X(rs1)[i]
35- X(rd)[2*i+1] = X(rs1)[i+xlen/2]
46+ X(rd)[2*i] = X(rs1)[i];
47+ X(rd)[2*i+1] = X(rs1)[i+xlen/2];
3648 }
You can’t perform that action at this time.
0 commit comments