comparison graal/com.oracle.max.asmdis/src/com/sun/max/asm/gen/cisc/amd64/AMD64AssemblerGenerator.java @ 4142:bc8527f3071c

Adjust code base to new level of warnings.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sun, 18 Dec 2011 05:24:06 +0100
parents e233f5660da4
children
comparison
equal deleted inserted replaced
4141:04d21be7a24f 4142:bc8527f3071c
53 53
54 private static String basicRexValueAsString(X86Template template) { 54 private static String basicRexValueAsString(X86Template template) {
55 return Bytes.toHexLiteral(basicRexValue(template)); 55 return Bytes.toHexLiteral(basicRexValue(template));
56 } 56 }
57 57
58 private void printUnconditionalRexBit(IndentWriter writer, X86Parameter parameter, int bitIndex) { 58 private static void printUnconditionalRexBit(IndentWriter writer, X86Parameter parameter, int bitIndex) {
59 writer.print(REX_BYTE_NAME + " |= (" + parameter.valueString() + " & 8) >> " + (3 - bitIndex) + ";"); 59 writer.print(REX_BYTE_NAME + " |= (" + parameter.valueString() + " & 8) >> " + (3 - bitIndex) + ";");
60 writer.println(" // " + parameter.place().comment()); 60 writer.println(" // " + parameter.place().comment());
61 } 61 }
62 62
63 private void checkGeneralRegister8Values(IndentWriter writer, X86Template template) { 63 private static void checkGeneralRegister8Values(IndentWriter writer, X86Template template) {
64 for (X86Parameter parameter : template.parameters()) { 64 for (X86Parameter parameter : template.parameters()) {
65 if (parameter.type() == AMD64GeneralRegister8.class) { 65 if (parameter.type() == AMD64GeneralRegister8.class) {
66 writer.println("if (" + parameter.variableName() + ".isHighByte()) {"); 66 writer.println("if (" + parameter.variableName() + ".isHighByte()) {");
67 writer.indent(); 67 writer.indent();
68 writer.println("throw new IllegalArgumentException(\"Cannot encode \" + " + parameter.variableName() + ".name() + \" in the presence of a REX prefix\");"); 68 writer.println("throw new IllegalArgumentException(\"Cannot encode \" + " + parameter.variableName() + ".name() + \" in the presence of a REX prefix\");");
95 checkGeneralRegister8Values(writer, template); 95 checkGeneralRegister8Values(writer, template);
96 emitByte(writer, REX_BYTE_NAME); 96 emitByte(writer, REX_BYTE_NAME);
97 writer.println(); 97 writer.println();
98 } 98 }
99 99
100 private void printConditionalRexBit(IndentWriter writer, X86Template template, X86Parameter parameter, int bitIndex) { 100 private static void printConditionalRexBit(IndentWriter writer, X86Template template, X86Parameter parameter, int bitIndex) {
101 if (parameter.type() == AMD64GeneralRegister8.class) { 101 if (parameter.type() == AMD64GeneralRegister8.class) {
102 writer.println("if (" + parameter.variableName() + ".requiresRexPrefix()) {"); 102 writer.println("if (" + parameter.variableName() + ".requiresRexPrefix()) {");
103 writer.indent(); 103 writer.indent();
104 writer.println(REX_BYTE_NAME + " |= " + basicRexValueAsString(template) + ";"); 104 writer.println(REX_BYTE_NAME + " |= " + basicRexValueAsString(template) + ";");
105 writer.println("if (" + parameter.valueString() + " >= 8) {"); 105 writer.println("if (" + parameter.valueString() + " >= 8) {");