[Bug jit/87291] Add support for inline asm to libgccjit

2020-11-12 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 David Malcolm changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-08 Thread bouanto at zoho dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #32 from Antoni --- Thanks; that looks really nice. The function gcc_jit_context_add_top_level_asm might be missing a location parameter. (In reply to David Malcolm from comment #31) > Created attachment 48704 [details] > v4 of the

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-08 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 David Malcolm changed: What|Removed |Added Attachment #48694|0 |1 is obsolete|

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-08 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 David Malcolm changed: What|Removed |Added Last reconfirmed||2020-06-08 Ever confirmed|0

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-06 Thread bouanto at zoho dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #29 from bouanto at zoho dot com --- This API looks fine. Another test would be to create a simple function, the equivalent of this: #include asm( "add:\n" "movq %rdi, %rax\n" "add %rsi, %rax\n" "ret\n"); extern in

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-06 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #28 from David Malcolm --- Generated HTML for docs (albeit without css) here: https://dmalcolm.fedorapeople.org/gcc/2020-06-06/asm-v3.html

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-06 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 David Malcolm changed: What|Removed |Added Attachment #48684|0 |1 is obsolete|

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-06 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #26 from David Malcolm --- (there's also -fno-toplevel-reorder which makes me wonder if we do need to preserve ordering with such constructs)

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-06 Thread bouanto at zoho dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #25 from bouanto at zoho dot com --- (In reply to David Malcolm from comment #24) > (In reply to bouanto from comment #23) > > Created attachment 48685 [details] > > Example of global assembly > > [...snip; thanks for the feedback

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-06 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #24 from David Malcolm --- (In reply to bouanto from comment #23) > Created attachment 48685 [details] > Example of global assembly [...snip; thanks for the feedback] > I attached an example of global assembly. Thanks. > I don

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-05 Thread bouanto at zoho dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #23 from bouanto at zoho dot com --- Created attachment 48685 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48685&action=edit Example of global assembly See answers below. (In reply to David Malcolm from comment #22) > Created

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-05 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 David Malcolm changed: What|Removed |Added Attachment #48677|0 |1 is obsolete|

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-05 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #21 from David Malcolm --- (In reply to bouanto from comment #20) > Well, there's syntax for assembly at the top-level so the user can enter > anything he wants, like in C. > I can craft you an example if you need to, though. I could

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-05 Thread bouanto at zoho dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #20 from bouanto at zoho dot com --- Well, there's syntax for assembly at the top-level so the user can enter anything he wants, like in C. I can craft you an example if you need to, though. (In reply to David Malcolm from comment #19

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-05 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #19 from David Malcolm --- (In reply to bouanto from comment #18) > (In reply to David Malcolm from comment #16) > > Created attachment 48677 [details] > This API looks good. Thanks. [...snip...] > > "Basic" asm > > ===

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-04 Thread bouanto at zoho dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #18 from bouanto at zoho dot com --- See answers below. (In reply to David Malcolm from comment #16) > Created attachment 48677 [details] > Work-in-progress patch > > I had a go at implementing this; attached is a work-in-progress pr

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-04 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #17 from David Malcolm --- (also uploaded to https://dmalcolm.fedorapeople.org/gcc/2020-06-04/0001-FIXME-WIP-on-extended-asm-support.patch )

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-04 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #16 from David Malcolm --- Created attachment 48677 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48677&action=edit Work-in-progress patch I had a go at implementing this; attached is a work-in-progress prototype. It works fo

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-04 Thread bouanto at zoho dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #15 from bouanto at zoho dot com --- (In reply to David Malcolm from comment #14) > Or even move the flags to API calls: > > extern gcc_jit_extended_asm * > gcc_jit_block_add_extended_asm (gcc_jit_block *block, >

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-04 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #14 from David Malcolm --- Or even move the flags to API calls: extern gcc_jit_extended_asm * gcc_jit_block_add_extended_asm (gcc_jit_block *block, const char *asm_template);

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-04 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #13 from David Malcolm --- An alternative approach that reduces the number of params by splitting it into successive calls: extern gcc_jit_extended_asm * gcc_jit_block_add_extended_asm (gcc_jit_block *block,

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-03 Thread bouanto at zoho dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #12 from bouanto at zoho dot com --- Since there would be many options, we could use a bitflags parameter instead of having multiple parameters for the options.

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-03 Thread programmerjake at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #11 from programmerjake at gmail dot com --- (In reply to programmerjake from comment #10) > (In reply to bouanto from comment #9) > > Does gcc provide a way to specify whether the stack should be aligned > > properly, or is it done au

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-03 Thread programmerjake at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 programmerjake at gmail dot com changed: What|Removed |Added CC||programmerjake at gmail

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-03 Thread bouanto at zoho dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #9 from bouanto at zoho dot com --- Ok, so you would go without a function-like API. I think you're missing a few parameters here, like the ASM dialect (intel vs ATT) unless that would be the string ".intel_syntax;" at the start of th

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-03 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #8 from David Malcolm --- Reading the docs for extended asm, I think the API entrypoint would need to look something like: extern void gcc_jit_block_add_extended_asm (gcc_jit_block *block, int is_volat

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-03 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #7 from David Malcolm --- (In reply to Andrew Pinski from comment #5) > (In reply to bouanto from comment #4) > > So, an example like this: > > > > ```c > > bool old; > > __asm__ ("btsl %2,%1\n\t" // Turn on zero-based bit #Offset in

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-03 Thread bouanto at zoho dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #6 from bouanto at zoho dot com --- (In reply to Andrew Pinski from comment #5) > (In reply to bouanto from comment #4) > > So, an example like this: > > > > ```c > > bool old; > > __asm__ ("btsl %2,%1\n\t" // Turn on zero-based bit #

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-03 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #5 from Andrew Pinski --- (In reply to bouanto from comment #4) > So, an example like this: > > ```c > bool old; > __asm__ ("btsl %2,%1\n\t" // Turn on zero-based bit #Offset in Base. > "sbb %0,%0" // Use the CF to calc

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-03 Thread bouanto at zoho dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #4 from bouanto at zoho dot com --- Oh, maybe it wasn't clear, but what I meant by constraints is: the output operands, the input operands, and clobbers. I guess we could make multiple parameters in the function for those. For the thi

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-03 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #3 from David Malcolm --- Note to self: GCC's documentation for using asm from C: https://gcc.gnu.org/onlinedocs/gcc/Using-Assembly-Language-with-C.html Thanks for the suggestions. I'm not seeing how the proposed entrypoints in co

[Bug jit/87291] Add support for inline asm to libgccjit

2020-06-03 Thread bouanto at zoho dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 bouanto at zoho dot com changed: What|Removed |Added CC||bouanto at zoho dot com --- Com

[Bug jit/87291] Add support for inline asm to libgccjit

2018-09-12 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87291 --- Comment #1 from David Malcolm --- Feature requests like this are fine here (though I make no guarantees about actually implementing them). Any thoughts on what the API should look like?