Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/AMDGPU/Utils/AMDKernelCodeTUtils.cpp
Line
Count
Source (jump to first uncovered line)
1
//===- AMDKernelCodeTUtils.cpp --------------------------------------------===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
/// \file - utility functions to parse/print amd_kernel_code_t structure
10
//
11
//===----------------------------------------------------------------------===//
12
13
#include "AMDKernelCodeTUtils.h"
14
#include "SIDefines.h"
15
#include "llvm/ADT/ArrayRef.h"
16
#include "llvm/ADT/StringMap.h"
17
#include "llvm/ADT/StringRef.h"
18
#include "llvm/MC/MCParser/MCAsmLexer.h"
19
#include "llvm/MC/MCParser/MCAsmParser.h"
20
#include "llvm/Support/raw_ostream.h"
21
#include <cassert>
22
#include <cstdint>
23
#include <utility>
24
25
using namespace llvm;
26
27
61.3k
static ArrayRef<StringRef> get_amd_kernel_code_t_FldNames() {
28
61.3k
  static StringRef const Table[] = {
29
61.3k
    "", // not found placeholder
30
4.05M
#define RECORD(name, altName, print, parse) #name
31
61.3k
#include "AMDKernelCodeTInfo.h"
32
61.3k
#undef RECORD
33
61.3k
  };
34
61.3k
  return makeArrayRef(Table);
35
61.3k
}
36
37
13
static ArrayRef<StringRef> get_amd_kernel_code_t_FldAltNames() {
38
13
  static StringRef const Table[] = {
39
13
    "", // not found placeholder
40
858
#define RECORD(name, altName, print, parse) #altName
41
13
#include "AMDKernelCodeTInfo.h"
42
13
#undef RECORD
43
13
  };
44
13
  return makeArrayRef(Table);
45
13
}
46
47
static StringMap<int> createIndexMap(const ArrayRef<StringRef> &names,
48
13
                                     const ArrayRef<StringRef> &altNames) {
49
13
  StringMap<int> map;
50
13
  assert(names.size() == altNames.size());
51
884
  for (unsigned i = 0; i < names.size(); 
++i871
) {
52
871
    map.insert(std::make_pair(names[i], i));
53
871
    map.insert(std::make_pair(altNames[i], i));
54
871
  }
55
13
  return map;
56
13
}
57
58
456
static int get_amd_kernel_code_t_FieldIndex(StringRef name) {
59
456
  static const auto map = createIndexMap(get_amd_kernel_code_t_FldNames(),
60
456
                                         get_amd_kernel_code_t_FldAltNames());
61
456
  return map.lookup(name) - 1; // returns -1 if not found
62
456
}
63
64
61.3k
static StringRef get_amd_kernel_code_t_FieldName(int index) {
65
61.3k
  return get_amd_kernel_code_t_FldNames()[index + 1];
66
61.3k
}
67
68
// Field printing
69
70
61.3k
static raw_ostream &printName(raw_ostream &OS, StringRef Name) {
71
61.3k
  return OS << Name << " = ";
72
61.3k
}
73
74
template <typename T, T amd_kernel_code_t::*ptr>
75
static void printField(StringRef Name, const amd_kernel_code_t &C,
76
25.1k
                       raw_ostream &OS) {
77
25.1k
  printName(OS, Name) << (int)(C.*ptr);
78
25.1k
}
AMDKernelCodeTUtils.cpp:void printField<unsigned int, &(amd_kernel_code_s::amd_kernel_code_version_major)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned int, &(amd_kernel_code_s::amd_kernel_code_version_minor)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned short, &(amd_kernel_code_s::amd_machine_kind)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned short, &(amd_kernel_code_s::amd_machine_version_major)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned short, &(amd_kernel_code_s::amd_machine_version_minor)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned short, &(amd_kernel_code_s::amd_machine_version_stepping)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<long long, &(amd_kernel_code_s::kernel_code_entry_byte_offset)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned long long, &(amd_kernel_code_s::kernel_code_prefetch_byte_size)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned int, &(amd_kernel_code_s::workitem_private_segment_byte_size)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned int, &(amd_kernel_code_s::workgroup_group_segment_byte_size)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned int, &(amd_kernel_code_s::gds_segment_byte_size)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned long long, &(amd_kernel_code_s::kernarg_segment_byte_size)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned int, &(amd_kernel_code_s::workgroup_fbarrier_count)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned short, &(amd_kernel_code_s::wavefront_sgpr_count)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned short, &(amd_kernel_code_s::workitem_vgpr_count)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned short, &(amd_kernel_code_s::reserved_vgpr_first)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned short, &(amd_kernel_code_s::reserved_vgpr_count)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned short, &(amd_kernel_code_s::reserved_sgpr_first)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned short, &(amd_kernel_code_s::reserved_sgpr_count)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned short, &(amd_kernel_code_s::debug_wavefront_private_segment_offset_sgpr)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned short, &(amd_kernel_code_s::debug_private_segment_buffer_sgpr)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned char, &(amd_kernel_code_s::kernarg_segment_alignment)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned char, &(amd_kernel_code_s::group_segment_alignment)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned char, &(amd_kernel_code_s::private_segment_alignment)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned char, &(amd_kernel_code_s::wavefront_size)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<int, &(amd_kernel_code_s::call_convention)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
AMDKernelCodeTUtils.cpp:void printField<unsigned long long, &(amd_kernel_code_s::runtime_loader_kernel_symbol)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
76
930
                       raw_ostream &OS) {
77
930
  printName(OS, Name) << (int)(C.*ptr);
78
930
}
79
80
template <typename T, T amd_kernel_code_t::*ptr, int shift, int width = 1>
81
static void printBitField(StringRef Name, const amd_kernel_code_t &c,
82
15.8k
                          raw_ostream &OS) {
83
15.8k
  const auto Mask = (static_cast<T>(1) << width) - 1;
84
15.8k
  printName(OS, Name) << (int)((c.*ptr >> shift) & Mask);
85
15.8k
}
AMDKernelCodeTUtils.cpp:void printBitField<unsigned int, &(amd_kernel_code_s::code_properties), 0, 1>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
82
930
                          raw_ostream &OS) {
83
930
  const auto Mask = (static_cast<T>(1) << width) - 1;
84
930
  printName(OS, Name) << (int)((c.*ptr >> shift) & Mask);
85
930
}
AMDKernelCodeTUtils.cpp:void printBitField<unsigned int, &(amd_kernel_code_s::code_properties), 1, 1>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
82
930
                          raw_ostream &OS) {
83
930
  const auto Mask = (static_cast<T>(1) << width) - 1;
84
930
  printName(OS, Name) << (int)((c.*ptr >> shift) & Mask);
85
930
}
AMDKernelCodeTUtils.cpp:void printBitField<unsigned int, &(amd_kernel_code_s::code_properties), 2, 1>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
82
930
                          raw_ostream &OS) {
83
930
  const auto Mask = (static_cast<T>(1) << width) - 1;
84
930
  printName(OS, Name) << (int)((c.*ptr >> shift) & Mask);
85
930
}
AMDKernelCodeTUtils.cpp:void printBitField<unsigned int, &(amd_kernel_code_s::code_properties), 3, 1>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
82
930
                          raw_ostream &OS) {
83
930
  const auto Mask = (static_cast<T>(1) << width) - 1;
84
930
  printName(OS, Name) << (int)((c.*ptr >> shift) & Mask);
85
930
}
AMDKernelCodeTUtils.cpp:void printBitField<unsigned int, &(amd_kernel_code_s::code_properties), 4, 1>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
82
930
                          raw_ostream &OS) {
83
930
  const auto Mask = (static_cast<T>(1) << width) - 1;
84
930
  printName(OS, Name) << (int)((c.*ptr >> shift) & Mask);
85
930
}
AMDKernelCodeTUtils.cpp:void printBitField<unsigned int, &(amd_kernel_code_s::code_properties), 5, 1>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
82
930
                          raw_ostream &OS) {
83
930
  const auto Mask = (static_cast<T>(1) << width) - 1;
84
930
  printName(OS, Name) << (int)((c.*ptr >> shift) & Mask);
85
930
}
AMDKernelCodeTUtils.cpp:void printBitField<unsigned int, &(amd_kernel_code_s::code_properties), 6, 1>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
82
930
                          raw_ostream &OS) {
83
930
  const auto Mask = (static_cast<T>(1) << width) - 1;
84
930
  printName(OS, Name) << (int)((c.*ptr >> shift) & Mask);
85
930
}
AMDKernelCodeTUtils.cpp:void printBitField<unsigned int, &(amd_kernel_code_s::code_properties), 7, 1>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
82
930
                          raw_ostream &OS) {
83
930
  const auto Mask = (static_cast<T>(1) << width) - 1;
84
930
  printName(OS, Name) << (int)((c.*ptr >> shift) & Mask);
85
930
}
AMDKernelCodeTUtils.cpp:void printBitField<unsigned int, &(amd_kernel_code_s::code_properties), 8, 1>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
82
930
                          raw_ostream &OS) {
83
930
  const auto Mask = (static_cast<T>(1) << width) - 1;
84
930
  printName(OS, Name) << (int)((c.*ptr >> shift) & Mask);
85
930
}
AMDKernelCodeTUtils.cpp:void printBitField<unsigned int, &(amd_kernel_code_s::code_properties), 9, 1>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
82
930
                          raw_ostream &OS) {
83
930
  const auto Mask = (static_cast<T>(1) << width) - 1;
84
930
  printName(OS, Name) << (int)((c.*ptr >> shift) & Mask);
85
930
}
AMDKernelCodeTUtils.cpp:void printBitField<unsigned int, &(amd_kernel_code_s::code_properties), 10, 1>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
82
930
                          raw_ostream &OS) {
83
930
  const auto Mask = (static_cast<T>(1) << width) - 1;
84
930
  printName(OS, Name) << (int)((c.*ptr >> shift) & Mask);
85
930
}
AMDKernelCodeTUtils.cpp:void printBitField<unsigned int, &(amd_kernel_code_s::code_properties), 16, 1>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
82
930
                          raw_ostream &OS) {
83
930
  const auto Mask = (static_cast<T>(1) << width) - 1;
84
930
  printName(OS, Name) << (int)((c.*ptr >> shift) & Mask);
85
930
}
AMDKernelCodeTUtils.cpp:void printBitField<unsigned int, &(amd_kernel_code_s::code_properties), 17, 2>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
82
930
                          raw_ostream &OS) {
83
930
  const auto Mask = (static_cast<T>(1) << width) - 1;
84
930
  printName(OS, Name) << (int)((c.*ptr >> shift) & Mask);
85
930
}
AMDKernelCodeTUtils.cpp:void printBitField<unsigned int, &(amd_kernel_code_s::code_properties), 19, 1>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
82
930
                          raw_ostream &OS) {
83
930
  const auto Mask = (static_cast<T>(1) << width) - 1;
84
930
  printName(OS, Name) << (int)((c.*ptr >> shift) & Mask);
85
930
}
AMDKernelCodeTUtils.cpp:void printBitField<unsigned int, &(amd_kernel_code_s::code_properties), 20, 1>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
82
930
                          raw_ostream &OS) {
83
930
  const auto Mask = (static_cast<T>(1) << width) - 1;
84
930
  printName(OS, Name) << (int)((c.*ptr >> shift) & Mask);
85
930
}
AMDKernelCodeTUtils.cpp:void printBitField<unsigned int, &(amd_kernel_code_s::code_properties), 21, 1>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
82
930
                          raw_ostream &OS) {
83
930
  const auto Mask = (static_cast<T>(1) << width) - 1;
84
930
  printName(OS, Name) << (int)((c.*ptr >> shift) & Mask);
85
930
}
AMDKernelCodeTUtils.cpp:void printBitField<unsigned int, &(amd_kernel_code_s::code_properties), 22, 1>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&)
Line
Count
Source
82
930
                          raw_ostream &OS) {
83
930
  const auto Mask = (static_cast<T>(1) << width) - 1;
84
930
  printName(OS, Name) << (int)((c.*ptr >> shift) & Mask);
85
930
}
86
87
using PrintFx = void(*)(StringRef, const amd_kernel_code_t &, raw_ostream &);
88
89
62.3k
static ArrayRef<PrintFx> getPrinterTable() {
90
62.3k
  static const PrintFx Table[] = {
91
4.13M
#define RECORD(name, altName, print, parse) print
AMDKernelCodeTUtils.cpp:getPrinterTable()::$_0::operator()(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&) const
Line
Count
Source
91
930
#define RECORD(name, altName, print, parse) print
AMDKernelCodeTUtils.cpp:getPrinterTable()::$_1::operator()(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&) const
Line
Count
Source
91
930
#define RECORD(name, altName, print, parse) print
AMDKernelCodeTUtils.cpp:getPrinterTable()::$_2::operator()(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&) const
Line
Count
Source
91
930
#define RECORD(name, altName, print, parse) print
AMDKernelCodeTUtils.cpp:getPrinterTable()::$_3::operator()(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&) const
Line
Count
Source
91
930
#define RECORD(name, altName, print, parse) print
AMDKernelCodeTUtils.cpp:getPrinterTable()::$_4::operator()(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&) const
Line
Count
Source
91
930
#define RECORD(name, altName, print, parse) print
AMDKernelCodeTUtils.cpp:getPrinterTable()::$_5::operator()(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&) const
Line
Count
Source
91
930
#define RECORD(name, altName, print, parse) print
AMDKernelCodeTUtils.cpp:getPrinterTable()::$_6::operator()(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&) const
Line
Count
Source
91
930
#define RECORD(name, altName, print, parse) print
AMDKernelCodeTUtils.cpp:getPrinterTable()::$_7::operator()(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&) const
Line
Count
Source
91
930
#define RECORD(name, altName, print, parse) print
AMDKernelCodeTUtils.cpp:getPrinterTable()::$_8::operator()(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&) const
Line
Count
Source
91
930
#define RECORD(name, altName, print, parse) print
AMDKernelCodeTUtils.cpp:getPrinterTable()::$_9::operator()(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&) const
Line
Count
Source
91
930
#define RECORD(name, altName, print, parse) print
AMDKernelCodeTUtils.cpp:getPrinterTable()::$_10::operator()(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&) const
Line
Count
Source
91
930
#define RECORD(name, altName, print, parse) print
AMDKernelCodeTUtils.cpp:getPrinterTable()::$_11::operator()(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&) const
Line
Count
Source
91
930
#define RECORD(name, altName, print, parse) print
AMDKernelCodeTUtils.cpp:getPrinterTable()::$_12::operator()(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&) const
Line
Count
Source
91
930
#define RECORD(name, altName, print, parse) print
AMDKernelCodeTUtils.cpp:getPrinterTable()::$_13::operator()(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&) const
Line
Count
Source
91
930
#define RECORD(name, altName, print, parse) print
AMDKernelCodeTUtils.cpp:getPrinterTable()::$_14::operator()(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&) const
Line
Count
Source
91
930
#define RECORD(name, altName, print, parse) print
AMDKernelCodeTUtils.cpp:getPrinterTable()::$_15::operator()(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&) const
Line
Count
Source
91
930
#define RECORD(name, altName, print, parse) print
AMDKernelCodeTUtils.cpp:getPrinterTable()::$_16::operator()(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&) const
Line
Count
Source
91
930
#define RECORD(name, altName, print, parse) print
AMDKernelCodeTUtils.cpp:getPrinterTable()::$_17::operator()(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&) const
Line
Count
Source
91
930
#define RECORD(name, altName, print, parse) print
AMDKernelCodeTUtils.cpp:getPrinterTable()::$_18::operator()(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&) const
Line
Count
Source
91
930
#define RECORD(name, altName, print, parse) print
AMDKernelCodeTUtils.cpp:getPrinterTable()::$_19::operator()(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&) const
Line
Count
Source
91
930
#define RECORD(name, altName, print, parse) print
AMDKernelCodeTUtils.cpp:getPrinterTable()::$_20::operator()(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&) const
Line
Count
Source
91
930
#define RECORD(name, altName, print, parse) print
AMDKernelCodeTUtils.cpp:getPrinterTable()::$_21::operator()(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&) const
Line
Count
Source
91
930
#define RECORD(name, altName, print, parse) print
92
62.3k
#include "AMDKernelCodeTInfo.h"
93
62.3k
#undef RECORD
94
62.3k
  };
95
62.3k
  return makeArrayRef(Table);
96
62.3k
}
97
98
void llvm::printAmdKernelCodeField(const amd_kernel_code_t &C,
99
                                   int FldIndex,
100
61.3k
                                   raw_ostream &OS) {
101
61.3k
  auto Printer = getPrinterTable()[FldIndex];
102
61.3k
  if (Printer)
103
61.3k
    Printer(get_amd_kernel_code_t_FieldName(FldIndex), C, OS);
104
61.3k
}
105
106
void llvm::dumpAmdKernelCode(const amd_kernel_code_t *C,
107
                             raw_ostream &OS,
108
930
                             const char *tab) {
109
930
  const int Size = getPrinterTable().size();
110
62.3k
  for (int i = 0; i < Size; 
++i61.3k
) {
111
61.3k
    OS << tab;
112
61.3k
    printAmdKernelCodeField(*C, i, OS);
113
61.3k
    OS << '\n';
114
61.3k
  }
115
930
}
116
117
// Field parsing
118
119
456
static bool expectAbsExpression(MCAsmParser &MCParser, int64_t &Value, raw_ostream& Err) {
120
456
121
456
  if (MCParser.getLexer().isNot(AsmToken::Equal)) {
122
0
    Err << "expected '='";
123
0
    return false;
124
0
  }
125
456
  MCParser.getLexer().Lex();
126
456
127
456
  if (MCParser.parseAbsoluteExpression(Value)) {
128
0
    Err << "integer absolute expression expected";
129
0
    return false;
130
0
  }
131
456
  return true;
132
456
}
133
134
template <typename T, T amd_kernel_code_t::*ptr>
135
static bool parseField(amd_kernel_code_t &C, MCAsmParser &MCParser,
136
194
                       raw_ostream &Err) {
137
194
  int64_t Value = 0;
138
194
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
194
  C.*ptr = (T)Value;
141
194
  return true;
142
194
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned int, &(amd_kernel_code_s::amd_kernel_code_version_major)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
8
                       raw_ostream &Err) {
137
8
  int64_t Value = 0;
138
8
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
8
  C.*ptr = (T)Value;
141
8
  return true;
142
8
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned int, &(amd_kernel_code_s::amd_kernel_code_version_minor)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
6
                       raw_ostream &Err) {
137
6
  int64_t Value = 0;
138
6
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
6
  C.*ptr = (T)Value;
141
6
  return true;
142
6
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned short, &(amd_kernel_code_s::amd_machine_kind)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
6
                       raw_ostream &Err) {
137
6
  int64_t Value = 0;
138
6
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
6
  C.*ptr = (T)Value;
141
6
  return true;
142
6
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned short, &(amd_kernel_code_s::amd_machine_version_major)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
6
                       raw_ostream &Err) {
137
6
  int64_t Value = 0;
138
6
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
6
  C.*ptr = (T)Value;
141
6
  return true;
142
6
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned short, &(amd_kernel_code_s::amd_machine_version_minor)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
6
                       raw_ostream &Err) {
137
6
  int64_t Value = 0;
138
6
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
6
  C.*ptr = (T)Value;
141
6
  return true;
142
6
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned short, &(amd_kernel_code_s::amd_machine_version_stepping)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
6
                       raw_ostream &Err) {
137
6
  int64_t Value = 0;
138
6
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
6
  C.*ptr = (T)Value;
141
6
  return true;
142
6
}
AMDKernelCodeTUtils.cpp:bool parseField<long long, &(amd_kernel_code_s::kernel_code_entry_byte_offset)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
6
                       raw_ostream &Err) {
137
6
  int64_t Value = 0;
138
6
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
6
  C.*ptr = (T)Value;
141
6
  return true;
142
6
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned long long, &(amd_kernel_code_s::kernel_code_prefetch_byte_size)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
6
                       raw_ostream &Err) {
137
6
  int64_t Value = 0;
138
6
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
6
  C.*ptr = (T)Value;
141
6
  return true;
142
6
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned int, &(amd_kernel_code_s::workitem_private_segment_byte_size)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
6
                       raw_ostream &Err) {
137
6
  int64_t Value = 0;
138
6
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
6
  C.*ptr = (T)Value;
141
6
  return true;
142
6
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned int, &(amd_kernel_code_s::workgroup_group_segment_byte_size)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
6
                       raw_ostream &Err) {
137
6
  int64_t Value = 0;
138
6
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
6
  C.*ptr = (T)Value;
141
6
  return true;
142
6
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned int, &(amd_kernel_code_s::gds_segment_byte_size)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
6
                       raw_ostream &Err) {
137
6
  int64_t Value = 0;
138
6
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
6
  C.*ptr = (T)Value;
141
6
  return true;
142
6
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned long long, &(amd_kernel_code_s::kernarg_segment_byte_size)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
12
                       raw_ostream &Err) {
137
12
  int64_t Value = 0;
138
12
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
12
  C.*ptr = (T)Value;
141
12
  return true;
142
12
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned int, &(amd_kernel_code_s::workgroup_fbarrier_count)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
6
                       raw_ostream &Err) {
137
6
  int64_t Value = 0;
138
6
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
6
  C.*ptr = (T)Value;
141
6
  return true;
142
6
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned short, &(amd_kernel_code_s::wavefront_sgpr_count)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
12
                       raw_ostream &Err) {
137
12
  int64_t Value = 0;
138
12
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
12
  C.*ptr = (T)Value;
141
12
  return true;
142
12
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned short, &(amd_kernel_code_s::workitem_vgpr_count)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
12
                       raw_ostream &Err) {
137
12
  int64_t Value = 0;
138
12
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
12
  C.*ptr = (T)Value;
141
12
  return true;
142
12
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned short, &(amd_kernel_code_s::reserved_vgpr_first)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
6
                       raw_ostream &Err) {
137
6
  int64_t Value = 0;
138
6
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
6
  C.*ptr = (T)Value;
141
6
  return true;
142
6
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned short, &(amd_kernel_code_s::reserved_vgpr_count)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
6
                       raw_ostream &Err) {
137
6
  int64_t Value = 0;
138
6
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
6
  C.*ptr = (T)Value;
141
6
  return true;
142
6
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned short, &(amd_kernel_code_s::reserved_sgpr_first)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
6
                       raw_ostream &Err) {
137
6
  int64_t Value = 0;
138
6
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
6
  C.*ptr = (T)Value;
141
6
  return true;
142
6
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned short, &(amd_kernel_code_s::reserved_sgpr_count)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
6
                       raw_ostream &Err) {
137
6
  int64_t Value = 0;
138
6
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
6
  C.*ptr = (T)Value;
141
6
  return true;
142
6
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned short, &(amd_kernel_code_s::debug_wavefront_private_segment_offset_sgpr)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
6
                       raw_ostream &Err) {
137
6
  int64_t Value = 0;
138
6
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
6
  C.*ptr = (T)Value;
141
6
  return true;
142
6
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned short, &(amd_kernel_code_s::debug_private_segment_buffer_sgpr)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
6
                       raw_ostream &Err) {
137
6
  int64_t Value = 0;
138
6
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
6
  C.*ptr = (T)Value;
141
6
  return true;
142
6
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned char, &(amd_kernel_code_s::kernarg_segment_alignment)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
6
                       raw_ostream &Err) {
137
6
  int64_t Value = 0;
138
6
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
6
  C.*ptr = (T)Value;
141
6
  return true;
142
6
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned char, &(amd_kernel_code_s::group_segment_alignment)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
6
                       raw_ostream &Err) {
137
6
  int64_t Value = 0;
138
6
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
6
  C.*ptr = (T)Value;
141
6
  return true;
142
6
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned char, &(amd_kernel_code_s::private_segment_alignment)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
6
                       raw_ostream &Err) {
137
6
  int64_t Value = 0;
138
6
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
6
  C.*ptr = (T)Value;
141
6
  return true;
142
6
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned char, &(amd_kernel_code_s::wavefront_size)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
18
                       raw_ostream &Err) {
137
18
  int64_t Value = 0;
138
18
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
18
  C.*ptr = (T)Value;
141
18
  return true;
142
18
}
AMDKernelCodeTUtils.cpp:bool parseField<int, &(amd_kernel_code_s::call_convention)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
6
                       raw_ostream &Err) {
137
6
  int64_t Value = 0;
138
6
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
6
  C.*ptr = (T)Value;
141
6
  return true;
142
6
}
AMDKernelCodeTUtils.cpp:bool parseField<unsigned long long, &(amd_kernel_code_s::runtime_loader_kernel_symbol)>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
136
6
                       raw_ostream &Err) {
137
6
  int64_t Value = 0;
138
6
  if (!expectAbsExpression(MCParser, Value, Err))
139
0
    return false;
140
6
  C.*ptr = (T)Value;
141
6
  return true;
142
6
}
143
144
template <typename T, T amd_kernel_code_t::*ptr, int shift, int width = 1>
145
static bool parseBitField(amd_kernel_code_t &C, MCAsmParser &MCParser,
146
122
                          raw_ostream &Err) {
147
122
  int64_t Value = 0;
148
122
  if (!expectAbsExpression(MCParser, Value, Err))
149
0
    return false;
150
122
  const uint64_t Mask = ((UINT64_C(1)  << width) - 1) << shift;
151
122
  C.*ptr &= (T)~Mask;
152
122
  C.*ptr |= (T)((Value << shift) & Mask);
153
122
  return true;
154
122
}
AMDKernelCodeTUtils.cpp:bool parseBitField<unsigned int, &(amd_kernel_code_s::code_properties), 0, 1>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
146
6
                          raw_ostream &Err) {
147
6
  int64_t Value = 0;
148
6
  if (!expectAbsExpression(MCParser, Value, Err))
149
0
    return false;
150
6
  const uint64_t Mask = ((UINT64_C(1)  << width) - 1) << shift;
151
6
  C.*ptr &= (T)~Mask;
152
6
  C.*ptr |= (T)((Value << shift) & Mask);
153
6
  return true;
154
6
}
AMDKernelCodeTUtils.cpp:bool parseBitField<unsigned int, &(amd_kernel_code_s::code_properties), 1, 1>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
146
6
                          raw_ostream &Err) {
147
6
  int64_t Value = 0;
148
6
  if (!expectAbsExpression(MCParser, Value, Err))
149
0
    return false;
150
6
  const uint64_t Mask = ((UINT64_C(1)  << width) - 1) << shift;
151
6
  C.*ptr &= (T)~Mask;
152
6
  C.*ptr |= (T)((Value << shift) & Mask);
153
6
  return true;
154
6
}
AMDKernelCodeTUtils.cpp:bool parseBitField<unsigned int, &(amd_kernel_code_s::code_properties), 2, 1>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
146
6
                          raw_ostream &Err) {
147
6
  int64_t Value = 0;
148
6
  if (!expectAbsExpression(MCParser, Value, Err))
149
0
    return false;
150
6
  const uint64_t Mask = ((UINT64_C(1)  << width) - 1) << shift;
151
6
  C.*ptr &= (T)~Mask;
152
6
  C.*ptr |= (T)((Value << shift) & Mask);
153
6
  return true;
154
6
}
AMDKernelCodeTUtils.cpp:bool parseBitField<unsigned int, &(amd_kernel_code_s::code_properties), 3, 1>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
146
12
                          raw_ostream &Err) {
147
12
  int64_t Value = 0;
148
12
  if (!expectAbsExpression(MCParser, Value, Err))
149
0
    return false;
150
12
  const uint64_t Mask = ((UINT64_C(1)  << width) - 1) << shift;
151
12
  C.*ptr &= (T)~Mask;
152
12
  C.*ptr |= (T)((Value << shift) & Mask);
153
12
  return true;
154
12
}
AMDKernelCodeTUtils.cpp:bool parseBitField<unsigned int, &(amd_kernel_code_s::code_properties), 4, 1>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
146
6
                          raw_ostream &Err) {
147
6
  int64_t Value = 0;
148
6
  if (!expectAbsExpression(MCParser, Value, Err))
149
0
    return false;
150
6
  const uint64_t Mask = ((UINT64_C(1)  << width) - 1) << shift;
151
6
  C.*ptr &= (T)~Mask;
152
6
  C.*ptr |= (T)((Value << shift) & Mask);
153
6
  return true;
154
6
}
AMDKernelCodeTUtils.cpp:bool parseBitField<unsigned int, &(amd_kernel_code_s::code_properties), 5, 1>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
146
6
                          raw_ostream &Err) {
147
6
  int64_t Value = 0;
148
6
  if (!expectAbsExpression(MCParser, Value, Err))
149
0
    return false;
150
6
  const uint64_t Mask = ((UINT64_C(1)  << width) - 1) << shift;
151
6
  C.*ptr &= (T)~Mask;
152
6
  C.*ptr |= (T)((Value << shift) & Mask);
153
6
  return true;
154
6
}
AMDKernelCodeTUtils.cpp:bool parseBitField<unsigned int, &(amd_kernel_code_s::code_properties), 6, 1>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
146
6
                          raw_ostream &Err) {
147
6
  int64_t Value = 0;
148
6
  if (!expectAbsExpression(MCParser, Value, Err))
149
0
    return false;
150
6
  const uint64_t Mask = ((UINT64_C(1)  << width) - 1) << shift;
151
6
  C.*ptr &= (T)~Mask;
152
6
  C.*ptr |= (T)((Value << shift) & Mask);
153
6
  return true;
154
6
}
AMDKernelCodeTUtils.cpp:bool parseBitField<unsigned int, &(amd_kernel_code_s::code_properties), 7, 1>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
146
6
                          raw_ostream &Err) {
147
6
  int64_t Value = 0;
148
6
  if (!expectAbsExpression(MCParser, Value, Err))
149
0
    return false;
150
6
  const uint64_t Mask = ((UINT64_C(1)  << width) - 1) << shift;
151
6
  C.*ptr &= (T)~Mask;
152
6
  C.*ptr |= (T)((Value << shift) & Mask);
153
6
  return true;
154
6
}
AMDKernelCodeTUtils.cpp:bool parseBitField<unsigned int, &(amd_kernel_code_s::code_properties), 8, 1>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
146
6
                          raw_ostream &Err) {
147
6
  int64_t Value = 0;
148
6
  if (!expectAbsExpression(MCParser, Value, Err))
149
0
    return false;
150
6
  const uint64_t Mask = ((UINT64_C(1)  << width) - 1) << shift;
151
6
  C.*ptr &= (T)~Mask;
152
6
  C.*ptr |= (T)((Value << shift) & Mask);
153
6
  return true;
154
6
}
AMDKernelCodeTUtils.cpp:bool parseBitField<unsigned int, &(amd_kernel_code_s::code_properties), 9, 1>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
146
6
                          raw_ostream &Err) {
147
6
  int64_t Value = 0;
148
6
  if (!expectAbsExpression(MCParser, Value, Err))
149
0
    return false;
150
6
  const uint64_t Mask = ((UINT64_C(1)  << width) - 1) << shift;
151
6
  C.*ptr &= (T)~Mask;
152
6
  C.*ptr |= (T)((Value << shift) & Mask);
153
6
  return true;
154
6
}
AMDKernelCodeTUtils.cpp:bool parseBitField<unsigned int, &(amd_kernel_code_s::code_properties), 10, 1>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
146
14
                          raw_ostream &Err) {
147
14
  int64_t Value = 0;
148
14
  if (!expectAbsExpression(MCParser, Value, Err))
149
0
    return false;
150
14
  const uint64_t Mask = ((UINT64_C(1)  << width) - 1) << shift;
151
14
  C.*ptr &= (T)~Mask;
152
14
  C.*ptr |= (T)((Value << shift) & Mask);
153
14
  return true;
154
14
}
AMDKernelCodeTUtils.cpp:bool parseBitField<unsigned int, &(amd_kernel_code_s::code_properties), 16, 1>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
146
6
                          raw_ostream &Err) {
147
6
  int64_t Value = 0;
148
6
  if (!expectAbsExpression(MCParser, Value, Err))
149
0
    return false;
150
6
  const uint64_t Mask = ((UINT64_C(1)  << width) - 1) << shift;
151
6
  C.*ptr &= (T)~Mask;
152
6
  C.*ptr |= (T)((Value << shift) & Mask);
153
6
  return true;
154
6
}
AMDKernelCodeTUtils.cpp:bool parseBitField<unsigned int, &(amd_kernel_code_s::code_properties), 17, 2>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
146
6
                          raw_ostream &Err) {
147
6
  int64_t Value = 0;
148
6
  if (!expectAbsExpression(MCParser, Value, Err))
149
0
    return false;
150
6
  const uint64_t Mask = ((UINT64_C(1)  << width) - 1) << shift;
151
6
  C.*ptr &= (T)~Mask;
152
6
  C.*ptr |= (T)((Value << shift) & Mask);
153
6
  return true;
154
6
}
AMDKernelCodeTUtils.cpp:bool parseBitField<unsigned int, &(amd_kernel_code_s::code_properties), 19, 1>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
146
12
                          raw_ostream &Err) {
147
12
  int64_t Value = 0;
148
12
  if (!expectAbsExpression(MCParser, Value, Err))
149
0
    return false;
150
12
  const uint64_t Mask = ((UINT64_C(1)  << width) - 1) << shift;
151
12
  C.*ptr &= (T)~Mask;
152
12
  C.*ptr |= (T)((Value << shift) & Mask);
153
12
  return true;
154
12
}
AMDKernelCodeTUtils.cpp:bool parseBitField<unsigned int, &(amd_kernel_code_s::code_properties), 20, 1>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
146
6
                          raw_ostream &Err) {
147
6
  int64_t Value = 0;
148
6
  if (!expectAbsExpression(MCParser, Value, Err))
149
0
    return false;
150
6
  const uint64_t Mask = ((UINT64_C(1)  << width) - 1) << shift;
151
6
  C.*ptr &= (T)~Mask;
152
6
  C.*ptr |= (T)((Value << shift) & Mask);
153
6
  return true;
154
6
}
AMDKernelCodeTUtils.cpp:bool parseBitField<unsigned int, &(amd_kernel_code_s::code_properties), 21, 1>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
146
6
                          raw_ostream &Err) {
147
6
  int64_t Value = 0;
148
6
  if (!expectAbsExpression(MCParser, Value, Err))
149
0
    return false;
150
6
  const uint64_t Mask = ((UINT64_C(1)  << width) - 1) << shift;
151
6
  C.*ptr &= (T)~Mask;
152
6
  C.*ptr |= (T)((Value << shift) & Mask);
153
6
  return true;
154
6
}
AMDKernelCodeTUtils.cpp:bool parseBitField<unsigned int, &(amd_kernel_code_s::code_properties), 22, 1>(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&)
Line
Count
Source
146
6
                          raw_ostream &Err) {
147
6
  int64_t Value = 0;
148
6
  if (!expectAbsExpression(MCParser, Value, Err))
149
0
    return false;
150
6
  const uint64_t Mask = ((UINT64_C(1)  << width) - 1) << shift;
151
6
  C.*ptr &= (T)~Mask;
152
6
  C.*ptr |= (T)((Value << shift) & Mask);
153
6
  return true;
154
6
}
155
156
using ParseFx = bool(*)(amd_kernel_code_t &, MCAsmParser &MCParser,
157
                        raw_ostream &Err);
158
159
456
static ArrayRef<ParseFx> getParserTable() {
160
456
  static const ParseFx Table[] = {
161
30.5k
#define RECORD(name, altName, print, parse) parse
AMDKernelCodeTUtils.cpp:getParserTable()::$_22::operator()(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&) const
Line
Count
Source
161
36
#define RECORD(name, altName, print, parse) parse
AMDKernelCodeTUtils.cpp:getParserTable()::$_23::operator()(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&) const
Line
Count
Source
161
36
#define RECORD(name, altName, print, parse) parse
AMDKernelCodeTUtils.cpp:getParserTable()::$_24::operator()(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&) const
Line
Count
Source
161
18
#define RECORD(name, altName, print, parse) parse
AMDKernelCodeTUtils.cpp:getParserTable()::$_25::operator()(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&) const
Line
Count
Source
161
18
#define RECORD(name, altName, print, parse) parse
AMDKernelCodeTUtils.cpp:getParserTable()::$_26::operator()(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&) const
Line
Count
Source
161
18
#define RECORD(name, altName, print, parse) parse
AMDKernelCodeTUtils.cpp:getParserTable()::$_27::operator()(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&) const
Line
Count
Source
161
18
#define RECORD(name, altName, print, parse) parse
AMDKernelCodeTUtils.cpp:getParserTable()::$_28::operator()(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&) const
Line
Count
Source
161
18
#define RECORD(name, altName, print, parse) parse
AMDKernelCodeTUtils.cpp:getParserTable()::$_29::operator()(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&) const
Line
Count
Source
161
18
#define RECORD(name, altName, print, parse) parse
AMDKernelCodeTUtils.cpp:getParserTable()::$_30::operator()(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&) const
Line
Count
Source
161
12
#define RECORD(name, altName, print, parse) parse
AMDKernelCodeTUtils.cpp:getParserTable()::$_31::operator()(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&) const
Line
Count
Source
161
12
#define RECORD(name, altName, print, parse) parse
AMDKernelCodeTUtils.cpp:getParserTable()::$_32::operator()(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&) const
Line
Count
Source
161
12
#define RECORD(name, altName, print, parse) parse
AMDKernelCodeTUtils.cpp:getParserTable()::$_33::operator()(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&) const
Line
Count
Source
161
18
#define RECORD(name, altName, print, parse) parse
AMDKernelCodeTUtils.cpp:getParserTable()::$_34::operator()(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&) const
Line
Count
Source
161
36
#define RECORD(name, altName, print, parse) parse
AMDKernelCodeTUtils.cpp:getParserTable()::$_35::operator()(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&) const
Line
Count
Source
161
6
#define RECORD(name, altName, print, parse) parse
AMDKernelCodeTUtils.cpp:getParserTable()::$_36::operator()(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&) const
Line
Count
Source
161
18
#define RECORD(name, altName, print, parse) parse
AMDKernelCodeTUtils.cpp:getParserTable()::$_37::operator()(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&) const
Line
Count
Source
161
18
#define RECORD(name, altName, print, parse) parse
AMDKernelCodeTUtils.cpp:getParserTable()::$_38::operator()(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&) const
Line
Count
Source
161
18
#define RECORD(name, altName, print, parse) parse
AMDKernelCodeTUtils.cpp:getParserTable()::$_39::operator()(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&) const
Line
Count
Source
161
18
#define RECORD(name, altName, print, parse) parse
AMDKernelCodeTUtils.cpp:getParserTable()::$_40::operator()(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&) const
Line
Count
Source
161
18
#define RECORD(name, altName, print, parse) parse
AMDKernelCodeTUtils.cpp:getParserTable()::$_41::operator()(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&) const
Line
Count
Source
161
18
#define RECORD(name, altName, print, parse) parse
AMDKernelCodeTUtils.cpp:getParserTable()::$_42::operator()(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&) const
Line
Count
Source
161
18
#define RECORD(name, altName, print, parse) parse
AMDKernelCodeTUtils.cpp:getParserTable()::$_43::operator()(amd_kernel_code_s&, llvm::MCAsmParser&, llvm::raw_ostream&) const
Line
Count
Source
161
18
#define RECORD(name, altName, print, parse) parse
162
456
#include "AMDKernelCodeTInfo.h"
163
456
#undef RECORD
164
456
  };
165
456
  return makeArrayRef(Table);
166
456
}
167
168
bool llvm::parseAmdKernelCodeField(StringRef ID,
169
                                   MCAsmParser &MCParser,
170
                                   amd_kernel_code_t &C,
171
456
                                   raw_ostream &Err) {
172
456
  const int Idx = get_amd_kernel_code_t_FieldIndex(ID);
173
456
  if (Idx < 0) {
174
0
    Err << "unexpected amd_kernel_code_t field name " << ID;
175
0
    return false;
176
0
  }
177
456
  auto Parser = getParserTable()[Idx];
178
456
  return Parser ? Parser(C, MCParser, Err) : 
false0
;
179
456
}