|
| 1 | +/* |
| 2 | + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. |
| 3 | + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 4 | + * |
| 5 | + * This code is free software; you can redistribute it and/or modify it |
| 6 | + * under the terms of the GNU General Public License version 2 only, as |
| 7 | + * published by the Free Software Foundation. Oracle designates this |
| 8 | + * particular file as subject to the "Classpath" exception as provided |
| 9 | + * by Oracle in the LICENSE file that accompanied this code. |
| 10 | + * |
| 11 | + * This code is distributed in the hope that it will be useful, but WITHOUT |
| 12 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 13 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 14 | + * version 2 for more details (a copy is included in the LICENSE file that |
| 15 | + * accompanied this code). |
| 16 | + * |
| 17 | + * You should have received a copy of the GNU General Public License version |
| 18 | + * 2 along with this work; if not, write to the Free Software Foundation, |
| 19 | + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 | + * |
| 21 | + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
| 22 | + * or visit www.oracle.com if you need additional information or have any |
| 23 | + * questions. |
| 24 | + */ |
| 25 | + |
| 26 | +package org.graalvm.compiler.core.riscv64; |
| 27 | + |
| 28 | +import jdk.vm.ci.code.Register; |
| 29 | +import jdk.vm.ci.code.RegisterArray; |
| 30 | + |
| 31 | +public class ShadowedRISCV64 { |
| 32 | + public static final Class<?> riscv64 = RISCV64ReflectionUtil.getArch(false); |
| 33 | + public static final Class<?> riscv64OrNull = RISCV64ReflectionUtil.getArch(true); |
| 34 | + |
| 35 | + public static final Register x0 = getRegister("x0"); |
| 36 | + public static final Register x1 = getRegister("x1"); |
| 37 | + public static final Register x2 = getRegister("x2"); |
| 38 | + public static final Register x3 = getRegister("x3"); |
| 39 | + public static final Register x4 = getRegister("x4"); |
| 40 | + public static final Register x5 = getRegister("x5"); |
| 41 | + public static final Register x6 = getRegister("x6"); |
| 42 | + public static final Register x7 = getRegister("x7"); |
| 43 | + public static final Register x8 = getRegister("x8"); |
| 44 | + public static final Register x9 = getRegister("x9"); |
| 45 | + public static final Register x10 = getRegister("x10"); |
| 46 | + public static final Register x11 = getRegister("x11"); |
| 47 | + public static final Register x12 = getRegister("x12"); |
| 48 | + public static final Register x13 = getRegister("x13"); |
| 49 | + public static final Register x14 = getRegister("x14"); |
| 50 | + public static final Register x15 = getRegister("x15"); |
| 51 | + public static final Register x16 = getRegister("x16"); |
| 52 | + public static final Register x17 = getRegister("x17"); |
| 53 | + public static final Register x18 = getRegister("x18"); |
| 54 | + public static final Register x19 = getRegister("x19"); |
| 55 | + public static final Register x20 = getRegister("x20"); |
| 56 | + public static final Register x21 = getRegister("x21"); |
| 57 | + public static final Register x22 = getRegister("x22"); |
| 58 | + public static final Register x23 = getRegister("x23"); |
| 59 | + public static final Register x24 = getRegister("x24"); |
| 60 | + public static final Register x25 = getRegister("x25"); |
| 61 | + public static final Register x26 = getRegister("x26"); |
| 62 | + public static final Register x27 = getRegister("x27"); |
| 63 | + public static final Register x28 = getRegister("x28"); |
| 64 | + public static final Register x29 = getRegister("x29"); |
| 65 | + public static final Register x30 = getRegister("x30"); |
| 66 | + public static final Register x31 = getRegister("x31"); |
| 67 | + |
| 68 | + public static final Register f0 = getRegister("f0"); |
| 69 | + public static final Register f1 = getRegister("f1"); |
| 70 | + public static final Register f2 = getRegister("f2"); |
| 71 | + public static final Register f3 = getRegister("f3"); |
| 72 | + public static final Register f4 = getRegister("f4"); |
| 73 | + public static final Register f5 = getRegister("f5"); |
| 74 | + public static final Register f6 = getRegister("f6"); |
| 75 | + public static final Register f7 = getRegister("f7"); |
| 76 | + public static final Register f8 = getRegister("f8"); |
| 77 | + public static final Register f9 = getRegister("f9"); |
| 78 | + public static final Register f10 = getRegister("f10"); |
| 79 | + public static final Register f11 = getRegister("f11"); |
| 80 | + public static final Register f12 = getRegister("f12"); |
| 81 | + public static final Register f13 = getRegister("f13"); |
| 82 | + public static final Register f14 = getRegister("f14"); |
| 83 | + public static final Register f15 = getRegister("f15"); |
| 84 | + public static final Register f16 = getRegister("f16"); |
| 85 | + public static final Register f17 = getRegister("f17"); |
| 86 | + public static final Register f18 = getRegister("f18"); |
| 87 | + public static final Register f19 = getRegister("f19"); |
| 88 | + public static final Register f20 = getRegister("f20"); |
| 89 | + public static final Register f21 = getRegister("f21"); |
| 90 | + public static final Register f22 = getRegister("f22"); |
| 91 | + public static final Register f23 = getRegister("f23"); |
| 92 | + public static final Register f24 = getRegister("f24"); |
| 93 | + public static final Register f25 = getRegister("f25"); |
| 94 | + public static final Register f26 = getRegister("f26"); |
| 95 | + public static final Register f27 = getRegister("f27"); |
| 96 | + public static final Register f28 = getRegister("f28"); |
| 97 | + public static final Register f29 = getRegister("f29"); |
| 98 | + public static final Register f30 = getRegister("f30"); |
| 99 | + public static final Register f31 = getRegister("f31"); |
| 100 | + |
| 101 | + public static final RegisterArray allRegisters = riscv64OrNull == null ? null : RISCV64ReflectionUtil.readStaticField(riscv64OrNull, "allRegisters"); |
| 102 | + |
| 103 | + private static Register getRegister(String register) { |
| 104 | + return riscv64OrNull == null ? null : RISCV64ReflectionUtil.readStaticField(riscv64OrNull, register); |
| 105 | + } |
| 106 | +} |
0 commit comments