Mercurial > projects > dstress
changeset 702:4c5b7f538994
some more asm tests
author | thomask |
---|---|
date | Wed, 12 Oct 2005 18:22:35 +0000 |
parents | 93c604903b9d |
children | 8dc894322ce8 |
files | run/a/asm_movss_01.d run/a/asm_nop_01.d run/a/asm_not_01_A.d run/a/asm_not_01_B.d run/a/asm_not_01_C.d run/a/asm_or_01_A.d run/a/asm_or_01_B.d run/a/asm_or_01_C.d run/a/asm_pop_01_A.d run/a/asm_pop_01_B.d run/a/asm_push_01_A.d run/a/asm_push_01_B.d run/a/asm_pushad_01.d run/a/asm_pxor_01_A.d run/a/asm_rcl_01_A.d run/a/asm_rcl_01_B.d run/a/asm_rcl_01_C.d run/a/asm_rcr_01_A.d run/a/asm_rcr_01_B.d run/a/asm_rcr_01_C.d run/a/asm_rdtsc_01.d run/a/asm_rol_01_A.d run/a/asm_rol_01_B.d run/a/asm_rol_01_C.d run/a/asm_ror_01_A.d run/a/asm_ror_01_B.d run/a/asm_ror_01_C.d run/a/asm_sal_01_A.d run/a/asm_sal_01_B.d run/a/asm_sal_01_C.d |
diffstat | 30 files changed, 816 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/run/a/asm_movss_01.d Wed Oct 05 08:12:26 2005 +0000 +++ b/run/a/asm_movss_01.d Wed Oct 12 18:22:35 2005 +0000 @@ -11,8 +11,8 @@ float b = 2.8L; asm{ - movsd XMM0, a; - movsd b, XMM0; + movss XMM0, a; + movss b, XMM0; } assert(a==b); @@ -22,4 +22,4 @@ pragma(msg, "no Inline asm support"); static assert(0); } -} \ No newline at end of file +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_nop_01.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,19 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_ax_01.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_nop_01; + +int main(){ + version(D_InlineAsm){ + + asm{ + nop; + } + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_not_01_A.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,22 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_ax_01.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_not_01_A; + +int main(){ + version(D_InlineAsm){ + ubyte a = 0b0110_1110; + + asm{ + not a; + } + + assert(a == 0b1001_0001); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_not_01_B.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,22 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_ax_01.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_not_01_B; + +int main(){ + version(D_InlineAsm){ + ushort a = 0b0110_1110_0000_1111; + + asm{ + not a; + } + + assert(a == 0b1001_0001_1111_0000); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_not_01_C.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,22 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_ax_01.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_not_01_C; + +int main(){ + version(D_InlineAsm){ + uint a = 0b0110_1110__0000_1111__1100_0011__0011_1111; + + asm{ + not a; + } + + assert(a == 0b1001_0001__1111_0000_0011_1100_1100_0000); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_or_01_A.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,24 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_ax_01.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_or_01_A; + +int main(){ + version(D_InlineAsm){ + uint a = 0b0110_1110__0000_1111__1100_0011__0011_1111; + uint b = 0b1110_1111__1111_1111__1111_1110__0111_1111; + + asm{ + mov EAX, a; + or b, EAX; + } + + assert(b == 0b1110_1111__1111_1111__1111_1111__0111_1111); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_or_01_B.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,24 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_ax_01.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_or_01_B; + +int main(){ + version(D_InlineAsm){ + ushort a = 0b0110_1110__0000_1111; + ushort b = 0b1110_1111__1110_0111; + + asm{ + mov AX, a; + or b, AX; + } + + assert(b == 0b1110_1111__1110_1111); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_or_01_C.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,24 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_ax_01.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_or_01_C; + +int main(){ + version(D_InlineAsm){ + ubyte a = 0b0110_1110; + ubyte b = 0b1110_1111; + + asm{ + mov AL, a; + or b, AL; + } + + assert(b == 0b1110_1111); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_pop_01_A.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,34 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_add_01_C.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_push_01_A; + +int main(){ + version(D_InlineAsm){ + ushort a= 0x12_AB; + ushort b= 0x00_00; + size_t p1, p2, p3; + + static if(size_t.sizeof==4){ + asm{ + mov p1, ESP; + push a; + mov p2, ESP; + pop b; + mov p3, ESP; + } + }else{ + static assert(0); + } + + assert(p1==p3); + assert(p1-2==p2); + assert(b==0x12_AB); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_pop_01_B.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,31 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_add_01_C.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_push_01_B; + +int main(){ + version(D_InlineAsm){ + static if(size_t.sizeof==4){ + uint a= 0x12_AB_34_CD; + uint b= 0x00_00_00_00; + size_t p1, p2, p3; + + asm{ + mov p1, ESP; + push a; + mov p2, ESP; + pop b; + mov p3, ESP; + } + + assert(p1==p3); + assert(p1-4==p2); + assert(b==0x12_AB_34_CD); + } + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_push_01_A.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,34 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_add_01_C.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_push_01_A; + +int main(){ + version(D_InlineAsm){ + ushort a= 0x12_AB; + ushort b= 0x00_00; + size_t p1, p2, p3; + + static if(size_t.sizeof==4){ + asm{ + mov p1, ESP; + push a; + mov p2, ESP; + pop b; + mov p3, ESP; + } + }else{ + static assert(0); + } + + assert(p1==p3); + assert(p1-2==p2); + assert(b==0x12_AB); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_push_01_B.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,31 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_add_01_C.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_push_01_B; + +int main(){ + version(D_InlineAsm){ + static if(size_t.sizeof==4){ + uint a= 0x12_AB_34_CD; + uint b= 0x00_00_00_00; + size_t p1, p2, p3; + + asm{ + mov p1, ESP; + push a; + mov p2, ESP; + pop b; + mov p3, ESP; + } + + assert(p1==p3); + assert(p1-4==p2); + assert(b==0x12_AB_34_CD); + } + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_pushad_01.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,74 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_add_01_C.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_pushad_01; + +int main(){ + version(D_InlineAsm){ + static if(size_t.sizeof==4){ + uint a_A, a_B, a_C, a_D, a_BP, a_SP, a_SI, a_DI; + uint b_A, b_B, b_C, b_D, b_BP, b_SP, b_SI, b_DI; + uint c_A, c_B, c_C, c_D, c_BP, c_SP, c_SI, c_DI; + uint x = 0x12_AB_CD_34; + asm{ + mov a_A, EAX; + mov a_B, EBX; + mov a_C, ECX; + mov a_D, EDX; + mov a_BP, EBP; + mov a_SP, ESP; + mov a_SI, ESI; + mov a_DI, EDI; + pushad; + mov EAX, x; + mov EBX, x; + mov ECX, x; + mov EDX, x; + mov ESI, x; + mov EDI, x; + mov b_A, EAX; + mov b_B, EBX; + mov b_C, ECX; + mov b_D, EDX; + mov b_BP, EBP; + mov b_SP, ESP; + mov b_SI, ESI; + mov b_DI, EDI; + popad; + mov c_A, EAX; + mov c_B, EBX; + mov c_C, ECX; + mov c_D, EDX; + mov c_BP, EBP; + mov c_SP, ESP; + mov c_SI, ESI; + mov c_DI, EDI; + } + + assert(a_A == c_A); + assert(b_A == x); + + assert(a_B == c_B); + assert(b_B == x); + + assert(a_C == c_C); + assert(b_C == x); + + assert(a_D == c_D); + assert(b_D == x); + + assert(a_SI == c_SI); + assert(b_SI == x); + + assert(a_SI == c_SI); + assert(b_SI == x); + + printf("%u\t%u\t%u\n", a_SP, b_SP, c_SP); + } + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_pxor_01_A.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,26 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_add_01_C.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_pxor_01_A; + +int main(){ + version(D_InlineAsm){ + ulong a = 0xFF01_00FF_0001_0000; + ulong b = 0xFF00_00FF_0002_0000; + ulong c = 2; + + asm{ + movq MM0, a; + pxor MM0, b; + movq c, MM0; + } + + assert(c==0x0001_0000_0003_0000); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_rcl_01_A.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,30 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_add_01_C.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_rcl_01_A; + +int main(){ + version(D_InlineAsm){ + ubyte a = 0b1111_1100; + + asm{ + clc; + rcl a, 1; + } + + assert(a == 0b1111_1000); + + asm{ + stc; + rcl a, 1; + } + + assert(a == 0b1111_0001); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_rcl_01_B.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,30 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_add_01_C.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_rcl_01_B; + +int main(){ + version(D_InlineAsm){ + ushort a = 0b1111_1100_0000_1010; + + asm{ + clc; + rcl a, 1; + } + + assert(a == 0b1111_1000_0001_0100); + + asm{ + stc; + rcl a, 1; + } + + assert(a == 0b1111_0000_0010_1001); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_rcl_01_C.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,30 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_add_01_C.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_rcl_01_C; + +int main(){ + version(D_InlineAsm){ + uint a = 0b1111_1100__0000_0000__0111_1111__1111_1111; + + asm{ + clc; + rcl a, 1; + } + + assert(a == 0b1111_1000__0000_0000__1111_1111__1111_1110); + + asm{ + stc; + rcl a, 1; + } + + assert(a == 0b1111_0000__0000_0001__1111_1111__1111_1101); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_rcr_01_A.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,30 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_add_01_C.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_rcr_01_A; + +int main(){ + version(D_InlineAsm){ + ubyte a = 0b1111_1101; + + asm{ + clc; + rcr a, 1; + } + + assert(a == 0b0111_1110); + + asm{ + stc; + rcr a, 1; + } + + assert(a == 0b1011_1111); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_rcr_01_B.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,30 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_add_01_C.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_rcr_01_B; + +int main(){ + version(D_InlineAsm){ + ushort a = 0b1111_1100__0000_0001; + + asm{ + clc; + rcr a, 1; + } + + assert(a == 0b0111_1110__0000_0000); + + asm{ + stc; + rcr a, 1; + } + + assert(a == 0b1011_1111__0000_0000); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_rcr_01_C.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,30 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_add_01_C.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_rcr_01_C; + +int main(){ + version(D_InlineAsm){ + uint a = 0b1111_1100__0000_0000__0111_1111__1111_1111; + + asm{ + clc; + rcr a, 1; + } + + assert(a == 0b0111_1110__0000_0000__0011_1111__1111_1111); + + asm{ + stc; + rcr a, 1; + } + + assert(a == 0b1011_1111__0000_0000__0001_1111__1111_1111); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_rdtsc_01.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,42 @@ + // $HeadURL: svn://dstress.kuehne.cn/run/a/asm_and_01.d $ + // $Date: 2005-09-08 09:37:28 +0200 (Thu, 08 Sep 2005) $ + // $Author: thomask $ + +module dstress.run.a.asm_rdtsc_01; + +int main(){ + version(D_InlineAsm){ + uint a1, a2; + uint b1, b2; + + asm{ + rdtsc; + mov a1, EDX; + mov a2, EAX; + rdtsc; + mov b1, EDX; + mov b2, EAX; + } + + ulong a = a1; + a <<= 32; + a |= a2; + + ulong b = b1; + b <<= 32; + b |= b2; + + assert(a != b); + + if(a < a.max >> 2){ + assert(a < b); + }else{ + // potential overflow + } + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_rol_01_A.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,22 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_add_01_C.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_rol_01_A; + +int main(){ + version(D_InlineAsm){ + ubyte a = 0b1111_1100; + + asm{ + rol a, 1; + } + + assert(a == 0b1111_1001); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_rol_01_B.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,22 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_add_01_C.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_rol_01_B; + +int main(){ + version(D_InlineAsm){ + ushort a = 0b1111_1100_0000_1010; + + asm{ + rol a, 1; + } + + assert(a == 0b1111_1000_0001_0101); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_rol_01_C.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,22 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_add_01_C.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_rol_01_C; + +int main(){ + version(D_InlineAsm){ + uint a = 0b1111_1100__0000_0000__0111_1111__1111_1111; + + asm{ + rol a, 1; + } + + assert(a == 0b1111_1000__0000_0000__1111_1111__1111_1111); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_ror_01_A.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,22 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_add_01_C.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_ror_01_A; + +int main(){ + version(D_InlineAsm){ + ubyte a = 0b1111_1101; + + asm{ + ror a, 1; + } + + assert(a == 0b1111_1110); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_ror_01_B.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,22 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_add_01_C.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_ror_01_B; + +int main(){ + version(D_InlineAsm){ + ushort a = 0b1111_1100__0000_0001; + + asm{ + ror a, 1; + } + + assert(a == 0b1111_1110__0000_0000); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_ror_01_C.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,22 @@ +// $HeadURL: svn://dstress.kuehne.cn/run/a/asm_add_01_C.d $ +// $Date: 2005-08-20 20:24:41 +0200 (Sat, 20 Aug 2005) $ +// $Author: thomask $ + +module dstress.run.a.asm_ror_01_C; + +int main(){ + version(D_InlineAsm){ + uint a = 0b1111_1100__0000_0000__0111_1111__1111_1111; + + asm{ + ror a, 1; + } + + assert(a == 0b1111_1110__0000_0000__0011_1111__1111_1111); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_sal_01_A.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,24 @@ + // $HeadURL: svn://dstress.kuehne.cn/run/a/asm_and_01.d $ + // $Date: 2005-09-08 09:37:28 +0200 (Thu, 08 Sep 2005) $ + // $Author: thomask $ + +module dstress.run.a.asm_sal_01_A; + +int main(){ + version(D_InlineAsm){ + uint a = 0xFF_FF_01_02; + + asm{ + mov EAX, a; + sal AL, 1; + mov a, EAX; + } + + assert(a==0xFF_FF_01_04); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_sal_01_B.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,24 @@ + // $HeadURL: svn://dstress.kuehne.cn/run/a/asm_and_01.d $ + // $Date: 2005-09-08 09:37:28 +0200 (Thu, 08 Sep 2005) $ + // $Author: thomask $ + +module dstress.run.a.asm_sal_01_B; + +int main(){ + version(D_InlineAsm){ + uint a = 0xFF_FF_01_02; + + asm{ + mov EAX, a; + sal AX, 1; + mov a, EAX; + } + + assert(a==0xFF_FF_02_04); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/asm_sal_01_C.d Wed Oct 12 18:22:35 2005 +0000 @@ -0,0 +1,24 @@ + // $HeadURL: svn://dstress.kuehne.cn/run/a/asm_and_01.d $ + // $Date: 2005-09-08 09:37:28 +0200 (Thu, 08 Sep 2005) $ + // $Author: thomask $ + +module dstress.run.a.asm_sal_01_C; + +int main(){ + version(D_InlineAsm){ + uint a = 0x80_01_01_02; + + asm{ + mov EAX, a; + sal EAX, 1; + mov a, EAX; + } + + assert(a==0x00_02_02_04); + + return 0; + }else{ + pragma(msg, "no Inline asm support"); + static assert(0); + } +} \ No newline at end of file