1 /*
   2  * Copyright (c) 2013, 2015, 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  */
  23 
  24 
  25 
  26 package org.graalvm.compiler.asm.aarch64.test;
  27 
  28 import org.graalvm.compiler.asm.AbstractAddress;
  29 import org.graalvm.compiler.asm.Label;
  30 import org.graalvm.compiler.asm.aarch64.AArch64Address;
  31 import org.graalvm.compiler.asm.aarch64.AArch64Assembler;
  32 
  33 import jdk.vm.ci.code.Register;
  34 import jdk.vm.ci.code.TargetDescription;
  35 
  36 /**
  37  * Cheat so that we can test protected functions of assembler.
  38  */
  39 class TestProtectedAssembler extends AArch64Assembler {
  40 
  41     TestProtectedAssembler(TargetDescription target) {
  42         super(target);
  43     }
  44 
  45     @Override
  46     protected void cbnz(int size, Register reg, int imm21, int pos) {
  47         super.cbnz(size, reg, imm21, pos);
  48     }
  49 
  50     @Override
  51     protected void cbz(int size, Register reg, int imm21, int pos) {
  52         super.cbz(size, reg, imm21, pos);
  53     }
  54 
  55     @Override
  56     public void ands(int size, Register dst, Register src, long bimm) {
  57         super.ands(size, dst, src, bimm);
  58     }
  59 
  60     @Override
  61     protected void b(ConditionFlag condition, int imm21) {
  62         super.b(condition, imm21);
  63     }
  64 
  65     @Override
  66     protected void b(ConditionFlag condition, int imm21, int pos) {
  67         super.b(condition, imm21, pos);
  68     }
  69 
  70     @Override
  71     protected void cbnz(int size, Register reg, int imm21) {
  72         super.cbnz(size, reg, imm21);
  73     }
  74 
  75     @Override
  76     protected void cbz(int size, Register reg, int imm21) {
  77         super.cbz(size, reg, imm21);
  78     }
  79 
  80     @Override
  81     protected void b(int imm28) {
  82         super.b(imm28);
  83     }
  84 
  85     @Override
  86     protected void b(int imm28, int pos) {
  87         super.b(imm28, pos);
  88     }
  89 
  90     @Override
  91     public void bl(int imm28) {
  92         super.bl(imm28);
  93     }
  94 
  95     @Override
  96     public void blr(Register reg) {
  97         super.blr(reg);
  98     }
  99 
 100     @Override
 101     protected void br(Register reg) {
 102         super.br(reg);
 103     }
 104 
 105     @Override
 106     public void ret(Register reg) {
 107         super.ret(reg);
 108     }
 109 
 110     @Override
 111     public void ldr(int srcSize, Register rt, AArch64Address address) {
 112         super.ldr(srcSize, rt, address);
 113     }
 114 
 115     @Override
 116     public void ldrs(int targetSize, int srcSize, Register rt, AArch64Address address) {
 117         super.ldrs(targetSize, srcSize, rt, address);
 118     }
 119 
 120     @Override
 121     public void str(int destSize, Register rt, AArch64Address address) {
 122         super.str(destSize, rt, address);
 123     }
 124 
 125     @Override
 126     protected void ldxr(int size, Register rt, Register rn) {
 127         super.ldxr(size, rt, rn);
 128     }
 129 
 130     @Override
 131     protected void stxr(int size, Register rs, Register rt, Register rn) {
 132         super.stxr(size, rs, rt, rn);
 133     }
 134 
 135     @Override
 136     protected void ldar(int size, Register rt, Register rn) {
 137         super.ldar(size, rt, rn);
 138     }
 139 
 140     @Override
 141     protected void stlr(int size, Register rt, Register rn) {
 142         super.stlr(size, rt, rn);
 143     }
 144 
 145     @Override
 146     public void ldaxr(int size, Register rt, Register rn) {
 147         super.ldaxr(size, rt, rn);
 148     }
 149 
 150     @Override
 151     public void stlxr(int size, Register rs, Register rt, Register rn) {
 152         super.stlxr(size, rs, rt, rn);
 153     }
 154 
 155     @Override
 156     public void adr(Register dst, int imm21) {
 157         super.adr(dst, imm21);
 158     }
 159 
 160     @Override
 161     protected void add(int size, Register dst, Register src, int aimm) {
 162         super.add(size, dst, src, aimm);
 163     }
 164 
 165     @Override
 166     protected void adds(int size, Register dst, Register src, int aimm) {
 167         super.adds(size, dst, src, aimm);
 168     }
 169 
 170     @Override
 171     protected void sub(int size, Register dst, Register src, int aimm) {
 172         super.sub(size, dst, src, aimm);
 173     }
 174 
 175     @Override
 176     protected void subs(int size, Register dst, Register src, int aimm) {
 177         super.subs(size, dst, src, aimm);
 178     }
 179 
 180     @Override
 181     public void and(int size, Register dst, Register src, long bimm) {
 182         super.and(size, dst, src, bimm);
 183     }
 184 
 185     @Override
 186     public void eor(int size, Register dst, Register src, long bimm) {
 187         super.eor(size, dst, src, bimm);
 188     }
 189 
 190     @Override
 191     protected void orr(int size, Register dst, Register src, long bimm) {
 192         super.orr(size, dst, src, bimm);
 193     }
 194 
 195     @Override
 196     protected void movz(int size, Register dst, int uimm16, int shiftAmt) {
 197         super.movz(size, dst, uimm16, shiftAmt);
 198     }
 199 
 200     @Override
 201     protected void movn(int size, Register dst, int uimm16, int shiftAmt) {
 202         super.movn(size, dst, uimm16, shiftAmt);
 203     }
 204 
 205     @Override
 206     protected void movk(int size, Register dst, int uimm16, int pos) {
 207         super.movk(size, dst, uimm16, pos);
 208     }
 209 
 210     @Override
 211     public void bfm(int size, Register dst, Register src, int r, int s) {
 212         super.bfm(size, dst, src, r, s);
 213     }
 214 
 215     @Override
 216     public void ubfm(int size, Register dst, Register src, int r, int s) {
 217         super.ubfm(size, dst, src, r, s);
 218     }
 219 
 220     @Override
 221     protected void sbfm(int size, Register dst, Register src, int r, int s) {
 222         super.sbfm(size, dst, src, r, s);
 223     }
 224 
 225     @Override
 226     protected void extr(int size, Register dst, Register src1, Register src2, int lsb) {
 227         super.extr(size, dst, src1, src2, lsb);
 228     }
 229 
 230     @Override
 231     public void adds(int size, Register dst, Register src1, Register src2, ShiftType shiftType, int imm) {
 232         super.adds(size, dst, src1, src2, shiftType, imm);
 233     }
 234 
 235     @Override
 236     public void subs(int size, Register dst, Register src1, Register src2, ShiftType shiftType, int imm) {
 237         super.subs(size, dst, src1, src2, shiftType, imm);
 238     }
 239 
 240     @Override
 241     protected void add(int size, Register dst, Register src1, Register src2, ShiftType shiftType, int imm) {
 242         super.add(size, dst, src1, src2, shiftType, imm);
 243     }
 244 
 245     @Override
 246     protected void sub(int size, Register dst, Register src1, Register src2, ShiftType shiftType, int imm) {
 247         super.sub(size, dst, src1, src2, shiftType, imm);
 248     }
 249 
 250     @Override
 251     public void add(int size, Register dst, Register src1, Register src2, ExtendType extendType, int shiftAmt) {
 252         super.add(size, dst, src1, src2, extendType, shiftAmt);
 253     }
 254 
 255     @Override
 256     protected void adds(int size, Register dst, Register src1, Register src2, ExtendType extendType, int shiftAmt) {
 257         super.adds(size, dst, src1, src2, extendType, shiftAmt);
 258     }
 259 
 260     @Override
 261     protected void sub(int size, Register dst, Register src1, Register src2, ExtendType extendType, int shiftAmt) {
 262         super.sub(size, dst, src1, src2, extendType, shiftAmt);
 263     }
 264 
 265     @Override
 266     public void subs(int size, Register dst, Register src1, Register src2, ExtendType extendType, int shiftAmt) {
 267         super.subs(size, dst, src1, src2, extendType, shiftAmt);
 268     }
 269 
 270     @Override
 271     protected void and(int size, Register dst, Register src1, Register src2, ShiftType shiftType, int shiftAmt) {
 272         super.and(size, dst, src1, src2, shiftType, shiftAmt);
 273     }
 274 
 275     @Override
 276     protected void ands(int size, Register dst, Register src1, Register src2, ShiftType shiftType, int shiftAmt) {
 277         super.ands(size, dst, src1, src2, shiftType, shiftAmt);
 278     }
 279 
 280     @Override
 281     protected void bic(int size, Register dst, Register src1, Register src2, ShiftType shiftType, int shiftAmt) {
 282         super.bic(size, dst, src1, src2, shiftType, shiftAmt);
 283     }
 284 
 285     @Override
 286     protected void bics(int size, Register dst, Register src1, Register src2, ShiftType shiftType, int shiftAmt) {
 287         super.bics(size, dst, src1, src2, shiftType, shiftAmt);
 288     }
 289 
 290     @Override
 291     protected void eon(int size, Register dst, Register src1, Register src2, ShiftType shiftType, int shiftAmt) {
 292         super.eon(size, dst, src1, src2, shiftType, shiftAmt);
 293     }
 294 
 295     @Override
 296     protected void eor(int size, Register dst, Register src1, Register src2, ShiftType shiftType, int shiftAmt) {
 297         super.eor(size, dst, src1, src2, shiftType, shiftAmt);
 298     }
 299 
 300     @Override
 301     protected void orr(int size, Register dst, Register src1, Register src2, ShiftType shiftType, int shiftAmt) {
 302         super.orr(size, dst, src1, src2, shiftType, shiftAmt);
 303     }
 304 
 305     @Override
 306     protected void orn(int size, Register dst, Register src1, Register src2, ShiftType shiftType, int shiftAmt) {
 307         super.orn(size, dst, src1, src2, shiftType, shiftAmt);
 308     }
 309 
 310     @Override
 311     protected void asr(int size, Register dst, Register src1, Register src2) {
 312         super.asr(size, dst, src1, src2);
 313     }
 314 
 315     @Override
 316     protected void lsl(int size, Register dst, Register src1, Register src2) {
 317         super.lsl(size, dst, src1, src2);
 318     }
 319 
 320     @Override
 321     protected void lsr(int size, Register dst, Register src1, Register src2) {
 322         super.lsr(size, dst, src1, src2);
 323     }
 324 
 325     @Override
 326     protected void ror(int size, Register dst, Register src1, Register src2) {
 327         super.ror(size, dst, src1, src2);
 328     }
 329 
 330     @Override
 331     protected void cls(int size, Register dst, Register src) {
 332         super.cls(size, dst, src);
 333     }
 334 
 335     @Override
 336     public void clz(int size, Register dst, Register src) {
 337         super.clz(size, dst, src);
 338     }
 339 
 340     @Override
 341     public void rbit(int size, Register dst, Register src) {
 342         super.rbit(size, dst, src);
 343     }
 344 
 345     @Override
 346     public void rev(int size, Register dst, Register src) {
 347         super.rev(size, dst, src);
 348     }
 349 
 350     @Override
 351     protected void csel(int size, Register dst, Register src1, Register src2, ConditionFlag condition) {
 352         super.csel(size, dst, src1, src2, condition);
 353     }
 354 
 355     @Override
 356     protected void csneg(int size, Register dst, Register src1, Register src2, ConditionFlag condition) {
 357         super.csneg(size, dst, src1, src2, condition);
 358     }
 359 
 360     @Override
 361     protected void csinc(int size, Register dst, Register src1, Register src2, ConditionFlag condition) {
 362         super.csinc(size, dst, src1, src2, condition);
 363     }
 364 
 365     @Override
 366     protected void madd(int size, Register dst, Register src1, Register src2, Register src3) {
 367         super.madd(size, dst, src1, src2, src3);
 368     }
 369 
 370     @Override
 371     protected void msub(int size, Register dst, Register src1, Register src2, Register src3) {
 372         super.msub(size, dst, src1, src2, src3);
 373     }
 374 
 375     @Override
 376     public void sdiv(int size, Register dst, Register src1, Register src2) {
 377         super.sdiv(size, dst, src1, src2);
 378     }
 379 
 380     @Override
 381     public void udiv(int size, Register dst, Register src1, Register src2) {
 382         super.udiv(size, dst, src1, src2);
 383     }
 384 
 385     @Override
 386     public void fldr(int size, Register rt, AArch64Address address) {
 387         super.fldr(size, rt, address);
 388     }
 389 
 390     @Override
 391     public void fstr(int size, Register rt, AArch64Address address) {
 392         super.fstr(size, rt, address);
 393     }
 394 
 395     @Override
 396     protected void fmov(int size, Register dst, Register src) {
 397         super.fmov(size, dst, src);
 398     }
 399 
 400     @Override
 401     protected void fmovFpu2Cpu(int size, Register dst, Register src) {
 402         super.fmovFpu2Cpu(size, dst, src);
 403     }
 404 
 405     @Override
 406     protected void fmovCpu2Fpu(int size, Register dst, Register src) {
 407         super.fmovCpu2Fpu(size, dst, src);
 408     }
 409 
 410     @Override
 411     protected void fmov(int size, Register dst, double imm) {
 412         super.fmov(size, dst, imm);
 413     }
 414 
 415     @Override
 416     public void fcvt(int srcSize, Register dst, Register src) {
 417         super.fcvt(srcSize, dst, src);
 418     }
 419 
 420     @Override
 421     public void fcvtzs(int targetSize, int srcSize, Register dst, Register src) {
 422         super.fcvtzs(targetSize, srcSize, dst, src);
 423     }
 424 
 425     @Override
 426     public void scvtf(int targetSize, int srcSize, Register dst, Register src) {
 427         super.scvtf(targetSize, srcSize, dst, src);
 428     }
 429 
 430     @Override
 431     protected void frintz(int size, Register dst, Register src) {
 432         super.frintz(size, dst, src);
 433     }
 434 
 435     @Override
 436     public void fabs(int size, Register dst, Register src) {
 437         super.fabs(size, dst, src);
 438     }
 439 
 440     @Override
 441     public void fneg(int size, Register dst, Register src) {
 442         super.fneg(size, dst, src);
 443     }
 444 
 445     @Override
 446     public void fsqrt(int size, Register dst, Register src) {
 447         super.fsqrt(size, dst, src);
 448     }
 449 
 450     @Override
 451     public void fadd(int size, Register dst, Register src1, Register src2) {
 452         super.fadd(size, dst, src1, src2);
 453     }
 454 
 455     @Override
 456     public void fsub(int size, Register dst, Register src1, Register src2) {
 457         super.fsub(size, dst, src1, src2);
 458     }
 459 
 460     @Override
 461     public void fmul(int size, Register dst, Register src1, Register src2) {
 462         super.fmul(size, dst, src1, src2);
 463     }
 464 
 465     @Override
 466     public void fdiv(int size, Register dst, Register src1, Register src2) {
 467         super.fdiv(size, dst, src1, src2);
 468     }
 469 
 470     @Override
 471     protected void fmadd(int size, Register dst, Register src1, Register src2, Register src3) {
 472         super.fmadd(size, dst, src1, src2, src3);
 473     }
 474 
 475     @Override
 476     protected void fmsub(int size, Register dst, Register src1, Register src2, Register src3) {
 477         super.fmsub(size, dst, src1, src2, src3);
 478     }
 479 
 480     @Override
 481     public void fcmp(int size, Register src1, Register src2) {
 482         super.fcmp(size, src1, src2);
 483     }
 484 
 485     @Override
 486     public void fccmp(int size, Register src1, Register src2, int uimm4, ConditionFlag condition) {
 487         super.fccmp(size, src1, src2, uimm4, condition);
 488     }
 489 
 490     @Override
 491     public void fcmpZero(int size, Register src) {
 492         super.fcmpZero(size, src);
 493     }
 494 
 495     @Override
 496     protected void fcsel(int size, Register dst, Register src1, Register src2, ConditionFlag condition) {
 497         super.fcsel(size, dst, src1, src2, condition);
 498     }
 499 
 500     @Override
 501     protected void hlt(int uimm16) {
 502         super.hlt(uimm16);
 503     }
 504 
 505     @Override
 506     protected void brk(int uimm16) {
 507         super.brk(uimm16);
 508     }
 509 
 510     @Override
 511     protected void hint(SystemHint hint) {
 512         super.hint(hint);
 513     }
 514 
 515     @Override
 516     protected void clrex() {
 517         super.clrex();
 518     }
 519 
 520     @Override
 521     public void dmb(BarrierKind barrierKind) {
 522         super.dmb(barrierKind);
 523     }
 524 
 525     @Override
 526     public void align(int modulus) {
 527     }
 528 
 529     @Override
 530     public void jmp(Label l) {
 531     }
 532 
 533     @Override
 534     protected void patchJumpTarget(int branch, int jumpTarget) {
 535 
 536     }
 537 
 538     @Override
 539     public AbstractAddress makeAddress(Register base, int displacement) {
 540         throw new UnsupportedOperationException();
 541     }
 542 
 543     @Override
 544     public AbstractAddress getPlaceholder(int instructionStartPosition) {
 545         throw new UnsupportedOperationException();
 546     }
 547 
 548     @Override
 549     public void ensureUniquePC() {
 550         throw new UnsupportedOperationException();
 551     }
 552 }