From: Jos v.d.V. <jo...@us...> - 2015-11-09 13:46:30
|
Update of /cvsroot/win32forth/win32forth/src In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30778 Modified Files: 486ASM.F 586ASMCM.f Log Message: Jos: Adapted for dpps and dppd Solved a bug for imm8 of shufpd Added a note for SSE instructions Index: 586ASMCM.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/586ASMCM.f,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** 586ASMCM.f 26 Jan 2015 13:55:57 -0000 1.12 --- 586ASMCM.f 9 Nov 2015 13:46:28 -0000 1.13 *************** *** 3,6 **** --- 3,7 ---- \ Also floating-point extensions for P6 or better gah \ Januari 2015, Added SSE instructions for SIMD. + \ Note: Not all possible syntax errors are recognized of the SSE instructions. also assembler also asm-hidden definitions *************** *** 32,35 **** --- 33,40 ---- 0x66 pre-dxmm-compile ; + : dpp-compile ( param -- | x \ param -- | x \ x \ param -- ) + 0x66 code-c, 0x0F code-c, 0x3A code-c, true no-do-disp data-! + true has-xmm-offset? data-! (xmm-compile) ; + : movd-compile ( param -- | x \ param -- | x \ x \ param -- ) 0x66 code-c, 0x0F code-c, (movd-compile) ; *************** *** 60,63 **** --- 65,75 ---- 0x66 code-c, true no-do-disp data-! xmm-compile ; + : shufps-compile ( param -- | x \ param -- | x \ x \ param -- ) + true has-xmm-offset? data-! xmm-compile-no-disp ; + + : shufpd-compile ( param -- | x \ param -- | x \ x \ param -- ) + true has-xmm-offset? data-! dxmm-compile-no-disp ; + + also forth *************** *** 269,274 **** 0xC207 ' cmpsd-compile opcode cmpordsd ! 0xC6 ' xmm-compile-no-disp opcode shufps ! 0xC6 ' dxmm-compile-no-disp opcode shufpd 0xD7 ' 66-dxmm-compile opcode pmovmskb --- 281,286 ---- 0xC207 ' cmpsd-compile opcode cmpordsd ! 0xC6 ' shufps-compile opcode shufps ! 0xC6 ' shufpd-compile opcode shufpd 0xD7 ' 66-dxmm-compile opcode pmovmskb *************** *** 277,280 **** --- 289,295 ---- 0xE6 ' F2-dxmm-compile opcode cvtpd2dq + 0x40 ' dpp-compile opcode dpps + 0x41 ' dpp-compile opcode dppd + in-previous only forth also forth definitions Index: 486ASM.F =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/486ASM.F,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** 486ASM.F 24 Oct 2015 15:24:30 -0000 1.19 --- 486ASM.F 9 Nov 2015 13:46:28 -0000 1.20 *************** *** 543,547 **** variable addmode ( addressing mode flags ) variable xmm/mmx-prefix \ xmm (2) or mmx (1) or neither (0) regs used ) ! variable no-do-disp ( No change to the mod-r/m byte ) : reset-vars ( store 0 into all instruction coding variables ) --- 543,548 ---- variable addmode ( addressing mode flags ) variable xmm/mmx-prefix \ xmm (2) or mmx (1) or neither (0) regs used ) ! variable has-xmm-offset? ( forcing 8bit for shufps shufpd dpps dppd ) ! variable no-do-disp ( No change to the mod-r/m byte ) : reset-vars ( store 0 into all instruction coding variables ) *************** *** 550,559 **** 0 sp-save data-! 0 offset-sv data-! 0 immed-sv data-! 0 dt-size data-! 0 ad-size data-! 0 rtype data-! 0 maxtype data-! 0 mod-r/m data-! ! 0 s-i-b data-! 0 addmode data-! 0 xmm/mmx-prefix data-! ; : reset-for-next-instr ( store a 0 into intermediate coding variables ) 0 offset-sv data-! 0 immed-sv data-! 0 dt-size data-! 0 ad-size data-! 0 rtype data-! 0 maxtype data-! 0 mod-r/m data-! ! 0 s-i-b data-! 0 addmode data-! ; ( set/reset mode bits ) --- 551,562 ---- 0 sp-save data-! 0 offset-sv data-! 0 immed-sv data-! 0 dt-size data-! 0 ad-size data-! 0 rtype data-! 0 maxtype data-! 0 mod-r/m data-! ! 0 s-i-b data-! 0 addmode data-! 0 xmm/mmx-prefix data-! ! 0 has-xmm-offset? data-! ; : reset-for-next-instr ( store a 0 into intermediate coding variables ) 0 offset-sv data-! 0 immed-sv data-! 0 dt-size data-! 0 ad-size data-! 0 rtype data-! 0 maxtype data-! 0 mod-r/m data-! ! 0 s-i-b data-! 0 addmode data-! ! 0 has-xmm-offset? data-! ; ( set/reset mode bits ) *************** *** 1189,1199 **** ( /r value -- ) 8* mod-r/m data-@ [ 7 8* -1 xor ] literal and or mod-r/m data-! ; - : disp, ( compile the displacement ) ( -- ) ! has-offset? if offset-sv data-@ dup abs 7f > has-full-off? or ! if ad-size data-@ 16bit = if 16b-abs register-ref code-w, else 32b-abs ! register-ref code-d, then else 8b-abs register-ref code-c, then then ; ! : default-8bit ( change a zero size to 8bit ) ( size -- size' ) --- 1192,1209 ---- ( /r value -- ) 8* mod-r/m data-@ [ 7 8* -1 xor ] literal and or mod-r/m data-! ; : disp, ( compile the displacement ) ( -- ) ! has-xmm-offset? data-@ ! if offset-sv data-@ 8b-abs register-ref code-c, ! else has-offset? ! if offset-sv data-@ dup abs 7f > has-full-off? or ! if ad-size data-@ 16bit = ! if 16b-abs register-ref code-w, ! else 32b-abs register-ref code-d, ! then ! else 8b-abs register-ref code-c, ! then ! then ! then ; : default-8bit ( change a zero size to 8bit ) ( size -- size' ) *************** *** 1822,1833 **** : no-xmm-move ( opcode - opcode flag ) dup &no-xmm-move not-any= ; - numbers: &xmm-to-xmm ( - adr n ) C2 C6 ;bytes - - : xmm-to-xmm ( opcode - opcode flag ) dup &xmm-to-xmm any= ; \ case: cmpss shufps shufpd - - numbers: &no-xmm-to-xmm? ( - adr n ) FC CA ;bytes - - : no-xmm-to-xmm? ( - flag ) &no-xmm-to-xmm? not-any-mod-r/m= ; - numbers: &xmm-to-m ( - adr n ) 13 17 ;bytes numbers: &no-xmm-to-m ( - adr n ) 1 4 C0 C1 0B ;bytes ( - adr ) --- 1832,1835 ---- *************** *** 1857,1861 **** endif endif ?noimmed - xmm-to-xmm no-xmm-to-xmm? and asm-abort" Operand must be xmmreg,xmmreg" no-xmm-move xmm-dir? and asm-abort" Operand r/m,xmmreg not allowed" dup D7 = not-to-r32? and asm-abort" Operand must be r32,xmmreg." \ case: pmovmskb --- 1859,1862 ---- |