blob: 6437474b0ec2f12b588e1f60d4aeb58bb28095ad [file] [log] [blame]
Jim Stichnoth5bff61c2015-10-28 09:26:00 -07001//===- subzero/src/IceRegList.h - Register list macro defs -----*- C++ -*-===//
2//
3// The Subzero Code Generator
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
Jim Stichnoth92a6e5b2015-12-02 16:52:44 -080010/// \file
11/// \brief Defines the REGLIST*() macros used in the IceInst*.def files.
12///
Jim Stichnoth5bff61c2015-10-28 09:26:00 -070013//===----------------------------------------------------------------------===//
14
15#ifndef SUBZERO_SRC_ICEINSTREGLIST_H
16#define SUBZERO_SRC_ICEINSTREGLIST_H
17
18// REGLISTn is a family of macros that we use to define register aliasing. "n"
19// indicates how many register aliases are being provided to the macro. It
20// assumes the parameters are register names declared in the "ns"
21// namespace/class, but with the common "Reg_" prefix removed for brevity.
John Porto4a308ce2015-12-30 09:55:04 -080022#define NO_ALIASES() \
23 {}
Jim Stichnoth5bff61c2015-10-28 09:26:00 -070024#define REGLIST1(ns, r0) \
25 { ns::Reg_##r0 }
26#define REGLIST2(ns, r0, r1) \
27 { ns::Reg_##r0, ns::Reg_##r1 }
28#define REGLIST3(ns, r0, r1, r2) \
29 { ns::Reg_##r0, ns::Reg_##r1, ns::Reg_##r2 }
30#define REGLIST4(ns, r0, r1, r2, r3) \
31 { ns::Reg_##r0, ns::Reg_##r1, ns::Reg_##r2, ns::Reg_##r3 }
John Porto2187c842015-12-16 07:48:25 -080032#define REGLIST7(ns, r0, r1, r2, r3, r4, r5, r6) \
Jim Stichnoth5bff61c2015-10-28 09:26:00 -070033 { \
34 ns::Reg_##r0, ns::Reg_##r1, ns::Reg_##r2, ns::Reg_##r3, ns::Reg_##r4, \
John Porto2187c842015-12-16 07:48:25 -080035 ns::Reg_##r5, ns::Reg_##r6 \
Jim Stichnoth5bff61c2015-10-28 09:26:00 -070036 }
37
38#endif // SUBZERO_SRC_ICEINSTREGLIST_H