mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
8058880: Introduce identifier TEMP_DEF for effects in adl
Modified adlc sources. Reviewed-by: kvn, drchase
This commit is contained in:
parent
854f91fd5b
commit
1d9e66c743
4 changed files with 46 additions and 38 deletions
|
@ -1,5 +1,5 @@
|
||||||
//
|
//
|
||||||
// Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
// Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
//
|
//
|
||||||
// This code is free software; you can redistribute it and/or modify it
|
// This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -969,23 +969,22 @@ OperandForm *ArchDesc::constructOperand(const char *ident,
|
||||||
void ArchDesc::initBaseOpTypes() {
|
void ArchDesc::initBaseOpTypes() {
|
||||||
// Create OperandForm and assign type for each opcode.
|
// Create OperandForm and assign type for each opcode.
|
||||||
for (int i = 1; i < _last_machine_leaf; ++i) {
|
for (int i = 1; i < _last_machine_leaf; ++i) {
|
||||||
char *ident = (char *)NodeClassNames[i];
|
char *ident = (char *)NodeClassNames[i];
|
||||||
constructOperand(ident, true);
|
constructOperand(ident, true);
|
||||||
}
|
}
|
||||||
// Create InstructForm and assign type for each ideal instruction.
|
// Create InstructForm and assign type for each ideal instruction.
|
||||||
for ( int j = _last_machine_leaf+1; j < _last_opcode; ++j) {
|
for (int j = _last_machine_leaf+1; j < _last_opcode; ++j) {
|
||||||
char *ident = (char *)NodeClassNames[j];
|
char *ident = (char *)NodeClassNames[j];
|
||||||
if(!strcmp(ident, "ConI") || !strcmp(ident, "ConP") ||
|
if (!strcmp(ident, "ConI") || !strcmp(ident, "ConP") ||
|
||||||
!strcmp(ident, "ConN") || !strcmp(ident, "ConNKlass") ||
|
!strcmp(ident, "ConN") || !strcmp(ident, "ConNKlass") ||
|
||||||
!strcmp(ident, "ConF") || !strcmp(ident, "ConD") ||
|
!strcmp(ident, "ConF") || !strcmp(ident, "ConD") ||
|
||||||
!strcmp(ident, "ConL") || !strcmp(ident, "Con" ) ||
|
!strcmp(ident, "ConL") || !strcmp(ident, "Con" ) ||
|
||||||
!strcmp(ident, "Bool") ) {
|
!strcmp(ident, "Bool")) {
|
||||||
constructOperand(ident, true);
|
constructOperand(ident, true);
|
||||||
}
|
} else {
|
||||||
else {
|
InstructForm *insForm = new InstructForm(ident, true);
|
||||||
InstructForm *insForm = new InstructForm(ident, true);
|
// insForm->_opcode = nextUserOpType(ident);
|
||||||
// insForm->_opcode = nextUserOpType(ident);
|
_globalNames.Insert(ident, insForm);
|
||||||
_globalNames.Insert(ident,insForm);
|
|
||||||
addForm(insForm);
|
addForm(insForm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1038,6 +1037,9 @@ void ArchDesc::initBaseOpTypes() {
|
||||||
ident = "TEMP";
|
ident = "TEMP";
|
||||||
eForm = new Effect(ident);
|
eForm = new Effect(ident);
|
||||||
_globalNames.Insert(ident, eForm);
|
_globalNames.Insert(ident, eForm);
|
||||||
|
ident = "TEMP_DEF";
|
||||||
|
eForm = new Effect(ident);
|
||||||
|
_globalNames.Insert(ident, eForm);
|
||||||
ident = "CALL";
|
ident = "CALL";
|
||||||
eForm = new Effect(ident);
|
eForm = new Effect(ident);
|
||||||
_globalNames.Insert(ident, eForm);
|
_globalNames.Insert(ident, eForm);
|
||||||
|
@ -1050,8 +1052,8 @@ void ArchDesc::initBaseOpTypes() {
|
||||||
const char *idealName = NodeClassNames[idealIndex];
|
const char *idealName = NodeClassNames[idealIndex];
|
||||||
_idealIndex.Insert((void*) idealName, (void*) (intptr_t) idealIndex);
|
_idealIndex.Insert((void*) idealName, (void*) (intptr_t) idealIndex);
|
||||||
}
|
}
|
||||||
for ( idealIndex = _last_machine_leaf+1;
|
for (idealIndex = _last_machine_leaf+1;
|
||||||
idealIndex < _last_opcode; ++idealIndex) {
|
idealIndex < _last_opcode; ++idealIndex) {
|
||||||
const char *idealName = NodeClassNames[idealIndex];
|
const char *idealName = NodeClassNames[idealIndex];
|
||||||
_idealIndex.Insert((void*) idealName, (void*) (intptr_t) idealIndex);
|
_idealIndex.Insert((void*) idealName, (void*) (intptr_t) idealIndex);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1816,15 +1816,16 @@ void InsEncode::output(FILE *fp) {
|
||||||
|
|
||||||
//------------------------------Effect-----------------------------------------
|
//------------------------------Effect-----------------------------------------
|
||||||
static int effect_lookup(const char *name) {
|
static int effect_lookup(const char *name) {
|
||||||
if(!strcmp(name, "USE")) return Component::USE;
|
if (!strcmp(name, "USE")) return Component::USE;
|
||||||
if(!strcmp(name, "DEF")) return Component::DEF;
|
if (!strcmp(name, "DEF")) return Component::DEF;
|
||||||
if(!strcmp(name, "USE_DEF")) return Component::USE_DEF;
|
if (!strcmp(name, "USE_DEF")) return Component::USE_DEF;
|
||||||
if(!strcmp(name, "KILL")) return Component::KILL;
|
if (!strcmp(name, "KILL")) return Component::KILL;
|
||||||
if(!strcmp(name, "USE_KILL")) return Component::USE_KILL;
|
if (!strcmp(name, "USE_KILL")) return Component::USE_KILL;
|
||||||
if(!strcmp(name, "TEMP")) return Component::TEMP;
|
if (!strcmp(name, "TEMP")) return Component::TEMP;
|
||||||
if(!strcmp(name, "INVALID")) return Component::INVALID;
|
if (!strcmp(name, "TEMP_DEF")) return Component::TEMP_DEF;
|
||||||
if(!strcmp(name, "CALL")) return Component::CALL;
|
if (!strcmp(name, "INVALID")) return Component::INVALID;
|
||||||
assert( false,"Invalid effect name specified\n");
|
if (!strcmp(name, "CALL")) return Component::CALL;
|
||||||
|
assert(false,"Invalid effect name specified\n");
|
||||||
return Component::INVALID;
|
return Component::INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1836,6 +1837,7 @@ const char *Component::getUsedefName() {
|
||||||
case Component::USE_KILL: return "USE_KILL"; break;
|
case Component::USE_KILL: return "USE_KILL"; break;
|
||||||
case Component::KILL: return "KILL"; break;
|
case Component::KILL: return "KILL"; break;
|
||||||
case Component::TEMP: return "TEMP"; break;
|
case Component::TEMP: return "TEMP"; break;
|
||||||
|
case Component::TEMP_DEF: return "TEMP_DEF"; break;
|
||||||
case Component::DEF: return "DEF"; break;
|
case Component::DEF: return "DEF"; break;
|
||||||
case Component::CALL: return "CALL"; break;
|
case Component::CALL: return "CALL"; break;
|
||||||
default: assert(false, "unknown effect");
|
default: assert(false, "unknown effect");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -910,13 +910,16 @@ public:
|
||||||
public:
|
public:
|
||||||
// Implementation depends upon working bit intersection and union.
|
// Implementation depends upon working bit intersection and union.
|
||||||
enum use_def_enum {
|
enum use_def_enum {
|
||||||
INVALID = 0x0,
|
INVALID = 0x0,
|
||||||
USE = 0x1,
|
USE = 0x1,
|
||||||
DEF = 0x2, USE_DEF = 0x3,
|
DEF = 0x2,
|
||||||
KILL = 0x4, USE_KILL = 0x5,
|
USE_DEF = USE | DEF,
|
||||||
|
KILL = 0x4,
|
||||||
|
USE_KILL = USE | KILL,
|
||||||
SYNTHETIC = 0x8,
|
SYNTHETIC = 0x8,
|
||||||
TEMP = USE | SYNTHETIC,
|
TEMP = USE | SYNTHETIC,
|
||||||
CALL = 0x10
|
TEMP_DEF = TEMP | DEF,
|
||||||
|
CALL = 0x10
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1715,13 +1715,14 @@ void ArchDesc::defineExpand(FILE *fp, InstructForm *node) {
|
||||||
bool declared_def = false;
|
bool declared_def = false;
|
||||||
bool declared_kill = false;
|
bool declared_kill = false;
|
||||||
|
|
||||||
while( (comp = node->_components.iter()) != NULL ) {
|
while ((comp = node->_components.iter()) != NULL) {
|
||||||
// Lookup register class associated with operand type
|
// Lookup register class associated with operand type
|
||||||
Form *form = (Form*)_globalNames[comp->_type];
|
Form *form = (Form*)_globalNames[comp->_type];
|
||||||
assert( form, "component type must be a defined form");
|
assert(form, "component type must be a defined form");
|
||||||
OperandForm *op = form->is_operand();
|
OperandForm *op = form->is_operand();
|
||||||
|
|
||||||
if (comp->is(Component::TEMP)) {
|
if (comp->is(Component::TEMP) ||
|
||||||
|
comp->is(Component::TEMP_DEF)) {
|
||||||
fprintf(fp, " // TEMP %s\n", comp->_name);
|
fprintf(fp, " // TEMP %s\n", comp->_name);
|
||||||
if (!declared_def) {
|
if (!declared_def) {
|
||||||
// Define the variable "def" to hold new MachProjNodes
|
// Define the variable "def" to hold new MachProjNodes
|
||||||
|
@ -1750,7 +1751,7 @@ void ArchDesc::defineExpand(FILE *fp, InstructForm *node) {
|
||||||
declared_kill = true;
|
declared_kill = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert( op, "Support additional KILLS for base operands");
|
assert(op, "Support additional KILLS for base operands");
|
||||||
const char *regmask = reg_mask(*op);
|
const char *regmask = reg_mask(*op);
|
||||||
const char *ideal_type = op->ideal_type(_globalNames, _register);
|
const char *ideal_type = op->ideal_type(_globalNames, _register);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue