traits.hh revision 12109
18512Sgeoffrey.blake@arm.com/*
29545Sandreas.hansson@arm.com * Copyright (c) 2016 ARM Limited
38512Sgeoffrey.blake@arm.com * All rights reserved
48512Sgeoffrey.blake@arm.com *
58512Sgeoffrey.blake@arm.com * The license below extends only to copyright in the software and shall
68512Sgeoffrey.blake@arm.com * not be construed as granting a license to any other intellectual
78512Sgeoffrey.blake@arm.com * property including but not limited to intellectual property relating
88512Sgeoffrey.blake@arm.com * to a hardware implementation of the functionality of the software
98512Sgeoffrey.blake@arm.com * licensed hereunder.  You may use the software subject to the license
108512Sgeoffrey.blake@arm.com * terms below provided that you ensure that this notice is replicated
118512Sgeoffrey.blake@arm.com * unmodified and in its entirety in all distributions of the software,
128512Sgeoffrey.blake@arm.com * modified or unmodified, in source code or in binary form.
138512Sgeoffrey.blake@arm.com *
148512Sgeoffrey.blake@arm.com * Redistribution and use in source and binary forms, with or without
158512Sgeoffrey.blake@arm.com * modification, are permitted provided that the following conditions are
168512Sgeoffrey.blake@arm.com * met: redistributions of source code must retain the above copyright
178512Sgeoffrey.blake@arm.com * notice, this list of conditions and the following disclaimer;
188512Sgeoffrey.blake@arm.com * redistributions in binary form must reproduce the above copyright
198512Sgeoffrey.blake@arm.com * notice, this list of conditions and the following disclaimer in the
208512Sgeoffrey.blake@arm.com * documentation and/or other materials provided with the distribution;
218512Sgeoffrey.blake@arm.com * neither the name of the copyright holders nor the names of its
228512Sgeoffrey.blake@arm.com * contributors may be used to endorse or promote products derived from
238512Sgeoffrey.blake@arm.com * this software without specific prior written permission.
248512Sgeoffrey.blake@arm.com *
258512Sgeoffrey.blake@arm.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
268512Sgeoffrey.blake@arm.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
278512Sgeoffrey.blake@arm.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
288512Sgeoffrey.blake@arm.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
298512Sgeoffrey.blake@arm.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
308512Sgeoffrey.blake@arm.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
318512Sgeoffrey.blake@arm.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
328512Sgeoffrey.blake@arm.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
338512Sgeoffrey.blake@arm.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
348512Sgeoffrey.blake@arm.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
358512Sgeoffrey.blake@arm.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
368512Sgeoffrey.blake@arm.com *
378512Sgeoffrey.blake@arm.com * Authors: Rekai Gonzalez
388512Sgeoffrey.blake@arm.com */
398512Sgeoffrey.blake@arm.com
408512Sgeoffrey.blake@arm.com/* Auxiliary structs for architecture traits. */
418512Sgeoffrey.blake@arm.com
428512Sgeoffrey.blake@arm.com#ifndef __ARCH_COMMON_TRAITS_HH__
438512Sgeoffrey.blake@arm.com#define __ARCH_COMMON_TRAITS_HH__
448512Sgeoffrey.blake@arm.com
459525SAndreas.Sandberg@ARM.com#include "enums/VecRegRenameMode.hh"
468512Sgeoffrey.blake@arm.com
478512Sgeoffrey.blake@arm.com/** Helper structure to get the vector register mode for a given ISA.
488512Sgeoffrey.blake@arm.com * This way we implement a default 'full' mode, and only those ISA that care
498512Sgeoffrey.blake@arm.com * have to actually specialise the template to forward the call to the
508512Sgeoffrey.blake@arm.com * appropriate member of the ISA.
519808Sstever@gmail.com */
528512Sgeoffrey.blake@arm.comtemplate <typename ISA>
538512Sgeoffrey.blake@arm.comstruct initRenameMode
548512Sgeoffrey.blake@arm.com{
558512Sgeoffrey.blake@arm.com    static Enums::VecRegRenameMode mode(const ISA*) { return Enums::Full; }
568512Sgeoffrey.blake@arm.com    /**
578512Sgeoffrey.blake@arm.com     * Compare the initial rename mode of two instances of the ISA.
588512Sgeoffrey.blake@arm.com     * Result is true by definition, as the default mode is Full.
598512Sgeoffrey.blake@arm.com     * */
608512Sgeoffrey.blake@arm.com    static bool equals(const ISA*, const ISA*) { return true; }
618512Sgeoffrey.blake@arm.com};
628512Sgeoffrey.blake@arm.com
638512Sgeoffrey.blake@arm.com#endif /* __ARCH_COMMON_TRAITS_HH__ */
648512Sgeoffrey.blake@arm.com