Commit 07cfdb72 by Antonio Maiorano

Subzero: fix invalid asserts during emit()

Fix asserts that would trip during emit, which we only use to emit textual representation of generated asm to stdout. Useful for debugging. Bug: b/144688789 Change-Id: I42d60da042fa04bf6afc9035b2892249e5e46c59 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/38475Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com> Reviewed-by: 's avatarBen Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 7ffda5b3
......@@ -159,7 +159,7 @@ void TargetX8664Traits::X86OperandMem::emit(const Cfg *Func) const {
if (!NeedSandboxing) {
// TODO(jpp): stop abusing the operand's type to identify LEAs.
const Type MemType = getType();
if (Base->getType() != IceType_i32 && MemType != IceType_void) {
if (Base->getType() != IceType_i32 && MemType != IceType_void && !isVectorType(MemType)) {
// X86-64 is ILP32, but %rsp and %rbp are accessed as 64-bit registers.
// For filetype=asm, they need to be emitted as their 32-bit siblings.
assert(Base->getType() == IceType_i64);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment