blob: 7a6c177267643b6e63ce7cd2a65e946009cb83b2 [file] [log] [blame]
/* { dg-do assemble { target { arm*-*-* } } } */
/* { dg-require-effective-target arm_hard_ok } */
/* { dg-require-effective-target arm_v8_2a_bf16_neon_ok } */
/* { dg-add-options arm_v8_2a_bf16_neon } */
/* { dg-additional-options "-O3 --save-temps -std=gnu90 -mfloat-abi=hard" } */
/* { dg-final { check-function-bodies "**" "" } } */
#include <arm_bf16.h>
/*
**stacktest1:
** ...
** vst1.16 {d[0-9]+\[[0-9]+\]}, \[r[0-9]+\]
** vld1.16 {d[0-9]+\[[0-9]+\]}, \[r[0-9]+\]
** ...
** bx lr
*/
bfloat16_t stacktest1 (bfloat16_t __a)
{
volatile bfloat16_t b = __a;
return b;
}
/*
**bfloat_mov_ww:
** ...
** vmov.f32 s1, s15
** ...
** bx lr
*/
void bfloat_mov_ww (void)
{
register bfloat16_t x asm ("s15");
register bfloat16_t y asm ("s1");
asm volatile ("#foo" : "=t" (x));
y = x;
asm volatile ("#foo" :: "t" (y));
}
/*
**bfloat_mov_rw:
** ...
** vmov s1, r4
** ...
** bx lr
*/
void bfloat_mov_rw (void)
{
register bfloat16_t x asm ("r4");
register bfloat16_t y asm ("s1");
asm volatile ("#foo" : "=r" (x));
y = x;
asm volatile ("#foo" :: "t" (y));
}
/*
**bfloat_mov_wr:
** ...
** vmov r4, s1
** ...
** bx lr
*/
void bfloat_mov_wr (void)
{
register bfloat16_t x asm ("s1");
register bfloat16_t y asm ("r4");
asm volatile ("#foo" : "=t" (x));
y = x;
asm volatile ("#foo" :: "r" (y));
}
/*
**bfloat_mov_rr:
** ...
** mov r4, r5 @ __bf16
** ...
** bx lr
*/
void bfloat_mov_rr (void)
{
register bfloat16_t x asm ("r5");
register bfloat16_t y asm ("r4");
asm volatile ("#foo" : "=r" (x));
y = x;
asm volatile ("#foo" :: "r" (y));
}
/*
**bfloat_mov_rm:
** ...
** strh r4, \[.*\] @ __bf16
** ...
** bx lr
*/
void bfloat_mov_rm (void)
{
register bfloat16_t x asm ("r4");
volatile bfloat16_t y;
asm volatile ("#foo" : "=r" (x));
y = x;
asm volatile ("#foo" : : : "memory");
}
/*
**bfloat_mov_mr:
** ...
** ldrh r4, \[.*\] @ __bf16
** ...
** bx lr
*/
void bfloat_mov_mr (void)
{
volatile bfloat16_t x;
register bfloat16_t y asm ("r4");
asm volatile ("#foo" : : : "memory");
y = x;
asm volatile ("#foo" :: "r" (y));
}