3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Scalable Matrix Extension (SME)Advent Calendar 2024

Day 3

SME日記その2: Apple Silicon M4にはCVTW命令は備わっていない?

Posted at

Apple Silicon M4でダイレクトにCVTW命令を実行してみたところ,illegal hardware instruction 例外が発生したので,Apple Silicon M4にはCVTW命令が備わっていない可能性があります.

SMEシリーズ

ソースコード

cntw.c
#include <stdint.h>
#include <stdio.h>

uint64_t cntw()
{
  uint64_t count;
  asm volatile ("cntw %0"
                : "=r"(count)
               );
  return count;
}

int main()
{
  printf("%llu\n", cntw());
}

コンパイル方法

clang -O2 -march=armv9-a+sme -o cntw cntw.c

実行の方法と結果

% ./cntw                                     
zsh: illegal hardware instruction  ./cntw
3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?