Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Jens Gustedt <jens.gustedt@loria.fr> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: inline functions |
| Date | 2012-12-05 10:57 +0100 |
| Organization | A noiseless patient Spider |
| Message-ID | <50BF1A99.7060708@loria.fr> (permalink) |
| References | (3 earlier) <87624v6kly.fsf@dpt-info.u-strasbg.fr> <zN6ss.970994$it2.113406@fx22.am4> <871ufi7wl3.fsf@dpt-info.u-strasbg.fr> <50B1139C.1080501@loria.fr> <87hao1m5y2.fsf@riseup.net> |
Am 05.12.2012 06:19, schrieb Sergio Durigan Junior: > On Saturday, November 24 2012, Jens Gustedt wrote: > >> or change to clang, that produces quite readable, annotated assembler >> with the -S option, for which it is much easier to keep track of the >> source lines, much better than gcc > > Don't want to cause any flamewars here (nor to hijack the thread), me neither > but can you provide an example? > You can use the various -d* (I'm thinking > about -dp here, actually) options on GCC to make it annotate the > assembler. -dp provides a very low level annotation of every assembler statement, usually not what *I* need to understand the assembler something like uComp: .LFB683: .cfi_startproc testq %rdx, %rdx # 10 *cmpdi_ccno_1/1 [length = 3] je .L586 # 11 *jcc_1 [length = 2] movq (%rdx), %rcx # 13 *movdi_internal_rex64/2 [length = 3] xorl %edx, %edx # 88 *movdi_xor [length = 2] movq (%rdi), %rax # 14 *movdi_internal_rex64/2 [length = 3] divq %rcx # 76 *udivmoddi4_noext [length = 3] movq (%rsi), %rax # 17 *movdi_internal_rex64/2 [length = 3] movq %rdx, %rdi # 71 *movdi_internal_rex64/2 [length = 3] xorl %edx, %edx # 89 *movdi_xor [length = 2] divq %rcx # 78 *udivmoddi4_noext [length = 3] xorl %ecx, %ecx # 90 *movsi_xor [length = 2] cmpq %rdx, %rdi # 91 *cmpdi_1/1 [length = 3] movl $-1, %eax # 7 *movsi_internal/1 [length = 5] seta %cl # 92 *setcc_qi_slp [length = 3] cmovae %ecx, %eax # 63 *movsicc_noc/1 [length = 3] ret # 82 return_internal [length = 1] .p2align 4,,10 .p2align 3 .L586: movq (%rsi), %rcx # 72 *movdi_internal_rex64/2 [length = 3] xorl %edx, %edx # 85 *movsi_xor [length = 2] movl $-1, %eax # 6 *movsi_internal/1 [length = 5] cmpq %rcx, (%rdi) # 86 *cmpdi_1/1 [length = 3] seta %dl # 87 *setcc_qi_slp [length = 3] cmovae %edx, %eax # 67 *movsicc_noc/1 [length = 3] ret # 84 return_internal [length = 1] .cfi_endproc .LFE683: .size uComp, .-uComp > Don't know how clang annotates it, I don't have it installed > here. Clang (with just -S) annotates the same code more lightly but with higher level annotations corresponding to the structure of the source, here in particular the if-then-else constructs that generated the branching. uComp: # @uComp .cfi_startproc # BB#0: # %entry testq %rdx, %rdx je .LBB9_3 # BB#1: # %if.then movq (%rsi), %rax movq (%rdx), %rsi xorl %edx, %edx divq %rsi movq %rdx, %rcx movq (%rdi), %rax xorl %edx, %edx divq %rsi movl $-1, %eax cmpq %rcx, %rdx jb .LBB9_5 # BB#2: # %cond.false cmpq %rcx, %rdx jmp .LBB9_4 .LBB9_3: # %if.else movq (%rsi), %rcx movq (%rdi), %rdx movl $-1, %eax cmpq %rcx, %rdx jb .LBB9_5 .LBB9_4: # %cond.false.i seta %al movzbl %al, %eax .LBB9_5: # %return ret .Ltmp115: .size uComp, .Ltmp115-uComp .cfi_endproc Jens
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
inline functions "BartC" <bc@freeuk.com> - 2012-11-24 12:20 +0000
Re: inline functions SG <sgesemann@gmail.invalid> - 2012-11-24 14:52 +0100
Re: inline functions "BartC" <bc@freeuk.com> - 2012-11-24 14:48 +0000
Re: inline functions Joost Kraaijeveld <J.Kraaijeveld@Askesis.nl> - 2012-11-24 15:59 +0100
Re: inline functions Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2012-11-24 16:25 +0100
Re: inline functions Johann Klammer <klammerj@NOSPAM.a1.net> - 2012-11-24 19:18 +0100
Re: inline functions Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-11-24 15:07 +0000
Re: inline functions "BartC" <bc@freeuk.com> - 2012-11-24 15:33 +0000
Re: inline functions Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2012-11-24 17:17 +0100
Re: inline functions "BartC" <bc@freeuk.com> - 2012-11-24 16:39 +0000
Re: inline functions Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2012-11-24 18:13 +0100
Re: inline functions Jens Gustedt <jens.gustedt@loria.fr> - 2012-11-24 19:36 +0100
Re: inline functions Sergio Durigan Junior <sergiodj@riseup.net> - 2012-12-05 03:19 -0200
Re: inline functions Jens Gustedt <jens.gustedt@loria.fr> - 2012-12-05 10:57 +0100
Re: inline functions Sergio Durigan Junior <sergiodj@riseup.net> - 2012-12-05 15:34 -0200
Re: inline functions Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-11-25 09:43 +0000
Re: inline functions Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2012-11-25 11:32 +0100
Re: inline functions Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-11-27 21:55 +0000
Re: inline functions "christian.bau" <christian.bau@cbau.wanadoo.co.uk> - 2012-11-26 04:16 -0800
Re: inline functions David Brown <david@westcontrol.removethisbit.com> - 2012-11-26 14:13 +0100
Re: inline functions Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-11-28 21:27 +0000
Re: inline functions James Kuyper <jameskuyper@verizon.net> - 2012-11-28 16:40 -0500
Re: inline functions Ben Pfaff <blp@cs.stanford.edu> - 2012-11-28 14:15 -0800
Re: inline functions Sergio Durigan Junior <sergiodj@riseup.net> - 2012-11-29 00:02 -0200
Re: inline functions Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-11-29 07:24 -0800
Re: inline functions James Kuyper <jameskuyper@verizon.net> - 2012-11-29 11:04 -0500
Re: inline functions Sergio Durigan Junior <sergiodj@riseup.net> - 2012-11-29 14:44 -0200
Re: inline functions Les Cargill <lcargill99@comcast.com> - 2012-11-29 12:44 -0600
Re: inline functions Sergio Durigan Junior <sergiodj@riseup.net> - 2012-11-29 20:43 -0200
Re: inline functions Les Cargill <lcargill99@comcast.com> - 2012-11-29 20:14 -0600
Re: inline functions Ian Collins <ian-news@hotmail.com> - 2012-11-30 07:44 +1300
Re: inline functions Sergio Durigan Junior <sergiodj@riseup.net> - 2012-11-29 20:38 -0200
Re: inline functions Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-12-05 03:17 +0000
Re: inline functions Noob <root@127.0.0.1> - 2012-12-05 11:26 +0100
Re: inline functions David Brown <david@westcontrol.removethisbit.com> - 2012-11-26 11:23 +0100
Re: inline functions "BartC" <bc@freeuk.com> - 2012-11-26 13:01 +0000
Re: inline functions David Brown <david@westcontrol.removethisbit.com> - 2012-11-26 14:24 +0100
Re: inline functions Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-11-26 05:35 -0800
Re: inline functions Les Cargill <lcargill99@comcast.com> - 2012-11-26 07:57 -0600
Re: inline functions Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-11-26 07:07 -0800
Re: inline functions Rosario1903 <Rosario@invalid.invalid> - 2012-11-27 09:46 +0100
Re: inline functions David Brown <david@westcontrol.removethisbit.com> - 2012-11-27 10:50 +0100
Re: inline functions "BartC" <bc@freeuk.com> - 2012-11-26 14:14 +0000
Re: inline functions "BartC" <bc@freeuk.com> - 2012-11-26 15:14 +0000
Re: inline functions Rosario1903 <Rosario@invalid.invalid> - 2012-11-27 09:46 +0100
Re: inline functions "BartC" <bc@freeuk.com> - 2012-11-27 14:41 +0000
Re: inline functions David Brown <david@westcontrol.removethisbit.com> - 2012-11-27 11:01 +0100
Re: inline functions "BartC" <bc@freeuk.com> - 2012-11-27 14:37 +0000
Re: inline functions Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2012-11-27 18:22 +0100
Re: inline functions James Kuyper <jameskuyper@verizon.net> - 2012-11-27 12:55 -0500
Re: inline functions Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-11-27 22:06 +0000
Re: inline functions David Brown <david@westcontrol.removethisbit.com> - 2012-11-29 09:47 +0100
Re: inline functions glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-11-26 14:39 +0000
Re: inline functions Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-11-24 07:20 -0800
Re: inline functions James Kuyper <jameskuyper@verizon.net> - 2012-11-24 10:44 -0500
Re: inline functions James Kuyper <jameskuyper@verizon.net> - 2012-11-24 10:35 -0500
Re: inline functions Philip Lantz <prl@canterey.us> - 2012-11-24 22:56 -0800
Re: inline functions James Dow Allen <jdallen2000@yahoo.com> - 2012-11-25 01:18 -0800
csiph-web