re PR target/11044 ([x86] out of range loop instructions for FP code on K6)

PR target/11044
	* config/i386/i386.md (length attribute): Set length to 4
	for instructions of type "fcmp".

From-SVN: r67300
This commit is contained in:
Eric Botcazou 2003-06-01 18:10:09 +02:00 committed by Eric Botcazou
parent e25a75e6da
commit a3033f34cf
4 changed files with 88 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2003-06-01 Eric Botcazou <ebotcazou@libertysurf.fr>
PR target/11044
* config/i386/i386.md (length attribute): Set length to 4
for instructions of type "fcmp".
2003-06-01 Andreas Jaeger <aj@suse.de>
* toplev.c: Use ISO C90 prototypes.

View File

@ -283,6 +283,8 @@
(define_attr "length" ""
(cond [(eq_attr "type" "other,multi,fistp")
(const_int 16)
(eq_attr "type" "fcmp")
(const_int 4)
(eq_attr "unit" "i387")
(plus (const_int 2)
(plus (attr "prefix_data16")

View File

@ -1,3 +1,7 @@
2003-06-01 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/i386-loop-3.c: New test.
2003-05-31 Toon Moene <toon@moene.indiv.nluug.nl>
* g77.dg/ffree-form-2.f: XFAIL removed, because fixed.

View File

@ -0,0 +1,76 @@
/* PR target/11044 */
/* Originator: Tim McGrath <misty-@charter.net> */
/* Testcase contributed by Eric Botcazou <ebotcazou@libertysurf.fr> */
/* { dg-do run { target i?86-*-* } } */
/* { dg-options "-mtune=k6 -O3 -ffast-math -funroll-loops" } */
typedef struct
{
unsigned char colormod;
} entity_state_t;
typedef struct
{
int num_entities;
entity_state_t *entities;
} packet_entities_t;
typedef struct
{
double senttime;
float ping_time;
packet_entities_t entities;
} client_frame_t;
typedef enum
{
cs_free,
cs_server,
cs_zombie,
cs_connected,
cs_spawned
} sv_client_state_t;
typedef struct client_s
{
sv_client_state_t state;
int ping;
client_frame_t frames[64];
} client_t;
int CalcPing (client_t *cl)
{
float ping;
int count, i;
register client_frame_t *frame;
if (cl->state == cs_server)
return cl->ping;
ping = 0;
count = 0;
for (frame = cl->frames, i = 0; i < 64; i++, frame++) {
if (frame->ping_time > 0) {
ping += frame->ping_time;
count++;
}
}
if (!count)
return 9999;
ping /= count;
return ping * 1000;
}
int main(void)
{
client_t cl;
memset(&cl, 0, sizeof(cl));
cl.frames[0].ping_time = 1.0f;
if (CalcPing(&cl) != 1000)
abort();
return 0;
}