Tom Stellard | 347ac79 | 2015-06-26 21:15:07 +0000 | [diff] [blame^] | 1 | //===-- AMDGPUBaseInfo.cpp - AMDGPU Base encoding information--------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | #include "AMDGPUBaseInfo.h" |
| 10 | #include "llvm/MC/SubtargetFeature.h" |
| 11 | |
| 12 | #define GET_SUBTARGETINFO_ENUM |
| 13 | #include "AMDGPUGenSubtargetInfo.inc" |
| 14 | #undef GET_SUBTARGETINFO_ENUM |
| 15 | |
| 16 | namespace llvm { |
| 17 | namespace AMDGPU { |
| 18 | |
| 19 | IsaVersion getIsaVersion(const FeatureBitset &Features) { |
| 20 | |
| 21 | if (Features.test(FeatureISAVersion7_0_0)) |
| 22 | return {7, 0, 0}; |
| 23 | |
| 24 | if (Features.test(FeatureISAVersion7_0_1)) |
| 25 | return {7, 0, 1}; |
| 26 | |
| 27 | if (Features.test(FeatureISAVersion8_0_0)) |
| 28 | return {8, 0, 0}; |
| 29 | |
| 30 | if (Features.test(FeatureISAVersion8_0_1)) |
| 31 | return {8, 0, 1}; |
| 32 | |
| 33 | return {0, 0, 0}; |
| 34 | } |
| 35 | |
| 36 | } // End namespace AMDGPU |
| 37 | } // End namespace llvm |