Selector.xcc

Benoit Dupont de Dinechin (Benoit.Dupont-de-Dinechinst.com). Christophe Guillon (Christophe.Guillonst.com).

Copyright 2002 - 2007 STMicroelectronics. Copyright 1995 - 1998 Commissariat a l'Energie Atomique.

This program is free software; you can redistribute it and/or modify it under the terms of either (at your option): the GNU General Public License (GPL) version 2; the GNU Lesser General Public License (LGPL) version 2.1; any later version of these licences as published by the Free Software Foundation.

Selector— Operation selector also used as Operation container of BasicBlock(s).
isBlock
True iff this Selector belongs to a BasicBlock.
struct Selector_ {
  //@args       Memory memory, void *procedure,
  //@args       Processor processor, bool isBlock
  IDList_ OPERATIONS[1];        // List of Operation(s) in this Selector.
  //@access MEMORY      IDList_memory(Selector_OPERATIONS(this))
  //@access COUNT       (IDList_count(Selector_OPERATIONS(this)))
  struct Procedure_ *PROCEDURE; // The Procedure this Selector belongs to.
  Processor PROCESSOR;  // Processor for which to select Operation(s).
  int8_t ISBLOCK;               // Equals -1 if this Selector is base of a BasicBlock.
  //@access BLOCKMASK   (intptr_t)Selector_ISBLOCK(this)
  //@access UGLYHACK    (uintptr_t)((Indexed)(this) - 1)
  //@access BASICBLOCK  (BasicBlock)(Selector_UGLYHACK(this) & Selector_BLOCKMASK(this))
  int32_t PHICOUNT;             // Number of PHI-operations in this Selector.
};
Selector_memory— This Selector Memory.
static inline Memory
Selector_memory(const_Selector this)
{
  return Selector_MEMORY(this);
}
Selector_procedure— This Selector Procedure.
static inline struct Procedure_ *
Selector_procedure(const_Selector this)
{
  return Selector_PROCEDURE(this);
}
Selector_setProcedure— Set this Selector Procedure.
static inline void
Selector_setProcedure(Selector this, struct Procedure_ *procedure)
{
  *Selector__PROCEDURE(this) = procedure;
}
Selector_processor— This Selector Processor.
static inline Processor
Selector_processor(const_Selector this)
{
  return Selector_PROCESSOR(this);
}
Selector_isEmpty— Test if this Selector is empty.
static inline bool
Selector_isEmpty(const_Selector this)
{
  return IDList_isEmpty(Selector_OPERATIONS(this));
}
Selector_countOperations— Count of Operation(s) in this Selector.
static inline int32_t
Selector_countOperations(const_Selector this)
{
  return IDList_count(Selector_OPERATIONS(this));
}
Selector_firstOperation— First operation of this Selector or NULL.
static inline Operation
Selector_firstOperation(const_Selector this)
{
  return (Operation)IDList_firstItem(Selector_OPERATIONS(this));
}
Selector_lastOperation— Last operation of this Selector or NULL.
static inline Operation
Selector_lastOperation(const_Selector this)
{
  return (Operation)IDList_lastItem(Selector_OPERATIONS(this));
}
Selector_operations— For use by Selector_FOREACH_Operation
static inline IDList
Selector_operations(Selector this)
{
  return Selector_OPERATIONS(this);
}
Selector_FOREACH_Operation— Iterate from first to last operation in this Selector.
#define Selector_FOREACH_Operation(this, operation) \
  IDList_FOREACH(Selector_operations(this), Operation_, operation)
#define Selector_ENDEACH_Operation \
  IDList_ENDEACH;
Selector_FORBACK_Operation— Iterate from last to first operation in this Selector.
#define Selector_FORBACK_Operation(this, operation) \
  IDList_FORBACK(Selector_operations(this), Operation_, operation)
#define Selector_ENDBACK_Operation \
  IDList_ENDBACK;
Selector_attachFirst— Attach a detached Operation first on this Selector.
void
Selector_attachFirst(Selector this, Operation operation);
Selector_attachLast— Attach a detached Operation last on this Selector.
void
Selector_attachLast(Selector this, Operation operation);
Selector_detachFirst— Detach the first Operation of this Selector.
Operation
Selector_detachFirst(Selector this);
Selector_detachLast— Detach the last Operation of this Selector.
Operation
Selector_detachLast(Selector this);
Selector_detachOperation— Detach an Operation from this Selector.

The detached Operation is left outside any Selector.

void
Selector_detachOperation(Selector this, Operation operation);
Selector_moveOperationFirst— Move this Selector Operation in first position.
void
Selector_moveOperationFirst(Selector this, Operation operation);
Selector_moveOperationLast— Move this Selector Operation in last position.
void
Selector_moveOperationLast(Selector this, Operation operation);
Selector_moveOperationBefore— Move this Selector Operation before another.
void
Selector_moveOperationBefore(Selector this, Operation before, Operation operation);
Selector_moveOperationAfter— Move this Selector Operation after another.
void
Selector_moveOperationAfter(Selector this, Operation after, Operation operation);
Selector_makeOperation_— Make a new Operation last on this Selector.

Low-level call, does not initialize the Operation arguments and results. The space for OPERANDS are allocated during this call. However, after calling Operation_resizeArguments or Operation_resizeResults, the OPERANDS may be reallocated in a different memory block.

Operation
Selector_makeOperation_(Selector this, Operator operator,
                        int32_t resCount, int32_t argCount,
                        const_RegisterSet clobberSet);

Selector_makeOperation_n_m -- Specializations of Selector_makeOperation.

Selector_makeOperation— Make a new Operation from this Selector.
Operation
Selector_makeOperation(Selector this, Operator operator,
                       int32_t resCount, int32_t argCount,
                       Temporary *results, Temporary *arguments,
                       const_RegisterSet clobberSet);
Selector_replicateOperation— Replicate an Operation from this Selector.

The Operation_INDEX of the new operation is the same.

Operation
Selector_replicateOperation(Selector this, const_Operation operation);
Selector_makeOperationLABEL— Make a LABEL Operation on this Selector.
Operation
Selector_makeOperationLABEL(Selector this, Label label);
Selector_makeOperationGOTO— Make a GOTO Operation on this Selector.
Operation
Selector_makeOperationGOTO(Selector this, Label label);
Selector_makeOperationLOOP— Make a LOOP Operation on this Selector.
Operation
Selector_makeOperationLOOP(Selector this, Label label);
Selector_makeOperationFALL— Make a FALL Operation on this Selector.
Operation
Selector_makeOperationFALL(Selector this, Label label);
Selector_makeOperationSKIP— Make a SKIP Operation on this Selector.
static inline Operation
Selector_makeOperationSKIP(Selector this)
{
  return Selector_makeOperation_0_0(this, Operator_SKIP);
}
Selector_makeOperationKILL— Make a KILL Operation on this Selector.
static inline Operation
Selector_makeOperationKILL(Selector this, Temporary result)
{
  return Selector_makeOperation_1_0(this, Operator_KILL, result);
}
Selector_makeOperationCOPY— Make a COPY Operation on this Selector.
static inline Operation
Selector_makeOperationCOPY(Selector this, Temporary result, Temporary argument)
{
  return Selector_makeOperation_1_1(this, Operator_COPY, result, argument);
}
Selector_makeOperationSELECT— Make a SELECT Operation on this Selector.
static inline Operation
Selector_makeOperationSELECT(Selector this,
                             Temporary result, Temporary condition,
                             Temporary if_true, Temporary if_false)
{
  return Selector_makeOperation_1_3(this, Operator_SELECT,
                                    result, condition, if_true, if_false);
}
Selector_makeOperationENTRY— Make a ENTRY Operation on this Selector.
static inline Operation
Selector_makeOperationENTRY(Selector this, int32_t maxCount)
{
  Operation operation =  Selector_makeOperation_(this, Operator_ENTRY, maxCount, 0, NULL);
  *Operation__RESCOUNT(operation) = *Operation__ARGCOUNT(operation) = 0;
  return operation;
}
Selector_makeOperationParCopy— Make a parallel copy Operation on this Selector.
Operation
Selector_makeOperationParCopy(Selector this, Operator operator, int32_t maxCount, bool registers);
Selector_selectLOAD— Select a load from memory at base+offset
void
Selector_selectLOAD(Selector this, NativeType nativeType, Temporary dst, Temporary base,
                    Temporary offset);
Selector_selectSTORE— Select a store from memory at base+offset
void
Selector_selectSTORE(Selector this, NativeType nativeType, Temporary src, Temporary base,
                     Temporary offset);
Selector_selectDirectLOAD— Select a direct load at address symbol+offset
void
Selector_selectDirectLOAD(Selector this, NativeType nativeType, Temporary dst,
                          Symbol symbol, int64_t offset);
Selector_selectDirectSTORE— Select a direct store at address symbol+offset
void
Selector_selectDirectSTORE(Selector this, NativeType nativeType, Temporary src,
                           Symbol symbol, int64_t offset);
Selector_selectCOPY— Select a copy between same RegFile Temporary(ies).
void
Selector_selectCOPY(Selector this, Temporary dst, Temporary src);
Selector_selectCOPYOnTrue— Select a copy between same RegFile Temporary(ies) predicated on true.
void
Selector_selectCOPYOnTrue(Selector this, Temporary predicate, Temporary dst, Temporary src);
Selector_selectCOPYOnFalse— Select a copy between same RegFile Temporary(ies) predicated on false.
void
Selector_selectCOPYOnFalse(Selector this, Temporary predicate, Temporary dst, Temporary src);
Selector_selectSWAP— Select a swap operation between same RegFile Temporary(ies). The sequence must not use additional temporaries.
void
Selector_selectSWAP(Selector this, Temporary dst1, Temporary dst2);
Selector_selectMOVE— Select a transfer between different RegFile Temporary(ies).
void
Selector_selectMOVE(Selector this, Temporary dst, Temporary src);
Selector_selectGOTO— Select a control transfer to label.
void
Selector_selectGOTO(Selector this, Label label);
Selector_selectGOTRUE— Generates code to implement a Go True
void
Selector_selectGOTRUE(Selector this, Temporary condition, Label label);
Selector_selectMAKEAbsolute— Select an absolute value into dst.
void
Selector_selectMAKEAbsolute(Selector this, NativeType nativeType, Temporary dst,
                            int64_t value);
Selector_selectMAKEAddress— Select a symbolic value+offset into dst.
void
Selector_selectMAKEAddress(Selector this, NativeType nativeType, Temporary dst,
                           Symbol symbol, int64_t offset);
Selector_selectLAND— Generates code to implement a logical AND
void
Selector_selectLAND(Selector this, Temporary dst, Temporary src1, Temporary src2);
Selector_selectLNOT— Generates code to implement a logical NOT
void
Selector_selectLNOT(Selector this, Temporary dst, Temporary src);
Selector_selectLOR— Generates code to implement a logical OR
void
Selector_selectLOR(Selector this, Temporary dst, Temporary src1, Temporary src2);
Selector_selectSELECT— Generates code to implement a select
void
Selector_selectSELECT(Selector this, Temporary dst, Temporary cond,
                      Temporary src1, Temporary src2);

st200-Selector.xcc

Christophe Guillon (Christophe.Guillonst.com). Benoit Dupont de Dinechin (Benoit.Dupont-de-Dinechinst.com).

Copyright 2002 - 2007 STMicroelectronics. Copyright 1995 - 1998 Commissariat a l'Energie Atomique.

This program is free software; you can redistribute it and/or modify it under the terms of either (at your option): the GNU General Public License (GPL) version 2; the GNU Lesser General Public License (LGPL) version 2.1; any later version of these licences as published by the Free Software Foundation.