On Sun, 2008-08-10 at 12:48 +0100, David Woodhouse wrote: > On PPC64 this reduces the size of the code calculating these bits by > about 60%. (gdb) disass make_what_old Dump of assembler code for function make_what_old: 0x0000000000000000 <make_what_old+0>: std r30,-16(r1) 0x0000000000000004 <make_what_old+4>: ld r30,0(r2) 0x0000000000000008 <make_what_old+8>: rlwinm r9,r3,29,30,30 0x000000000000000c <make_what_old+12>: rlwinm r10,r3,1,29,29 0x0000000000000010 <make_what_old+16>: extsw r9,r9 0x0000000000000014 <make_what_old+20>: rlwinm r7,r3,0,29,29 0x0000000000000018 <make_what_old+24>: ld r8,-32768(r30) 0x000000000000001c <make_what_old+28>: rldicr r9,r9,2,61 0x0000000000000020 <make_what_old+32>: rlwinm r11,r3,30,28,28 0x0000000000000024 <make_what_old+36>: ld r30,-16(r1) 0x0000000000000028 <make_what_old+40>: extsw r10,r10 0x000000000000002c <make_what_old+44>: rlwinm r0,r3,30,27,27 0x0000000000000030 <make_what_old+48>: rldicr r10,r10,2,61 0x0000000000000034 <make_what_old+52>: extsw r11,r11 0x0000000000000038 <make_what_old+56>: lwzx r9,r8,r9 0x000000000000003c <make_what_old+60>: lwzx r3,r8,r7 0x0000000000000040 <make_what_old+64>: extsw r0,r0 0x0000000000000044 <make_what_old+68>: rldicr r11,r11,2,61 0x0000000000000048 <make_what_old+72>: or r3,r3,r9 0x000000000000004c <make_what_old+76>: rldicr r0,r0,2,61 0x0000000000000050 <make_what_old+80>: lwzx r9,r8,r10 0x0000000000000054 <make_what_old+84>: or r3,r3,r4 0x0000000000000058 <make_what_old+88>: lwzx r11,r8,r11 0x000000000000005c <make_what_old+92>: or r3,r3,r9 0x0000000000000060 <make_what_old+96>: lwzx r0,r8,r0 0x0000000000000064 <make_what_old+100>: or r3,r3,r11 0x0000000000000068 <make_what_old+104>: or r3,r3,r0 0x000000000000006c <make_what_old+108>: clrldi r3,r3,32 0x0000000000000070 <make_what_old+112>: blr End of assembler dump. (gdb) disass make_what_new Dump of assembler code for function make_what_new: 0x0000000000000074 <make_what_new+0>: mr r0,r3 0x0000000000000078 <make_what_new+4>: rlwinm r3,r3,16,13,13 0x000000000000007c <make_what_new+8>: rlwinm r9,r0,15,12,12 0x0000000000000080 <make_what_new+12>: rlwinm r11,r0,26,4,4 0x0000000000000084 <make_what_new+16>: or r3,r3,r9 0x0000000000000088 <make_what_new+20>: rlwinm r9,r0,23,3,3 0x000000000000008c <make_what_new+24>: or r3,r3,r4 0x0000000000000090 <make_what_new+28>: rlwinm r0,r0,23,2,2 0x0000000000000094 <make_what_new+32>: or r3,r3,r11 0x0000000000000098 <make_what_new+36>: or r3,r3,r9 0x000000000000009c <make_what_new+40>: or r3,r3,r0 0x00000000000000a0 <make_what_new+44>: clrldi r3,r3,32 0x00000000000000a4 <make_what_new+48>: blr End of assembler dump. > On x86_64 it's less of a win -- only 40%. (gdb) disass make_what_old Dump of assembler code for function make_what_old: 0x0000000000000000 <make_what_old+0>: mov %edi,%edx 0x0000000000000002 <make_what_old+2>: mov %rdi,%rax 0x0000000000000005 <make_what_old+5>: push %rbp 0x0000000000000006 <make_what_old+6>: and $0x10,%edx 0x0000000000000009 <make_what_old+9>: and $0x4,%eax 0x000000000000000c <make_what_old+12>: sar $0x3,%edx 0x000000000000000f <make_what_old+15>: mov 0x0(%rax),%eax 0x0000000000000015 <make_what_old+21>: mov %rsp,%rbp 0x0000000000000018 <make_what_old+24>: movslq %edx,%rdx 0x000000000000001b <make_what_old+27>: or 0x0(,%rdx,4),%eax 0x0000000000000022 <make_what_old+34>: mov %edi,%edx 0x0000000000000024 <make_what_old+36>: and $0x2,%edx 0x0000000000000027 <make_what_old+39>: add %edx,%edx 0x0000000000000029 <make_what_old+41>: movslq %edx,%rdx 0x000000000000002c <make_what_old+44>: or %esi,%eax 0x000000000000002e <make_what_old+46>: or 0x0(,%rdx,4),%eax 0x0000000000000035 <make_what_old+53>: mov %edi,%edx 0x0000000000000037 <make_what_old+55>: and $0x20,%edx 0x000000000000003a <make_what_old+58>: and $0x40,%edi 0x000000000000003d <make_what_old+61>: sar $0x2,%edx 0x0000000000000040 <make_what_old+64>: sar $0x2,%edi 0x0000000000000043 <make_what_old+67>: movslq %edx,%rdx 0x0000000000000046 <make_what_old+70>: movslq %edi,%rdi 0x0000000000000049 <make_what_old+73>: or 0x0(,%rdx,4),%eax 0x0000000000000050 <make_what_old+80>: or 0x0(,%rdi,4),%eax 0x0000000000000057 <make_what_old+87>: leaveq 0x0000000000000058 <make_what_old+88>: retq End of assembler dump. (gdb) disass make_what_new Dump of assembler code for function make_what_new: 0x0000000000000059 <make_what_new+0>: mov %edi,%eax 0x000000000000005b <make_what_new+2>: mov %edi,%edx 0x000000000000005d <make_what_new+4>: push %rbp 0x000000000000005e <make_what_new+5>: and $0x4,%eax 0x0000000000000061 <make_what_new+8>: and $0x10,%edx 0x0000000000000064 <make_what_new+11>: shl $0xf,%edx 0x0000000000000067 <make_what_new+14>: shl $0x10,%eax 0x000000000000006a <make_what_new+17>: mov %rsp,%rbp 0x000000000000006d <make_what_new+20>: or %edx,%eax 0x000000000000006f <make_what_new+22>: mov %edi,%edx 0x0000000000000071 <make_what_new+24>: and $0x2,%edx 0x0000000000000074 <make_what_new+27>: or %esi,%eax 0x0000000000000076 <make_what_new+29>: shl $0x1a,%edx 0x0000000000000079 <make_what_new+32>: leaveq 0x000000000000007a <make_what_new+33>: or %edx,%eax 0x000000000000007c <make_what_new+35>: mov %edi,%edx 0x000000000000007e <make_what_new+37>: and $0x40,%edi 0x0000000000000081 <make_what_new+40>: and $0x20,%edx 0x0000000000000084 <make_what_new+43>: shl $0x17,%edi 0x0000000000000087 <make_what_new+46>: shl $0x17,%edx 0x000000000000008a <make_what_new+49>: or %edx,%eax 0x000000000000008c <make_what_new+51>: or %edi,%eax 0x000000000000008e <make_what_new+53>: retq End of assembler dump. -- David Woodhouse Open Source Technology Centre David.Woodhouse@xxxxxxxxx Intel Corporation -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html