1 /* |
1 /* |
2 * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
42 |
42 |
43 public final class AMD64VectorCompareOp extends AMD64LIRInstruction { |
43 public final class AMD64VectorCompareOp extends AMD64LIRInstruction { |
44 public static final LIRInstructionClass<AMD64VectorCompareOp> TYPE = LIRInstructionClass.create(AMD64VectorCompareOp.class); |
44 public static final LIRInstructionClass<AMD64VectorCompareOp> TYPE = LIRInstructionClass.create(AMD64VectorCompareOp.class); |
45 |
45 |
46 @Opcode private final VexRMOp opcode; |
46 @Opcode private final VexRMOp opcode; |
|
47 private final AVXSize size; |
47 @Use({REG}) protected AllocatableValue x; |
48 @Use({REG}) protected AllocatableValue x; |
48 @Use({REG, STACK}) protected AllocatableValue y; |
49 @Use({REG, STACK}) protected AllocatableValue y; |
49 |
50 |
50 public AMD64VectorCompareOp(VexRMOp opcode, AllocatableValue x, AllocatableValue y) { |
51 public AMD64VectorCompareOp(VexRMOp opcode, AllocatableValue x, AllocatableValue y) { |
|
52 this(opcode, AVXSize.XMM, x, y); |
|
53 } |
|
54 |
|
55 public AMD64VectorCompareOp(VexRMOp opcode, AVXSize size, AllocatableValue x, AllocatableValue y) { |
51 super(TYPE); |
56 super(TYPE); |
52 this.opcode = opcode; |
57 this.opcode = opcode; |
|
58 this.size = size; |
53 this.x = x; |
59 this.x = x; |
54 this.y = y; |
60 this.y = y; |
55 } |
61 } |
56 |
62 |
57 @Override |
63 @Override |
58 public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) { |
64 public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) { |
59 if (isRegister(y)) { |
65 if (isRegister(y)) { |
60 opcode.emit(masm, AVXSize.XMM, asRegister(x), asRegister(y)); |
66 opcode.emit(masm, size, asRegister(x), asRegister(y)); |
61 } else { |
67 } else { |
62 opcode.emit(masm, AVXSize.XMM, asRegister(x), (AMD64Address) crb.asAddress(y)); |
68 opcode.emit(masm, size, asRegister(x), (AMD64Address) crb.asAddress(y)); |
63 } |
69 } |
64 } |
70 } |
65 } |
71 } |