< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64MacroAssembler.java

Print this page
rev 49736 : 8185505: AArch64: Port AOT to AArch64
Reviewed-by: duke
   1 /*
   2  * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.

   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */


1545     }
1546 
1547     /**
1548      * Generates an address of the form {@code base + displacement}.
1549      *
1550      * Does not change base register to fulfill this requirement. Will fail if displacement cannot
1551      * be represented directly as address.
1552      *
1553      * @param base general purpose register. May not be null or the zero register.
1554      * @param displacement arbitrary displacement added to base.
1555      * @return AArch64Address referencing memory at {@code base + displacement}.
1556      */
1557     @Override
1558     public AArch64Address makeAddress(Register base, int displacement) {
1559         return makeAddress(base, displacement, zr, /* signExtend */false, /* transferSize */0, zr, /* allowOverwrite */false);
1560     }
1561 
1562     @Override
1563     public AbstractAddress getPlaceholder(int instructionStartPosition) {
1564         return AArch64Address.PLACEHOLDER;






1565     }
1566 
1567     /**
1568      * Loads an address into Register d.
1569      *
1570      * @param d general purpose register. May not be null.
1571      * @param a AArch64Address the address of an operand.
1572      */
1573     public void lea(Register d, AArch64Address a) {
1574         a.lea(this, d);
1575     }
1576 }
   1 /*
   2  * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright (c) 2018, Red Hat Inc. All rights reserved.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  */


1546     }
1547 
1548     /**
1549      * Generates an address of the form {@code base + displacement}.
1550      *
1551      * Does not change base register to fulfill this requirement. Will fail if displacement cannot
1552      * be represented directly as address.
1553      *
1554      * @param base general purpose register. May not be null or the zero register.
1555      * @param displacement arbitrary displacement added to base.
1556      * @return AArch64Address referencing memory at {@code base + displacement}.
1557      */
1558     @Override
1559     public AArch64Address makeAddress(Register base, int displacement) {
1560         return makeAddress(base, displacement, zr, /* signExtend */false, /* transferSize */0, zr, /* allowOverwrite */false);
1561     }
1562 
1563     @Override
1564     public AbstractAddress getPlaceholder(int instructionStartPosition) {
1565         return AArch64Address.PLACEHOLDER;
1566     }
1567 
1568     public void addressOf(Register dst) {
1569         // This will be fixed up later.
1570         super.adrp(dst);
1571         super.add(64, dst, dst, 0);
1572     }
1573 
1574     /**
1575      * Loads an address into Register d.
1576      *
1577      * @param d general purpose register. May not be null.
1578      * @param a AArch64Address the address of an operand.
1579      */
1580     public void lea(Register d, AArch64Address a) {
1581         a.lea(this, d);
1582     }
1583 }
< prev index next >