VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-instr-3-template.mac@ 95397

Last change on this file since 95397 was 95397, checked in by vboxsync, 3 years ago

ValKit/bs3kit,bs3-cpu-instr-3: 128 and 256 bit wide vxorps, alignment checks. bugref:9898

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.9 KB
Line 
1; $Id: bs3-cpu-instr-3-template.mac 95397 2022-06-27 17:49:40Z vboxsync $
2;; @file
3; BS3Kit - bs3-cpu-instr-3 - MMX, SSE and AVX instructions, assembly template.
4;
5
6;
7; Copyright (C) 2007-2022 Oracle Corporation
8;
9; This file is part of VirtualBox Open Source Edition (OSE), as
10; available from http://www.virtualbox.org. This file is free software;
11; you can redistribute it and/or modify it under the terms of the GNU
12; General Public License (GPL) as published by the Free Software
13; Foundation, in version 2 as it comes in the "COPYING" file of the
14; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16;
17; The contents of this file may alternatively be used under the terms
18; of the Common Development and Distribution License Version 1.0
19; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20; VirtualBox OSE distribution, in which case the provisions of the
21; CDDL are applicable instead of those of the GPL.
22;
23; You may elect to license modified versions of this file under the
24; terms and conditions of either the GPL or the CDDL or both.
25;
26
27
28;*********************************************************************************************************************************
29;* Header Files *
30;*********************************************************************************************************************************
31%include "bs3kit-template-header.mac" ; setup environment
32
33
34;*********************************************************************************************************************************
35;* External Symbols *
36;*********************************************************************************************************************************
37TMPL_BEGIN_TEXT
38
39
40;
41; Test code snippets containing code which differs between 16-bit, 32-bit
42; and 64-bit CPUs modes.
43;
44%ifdef BS3_INSTANTIATING_CMN
45
46
47;;
48; Variant on BS3_PROC_BEGIN_CMN w/ BS3_PBC_NEAR that prefixes the function
49; with an instruction length byte.
50;
51; ASSUMES the length is between the start of the function and the .again label.
52;
53%ifndef BS3CPUINSTR3_PROC_BEGIN_CMN
54 %define BS3CPUINSTR3_PROC_BEGIN_CMN_DEFINED
55 %macro BS3CPUINSTR3_PROC_BEGIN_CMN 1
56 align 8, db 0cch
57 db BS3_CMN_NM(%1).again - BS3_CMN_NM(%1)
58BS3_PROC_BEGIN_CMN %1, BS3_PBC_NEAR
59 %endmacro
60%endif
61
62;
63; XORPS (SSE2) & VXORPS (AVX)
64;
65BS3CPUINSTR3_PROC_BEGIN_CMN bs3CpuInstr3_xorps_XMM1_XMM2_icebp
66 xorps xmm1, xmm2
67.again:
68 icebp
69 jmp .again
70BS3_PROC_END_CMN bs3CpuInstr3_xorps_XMM1_XMM2_icebp
71
72BS3CPUINSTR3_PROC_BEGIN_CMN bs3CpuInstr3_xorps_XMM1_FSxBX_icebp
73 xorps xmm1, [fs:xBX]
74.again:
75 icebp
76 jmp .again
77BS3_PROC_END_CMN bs3CpuInstr3_xorps_XMM1_FSxBX_icebp
78
79BS3CPUINSTR3_PROC_BEGIN_CMN bs3CpuInstr3_vxorps_XMM1_XMM1_XMM2_icebp
80 vxorps xmm1, xmm1, xmm2
81.again:
82 icebp
83 jmp .again
84BS3_PROC_END_CMN bs3CpuInstr3_vxorps_XMM1_XMM1_XMM2_icebp
85
86BS3CPUINSTR3_PROC_BEGIN_CMN bs3CpuInstr3_vxorps_XMM1_XMM1_FSxBX_icebp
87%if 0
88.again2:
89 pause
90 jmp .again2
91%endif
92 vxorps xmm1, xmm1, [fs:xBX]
93.again:
94 icebp
95 jmp .again
96BS3_PROC_END_CMN bs3CpuInstr3_vxorps_XMM1_XMM1_FSxBX_icebp
97
98BS3CPUINSTR3_PROC_BEGIN_CMN bs3CpuInstr3_vxorps_YMM1_YMM1_YMM2_icebp
99 vxorps ymm1, ymm1, ymm2
100.again:
101 icebp
102 jmp .again
103BS3_PROC_END_CMN bs3CpuInstr3_vxorps_YMM1_YMM1_YMM2_icebp
104
105BS3CPUINSTR3_PROC_BEGIN_CMN bs3CpuInstr3_vxorps_YMM1_YMM1_FSxBX_icebp
106 vxorps ymm1, ymm1, [fs:xBX]
107.again:
108 icebp
109 jmp .again
110BS3_PROC_END_CMN bs3CpuInstr3_vxorps_YMM1_YMM1_FSxBX_icebp
111
112
113%endif ; BS3_INSTANTIATING_CMN
114
115%include "bs3kit-template-footer.mac" ; reset environment
116
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette