diff options
Diffstat (limited to 'validation/asm-goto-lables.c')
-rw-r--r-- | validation/asm-goto-lables.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/validation/asm-goto-lables.c b/validation/asm-goto-lables.c new file mode 100644 index 0000000..ac2bf2a --- /dev/null +++ b/validation/asm-goto-lables.c @@ -0,0 +1,22 @@ +static inline int __static_cpu_has(unsigned char bit) +{ + asm goto("1: jmp %l[t_no]\n" + "2:\n" + ".section .altinstructions,\"a\"\n" + "\n" + "1b\n" + "0\n" /* no replacement */ + " .byte %P0\n" /* feature bit */ + " .byte 2b - 1b\n" /* source len */ + " .byte 0\n" /* replacement len */ + " .byte 0xff + 0 - (2b-1b)\n" /* padding */ + ".previous\n" + : : "i" (bit) : : t_no, ble); + return 1; +t_no: + return 0; +} +/* + * check-name: Asm with goto labels. + */ + |