This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch-86512]: Subnormal float support in armv7(with -msoft-float) for intrinsics


Hi Nicolas,

I think your patch doesn't quite work as expected:

@@ -238,9 +238,10 @@ LSYM(Lad_a):
 	movs	ip, ip, lsl #1
 	adcs	xl, xl, xl
 	adc	xh, xh, xh
-	tst	xh, #0x00100000
-	sub	r4, r4, #1
-	bne	LSYM(Lad_e)
+	subs	r4, r4, #1
+	do_it	hs
+	tsths	xh, #0x00100000
+	bhi	LSYM(Lad_e)

If the exponent in r4 is zero, the carry bit will be clear, so we don't execute the tsths
and fallthrough (the denormal will be normalized and then denormalized again, but
that's so rare it doesn't matter really).

However if r4 is non-zero, the carry will be set, and the tsths will be executed. This
clears the carry and sets the Z flag based on bit 20. We will now also always
fallthrough rather than take the branch if bit 20 is non-zero. This may still give the
correct answer, however it would add considerable extra overhead... I think using
a cmp rather than tst would work.

Wilco

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]