projects
/
platform
/
upstream
/
dotnet
/
runtime.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
37c2751
)
Use VEX xorps to zero a zmm reg (#86555)
author
Egor Bogatov
<egorbo@gmail.com>
Sun, 21 May 2023 20:41:51 +0000
(22:41 +0200)
committer
GitHub
<noreply@github.com>
Sun, 21 May 2023 20:41:51 +0000
(22:41 +0200)
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
src/coreclr/jit/codegenxarch.cpp
patch
|
blob
|
history
diff --git
a/src/coreclr/jit/codegenxarch.cpp
b/src/coreclr/jit/codegenxarch.cpp
index
72939e8
..
f849495
100644
(file)
--- a/
src/coreclr/jit/codegenxarch.cpp
+++ b/
src/coreclr/jit/codegenxarch.cpp
@@
-517,7
+517,13
@@
void CodeGen::genSetRegToConst(regNumber targetReg, var_types targetType, simd_t
}
else if (val64.IsZero())
{
- emit->emitIns_SIMD_R_R_R(INS_xorps, attr, targetReg, targetReg, targetReg);
+ // Use VEX version because it's smaller (for zmm0-zmm15) than EVEX to zero a zmm register and still
+ // zeros the entire register:
+ //
+ // xorps zmm0, zmm0, zmm0 (6 bytes)
+ // xorps ymm0, ymm0, ymm0 (4 bytes)
+ //
+ emit->emitIns_SIMD_R_R_R(INS_xorps, EA_32BYTE, targetReg, targetReg, targetReg);
}
else
{