/ assembler / X86Registers.h
X86Registers.h
 1  /*
 2   * Copyright (C) 2019 Metrological Group B.V.
 3   * Copyright (C) 2019 Igalia S.L.
 4   *
 5   * Redistribution and use in source and binary forms, with or without
 6   * modification, are permitted provided that the following conditions
 7   * are met:
 8   * 1. Redistributions of source code must retain the above copyright
 9   *    notice, this list of conditions and the following disclaimer.
10   * 2. Redistributions in binary form must reproduce the above copyright
11   *    notice, this list of conditions and the following disclaimer in the
12   *    documentation and/or other materials provided with the distribution.
13   *
14   * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
15   * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17   * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
18   * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19   * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20   * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21   * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22   * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
25   */
26  
27  #pragma once
28  
29  #include <wtf/Platform.h>
30  
31  #define RegisterNames X86Registers
32  
33  #define FOR_EACH_REGISTER(macro)                \
34      FOR_EACH_GP_REGISTER(macro)                 \
35      FOR_EACH_FP_REGISTER(macro)
36  
37  #define FOR_EACH_GP_REGISTER(macro)             \
38      macro(eax, "eax", 0, 0)                     \
39      macro(ecx, "ecx", 0, 0)                     \
40      macro(edx, "edx", 0, 0)                     \
41      macro(ebx, "ebx", 0, 1)                     \
42      macro(esp, "esp", 0, 0)                     \
43      macro(ebp, "ebp", 0, 1)                     \
44      macro(esi, "esi", 0, 1)                     \
45      macro(edi, "edi", 0, 1)
46  
47  #define FOR_EACH_FP_REGISTER(macro)             \
48      macro(xmm0, "xmm0", 0, 0)                   \
49      macro(xmm1, "xmm1", 0, 0)                   \
50      macro(xmm2, "xmm2", 0, 0)                   \
51      macro(xmm3, "xmm3", 0, 0)                   \
52      macro(xmm4, "xmm4", 0, 0)                   \
53      macro(xmm5, "xmm5", 0, 0)                   \
54      macro(xmm6, "xmm6", 0, 0)                   \
55      macro(xmm7, "xmm7", 0, 0)
56  
57  #define FOR_EACH_SP_REGISTER(macro)             \
58      macro(eip,    "eip",    0, 0)               \
59      macro(eflags, "eflags", 0, 0)
60