Ignore:
Timestamp:
Jan 21, 2018, 12:10:09 AM (6 years ago)
Author:
coas-nagasima
Message:

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

Location:
EcnlProtoTool/trunk/tcc-0.9.27
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • EcnlProtoTool/trunk/tcc-0.9.27/tests/asmtest.S

    • Property svn:keywords deleted
    r279 r331  
    1212   .byte 1
    1313/* .align 16, 0x90 gas is too clever for us with 0x90 fill */
     14   .balign 4, 0x92
    1415   .align 16, 0x91 /* 0x91 tests the non-clever behaviour */
    1516   .skip 3
    1617   .skip 15, 0x90
    1718   .string "hello\0world"
    18 
     19/* Macro expansion should work like with C, the #n shouldn't be parsed
     20   as asm line comment */
     21#define __stringify(n) #n
     22#define stringify(n) __stringify(n)
     23   .skip 8,0x90
     24   .asciz stringify(BLA)
     25   .skip 8,0x90
     26
     27# 28 "asmtest.S"        # a line directive (and a line comment)
     28        movl %eax, %ebx # some more asm comment
    1929/* some label tests */
    20 
    21         movl %eax, %ebx
    2230L1:
    2331        movl %eax, %ebx
     
    3947mov $1, %edx
    4048mov $1, %dx
    41 mov $1, %dl
     49mov $1, %cl
    4250movb $2, 0x100(%ebx,%edx,2)
    4351movw $2, 0x100(%ebx,%edx,2)
     
    4755movw %ax, 0x100(%ebx,%edx,2)
    4856
     57movw $0x1122,%si
     58movl $0x112233,%edx
     59movl $0x80000000, %esi
     60movl $-0x7fffffff, %edi
     61#ifdef __x86_64__
     62mov $0x11223344,%rbx
     63movq $0x11223344,%rbx
     64mov $0x1122334455,%rbx
     65movq $0x1122334455,%rbx
     66movl $0x11334455,(%rbx)
     67#endif
     68
    4969mov %eax, 0x12(,%edx,2)
    5070       
     71#ifdef __i386__
    5172mov %cr3, %edx
    5273mov %ecx, %cr3
     
    5576movl %db3, %ebx
    5677movl %dr6, %eax
     78#else
     79mov %cr3, %rdx
     80mov %rcx, %cr3
     81movq %cr3, %rax
     82movq %db3, %rbx
     83movq %dr6, %rax
     84mov %cr8, %rsi
     85mov %rdi, %cr8
     86#endif
    5787movl %fs, %ecx
    5888movl %ebx, %fs
     89
     90#ifdef __x86_64__
     91movq %r8, %r9
     92movq %r10, %r11
     93movq %r12, %r13
     94movq %r14, %r15
     95movq %rax, %r9
     96movq %r15, %rsi
     97inc %r9b
     98dec %r10w
     99not %r11d
     100negq %r12
     101decb %r13b
     102incw %r14w
     103notl %r15d
     104#endif
    59105
    60106     movsbl 0x1000, %eax
     
    69115     movzb 0x1000, %ax
    70116               
     117     mov $0x12345678,%eax
     118
     119#ifdef __x86_64__
     120     movzb 0x1000, %rax
     121     movzbq 0x1000, %rbx
     122     movsbq 0x1000, %rdx
     123     movzwq 0x1000, %rdi
     124     movswq 0x1000, %rdx
     125     movslq %eax, %rcx
     126     mov $0x12345678,%rax
     127     mov $0x12345678,%rdx
     128     mov $0x12345678,%r10
     129     mov $0x123456789abcdef0,%rax
     130     mov $0x123456789abcdef0,%rcx
     131     mov $0x123456789abcdef0,%r11
     132#endif
    71133       
     134#ifdef __i386__
    72135  pushl %eax
    73   pushw %ax
    74136  push %eax
    75137  push %cs
     138#else
     139  pushq %rax
     140  push %rax
     141#endif
     142  pushw %ax
    76143  push %gs
    77144  push $1
    78145  push $100
     146  push 0x42(%eax)
     147  pop 0x43(%esi)
    79148                                               
     149#ifdef __i386__
    80150  popl %eax
    81   popw %ax
    82151  pop %eax
    83152  pop %ds
     153#else
     154  popq %rax
     155  pop %rax
     156#endif
     157  popw %ax
    84158  pop %fs
    85159         
     
    112186  lea 0x1000(%ebx), %ecx
    113187
     188#ifdef __i386__
    114189  les 0x2000, %eax
    115190  lds 0x2000, %ebx
     191  lss 0x2000, %edx
     192#endif
    116193  lfs 0x2000, %ecx
    117194  lgs 0x2000, %edx
    118   lss 0x2000, %edx
    119195
    120196addl $0x123, %eax
    121197add $0x123, %ebx
     198add $-16, %ecx
     199add $-0x123, %esi
     200add $1, %bx
     201add $1, %ebx
     202add $-1, %bx
     203add $-1, %ebx
     204add $127, %bx
     205addl $127, %ebx
     206addl $-128, %ebx
     207addl $-128, %ebx
     208addl $-129, %ebx
     209addl $128, %ebx
     210addl $255, %ebx
     211addl $256, %ebx
     212andb $0xf, %ah
     213andb $-15, %cl
     214xorb $127, %dh
     215cmpb $42, (%eax)
    122216addl $0x123, 0x100
    123217addl $0x123, 0x100(%ebx)
     
    128222addl $0x123, (%esp)
    129223cmpl $0x123, (%esp)
     224
     225#ifdef __x86_64__
     226xor %bl,%ah
     227xor %bl,%r8b
     228xor %r9b,%bl
     229xor %sil,%cl
     230add %eax,(%r8d)
     231add %ebx,(%r9)
     232add %edx,(%r10d,%r11d)
     233add %ecx,(%r12,%r13)
     234add %esi,(%r14,%r15,4)
     235add %edi,0x1000(%rbx,%r12,8)
     236add %r11,0x1000(%ebp,%r9d,8)
     237movb $12, %ah
     238movb $13, %bpl
     239movb $14, %dil
     240movb $15, %r12b
     241#endif
    130242
    131243add %eax, (%ebx)
     
    180292    div %ecx, %eax
    181293
     294and $15,%bx
     295and $-20,%edx
    182296
    183297shl %edx
     
    196310call 0x1000
    197311call L4
     312#ifdef __i386__
    198313call *%eax
     314#else
     315call *%rax
     316#endif
    199317call *0x1000
    200318call func1
     
    205323L6:
    206324
     325#ifdef __i386__
    207326lcall $0x100, $0x1000
     327#else
     328lcall *0x100
     329lcall *(%rax)
     330#endif
    208331
    209332jmp 0x1000
     333jmp *(%edi)
     334#ifdef __i386__
    210335jmp *%eax
     336#else
     337jmp *%rax
     338#endif
    211339jmp *0x1000
    212340
     341#ifdef __i386__
    213342ljmp $0x100, $0x1000
     343#else
     344ljmp *0x100
     345ljmp *(%rdi)
     346ljmpl *(%esi)
     347ljmpw *(%esi)
     348#endif
    214349
    215350ret
     351ret $10
     352#ifdef __i386__
    216353retl
    217 
    218 ret $10
    219354retl $10
     355#else
     356retq
     357retq $10
     358#endif
    220359
    221360lret
     
    245384       
    246385 seto %al
     386 setc %al
     387 setcb %al
    247388 setnp 0x1000
    248389 setl 0xaaaa
     
    402543
    403544bswap %edx
     545bswapl %ecx
    404546xadd %ecx, %edx
    405547xaddb %dl, 0x1000
     
    412554invlpg 0x1000
    413555cmpxchg8b 0x1002
     556#ifdef __x86_64__
     557cmpxchg16b (%rax)
     558cmpxchg16b (%r10,%r11)
     559#endif
    414560
    415561fcmovb %st(5), %st
     
    431577 cmovs 0x1000, %eax
    432578 cmovns %edx, %edi
     579 cmovne %ax, %si
     580 cmovbw %ax, %di
     581 cmovnbel %edx, %ecx
     582#ifdef __x86_64__
     583 bswapq %rsi
     584 bswapq %r10
     585 cmovz %rdi,%rbx
     586 cmovpeq %rsi, %rdx
     587#endif
    433588
    434589int $3
    435590int $0x10
    436591
     592#ifdef __i386__
    437593    pusha
    438594    popa
    439     clc
    440     cld
     595#endif
     596    clc # another comment
     597    cld # a comment with embedded ' tick
    441598    cli
    442599    clts
     
    444601    lahf
    445602    sahf
     603#ifdef __i386__
    446604    pushfl
    447605    popfl
     606#else
     607    pushfq
     608    popfq
     609#endif
    448610    pushf
    449611    popf
     
    451613    std
    452614    sti
     615#ifdef __i386__
    453616    aaa
    454617    aas
     
    457620    aad
    458621    aam
     622    into
     623#endif
    459624    cbw
    460625    cwd
     
    467632    leave
    468633    int3
    469     into
    470634    iret
    471635    rsm
     
    512676    rdpmc
    513677    ud2
    514 
     678#ifdef __x86_64__
     679    syscall
     680    sysret
     681    sysretq
     682    lfence
     683    mfence
     684    sfence
     685    prefetchnta 0x18(%rdx)
     686    prefetcht0 (%rcx)
     687    prefetcht1 (%rsi)
     688    prefetcht2 (%rdi)
     689    prefetchw (%rdi)
     690    clflush 0x1000(%rax,%rcx)
     691    fxsaveq (%rdx)
     692    fxsaveq (%r11)
     693    fxrstorq (%rcx)
     694    fxrstorq (%r10)
     695
     696#endif
     697
     698    lar %ax,%dx
     699    lar %eax,%dx
     700    lar %ax,%edx
     701    lar %eax,%edx
     702#ifdef __x86_64__
     703    lar %ax,%rdx
     704    lar %eax,%rdx
     705#endif
    515706    emms
    516707    movd %edx, %mm3
     
    557748       
    558749       
     750#ifdef __i386__
    559751    boundl %edx, 0x10000
    560752    boundw %bx, 0x1000
    561    
     753
    562754    arpl %bx, 0x1000
     755#endif
    563756    lar 0x1000, %eax
    564757    lgdt 0x1000
    565758    lidt 0x1000
    566759    lldt 0x1000
     760    sgdt 0x1000
     761    sidt 0x1000
     762    sldt 0x1000
     763#ifdef __x86_64__
     764    lgdtq 0x1000
     765    lidtq 0x1000
     766    sgdtq 0x1000
     767    sidtq 0x1000
     768
     769    swapgs
     770
     771    str %rdx
     772    str %r9
     773#endif
     774
    567775    lmsw 0x1000
    568776    lsl 0x1000, %ecx
    569777    ltr 0x1000
    570    
    571     sgdt 0x1000
    572     sidt 0x1000
    573     sldt 0x1000
     778    ltr %si
    574779    smsw 0x1000
    575780    str 0x1000
     781    str %ecx
     782    str %dx
    576783   
    577784    verr 0x1000
    578785    verw 0x1000
    579786 
     787#ifdef __i386__
    580788    push %ds
    581789    pushw %ds
     
    584792    popw %ds
    585793    popl %ds
     794#endif
    586795    fxsave 1(%ebx)
    587796    fxrstor 1(%ecx)
     797#ifdef __i386__
    588798    pushl $1
     799#else
     800    pushq $1
     801#endif
    589802    pushw $1
    590803    push $1
     
    594807#endif
    595808
     809#ifndef _WIN32
    596810ft1: ft2: ft3: ft4: ft5: ft6: ft7: ft8: ft9:
    597811    xor %eax, %eax
     
    606820.type ft7,%function
    607821.type ft8,"function"
     822#endif
    608823
    609824    pause
     825.rept 6
     826    nop
     827.endr
     828.fill 4,1,0x90
     829
     830.section .text.one,"ax"
     831nop
     832.previous
     833.pushsection .text.one,"ax"
     834nop
     835.pushsection .text.two,"ax"
     836nop
     837.popsection
     838.popsection
     839
     8401: ud2
     841.pushsection __bug_table,"a"
     842.align 8
     8432: .long 1b - 2b
     844   .long 0x600000 - 2b
     845   .long 1b + 42
     846   .long 43 + 1b
     847   .long 2b + 144
     848   .long 145 + 2b
     849   .word 164, 0
     850   .org 2b+32
     851#ifdef __x86_64__
     852   .quad 1b
     853#else
     854   .long 1b
     855#endif
     856.popsection
     8573: mov %eax,%ecx
     8584:
     859.pushsection .text.three, "ax"
     860nop
     861.skip (-((4b-3b) > 0) * 2) , 0x90
     862.popsection
     863
     864.globl overrideme
     865.weak overrideme
     866  nop
     867.globl notimplemented
     868notimplemented:
     869  ret
     870.set overrideme, notimplemented
     871overrideme = notimplemented
     872overrideme:
     873  ret
     874
     875    movd %esi, %mm1
     876    movd %edi, %xmm2
     877    movd (%ebx), %mm3
     878    movd (%ebx), %xmm3
     879    movd %mm1, %esi
     880    movd %xmm2, %edi
     881    movd %mm3, (%edx)
     882    movd %xmm3, (%edx)
     883#ifdef __x86_64__
     884    movd %rsi, %mm1
     885    movd %rdi, %xmm2
     886    movd (%rbx), %mm3
     887    movd (%rbx), %xmm3
     888    movd %mm1, %r12
     889    movd %xmm2, %rdi
     890    movd %mm3, (%r8)
     891    movd %xmm3, (%r13)
     892#endif
     893
     894    movq (%ebp), %mm1
     895    movq %mm2, (%edi)
     896    movq (%edi), %xmm3
     897    movq %mm4, %mm5
     898#ifdef __x86_64__
     899    movq %rcx, %mm1
     900    movq %rdx, %xmm2
     901    movq %r13, %xmm3
     902    /* movq mem64->xmm is encoded as f30f7e by GAS, but as
     903       660f6e by tcc (which really is a movd and would need
     904       a REX.W prefix to be movq).  */
     905    movq (%rsi), %xmm3
     906    movq %mm1, %rdx
     907    movq %xmm3, %rcx
     908    movq %xmm4, (%rsi)
     909#endif
     910
     911#define TEST_MMX_SSE(insn) \
     912    insn %mm1, %mm2; \
     913    insn %xmm2, %xmm3; \
     914    insn (%ebx), %xmm3;
     915#define TEST_MMX_SSE_I8(insn) \
     916    TEST_MMX_SSE(insn) \
     917    insn $0x42, %mm4; \
     918    insn $0x42, %xmm4;
     919
     920    TEST_MMX_SSE(packssdw)
     921    TEST_MMX_SSE(packsswb)
     922    TEST_MMX_SSE(packuswb)
     923    TEST_MMX_SSE(paddb)
     924    TEST_MMX_SSE(paddw)
     925    TEST_MMX_SSE(paddd)
     926    TEST_MMX_SSE(paddsb)
     927    TEST_MMX_SSE(paddsw)
     928    TEST_MMX_SSE(paddusb)
     929    TEST_MMX_SSE(paddusw)
     930    TEST_MMX_SSE(pand)
     931    TEST_MMX_SSE(pandn)
     932    TEST_MMX_SSE(pcmpeqb)
     933    TEST_MMX_SSE(pcmpeqw)
     934    TEST_MMX_SSE(pcmpeqd)
     935    TEST_MMX_SSE(pcmpgtb)
     936    TEST_MMX_SSE(pcmpgtw)
     937    TEST_MMX_SSE(pcmpgtd)
     938    TEST_MMX_SSE(pmaddwd)
     939    TEST_MMX_SSE(pmulhw)
     940    TEST_MMX_SSE(pmullw)
     941    TEST_MMX_SSE(por)
     942    TEST_MMX_SSE(psllw)
     943TEST_MMX_SSE_I8(psllw)
     944    TEST_MMX_SSE(pslld)
     945TEST_MMX_SSE_I8(pslld)
     946    TEST_MMX_SSE(psllq)
     947TEST_MMX_SSE_I8(psllq)
     948    TEST_MMX_SSE(psraw)
     949TEST_MMX_SSE_I8(psraw)
     950    TEST_MMX_SSE(psrad)
     951TEST_MMX_SSE_I8(psrad)
     952    TEST_MMX_SSE(psrlw)
     953TEST_MMX_SSE_I8(psrlw)
     954    TEST_MMX_SSE(psrld)
     955TEST_MMX_SSE_I8(psrld)
     956    TEST_MMX_SSE(psrlq)
     957TEST_MMX_SSE_I8(psrlq)
     958    TEST_MMX_SSE(psubb)
     959    TEST_MMX_SSE(psubw)
     960    TEST_MMX_SSE(psubd)
     961    TEST_MMX_SSE(psubsb)
     962    TEST_MMX_SSE(psubsw)
     963    TEST_MMX_SSE(psubusb)
     964    TEST_MMX_SSE(psubusw)
     965    TEST_MMX_SSE(punpckhbw)
     966    TEST_MMX_SSE(punpckhwd)
     967    TEST_MMX_SSE(punpckhdq)
     968    TEST_MMX_SSE(punpcklbw)
     969    TEST_MMX_SSE(punpcklwd)
     970    TEST_MMX_SSE(punpckldq)
     971    TEST_MMX_SSE(pxor)
     972
     973    cvtpi2ps %mm1, %xmm2
     974    cvtpi2ps (%ebx), %xmm2
     975    TEST_MMX_SSE(pmaxsw)
     976    TEST_MMX_SSE(pmaxub)
     977    TEST_MMX_SSE(pminsw)
     978    TEST_MMX_SSE(pminub)
Note: See TracChangeset for help on using the changeset viewer.