search for: __counter__

Displaying 9 results from an estimated 9 matches for "__counter__".

2016 Oct 14
2
emflac
...ned(__clang__) && (__clang_major__ > 3 || \ (__clang_major__ == 3 && __clang_minor__ >= 9))) 2. Min and max macros I'm also surprised by the degree of variation here. flac_max uses a statement expression. flac_min relies on some preprocessor magic and the __COUNTER__ macro instead. For non-gcc-4.3+ it falls back MIN and MAX from sys/param.h which probably satisfies this dependency for most users who use configure, but which does not cache its arguments but evaluate them twice, at least on my system. But for non-Windows with no sys/param.h, it defines MIN and MA...
2017 Apr 04
3
[inline-asm][asm-goto] Supporting "asm goto" in inline assembly
...trace_table;" \ ".long 0b, %l0;" \ ".popsection" \ : : : : trace#NUM); \ if (0) { trace#NUM: trace(); } \ } while (0) #define TRACE TRACE1(__COUNTER__) In this example (which in fact inspired the asm goto feature) we want on rare occasions to call the trace function; on other occasions we'd like to keep the overhead to the absolute minimum. The normal code path consists of a single nop instruction. However, we record the address of this nop...
2018 Dec 16
1
[PATCH v2] x86, kbuild: revert macrofying inline assembly code
...iler.h @@ -99,13 +99,22 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, * unique, to convince GCC not to merge duplicate inline asm statements. */ #define annotate_reachable() ({ \ - asm volatile("ANNOTATE_REACHABLE counter=%c0" \ - : : "i" (__COUNTER__)); \ + asm volatile("%c0:\n\t" \ + ".pushsection .discard.reachable\n\t" \ + ".long %c0b - .\n\t" \ + ".popsection\n\t" : : "i" (__COUNTER__)); \ }) #define annotate_unreachable() ({ \ - asm volatile("ANNOTA...
2018 Dec 13
2
[PATCH] kbuild, x86: revert macros in extended asm workarounds
...iler.h @@ -99,13 +99,22 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, * unique, to convince GCC not to merge duplicate inline asm statements. */ #define annotate_reachable() ({ \ - asm volatile("ANNOTATE_REACHABLE counter=%c0" \ - : : "i" (__COUNTER__)); \ + asm volatile("%c0:\n\t" \ + ".pushsection .discard.reachable\n\t" \ + ".long %c0b - .\n\t" \ + ".popsection\n\t" : : "i" (__COUNTER__)); \ }) #define annotate_unreachable() ({ \ - asm volatile("ANNOTA...
2018 Dec 13
2
[PATCH] kbuild, x86: revert macros in extended asm workarounds
...iler.h @@ -99,13 +99,22 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, * unique, to convince GCC not to merge duplicate inline asm statements. */ #define annotate_reachable() ({ \ - asm volatile("ANNOTATE_REACHABLE counter=%c0" \ - : : "i" (__COUNTER__)); \ + asm volatile("%c0:\n\t" \ + ".pushsection .discard.reachable\n\t" \ + ".long %c0b - .\n\t" \ + ".popsection\n\t" : : "i" (__COUNTER__)); \ }) #define annotate_unreachable() ({ \ - asm volatile("ANNOTA...
2017 Apr 04
1
[inline-asm][asm-goto] Supporting "asm goto" in inline assembly
...quot;.long 0b, %l0;" \ > > ".popsection" \ > > : : : : trace#NUM); \ > > if (0) { trace#NUM: trace(); } \ > > } while (0) > > #define TRACE TRACE1(__COUNTER__) > > In this example (which in fact inspired the asm goto feature) we want on > rare occasions to call the trace function; on other occasions we'd like > to keep the overhead to the absolute minimum. The normal code path consists > of a single nop instruction. However, we record...
2018 Feb 14
0
[inline-asm][asm-goto] Supporting "asm goto" in inline assembly
...quot;.long 0b, %l0;"              \ > >                    ".popsection"                 \ > >                    : : : : trace#NUM);           \ > >          if (0) { trace#NUM: trace(); }          \ > >        } while (0) > >      #define TRACE  TRACE1(__COUNTER__) > > In this example (which in fact inspired the asm goto feature) we > > want on rare occasions to call the trace function; on other > > occasions we'd like to keep the overhead to the absolute minimum. > > The normal code path consists of a single nop instruction. Howe...
2017 Apr 04
4
[inline-asm][asm-goto] Supporting "asm goto" in inline assembly
...> ".long 0b, %l0;" \ > ".popsection" \ > : : : : trace#NUM); \ > if (0) { trace#NUM: trace(); } \ > } while (0) > #define TRACE TRACE1(__COUNTER__) > In this example (which in fact inspired the asm goto feature) we want on rare occasions to call the trace function; on other occasions we'd like to keep the overhead to the absolute minimum. The normal code path consists of a single nop instruction. However, we record the address of this...
2017 Mar 30
3
[inline-asm][asm-goto] Supporting "asm goto" in inline assembly
Linux kernel is using the “asm goto” feature, other projects probably use it as well. I think it provides motivation to support it in LLVM. Regarding the complexity, I believe there is some infrastructure that we can at least partially reuse (the support for “indirectbr” instruction). My focus is adding “asm goto” support, the other things are indeed completely orthogonal and came up in bugs