aboutsummaryrefslogtreecommitdiff
path: root/gentestvec/gentestvec_alu.c
diff options
context:
space:
mode:
Diffstat (limited to 'gentestvec/gentestvec_alu.c')
-rw-r--r--gentestvec/gentestvec_alu.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gentestvec/gentestvec_alu.c b/gentestvec/gentestvec_alu.c
index 39de43e..4a11a74 100644
--- a/gentestvec/gentestvec_alu.c
+++ b/gentestvec/gentestvec_alu.c
@@ -6,7 +6,8 @@
typedef enum {
ADD = 0b0000,
SUB = 0b0001,
- SLT = 0b0011,
+ SLT = 0b0010,
+ SLTU = 0b0011,
AND = 0b0100,
OR = 0b0101,
@@ -31,6 +32,9 @@ void test_op(OP op, uint32_t a, uint32_t b) {
case SLT:
result = (int32_t)a < (int32_t)b;
break;
+ case SLTU:
+ result = a < b;
+ break;
case AND:
result = a & b;
@@ -79,6 +83,7 @@ int main(int argc, const char *argv[]) {
test_op(SLT, 0x8fffffff, 0xffffffff);
test_op(SLT, 0xffffffff, 0x00000001);
test_op(SLT, 0x00000001, 0xffffffff);
+ test_op_random(SLTU, 1000);
test_op_random(OR, 1000);
test_op(OR, 0x00000000, 0x00000000);