brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.7 KiB · 6055b8f Raw
129 lines · plain
1; RUN: llc -mtriple=arm-eabi -mattr=+vfp2 %s -o - \2; RUN:  | FileCheck %s -check-prefix=VFP23 4; RUN: llc -mtriple=arm-eabi -mattr=+neon,-neonfp %s -o - \5; RUN:  | FileCheck %s -check-prefix=NFP06 7; RUN: llc -mtriple=arm-eabi -mattr=+neon,+neonfp %s -o - \8; RUN:  | FileCheck %s -check-prefix=NFP19 10; RUN: llc -mtriple=arm-eabi -mcpu=cortex-a8 %s -o - \11; RUN:  | FileCheck %s -check-prefix=CORTEXA812 13; RUN: llc -mtriple=arm-eabi -mcpu=cortex-a8 --denormal-fp-math=preserve-sign %s -o - \14; RUN:  | FileCheck %s -check-prefix=CORTEXA8U15 16; RUN: llc -mtriple=arm-darwin -mcpu=cortex-a8 %s -o - \17; RUN:  | FileCheck %s -check-prefix=CORTEXA8U-DARWIN18 19; RUN: llc -mtriple=arm-eabi -mcpu=cortex-a9 %s -o - \20; RUN:  | FileCheck %s -check-prefix=CORTEXA921 22define float @test1(ptr %a) {23entry:24	%0 = load float, ptr %a, align 4		; <float> [#uses=2]25	%1 = fsub float -0.000000e+00, %0		; <float> [#uses=2]26	%2 = fpext float %1 to double		; <double> [#uses=1]27	%3 = fcmp olt double %2, 1.234000e+00		; <i1> [#uses=1]28	%retval = select i1 %3, float %1, float %0		; <float> [#uses=1]29	ret float %retval30}31; VFP2-LABEL: test1:32; VFP2: 	vneg.f32	s{{.*}}, s{{.*}}33 34; NFP1-LABEL: test1:35; NFP1: 	vneg.f32	d{{.*}}, d{{.*}}36 37; NFP0-LABEL: test1:38; NFP0: 	vneg.f32	s{{.*}}, s{{.*}}39 40; CORTEXA8-LABEL: test1:41; CORTEXA8: 	vneg.f32	s{{.*}}, s{{.*}}42 43; CORTEXA8U-LABEL: test1:44; CORTEXA8U: 	vsub.f32	d{{.*}}, d{{.*}}, d{{.*}}45 46; CORTEXA8U-DARWIN-LABEL: test1:47; CORTEXA8U-DARWIN: 	vneg.f32	d{{.*}}, d{{.*}}48 49; CORTEXA9-LABEL: test1:50; CORTEXA9: 	vneg.f32	s{{.*}}, s{{.*}}51 52define float @test2(ptr %a) {53entry:54	%0 = load float, ptr %a, align 4		; <float> [#uses=2]55	%1 = fneg float %0                  ; <float> [#uses=2]56	%2 = fpext float %1 to double		; <double> [#uses=1]57	%3 = fcmp olt double %2, 1.234000e+00		; <i1> [#uses=1]58	%retval = select i1 %3, float %1, float %0		; <float> [#uses=1]59	ret float %retval60}61; VFP2-LABEL: test2:62; VFP2: 	vneg.f32	s{{.*}}, s{{.*}}63 64; NFP1-LABEL: test2:65; NFP1: 	vneg.f32	d{{.*}}, d{{.*}}66 67; NFP0-LABEL: test2:68; NFP0: 	vneg.f32	s{{.*}}, s{{.*}}69 70; CORTEXA8-LABEL: test2:71; CORTEXA8: 	vneg.f32	s{{.*}}, s{{.*}}72 73; CORTEXA8U-LABEL: test2:74; CORTEXA8U: 	vneg.f32	d{{.*}}, d{{.*}}75 76; CORTEXA9-LABEL: test2:77; CORTEXA9: 	vneg.f32	s{{.*}}, s{{.*}}78 79; If we're bitcasting an integer to an FP vector, we should avoid the FP/vector unit entirely.80; Make sure that we're flipping the sign bit and only the sign bit of each float (PR20354).81; So instead of something like this:82;    vmov     d16, r0, r183;    vneg.f32 d16, d1684;    vmov     r0, r1, d1685;86; We should generate:87;    eor     r0, r0, #-21478364888;    eor     r1, r1, #-21478364889 90define <2 x float> @fneg_bitcast(i64 %i) {91  %bitcast = bitcast i64 %i to <2 x float>92  %fneg = fsub <2 x float> <float -0.0, float -0.0>, %bitcast93  ret <2 x float> %fneg94}95; VFP2-LABEL: fneg_bitcast:96; VFP2-DAG: eor r0, r0, #-214748364897; VFP2-DAG: eor r1, r1, #-214748364898; VFP2-NOT:  vneg.f3299 100; NFP1-LABEL: fneg_bitcast:101; NFP1-DAG: eor r0, r0, #-2147483648102; NFP1-DAG: eor r1, r1, #-2147483648103; NFP1-NOT: vneg.f32104 105; NFP0-LABEL: fneg_bitcast:106; NFP0-DAG: eor r0, r0, #-2147483648107; NFP0-DAG: eor r1, r1, #-2147483648108; NFP0-NOT: vneg.f32109 110; CORTEXA8-LABEL: fneg_bitcast:111; CORTEXA8-DAG: eor r0, r0, #-2147483648112; CORTEXA8-DAG: eor r1, r1, #-2147483648113; CORTEXA8-NOT:         vneg.f32114 115; CORTEXA8U-LABEL: fneg_bitcast:116; CORTEXA8U-DAG: vmov.i32	d{{.*}}, #0x80000000117; CORTEXA8U-DAG: vsub.f32	d{{.*}}, d{{.*}}, d{{.*}}118 119; CORTEXA8U-DARWIN-LABEL: fneg_bitcast:120; CORTEXA8U-DARWIN-DAG: eor r0, r0, #-2147483648121; CORTEXA8U-DARWIN-DAG: eor r1, r1, #-2147483648122; CORTEXA8U-DARWIN-NOT:        vneg.f32123 124; CORTEXA9-LABEL: fneg_bitcast:125; CORTEXA9-DAG: eor r0, r0, #-2147483648126; CORTEXA9-DAG: eor r1, r1, #-2147483648127; CORTEXA9-NOT:         vneg.f32128 129