Add more repeat support and register views.

Rationale:
This enables exhaustive testing of instructions
that use various memory addressing modes and
register views (full, half, quarter, etc.).

Bug: 18380245
Bug: 18380559
Bug: 18380348

Test: assembler_x86[_64]_test
Change-Id: I598c3e35a4791166ab629479ccb969ef3c6494b8
diff --git a/compiler/utils/x86_64/assembler_x86_64.h b/compiler/utils/x86_64/assembler_x86_64.h
index fc0839b5a8..1130444 100644
--- a/compiler/utils/x86_64/assembler_x86_64.h
+++ b/compiler/utils/x86_64/assembler_x86_64.h
@@ -80,6 +80,21 @@
     return static_cast<Register>(encoding_at(1) & 7);
   }
 
+  CpuRegister cpu_rm() const {
+    int ext = (rex_ & 1) != 0 ? x86_64::R8 : x86_64::RAX;
+    return static_cast<CpuRegister>(rm() + ext);
+  }
+
+  CpuRegister cpu_index() const {
+    int ext = (rex_ & 2) != 0 ? x86_64::R8 : x86_64::RAX;
+    return static_cast<CpuRegister>(index() + ext);
+  }
+
+  CpuRegister cpu_base() const {
+    int ext = (rex_ & 1) != 0 ? x86_64::R8 : x86_64::RAX;
+    return static_cast<CpuRegister>(base() + ext);
+  }
+
   uint8_t rex() const {
     return rex_;
   }
@@ -268,6 +283,7 @@
   Address() {}
 };
 
+std::ostream& operator<<(std::ostream& os, const Address& addr);
 
 /**
  * Class to handle constant area values.