Duplicate X86 headers into X8632 and X8664 ones
This is a first step into de-templatizing the X86 backend classes. It
eliminates the need for the X86NAMESPACE macro.
Bug: b/192890685
Change-Id: Iedf11931b3e93ba668f794333bb8b80e0f9a71d9
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/55548
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Sean Risser <srisser@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/third_party/subzero/src/IceAssemblerX8632.h b/third_party/subzero/src/IceAssemblerX8632.h
index 6f3f819..27daf2e 100644
--- a/third_party/subzero/src/IceAssemblerX8632.h
+++ b/third_party/subzero/src/IceAssemblerX8632.h
@@ -23,9 +23,7 @@
#ifndef SUBZERO_SRC_ICEASSEMBLERX8632_H
#define SUBZERO_SRC_ICEASSEMBLERX8632_H
-#define X86NAMESPACE X8632
-#include "IceAssemblerX86Base.h"
-#undef X86NAMESPACE
+#include "IceAssemblerX8632Base.h"
#include "IceTargetLoweringX8632Traits.h"
namespace Ice {
diff --git a/third_party/subzero/src/IceAssemblerX86Base.h b/third_party/subzero/src/IceAssemblerX8632Base.h
similarity index 98%
rename from third_party/subzero/src/IceAssemblerX86Base.h
rename to third_party/subzero/src/IceAssemblerX8632Base.h
index c6dda23..91e18b8 100644
--- a/third_party/subzero/src/IceAssemblerX86Base.h
+++ b/third_party/subzero/src/IceAssemblerX8632Base.h
@@ -1,4 +1,5 @@
-//===- subzero/src/IceAssemblerX86Base.h - base x86 assembler -*- C++ -*---===//
+//===- subzero/src/IceAssemblerX8632Base.h - base x86 assembler -*- C++
+//-*---===//
//
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -21,8 +22,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef SUBZERO_SRC_ICEASSEMBLERX86BASE_H
-#define SUBZERO_SRC_ICEASSEMBLERX86BASE_H
+#ifndef SUBZERO_SRC_ICEASSEMBLERX8632BASE_H
+#define SUBZERO_SRC_ICEASSEMBLERX8632BASE_H
#include "IceAssembler.h"
#include "IceDefs.h"
@@ -31,12 +32,7 @@
#include "IceUtils.h"
namespace Ice {
-
-#ifndef X86NAMESPACE
-#error "You must define the X86 Target namespace."
-#endif
-
-namespace X86NAMESPACE {
+namespace X8632 {
template <typename TraitsType>
class AssemblerX86Base : public ::Ice::Assembler {
@@ -926,10 +922,9 @@
emitUint8(0x66);
}
-} // end of namespace X86NAMESPACE
-
+} // end of namespace X8632
} // end of namespace Ice
-#include "IceAssemblerX86BaseImpl.h"
+#include "IceAssemblerX8632BaseImpl.h"
-#endif // SUBZERO_SRC_ICEASSEMBLERX86BASE_H
+#endif // SUBZERO_SRC_ICEASSEMBLERX8632BASE_H
diff --git a/third_party/subzero/src/IceAssemblerX86BaseImpl.h b/third_party/subzero/src/IceAssemblerX8632BaseImpl.h
similarity index 99%
copy from third_party/subzero/src/IceAssemblerX86BaseImpl.h
copy to third_party/subzero/src/IceAssemblerX8632BaseImpl.h
index 1774409..d323623 100644
--- a/third_party/subzero/src/IceAssemblerX86BaseImpl.h
+++ b/third_party/subzero/src/IceAssemblerX8632BaseImpl.h
@@ -15,19 +15,19 @@
//===----------------------------------------------------------------------===//
//
/// \file
-/// \brief Implements the AssemblerX86Base template class, which is the base
-/// Assembler class for X86 assemblers.
+/// \brief Implements the AssemblerX8632Base template class, which is the base
+/// Assembler class for X8632 assemblers.
//
//===----------------------------------------------------------------------===//
-#include "IceAssemblerX86Base.h"
+#include "IceAssemblerX8632Base.h"
#include "IceCfg.h"
#include "IceCfgNode.h"
#include "IceOperand.h"
namespace Ice {
-namespace X86NAMESPACE {
+namespace X8632 {
template <typename TraitsType>
AssemblerX86Base<TraitsType>::~AssemblerX86Base() {
@@ -3913,5 +3913,5 @@
emitOperand(rm, operand);
}
-} // end of namespace X86NAMESPACE
+} // namespace X8632
} // end of namespace Ice
diff --git a/third_party/subzero/src/IceAssemblerX8664.h b/third_party/subzero/src/IceAssemblerX8664.h
index 18215cd..3a49840 100644
--- a/third_party/subzero/src/IceAssemblerX8664.h
+++ b/third_party/subzero/src/IceAssemblerX8664.h
@@ -23,9 +23,7 @@
#ifndef SUBZERO_SRC_ICEASSEMBLERX8664_H
#define SUBZERO_SRC_ICEASSEMBLERX8664_H
-#define X86NAMESPACE X8664
-#include "IceAssemblerX86Base.h"
-#undef X86NAMESPACE
+#include "IceAssemblerX8664Base.h"
#include "IceTargetLoweringX8664Traits.h"
namespace Ice {
diff --git a/third_party/subzero/src/IceAssemblerX86Base.h b/third_party/subzero/src/IceAssemblerX8664Base.h
similarity index 98%
copy from third_party/subzero/src/IceAssemblerX86Base.h
copy to third_party/subzero/src/IceAssemblerX8664Base.h
index c6dda23..8262615 100644
--- a/third_party/subzero/src/IceAssemblerX86Base.h
+++ b/third_party/subzero/src/IceAssemblerX8664Base.h
@@ -1,4 +1,5 @@
-//===- subzero/src/IceAssemblerX86Base.h - base x86 assembler -*- C++ -*---===//
+//===- subzero/src/IceAssemblerX8664Base.h - base x86 assembler -*- C++
+//-*---===//
//
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -16,13 +17,13 @@
//===----------------------------------------------------------------------===//
//
/// \file
-/// \brief Defines the AssemblerX86 template class for x86, the base of all X86
-/// assemblers.
+/// \brief Defines the AssemblerX8664 template class for x86, the base of all
+/// X8664 assemblers.
//
//===----------------------------------------------------------------------===//
-#ifndef SUBZERO_SRC_ICEASSEMBLERX86BASE_H
-#define SUBZERO_SRC_ICEASSEMBLERX86BASE_H
+#ifndef SUBZERO_SRC_ICEASSEMBLERX8664BASE_H
+#define SUBZERO_SRC_ICEASSEMBLERX8664BASE_H
#include "IceAssembler.h"
#include "IceDefs.h"
@@ -31,12 +32,7 @@
#include "IceUtils.h"
namespace Ice {
-
-#ifndef X86NAMESPACE
-#error "You must define the X86 Target namespace."
-#endif
-
-namespace X86NAMESPACE {
+namespace X8664 {
template <typename TraitsType>
class AssemblerX86Base : public ::Ice::Assembler {
@@ -926,10 +922,9 @@
emitUint8(0x66);
}
-} // end of namespace X86NAMESPACE
-
+} // end of namespace X8664
} // end of namespace Ice
-#include "IceAssemblerX86BaseImpl.h"
+#include "IceAssemblerX8664BaseImpl.h"
-#endif // SUBZERO_SRC_ICEASSEMBLERX86BASE_H
+#endif // SUBZERO_SRC_ICEASSEMBLERX8664BASE_H
diff --git a/third_party/subzero/src/IceAssemblerX86BaseImpl.h b/third_party/subzero/src/IceAssemblerX8664BaseImpl.h
similarity index 99%
rename from third_party/subzero/src/IceAssemblerX86BaseImpl.h
rename to third_party/subzero/src/IceAssemblerX8664BaseImpl.h
index 1774409..1dcddec 100644
--- a/third_party/subzero/src/IceAssemblerX86BaseImpl.h
+++ b/third_party/subzero/src/IceAssemblerX8664BaseImpl.h
@@ -20,14 +20,14 @@
//
//===----------------------------------------------------------------------===//
-#include "IceAssemblerX86Base.h"
+#include "IceAssemblerX8664Base.h"
#include "IceCfg.h"
#include "IceCfgNode.h"
#include "IceOperand.h"
namespace Ice {
-namespace X86NAMESPACE {
+namespace X8664 {
template <typename TraitsType>
AssemblerX86Base<TraitsType>::~AssemblerX86Base() {
@@ -3913,5 +3913,5 @@
emitOperand(rm, operand);
}
-} // end of namespace X86NAMESPACE
+} // end of namespace X8664
} // end of namespace Ice
diff --git a/third_party/subzero/src/IceInstX8632.h b/third_party/subzero/src/IceInstX8632.h
index af6faef..98cf27f 100644
--- a/third_party/subzero/src/IceInstX8632.h
+++ b/third_party/subzero/src/IceInstX8632.h
@@ -28,12 +28,10 @@
#include "IceDefs.h"
#include "IceInst.h"
-#define X86NAMESPACE X8632
-#include "IceInstX86Base.h"
-#undef X86NAMESPACE
+#include "IceInstX8632Base.h"
#include "IceOperand.h"
#include "IceTargetLoweringX8632Traits.h"
-X86INSTS_DEFINE_STATIC_DATA(X8632, X8632::Traits)
+X86INSTS_DEFINE_STATIC_DATA(X8632::Traits)
#endif // SUBZERO_SRC_ICEINSTX8632_H
diff --git a/third_party/subzero/src/IceInstX86Base.h b/third_party/subzero/src/IceInstX8632Base.h
similarity index 99%
rename from third_party/subzero/src/IceInstX86Base.h
rename to third_party/subzero/src/IceInstX8632Base.h
index c20f394..1f6f84d 100644
--- a/third_party/subzero/src/IceInstX86Base.h
+++ b/third_party/subzero/src/IceInstX8632Base.h
@@ -1,4 +1,5 @@
-//===- subzero/src/IceInstX86Base.h - Generic x86 instructions -*- C++ -*--===//
+//===- subzero/src/IceInstX8632Base.h - Generic x86 instructions -*- C++
+//-*--===//
//
// The Subzero Code Generator
//
@@ -16,20 +17,15 @@
///
//===----------------------------------------------------------------------===//
-#ifndef SUBZERO_SRC_ICEINSTX86BASE_H
-#define SUBZERO_SRC_ICEINSTX86BASE_H
+#ifndef SUBZERO_SRC_ICEINSTX8632BASE_H
+#define SUBZERO_SRC_ICEINSTX8632BASE_H
#include "IceDefs.h"
#include "IceInst.h"
#include "IceOperand.h"
namespace Ice {
-
-#ifndef X86NAMESPACE
-#error "You must define the X86 Target namespace."
-#endif
-
-namespace X86NAMESPACE {
+namespace X8632 {
template <typename TraitsType> struct InstImpl {
using Traits = TraitsType;
@@ -3166,7 +3162,7 @@
/// struct Insts is a template that can be used to instantiate all the X86
/// instructions for a target with a simple
///
-/// using Insts = ::Ice::X86NAMESPACE::Insts<TraitsType>;
+/// using Insts = ::Ice::X8632::Insts<TraitsType>;
template <typename TraitsType> struct Insts {
using FakeRMW = typename InstImpl<TraitsType>::InstX86FakeRMW;
using Label = typename InstImpl<TraitsType>::InstX86Label;
@@ -3305,9 +3301,9 @@
/// emitters). Each X86 target needs to declare and define all of these, so the
/// macros below are provided so that, if something changes, all X86
/// targets will be updated automatically.
-#define X86INSTS_DEFINE_STATIC_DATA(X86NAMESPACE, TraitsType) \
+#define X86INSTS_DEFINE_STATIC_DATA(TraitsType) \
namespace Ice { \
- namespace X86NAMESPACE { \
+ namespace X8632 { \
/* In-place ops */ \
template <> \
template <> \
@@ -4101,9 +4097,9 @@
} \
}
-} // end of namespace X86NAMESPACE
+} // namespace X8632
} // end of namespace Ice
-#include "IceInstX86BaseImpl.h"
+#include "IceInstX8632BaseImpl.h"
-#endif // SUBZERO_SRC_ICEINSTX86BASE_H
+#endif // SUBZERO_SRC_ICEINSTX8632BASE_H
diff --git a/third_party/subzero/src/IceInstX86BaseImpl.h b/third_party/subzero/src/IceInstX8632BaseImpl.h
similarity index 99%
rename from third_party/subzero/src/IceInstX86BaseImpl.h
rename to third_party/subzero/src/IceInstX8632BaseImpl.h
index 99e5993..a77a6e0 100644
--- a/third_party/subzero/src/IceInstX86BaseImpl.h
+++ b/third_party/subzero/src/IceInstX8632BaseImpl.h
@@ -1,4 +1,5 @@
-//===- subzero/src/IceInstX86BaseImpl.h - Generic X86 instructions -*- C++ -*=//
+//===- subzero/src/IceInstX8632BaseImpl.h - Generic X86 instructions -*- C++
+//-*=//
//
// The Subzero Code Generator
//
@@ -12,23 +13,22 @@
///
//===----------------------------------------------------------------------===//
-#ifndef SUBZERO_SRC_ICEINSTX86BASEIMPL_H
-#define SUBZERO_SRC_ICEINSTX86BASEIMPL_H
+#ifndef SUBZERO_SRC_ICEINSTX8632BASEIMPL_H
+#define SUBZERO_SRC_ICEINSTX8632BASEIMPL_H
-#include "IceInstX86Base.h"
+#include "IceInstX8632Base.h"
-#include "IceAssemblerX86Base.h"
+#include "IceAssemblerX8632Base.h"
#include "IceCfg.h"
#include "IceCfgNode.h"
#include "IceDefs.h"
#include "IceInst.h"
#include "IceOperand.h"
#include "IceTargetLowering.h"
-#include "IceTargetLoweringX86Base.h"
+#include "IceTargetLoweringX8632Base.h"
namespace Ice {
-
-namespace X86NAMESPACE {
+namespace X8632 {
template <typename TraitsType>
const char *InstImpl<TraitsType>::InstX86Base::getWidthString(Type Ty) {
@@ -3112,8 +3112,7 @@
Str << "IACA_END";
}
-} // end of namespace X86NAMESPACE
-
+} // end of namespace X8632
} // end of namespace Ice
-#endif // SUBZERO_SRC_ICEINSTX86BASEIMPL_H
+#endif // SUBZERO_SRC_ICEINSTX8632BASEIMPL_H
diff --git a/third_party/subzero/src/IceInstX8664.h b/third_party/subzero/src/IceInstX8664.h
index 070c272..1ed80d7 100644
--- a/third_party/subzero/src/IceInstX8664.h
+++ b/third_party/subzero/src/IceInstX8664.h
@@ -26,12 +26,10 @@
#include "IceDefs.h"
#include "IceInst.h"
-#define X86NAMESPACE X8664
-#include "IceInstX86Base.h"
-#undef X86NAMESPACE
+#include "IceInstX8664Base.h"
#include "IceOperand.h"
#include "IceTargetLoweringX8664Traits.h"
-X86INSTS_DEFINE_STATIC_DATA(X8664, X8664::Traits)
+X86INSTS_DEFINE_STATIC_DATA(X8664::Traits)
#endif // SUBZERO_SRC_ICEINSTX8664_H
diff --git a/third_party/subzero/src/IceInstX86Base.h b/third_party/subzero/src/IceInstX8664Base.h
similarity index 99%
copy from third_party/subzero/src/IceInstX86Base.h
copy to third_party/subzero/src/IceInstX8664Base.h
index c20f394..e2d1560 100644
--- a/third_party/subzero/src/IceInstX86Base.h
+++ b/third_party/subzero/src/IceInstX8664Base.h
@@ -1,4 +1,5 @@
-//===- subzero/src/IceInstX86Base.h - Generic x86 instructions -*- C++ -*--===//
+//===- subzero/src/IceInstX8664Base.h - Generic x86 instructions -*- C++
+//-*--===//
//
// The Subzero Code Generator
//
@@ -16,20 +17,15 @@
///
//===----------------------------------------------------------------------===//
-#ifndef SUBZERO_SRC_ICEINSTX86BASE_H
-#define SUBZERO_SRC_ICEINSTX86BASE_H
+#ifndef SUBZERO_SRC_ICEINSTX8664BASE_H
+#define SUBZERO_SRC_ICEINSTX8664BASE_H
#include "IceDefs.h"
#include "IceInst.h"
#include "IceOperand.h"
namespace Ice {
-
-#ifndef X86NAMESPACE
-#error "You must define the X86 Target namespace."
-#endif
-
-namespace X86NAMESPACE {
+namespace X8664 {
template <typename TraitsType> struct InstImpl {
using Traits = TraitsType;
@@ -3166,7 +3162,7 @@
/// struct Insts is a template that can be used to instantiate all the X86
/// instructions for a target with a simple
///
-/// using Insts = ::Ice::X86NAMESPACE::Insts<TraitsType>;
+/// using Insts = ::Ice::X8664::Insts<TraitsType>;
template <typename TraitsType> struct Insts {
using FakeRMW = typename InstImpl<TraitsType>::InstX86FakeRMW;
using Label = typename InstImpl<TraitsType>::InstX86Label;
@@ -3305,9 +3301,9 @@
/// emitters). Each X86 target needs to declare and define all of these, so the
/// macros below are provided so that, if something changes, all X86
/// targets will be updated automatically.
-#define X86INSTS_DEFINE_STATIC_DATA(X86NAMESPACE, TraitsType) \
+#define X86INSTS_DEFINE_STATIC_DATA(TraitsType) \
namespace Ice { \
- namespace X86NAMESPACE { \
+ namespace X8664 { \
/* In-place ops */ \
template <> \
template <> \
@@ -4101,9 +4097,9 @@
} \
}
-} // end of namespace X86NAMESPACE
+} // namespace X8664
} // end of namespace Ice
-#include "IceInstX86BaseImpl.h"
+#include "IceInstX8664BaseImpl.h"
-#endif // SUBZERO_SRC_ICEINSTX86BASE_H
+#endif // SUBZERO_SRC_ICEINSTX8664BASE_H
diff --git a/third_party/subzero/src/IceInstX86BaseImpl.h b/third_party/subzero/src/IceInstX8664BaseImpl.h
similarity index 99%
copy from third_party/subzero/src/IceInstX86BaseImpl.h
copy to third_party/subzero/src/IceInstX8664BaseImpl.h
index 99e5993..0dcd88b 100644
--- a/third_party/subzero/src/IceInstX86BaseImpl.h
+++ b/third_party/subzero/src/IceInstX8664BaseImpl.h
@@ -1,4 +1,5 @@
-//===- subzero/src/IceInstX86BaseImpl.h - Generic X86 instructions -*- C++ -*=//
+//===- subzero/src/IceInstX8664BaseImpl.h - Generic X86 instructions -*- C++
+//-*=//
//
// The Subzero Code Generator
//
@@ -12,23 +13,22 @@
///
//===----------------------------------------------------------------------===//
-#ifndef SUBZERO_SRC_ICEINSTX86BASEIMPL_H
-#define SUBZERO_SRC_ICEINSTX86BASEIMPL_H
+#ifndef SUBZERO_SRC_ICEINSTX8664BASEIMPL_H
+#define SUBZERO_SRC_ICEINSTX8664BASEIMPL_H
-#include "IceInstX86Base.h"
+#include "IceInstX8664Base.h"
-#include "IceAssemblerX86Base.h"
+#include "IceAssemblerX8664Base.h"
#include "IceCfg.h"
#include "IceCfgNode.h"
#include "IceDefs.h"
#include "IceInst.h"
#include "IceOperand.h"
#include "IceTargetLowering.h"
-#include "IceTargetLoweringX86Base.h"
+#include "IceTargetLoweringX8664Base.h"
namespace Ice {
-
-namespace X86NAMESPACE {
+namespace X8664 {
template <typename TraitsType>
const char *InstImpl<TraitsType>::InstX86Base::getWidthString(Type Ty) {
@@ -3112,8 +3112,7 @@
Str << "IACA_END";
}
-} // end of namespace X86NAMESPACE
-
+} // end of namespace X8664
} // end of namespace Ice
-#endif // SUBZERO_SRC_ICEINSTX86BASEIMPL_H
+#endif // SUBZERO_SRC_ICEINSTX8664BASEIMPL_H
diff --git a/third_party/subzero/src/IceTargetLoweringX8632.h b/third_party/subzero/src/IceTargetLoweringX8632.h
index c057647..b4bffd3 100644
--- a/third_party/subzero/src/IceTargetLoweringX8632.h
+++ b/third_party/subzero/src/IceTargetLoweringX8632.h
@@ -21,9 +21,7 @@
#include "IceInstX8632.h"
#include "IceRegistersX8632.h"
#include "IceTargetLowering.h"
-#define X86NAMESPACE X8632
-#include "IceTargetLoweringX86Base.h"
-#undef X86NAMESPACE
+#include "IceTargetLoweringX8632Base.h"
#include "IceTargetLoweringX8632Traits.h"
namespace Ice {
diff --git a/third_party/subzero/src/IceTargetLoweringX86Base.h b/third_party/subzero/src/IceTargetLoweringX8632Base.h
similarity index 98%
rename from third_party/subzero/src/IceTargetLoweringX86Base.h
rename to third_party/subzero/src/IceTargetLoweringX8632Base.h
index 805465b..e619712 100644
--- a/third_party/subzero/src/IceTargetLoweringX86Base.h
+++ b/third_party/subzero/src/IceTargetLoweringX8632Base.h
@@ -1,4 +1,5 @@
-//===- subzero/src/IceTargetLoweringX86Base.h - x86 lowering ----*- C++ -*-===//
+//===- subzero/src/IceTargetLoweringX8632Base.h - x86 lowering ----*- C++
+//-*-===//
//
// The Subzero Code Generator
//
@@ -13,8 +14,8 @@
///
//===----------------------------------------------------------------------===//
-#ifndef SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H
-#define SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H
+#ifndef SUBZERO_SRC_ICETARGETLOWERINGX8632BASE_H
+#define SUBZERO_SRC_ICETARGETLOWERINGX8632BASE_H
#include "IceDefs.h"
#include "IceInst.h"
@@ -27,12 +28,8 @@
#include <type_traits>
#include <utility>
-#ifndef X86NAMESPACE
-#error "You must define the X86 Target namespace."
-#endif
-
namespace Ice {
-namespace X86NAMESPACE {
+namespace X8632 {
using namespace ::Ice::X86;
@@ -1051,9 +1048,9 @@
explicit TargetHeaderX86(GlobalContext *Ctx) : TargetHeaderLowering(Ctx) {}
};
-} // end of namespace X86NAMESPACE
+} // end of namespace X8632
} // end of namespace Ice
-#include "IceTargetLoweringX86BaseImpl.h"
+#include "IceTargetLoweringX8632BaseImpl.h"
-#endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H
+#endif // SUBZERO_SRC_ICETARGETLOWERINGX8632BASE_H
diff --git a/third_party/subzero/src/IceTargetLoweringX86BaseImpl.h b/third_party/subzero/src/IceTargetLoweringX8632BaseImpl.h
similarity index 99%
rename from third_party/subzero/src/IceTargetLoweringX86BaseImpl.h
rename to third_party/subzero/src/IceTargetLoweringX8632BaseImpl.h
index 5711cb9..ae776e1 100644
--- a/third_party/subzero/src/IceTargetLoweringX86BaseImpl.h
+++ b/third_party/subzero/src/IceTargetLoweringX8632BaseImpl.h
@@ -1,4 +1,5 @@
-//===- subzero/src/IceTargetLoweringX86BaseImpl.h - x86 lowering -*- C++ -*-==//
+//===- subzero/src/IceTargetLoweringX8632BaseImpl.h - x86 lowering -*- C++
+//-*-==//
//
// The Subzero Code Generator
//
@@ -13,8 +14,8 @@
///
//===----------------------------------------------------------------------===//
-#ifndef SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H
-#define SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H
+#ifndef SUBZERO_SRC_ICETARGETLOWERINGX8632BASEIMPL_H
+#define SUBZERO_SRC_ICETARGETLOWERINGX8632BASEIMPL_H
#include "IceCfg.h"
#include "IceCfgNode.h"
@@ -23,7 +24,7 @@
#include "IceELFObjectWriter.h"
#include "IceGlobalInits.h"
#include "IceInstVarIter.h"
-#include "IceInstX86Base.h"
+#include "IceInstX8632Base.h"
#include "IceLiveness.h"
#include "IceOperand.h"
#include "IcePhiLoweringImpl.h"
@@ -36,7 +37,7 @@
#include <stack>
namespace Ice {
-namespace X86NAMESPACE {
+namespace X8632 {
// The Microsoft x64 ABI requires the caller to allocate a 32 byte
// "shadow store" (aka "home space") so that the callee may copy the 4
@@ -4038,7 +4039,7 @@
return;
case Intrinsics::AtomicFenceAll:
// NOTE: FenceAll should prevent and load/store from being moved across the
- // fence (both atomic and non-atomic). The InstX8632Mfence instruction is
+ // fence (both atomic and non-atomic). The InstX86Mfence instruction is
// currently marked coarsely as "HasSideEffects".
_mfence();
return;
@@ -8175,7 +8176,7 @@
} break;
}
}
-} // end of namespace X86NAMESPACE
+} // namespace X8632
} // end of namespace Ice
-#endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H
+#endif // SUBZERO_SRC_ICETARGETLOWERINGX8632BASEIMPL_H
diff --git a/third_party/subzero/src/IceTargetLoweringX8664.h b/third_party/subzero/src/IceTargetLoweringX8664.h
index a392934..bac931b 100644
--- a/third_party/subzero/src/IceTargetLoweringX8664.h
+++ b/third_party/subzero/src/IceTargetLoweringX8664.h
@@ -21,9 +21,7 @@
#include "IceGlobalContext.h"
#include "IceInstX8664.h"
#include "IceTargetLowering.h"
-#define X86NAMESPACE X8664
-#include "IceTargetLoweringX86Base.h"
-#undef X86NAMESPACE
+#include "IceTargetLoweringX8664Base.h"
#include "IceTargetLoweringX8664Traits.h"
namespace Ice {
diff --git a/third_party/subzero/src/IceTargetLoweringX86Base.h b/third_party/subzero/src/IceTargetLoweringX8664Base.h
similarity index 98%
copy from third_party/subzero/src/IceTargetLoweringX86Base.h
copy to third_party/subzero/src/IceTargetLoweringX8664Base.h
index 805465b..d033b3f 100644
--- a/third_party/subzero/src/IceTargetLoweringX86Base.h
+++ b/third_party/subzero/src/IceTargetLoweringX8664Base.h
@@ -1,4 +1,5 @@
-//===- subzero/src/IceTargetLoweringX86Base.h - x86 lowering ----*- C++ -*-===//
+//===- subzero/src/IceTargetLoweringX8664Base.h - x86 lowering ----*- C++
+//-*-===//
//
// The Subzero Code Generator
//
@@ -13,8 +14,8 @@
///
//===----------------------------------------------------------------------===//
-#ifndef SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H
-#define SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H
+#ifndef SUBZERO_SRC_ICETARGETLOWERINGX8664BASE_H
+#define SUBZERO_SRC_ICETARGETLOWERINGX8664BASE_H
#include "IceDefs.h"
#include "IceInst.h"
@@ -27,12 +28,8 @@
#include <type_traits>
#include <utility>
-#ifndef X86NAMESPACE
-#error "You must define the X86 Target namespace."
-#endif
-
namespace Ice {
-namespace X86NAMESPACE {
+namespace X8664 {
using namespace ::Ice::X86;
@@ -1051,9 +1048,9 @@
explicit TargetHeaderX86(GlobalContext *Ctx) : TargetHeaderLowering(Ctx) {}
};
-} // end of namespace X86NAMESPACE
+} // end of namespace X8664
} // end of namespace Ice
-#include "IceTargetLoweringX86BaseImpl.h"
+#include "IceTargetLoweringX8664BaseImpl.h"
-#endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H
+#endif // SUBZERO_SRC_ICETARGETLOWERINGX8664BASE_H
diff --git a/third_party/subzero/src/IceTargetLoweringX86BaseImpl.h b/third_party/subzero/src/IceTargetLoweringX8664BaseImpl.h
similarity index 99%
copy from third_party/subzero/src/IceTargetLoweringX86BaseImpl.h
copy to third_party/subzero/src/IceTargetLoweringX8664BaseImpl.h
index 5711cb9..ca22a84 100644
--- a/third_party/subzero/src/IceTargetLoweringX86BaseImpl.h
+++ b/third_party/subzero/src/IceTargetLoweringX8664BaseImpl.h
@@ -1,4 +1,5 @@
-//===- subzero/src/IceTargetLoweringX86BaseImpl.h - x86 lowering -*- C++ -*-==//
+//===- subzero/src/IceTargetLoweringX8664BaseImpl.h - x86 lowering -*- C++
+//-*-==//
//
// The Subzero Code Generator
//
@@ -13,8 +14,8 @@
///
//===----------------------------------------------------------------------===//
-#ifndef SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H
-#define SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H
+#ifndef SUBZERO_SRC_ICETARGETLOWERINGX8664BASEIMPL_H
+#define SUBZERO_SRC_ICETARGETLOWERINGX8664BASEIMPL_H
#include "IceCfg.h"
#include "IceCfgNode.h"
@@ -23,7 +24,7 @@
#include "IceELFObjectWriter.h"
#include "IceGlobalInits.h"
#include "IceInstVarIter.h"
-#include "IceInstX86Base.h"
+#include "IceInstX8664Base.h"
#include "IceLiveness.h"
#include "IceOperand.h"
#include "IcePhiLoweringImpl.h"
@@ -36,7 +37,7 @@
#include <stack>
namespace Ice {
-namespace X86NAMESPACE {
+namespace X8664 {
// The Microsoft x64 ABI requires the caller to allocate a 32 byte
// "shadow store" (aka "home space") so that the callee may copy the 4
@@ -4038,7 +4039,7 @@
return;
case Intrinsics::AtomicFenceAll:
// NOTE: FenceAll should prevent and load/store from being moved across the
- // fence (both atomic and non-atomic). The InstX8632Mfence instruction is
+ // fence (both atomic and non-atomic). The InstX86Mfence instruction is
// currently marked coarsely as "HasSideEffects".
_mfence();
return;
@@ -8175,7 +8176,7 @@
} break;
}
}
-} // end of namespace X86NAMESPACE
+} // namespace X8664
} // end of namespace Ice
-#endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H
+#endif // SUBZERO_SRC_ICETARGETLOWERINGX8664BASEIMPL_H