From e4251246a833b35a5c63a6d60544c24ecee6a6b6 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 17 Apr 2018 05:56:19 +0100 Subject: [PATCH] add branch instructions from appendix --- simple_v_extension.mdwn | 86 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/simple_v_extension.mdwn b/simple_v_extension.mdwn index f077c5758..138eaa2a0 100644 --- a/simple_v_extension.mdwn +++ b/simple_v_extension.mdwn @@ -291,6 +291,92 @@ instruction codes in Quadrant 1 could be used as a parallelism prefix, bringing parallelised opcodes down to 32-bit and having the benefit of being explicit.* +## Branch Instruction: + +[[!table data=""" +31 | 30 .. 25 |24 ... 20 | 19 15 | 14 12 | 11 .. 8 | 7 | 6 ... 0 | +imm[12] | imm[10:5]| rs2 | rs1 | funct3 | imm[4:1] | imm[11] | opcode | +1 | 6 | 5 | 5 | 3 | 4 | 1 | 7 | +I/F | reserved | src2 | src1 | BPR | predicate rs3 || BRANCH | +0 | reserved | src2 | src1 | 000 | predicate rs3 || BEQ | +0 | reserved | src2 | src1 | 001 | predicate rs3 || BNE | +0 | reserved | src2 | src1 | 010 | predicate rs3 || rsvd | +0 | reserved | src2 | src1 | 011 | predicate rs3 || rsvd | +0 | reserved | src2 | src1 | 100 | predicate rs3 || BLE | +0 | reserved | src2 | src1 | 101 | predicate rs3 || BGE | +0 | reserved | src2 | src1 | 110 | predicate rs3 || BLTU | +0 | reserved | src2 | src1 | 111 | predicate rs3 || BGEU | +1 | reserved | src2 | src1 | 000 | predicate rs3 || FEQ | +1 | reserved | src2 | src1 | 001 | predicate rs3 || FNE | +1 | reserved | src2 | src1 | 010 | predicate rs3 || rsvd | +1 | reserved | src2 | src1 | 011 | predicate rs3 || rsvd | +1 | reserved | src2 | src1 | 100 | predicate rs3 || FLT | +1 | reserved | src2 | src1 | 101 | predicate rs3 || FLE | +1 | reserved | src2 | src1 | 110 | predicate rs3 || rsvd | +1 | reserved | src2 | src1 | 111 | predicate rs3 || rsvd | +"""]] + +In Hwacha EECS-2015-262 Section 6.7.2 the following pseudocode is given +for predicated compare operations of function "cmp": + + for (int i=0; i 1; + s2 = CSRvectorlen[src2] > 1; + for (int i=0; i