Let's consider the following program, which computes an unsigned square of the argument:
.global foo
.text
foo:
mov %rdi, %rax
mul %rdi
ret
This is properly compiled by as
, but disassembles to
0000000000000000 <foo>:
0: 48 89 f8 mov %rdi,%rax
3: 48 f7 e7 mul %rdi
6: c3 retq
Is there any difference between ret
and retq
?