X86: Detect branches taking into account instruction size.
authorGabe Black <gblack@eecs.umich.edu>
Mon, 14 Feb 2011 01:45:47 +0000 (17:45 -0800)
committerGabe Black <gblack@eecs.umich.edu>
Mon, 14 Feb 2011 01:45:47 +0000 (17:45 -0800)
The size of the current instruction determines what the npc should be if
there's no branching.

src/arch/x86/types.hh

index d78af1b8150d25e8b2d7835d5851e89614cc1210..4641141d356dec6d52409ae7c58194f44788db3d 100644 (file)
@@ -243,6 +243,12 @@ namespace X86ISA
         uint8_t size() const { return _size; }
         void size(uint8_t newSize) { _size = newSize; }
 
+        bool
+        branching() const
+        {
+            return this->npc() != this->pc() + size();
+        }
+
         void
         advance()
         {