mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-03-23 11:28:40 +00:00
Squashed 'externals/biscuit/' content from commit 1d53c9e6
git-subtree-dir: externals/biscuit git-subtree-split: 1d53c9e6cfe56544982200a5bac15a5de064936b
This commit is contained in:
1
examples/CMakeLists.txt
Normal file
1
examples/CMakeLists.txt
Normal file
@@ -0,0 +1 @@
|
||||
add_subdirectory(cpuinfo)
|
||||
3
examples/cpuinfo/CMakeLists.txt
Normal file
3
examples/cpuinfo/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
add_executable(cpuinfo cpuinfo.cpp)
|
||||
target_link_libraries(cpuinfo biscuit)
|
||||
set_property(TARGET cpuinfo PROPERTY CXX_STANDARD 20)
|
||||
31
examples/cpuinfo/cpuinfo.cpp
Normal file
31
examples/cpuinfo/cpuinfo.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
// Copyright (c), 2022, KNS Group LLC (YADRO)
|
||||
//
|
||||
// Use of this source code is governed by an MIT-style
|
||||
// license that can be found in the LICENSE file or at
|
||||
// https://opensource.org/licenses/MIT.
|
||||
|
||||
#include <biscuit/assembler.hpp>
|
||||
#include <biscuit/cpuinfo.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
using namespace biscuit;
|
||||
|
||||
int main()
|
||||
{
|
||||
CPUInfo cpu;
|
||||
|
||||
std::cout << "Has I:" << cpu.Has(RISCVExtension::I) << std::endl;
|
||||
std::cout << "Has M:" << cpu.Has(RISCVExtension::M) << std::endl;
|
||||
std::cout << "Has A:" << cpu.Has(RISCVExtension::A) << std::endl;
|
||||
std::cout << "Has F:" << cpu.Has(RISCVExtension::F) << std::endl;
|
||||
std::cout << "Has D:" << cpu.Has(RISCVExtension::D) << std::endl;
|
||||
std::cout << "Has C:" << cpu.Has(RISCVExtension::C) << std::endl;
|
||||
std::cout << "Has V:" << cpu.Has(RISCVExtension::V) << std::endl;
|
||||
|
||||
if (cpu.Has(RISCVExtension::V)) {
|
||||
std::cout << "VLENB:" << cpu.GetVlenb() << std::endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user