[PATCH] D79709: [AArch64][BFloat] basic AArch64 bfloat support

Francesco Petrogalli via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 20 17:08:01 PDT 2020


fpetrogalli added a comment.

In D79709#2046781 <https://reviews.llvm.org/D79709#2046781>, @stuij wrote:

> Having a think, I think the calling convention test would be more meaningful if we have a bit more bfloat lowering support. Which we have in the bfloat lowering follow-up patch: https://reviews.llvm.org/D79712


Yep - I'd make sure that the codegen patch is in before testing the CC. In fact, for the codegen patch you mention, I don't think you need CC at all:

  void test_ldst(bfloat * A, bfloat *B) {
  %1 = load bfloat, bfloat* A
  void store(bfloat %1, bfloat *b)
  }

Then, when the codegen is available, you can test the calling convention.

> As it is, for this patch we can test we pass a bfloat through the function, which gives us a `ret`, which I feel isn't too meaningful. But if we for example load it from a pointer, we can check that the arguments are put in the correct register.

I think that the tests for the calling convention should look something like the following:

  bfloat callee() {
     // check that h7 is not preserved
     // check that h22 and h23 are preserved (didn't check the actual calling convention, just guessing here, to give an idea)
  
     //some assembly code that uses some of the registers that are not preserved across the call, and some that are call preserved
     // e.g. :
    call void asm sideeffect "nop", "~{h7},~{h22},~{h23}"() nounwind
  }
  
  bfloat caller (bfloat *%A) {
  // check that the registers preserved across the call are preserved by the caller, by for example clobbering h0 between the load and the call, and making sure that the clobbered h0 is stored before being written with the value of A
      %0 = load bfloat from A
     %1 = call bfloat @callee(bfloat %A); 
    ret bfloat %1;
  }


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79709/new/

https://reviews.llvm.org/D79709





More information about the llvm-commits mailing list