From 1f34e759bc4e21ec91300121cc19e670ef1da3e6 Mon Sep 17 00:00:00 2001 From: chad Date: Wed, 8 Oct 2014 15:05:45 -0400 Subject: [PATCH] Fixed predicate register encoding #2 --- src/enc.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/enc.cpp b/src/enc.cpp index 43a2ca97..946981c3 100644 --- a/src/enc.cpp +++ b/src/enc.cpp @@ -8,8 +8,7 @@ #include #include - - +#include "include/debug.h" #include "include/types.h" #include "include/util.h" #include "include/enc.h" @@ -271,8 +270,8 @@ Instruction *WordDecoder::decode(const std::vector &v, Size &idx) { Word code(readWord(v, idx, n/8)); Instruction &inst = * new Instruction(); - bool predicated = (code>>(i1+o+p)); - if (predicated) { inst.setPred((code>>(i1+o))&p); } + bool predicated = (code>>(n-1)); + if (predicated) { inst.setPred((code>>(n-p-1))&pMask); } Instruction::Opcode op = (Instruction::Opcode)((code>>i1)&oMask); inst.setOpcode(op); @@ -346,7 +345,7 @@ Instruction *WordDecoder::decode(const std::vector &v, Size &idx) { inst.setImmRef(*r); } - //cout << "Decoded 0x" << hex << code << " into: " << inst << '\n'; + D(2, "Decoded 0x" << hex << code << " into: " << inst << '\n'); return &inst; }