1 /*
   2  * Copyright (c) 2002, 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.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores,
  20  * CA 94065 USA or visit www.oracle.com if you need additional information or
  21  * have any questions.
  22  *
  23  */
  24 
  25 package sun.jvm.hotspot.asm.sparc;
  26 
  27 import sun.jvm.hotspot.utilities.Assert;
  28 
  29 public class SPARCFloatRegisters {
  30     public static int getNumRegisters() {
  31         return 64;
  32     }
  33 
  34     public static SPARCFloatRegister getRegister(int i) {
  35         Assert.that(i >= 0 && i < 64, "float register number is invalid");
  36         return registers[i];
  37     }
  38 
  39     public static String getRegisterName(int i) {
  40         return "%f" + i;
  41     }
  42 
  43     public static final SPARCFloatRegister F0;
  44     public static final SPARCFloatRegister F1;
  45     public static final SPARCFloatRegister F2;
  46     public static final SPARCFloatRegister F3;
  47     public static final SPARCFloatRegister F4;
  48     public static final SPARCFloatRegister F5;
  49     public static final SPARCFloatRegister F6;
  50     public static final SPARCFloatRegister F7;
  51     public static final SPARCFloatRegister F8;
  52     public static final SPARCFloatRegister F9;
  53     public static final SPARCFloatRegister F10;
  54     public static final SPARCFloatRegister F11;
  55     public static final SPARCFloatRegister F12;
  56     public static final SPARCFloatRegister F13;
  57     public static final SPARCFloatRegister F14;
  58     public static final SPARCFloatRegister F15;
  59     public static final SPARCFloatRegister F16;
  60     public static final SPARCFloatRegister F17;
  61     public static final SPARCFloatRegister F18;
  62     public static final SPARCFloatRegister F19;
  63     public static final SPARCFloatRegister F20;
  64     public static final SPARCFloatRegister F21;
  65     public static final SPARCFloatRegister F22;
  66     public static final SPARCFloatRegister F23;
  67     public static final SPARCFloatRegister F24;
  68     public static final SPARCFloatRegister F25;
  69     public static final SPARCFloatRegister F26;
  70     public static final SPARCFloatRegister F27;
  71     public static final SPARCFloatRegister F28;
  72     public static final SPARCFloatRegister F29;
  73     public static final SPARCFloatRegister F30;
  74     public static final SPARCFloatRegister F31;
  75     public static final SPARCFloatRegister F32;
  76     public static final SPARCFloatRegister F34;
  77     public static final SPARCFloatRegister F36;
  78     public static final SPARCFloatRegister F38;
  79     public static final SPARCFloatRegister F40;
  80     public static final SPARCFloatRegister F42;
  81     public static final SPARCFloatRegister F44;
  82     public static final SPARCFloatRegister F46;
  83     public static final SPARCFloatRegister F48;
  84     public static final SPARCFloatRegister F50;
  85     public static final SPARCFloatRegister F52;
  86     public static final SPARCFloatRegister F54;
  87     public static final SPARCFloatRegister F56;
  88     public static final SPARCFloatRegister F58;
  89     public static final SPARCFloatRegister F60;
  90     public static final SPARCFloatRegister F62;
  91     public static final int NUM_REGISTERS = 64;
  92     private static final SPARCFloatRegister registers[];
  93 
  94     static {
  95         F0 = new SPARCFloatRegister(0);
  96         F1 = new SPARCFloatRegister(1);
  97         F2 = new SPARCFloatRegister(2);
  98         F3 = new SPARCFloatRegister(3);
  99         F4 = new SPARCFloatRegister(4);
 100         F5 = new SPARCFloatRegister(5);
 101         F6 = new SPARCFloatRegister(6);
 102         F7 = new SPARCFloatRegister(7);
 103         F8 = new SPARCFloatRegister(8);
 104         F9 = new SPARCFloatRegister(9);
 105         F10 = new SPARCFloatRegister(10);
 106         F11 = new SPARCFloatRegister(11);
 107         F12 = new SPARCFloatRegister(12);
 108         F13 = new SPARCFloatRegister(13);
 109         F14 = new SPARCFloatRegister(14);
 110         F15 = new SPARCFloatRegister(15);
 111         F16 = new SPARCFloatRegister(16);
 112         F17 = new SPARCFloatRegister(17);
 113         F18 = new SPARCFloatRegister(18);
 114         F19 = new SPARCFloatRegister(19);
 115         F20 = new SPARCFloatRegister(20);
 116         F21 = new SPARCFloatRegister(21);
 117         F22 = new SPARCFloatRegister(22);
 118         F23 = new SPARCFloatRegister(23);
 119         F24 = new SPARCFloatRegister(24);
 120         F25 = new SPARCFloatRegister(25);
 121         F26 = new SPARCFloatRegister(26);
 122         F27 = new SPARCFloatRegister(27);
 123         F28 = new SPARCFloatRegister(28);
 124         F29 = new SPARCFloatRegister(29);
 125         F30 = new SPARCFloatRegister(30);
 126         F31 = new SPARCFloatRegister(31);
 127         F32 = new SPARCFloatRegister(32);
 128         F34 = new SPARCFloatRegister(34);
 129         F36 = new SPARCFloatRegister(36);
 130         F38 = new SPARCFloatRegister(38);
 131         F40 = new SPARCFloatRegister(40);
 132         F42 = new SPARCFloatRegister(42);
 133         F44 = new SPARCFloatRegister(44);
 134         F46 = new SPARCFloatRegister(46);
 135         F48 = new SPARCFloatRegister(48);
 136         F50 = new SPARCFloatRegister(50);
 137         F52 = new SPARCFloatRegister(52);
 138         F54 = new SPARCFloatRegister(54);
 139         F56 = new SPARCFloatRegister(56);
 140         F58 = new SPARCFloatRegister(58);
 141         F60 = new SPARCFloatRegister(60);
 142         F62 = new SPARCFloatRegister(62);
 143         registers = (new SPARCFloatRegister[] {
 144             F0, F2, F3, F4, F5, F6, F7, F8, F9, F10,
 145             F11, F12, F13, F14, F15, F16, F17, F18, F19, F20,
 146             F21, F22, F23, F24, F25, F26, F27, F28, F29, F30,
 147             F31, F32, null, F34, null, F36, null, F38, null, F40,
 148             null, F42, null, F44, null, F46, null, F48, null, F50,
 149             null, F52, null, F54, null, F56, null, F58, null, F60,
 150             null, F62, null
 151         });
 152     }
 153 }