1; RUN: llvm-as < %s | llvm-dis | FileCheck %s --check-prefix=ASSEM-DISASS 2; RUN: opt < %s -O3 -S | FileCheck %s --check-prefix=OPT 3; RUN: verify-uselistorder %s 4; Basic smoke tests for bfloat type. 5 6define bfloat @check_bfloat(bfloat %A) { 7; ASSEM-DISASS: ret bfloat %A 8 ret bfloat %A 9} 10 11define bfloat @check_bfloat_literal() { 12; ASSEM-DISASS: ret bfloat 0xR3149 13 ret bfloat 0xR3149 14} 15 16define <4 x bfloat> @check_fixed_vector() { 17; ASSEM-DISASS: ret <4 x bfloat> %tmp 18 %tmp = fadd <4 x bfloat> undef, undef 19 ret <4 x bfloat> %tmp 20} 21 22define <vscale x 4 x bfloat> @check_vector() { 23; ASSEM-DISASS: ret <vscale x 4 x bfloat> %tmp 24 %tmp = fadd <vscale x 4 x bfloat> undef, undef 25 ret <vscale x 4 x bfloat> %tmp 26} 27 28define bfloat @check_bfloat_constprop() { 29 %tmp = fadd bfloat 0xR40C0, 0xR40C0 30; OPT: 0xR4140 31 ret bfloat %tmp 32} 33 34define float @check_bfloat_convert() { 35 %tmp = fpext bfloat 0xR4C8D to float 36; OPT: 0x4191A00000000000 37 ret float %tmp 38} 39 40; ASSEM-DISASS-LABEL @snan_bfloat 41define bfloat @snan_bfloat() { 42; ASSEM-DISASS: ret bfloat 0xR7F81 43 ret bfloat 0xR7F81 44} 45 46; ASSEM-DISASS-LABEL @qnan_bfloat 47define bfloat @qnan_bfloat() { 48; ASSEM-DISASS: ret bfloat 0xR7FC0 49 ret bfloat 0xR7FC0 50} 51 52; ASSEM-DISASS-LABEL @pos_inf_bfloat 53define bfloat @pos_inf_bfloat() { 54; ASSEM-DISASS: ret bfloat 0xR7F80 55 ret bfloat 0xR7F80 56} 57 58; ASSEM-DISASS-LABEL @neg_inf_bfloat 59define bfloat @neg_inf_bfloat() { 60; ASSEM-DISASS: ret bfloat 0xRFF80 61 ret bfloat 0xRFF80 62} 63