[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / compiler-rt / lib / xray / xray_x86_64.inc
blob477900355cf43f69e7ccd0a8c7f490a539a6f7db
1 //===-- xray_x86_64.inc -----------------------------------------*- C++ -*-===//
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 // This file is a part of XRay, a dynamic runtime instrumentation system.
11 //===----------------------------------------------------------------------===//
13 #include <cstdint>
14 #include <x86intrin.h>
16 #include "sanitizer_common/sanitizer_internal_defs.h"
17 #include "xray_defs.h"
19 namespace __xray {
21 ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
22   unsigned LongCPU;
23   unsigned long Rax, Rdx;
24   __asm__ __volatile__("rdtscp\n" : "=a"(Rax), "=d"(Rdx), "=c"(LongCPU) ::);
25   CPU = LongCPU;
26   return (Rdx << 32) + Rax;
29 uint64_t getTSCFrequency();
31 bool probeRequiredCPUFeatures();
33 } // namespace __xray