traits.hh revision 13601
12810Srdreslin@umich.edu/* 212500Snikos.nikoleris@arm.com * Copyright (c) 2016 ARM Limited 311051Sandreas.hansson@arm.com * All rights reserved 411051Sandreas.hansson@arm.com * 511051Sandreas.hansson@arm.com * The license below extends only to copyright in the software and shall 611051Sandreas.hansson@arm.com * not be construed as granting a license to any other intellectual 711051Sandreas.hansson@arm.com * property including but not limited to intellectual property relating 811051Sandreas.hansson@arm.com * to a hardware implementation of the functionality of the software 911051Sandreas.hansson@arm.com * licensed hereunder. You may use the software subject to the license 1011051Sandreas.hansson@arm.com * terms below provided that you ensure that this notice is replicated 1111051Sandreas.hansson@arm.com * unmodified and in its entirety in all distributions of the software, 1211051Sandreas.hansson@arm.com * modified or unmodified, in source code or in binary form. 1311051Sandreas.hansson@arm.com * 1411051Sandreas.hansson@arm.com * Redistribution and use in source and binary forms, with or without 1511051Sandreas.hansson@arm.com * modification, are permitted provided that the following conditions are 162810Srdreslin@umich.edu * met: redistributions of source code must retain the above copyright 172810Srdreslin@umich.edu * notice, this list of conditions and the following disclaimer; 182810Srdreslin@umich.edu * redistributions in binary form must reproduce the above copyright 192810Srdreslin@umich.edu * notice, this list of conditions and the following disclaimer in the 202810Srdreslin@umich.edu * documentation and/or other materials provided with the distribution; 212810Srdreslin@umich.edu * neither the name of the copyright holders nor the names of its 222810Srdreslin@umich.edu * contributors may be used to endorse or promote products derived from 232810Srdreslin@umich.edu * this software without specific prior written permission. 242810Srdreslin@umich.edu * 252810Srdreslin@umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 262810Srdreslin@umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 272810Srdreslin@umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 282810Srdreslin@umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 292810Srdreslin@umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 302810Srdreslin@umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 312810Srdreslin@umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 322810Srdreslin@umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 332810Srdreslin@umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 342810Srdreslin@umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 352810Srdreslin@umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 362810Srdreslin@umich.edu * 372810Srdreslin@umich.edu * Authors: Rekai Gonzalez 382810Srdreslin@umich.edu */ 392810Srdreslin@umich.edu 402810Srdreslin@umich.edu/* Auxiliary structs for architecture traits. */ 412810Srdreslin@umich.edu 4211051Sandreas.hansson@arm.com#ifndef __ARCH_COMMON_TRAITS_HH__ 4311051Sandreas.hansson@arm.com#define __ARCH_COMMON_TRAITS_HH__ 442810Srdreslin@umich.edu 4511051Sandreas.hansson@arm.com#include "arch/types.hh" 4611051Sandreas.hansson@arm.com#include "enums/VecRegRenameMode.hh" 4712349Snikos.nikoleris@arm.com 482810Srdreslin@umich.edu/** Helper structure to get the vector register mode for a given ISA. 492810Srdreslin@umich.edu * This way we implement a default 'full' mode, and only those ISA that care 502810Srdreslin@umich.edu * have to actually specialise the template to forward the call to the 512810Srdreslin@umich.edu * appropriate member of the ISA. 5211051Sandreas.hansson@arm.com */ 532810Srdreslin@umich.edutemplate <typename ISA> 542810Srdreslin@umich.edustruct RenameMode 5511051Sandreas.hansson@arm.com{ 562810Srdreslin@umich.edu static Enums::VecRegRenameMode init(const ISA*) { return Enums::Full; } 5712334Sgabeblack@google.com 5811051Sandreas.hansson@arm.com static Enums::VecRegRenameMode 5911051Sandreas.hansson@arm.com mode(const TheISA::PCState&) 6011051Sandreas.hansson@arm.com { return Enums::Full; } 6111051Sandreas.hansson@arm.com 6211288Ssteve.reinhardt@amd.com /** 6311051Sandreas.hansson@arm.com * Compare the initial rename mode of two instances of the ISA. 6411051Sandreas.hansson@arm.com * Result is true by definition, as the default mode is Full. 6511051Sandreas.hansson@arm.com * */ 6611051Sandreas.hansson@arm.com static bool equalsInit(const ISA*, const ISA*) { return true; } 6711051Sandreas.hansson@arm.com}; 6811053Sandreas.hansson@arm.com 6911053Sandreas.hansson@arm.com#endif /* __ARCH_COMMON_TRAITS_HH__ */ 7011051Sandreas.hansson@arm.com