[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] integer suffix abuse
From: |
Tom Bishop, Wenlin Institute |
Subject: |
Re: [ft-devel] integer suffix abuse |
Date: |
Wed, 24 Jun 2015 15:41:20 -0400 |
> On Jun 24, 2015, at 2:36 PM, Alexei Podtelezhnikov <address@hidden> wrote:
>
> On Wed, Jun 24, 2015 at 1:12 PM, Tom Bishop, Wenlin Institute
> <address@hidden> wrote:
>> I would have guessed that with a 64-bit compiler the resulting executable
>> code would be the same with or without L. (The definitions of types like
>> FT_Fixed and FT_Long would make more difference.) Surprisingly, changing all
>> 0x10000L to 0x10000 in FreetypeAmalgam.c really does produce a few different
>> assembly language instructions (using Xcode). (See below for the diff.)
>
> That is reassuring. 64-bit gcc produces exact same code with and
> without L in large numbers. Can you regenerate unified diff (-u) so
> that we can see line numbers?
Here it is (I hope!). -Tom
diff -u test_L.u8 test_no_L.u8
--- test_L.u8 2015-06-24 12:31:44.000000000 -0400
+++ test_no_L.u8 2015-06-24 12:31:32.000000000 -0400
@@ -1,5 +1,5 @@
# Assembly output for FreeTypeAmalgam.c
-# Generated at 12:13:05 PM on Wednesday, June 24, 2015
+# Generated at 12:30:21 PM on Wednesday, June 24, 2015
# Using Debug configuration, x86_64 architecture for Wenlin target of Wenlin
project
.section __TEXT,__text,regular,pure_instructions
@@ -39065,18 +39065,17 @@
Ltmp3912:
LBB176_452: ## in Loop: Header=BB176_5 Depth=1
xorl %eax, %eax
- movl %eax, %ecx
- movl $65536, %eax ## imm = 0x10000
- movl %eax, %edx
+ movl $65536, %ecx ## imm = 0x10000
.loc 1 50377 4 ##
/Users/tbishop/wenlin/freetype_amalg/FreeTypeAmalgam.c:50377:4
cmpq $0, -400(%rbp)
- cmovneq %rdx, %rcx
- movq -144(%rbp), %rdx
- movq %rcx, (%rdx)
+ cmovnel %ecx, %eax
+ movslq %eax, %rdx
+ movq -144(%rbp), %rsi
+ movq %rdx, (%rsi)
.loc 1 50378 4 ##
/Users/tbishop/wenlin/freetype_amalg/FreeTypeAmalgam.c:50378:4
- movq -144(%rbp), %rcx
- addq $8, %rcx
- movq %rcx, -144(%rbp)
+ movq -144(%rbp), %rdx
+ addq $8, %rdx
+ movq %rdx, -144(%rbp)
Ltmp3913:
.loc 1 50380 5 ##
/Users/tbishop/wenlin/freetype_amalg/FreeTypeAmalgam.c:50380:5
jmp LBB176_515
@@ -39106,18 +39105,17 @@
Ltmp3916:
LBB176_457: ## in Loop: Header=BB176_5 Depth=1
xorl %eax, %eax
- movl %eax, %ecx
- movl $65536, %eax ## imm = 0x10000
- movl %eax, %edx
+ movl $65536, %ecx ## imm = 0x10000
.loc 1 50388 4 ##
/Users/tbishop/wenlin/freetype_amalg/FreeTypeAmalgam.c:50388:4
cmpq $0, -408(%rbp)
- cmovneq %rdx, %rcx
- movq -144(%rbp), %rdx
- movq %rcx, (%rdx)
+ cmovnel %ecx, %eax
+ movslq %eax, %rdx
+ movq -144(%rbp), %rsi
+ movq %rdx, (%rsi)
.loc 1 50389 4 ##
/Users/tbishop/wenlin/freetype_amalg/FreeTypeAmalgam.c:50389:4
- movq -144(%rbp), %rcx
- addq $8, %rcx
- movq %rcx, -144(%rbp)
+ movq -144(%rbp), %rdx
+ addq $8, %rdx
+ movq %rdx, -144(%rbp)
Ltmp3917:
.loc 1 50391 5 ##
/Users/tbishop/wenlin/freetype_amalg/FreeTypeAmalgam.c:50391:5
jmp LBB176_515
@@ -39139,18 +39137,17 @@
Ltmp3920:
LBB176_460: ## in Loop: Header=BB176_5 Depth=1
xorl %eax, %eax
- movl %eax, %ecx
- movl $65536, %eax ## imm = 0x10000
- movl %eax, %edx
+ movl $65536, %ecx ## imm = 0x10000
.loc 1 50399 4 ##
/Users/tbishop/wenlin/freetype_amalg/FreeTypeAmalgam.c:50399:4
cmpq $0, -416(%rbp)
- cmovneq %rdx, %rcx
- movq -144(%rbp), %rdx
- movq %rcx, (%rdx)
+ cmovnel %ecx, %eax
+ movslq %eax, %rdx
+ movq -144(%rbp), %rsi
+ movq %rdx, (%rsi)
.loc 1 50400 4 ##
/Users/tbishop/wenlin/freetype_amalg/FreeTypeAmalgam.c:50400:4
- movq -144(%rbp), %rcx
- addq $8, %rcx
- movq %rcx, -144(%rbp)
+ movq -144(%rbp), %rdx
+ addq $8, %rdx
+ movq %rdx, -144(%rbp)
Ltmp3921:
.loc 1 50402 5 ##
/Users/tbishop/wenlin/freetype_amalg/FreeTypeAmalgam.c:50402:5
jmp LBB176_515
@@ -168321,7 +168318,7 @@
cmpq $65536, -64(%rbp) ## imm = 0x10000
jle LBB1002_10
## BB#9: ## in Loop: Header=BB1002_5 Depth=2
- .loc 1 144104 30 ##
/Users/tbishop/wenlin/freetype_amalg/FreeTypeAmalgam.c:144104:30
+ .loc 1 144104 29 ##
/Users/tbishop/wenlin/freetype_amalg/FreeTypeAmalgam.c:144104:29
movq $65536, -64(%rbp) ## imm = 0x10000
Ltmp17140:
LBB1002_10: ## in Loop: Header=BB1002_5 Depth=2
@@ -202113,13 +202110,13 @@
movq -120(%rbp), %rsi
callq _FT_DivFix
movl $65536, %ecx ## imm = 0x10000
- movl %ecx, %esi
- movq $-65536, %rdi ## imm = 0xFFFFFFFFFFFF0000
+ movl $4294901760, %edx ## imm = 0xFFFF0000
movq %rax, -24(%rbp)
.loc 1 144809 4 ##
/Users/tbishop/wenlin/freetype_amalg/FreeTypeAmalgam.c:144809:4
cmpq $0, -40(%rbp)
- cmovlq %rdi, %rsi
- movq %rsi, -40(%rbp)
+ cmovll %edx, %ecx
+ movslq %ecx, %rax
+ movq %rax, -40(%rbp)
Ltmp20512:
LBB1172_11:
.loc 1 144812 2 ##
/Users/tbishop/wenlin/freetype_amalg/FreeTypeAmalgam.c:144812:2
@@ -240479,7 +240476,7 @@
movq %rax, %rdi
callq _FT_Sin
shlq $2, %rax
- .loc 1 75753 22 ##
/Users/tbishop/wenlin/freetype_amalg/FreeTypeAmalgam.c:75753:22
+ .loc 1 75753 21 ##
/Users/tbishop/wenlin/freetype_amalg/FreeTypeAmalgam.c:75753:21
movq -88(%rbp), %rdi
movq %rax, -184(%rbp) ## 8-byte Spill
callq _FT_Cos
Wenlin Institute, Inc. SPC (a Social Purpose Corporation)
文林研究所社会目的公司
Software for Learning Chinese
E-mail: address@hidden Web: http://www.wenlin.com
Telephone: 1-877-4-WENLIN (1-877-493-6546)
☯
Re: [ft-devel] integer suffix abuse, Tom Bishop, Wenlin Institute, 2015/06/24