Path: blob/21.2-virgl/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.h
4574 views
/*1* Copyright 2011 Christoph Bumiller2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice shall be included in11* all copies or substantial portions of the Software.12*13* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR14* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,15* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL16* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR17* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,18* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR19* OTHER DEALINGS IN THE SOFTWARE.20*/2122#include "codegen/nv50_ir_target.h"2324namespace nv50_ir {2526#define NVC0_BUILTIN_DIV_U32 027#define NVC0_BUILTIN_DIV_S32 128#define NVC0_BUILTIN_RCP_F64 229#define NVC0_BUILTIN_RSQ_F64 33031#define NVC0_BUILTIN_COUNT 43233class TargetNV50 : public Target34{35public:36TargetNV50(unsigned int chipset);3738virtual CodeEmitter *getCodeEmitter(Program::Type);3940virtual bool runLegalizePass(Program *, CGStage stage) const;4142virtual void getBuiltinCode(const uint32_t **code, uint32_t *size) const;4344virtual void parseDriverInfo(const struct nv50_ir_prog_info *,45const struct nv50_ir_prog_info_out *);4647virtual bool insnCanLoad(const Instruction *insn, int s,48const Instruction *ld) const;49virtual bool insnCanLoadOffset(const Instruction *insn, int s,50int offset) const;51virtual bool isOpSupported(operation, DataType) const;52virtual bool isAccessSupported(DataFile, DataType) const;53virtual bool isModSupported(const Instruction *, int s, Modifier) const;54virtual bool isSatSupported(const Instruction *) const;55virtual bool mayPredicate(const Instruction *, const Value *) const;5657virtual int getLatency(const Instruction *) const;58virtual int getThroughput(const Instruction *) const;5960virtual unsigned int getFileSize(DataFile) const;61virtual unsigned int getFileUnit(DataFile) const;6263virtual uint32_t getSVAddress(DataFile shaderFile, const Symbol *sv) const;6465uint32_t getBuiltinOffset(int builtin) const;6667private:68void initOpInfo();6970uint16_t sysvalLocation[SV_LAST + 1];71uint8_t wposMask;72};7374} // namespace nv50_ir757677