int main(void) {
1179: 55 pushq %rbp
117a: 48 89 e5 movq %rsp,%rbp
printf("%f\n", pow(2, 3));
117d: 48 8b 05 3c 0f 00 00 movq 0xf3c(%rip),%rax # 20c0 <_IO_stdin_used+0xc0>
1184: 66 48 0f 6e c0 movq %rax,%xmm0
1189: 48 8d 05 90 0e 00 00 leaq 0xe90(%rip),%rax # 2020 <_IO_stdin_used+0x20>
1190: 48 89 c7 movq %rax,%rdi
1193: b8 01 00 00 00 movl $0x1,%eax
1198: e8 93 fe ff ff callq 1030 <printf@plt>
return 0;
119d: b8 00 00 00 00 movl $0x0,%eax
}
11a2: 5d popq %rbp
11a3: c3 retq
int main(void) {
1189: 55 pushq %rbp
118a: 48 89 e5 movq %rsp,%rbp
118d: 48 83 ec 10 subq $0x10,%rsp
int a = 2, b = 3;
1191: c7 45 f8 02 00 00 00 movl $0x2,-0x8(%rbp)
1198: c7 45 fc 03 00 00 00 movl $0x3,-0x4(%rbp)
printf("%f\n", pow(a, b));
119f: 66 0f ef c0 pxor %xmm0,%xmm0
11a3: f2 0f 2a 45 fc cvtsi2sdl -0x4(%rbp),%xmm0
11a8: 66 0f ef d2 pxor %xmm2,%xmm2
11ac: f2 0f 2a 55 f8 cvtsi2sdl -0x8(%rbp),%xmm2
11b1: 66 48 0f 7e d0 movq %xmm2,%rax
11b6: 66 0f 28 c8 movapd %xmm0,%xmm1
11ba: 66 48 0f 6e c0 movq %rax,%xmm0
11bf: e8 bc fe ff ff callq 1080 <pow@plt>
11c4: 66 48 0f 7e c0 movq %xmm0,%rax
11c9: 66 48 0f 6e c0 movq %rax,%xmm0
11ce: 48 8d 05 4b 0e 00 00 leaq 0xe4b(%rip),%rax # 2020 <_IO_stdin_used+0x20>
11d5: 48 89 c7 movq %rax,%rdi
11d8: b8 01 00 00 00 movl $0x1,%eax
11dd: e8 4e fe ff ff callq 1030 <printf@plt>
return 0;
11e2: b8 00 00 00 00 movl $0x0,%eax
}
11e7: c9 leaveq
11e8: c3 retq
是的,因为pow的参数全是常量,编译器就直接帮你计算好了,没有调用pow函数,所以编译的时候不用加 -lm
不用加-lm,是因为没有使用math库里面的东西
|