blob: d7404652d2b112a5bd5959210fc689aa9efdc8ff [file] [log] [blame]
bjacob886ac3e2023-03-07 14:25:01 -05001// Copyright 2023 The IREE Authors
2//
3// Licensed 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#include <stdio.h>
8
9#include "iree/base/api.h"
10#include "iree/base/internal/cpu.h"
11
12int main(int argc, char *argv[]) {
13 iree_cpu_initialize(iree_allocator_system());
14
15#define IREE_CPU_FEATURE_BIT(arch, field_index, bit_pos, bit_name, llvm_name) \
16 if (IREE_ARCH_ENUM == IREE_ARCH_ENUM_##arch) { \
17 int64_t result = 0; \
18 IREE_CHECK_OK(iree_cpu_lookup_data_by_key(IREE_SV(llvm_name), &result)); \
19 printf("%-20s %ld\n", llvm_name, result); \
20 }
21#include "iree/schemas/cpu_feature_bits.inl"
22#undef IREE_CPU_FEATURE_BIT
23
24 return 0;
25}