public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Help with assembly
@ 1999-04-22 15:28 Philipp Thomas
  1999-04-22 15:48 ` Bill Currie
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Philipp Thomas @ 1999-04-22 15:28 UTC (permalink / raw)
  To: egcs

Yes, I know this possibly isn't the right place to ask. But could somebody
with more knowledge of x86 assembly tell me what's wrong with this asm
(besides the message that egcs spits out) and how to possibly fix it ?

time.c: In function `calibrate_tsc':
time.c:611: Invalid `asm' statement:
time.c:611: fixed or forbidden register 1 (dx) was spilled for class DREG.



	__asm__("mull %1\n\t"
		"divl %4"
		: "=a" (calibrate_time)
		: "r" (calibrate_latch), "0" (1000000), "d" (0),
		  "r" (CLOCK_TICK_RATE)
		: "edx");



Philipp Thomas

-- 
caffeine low .... brain halted

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Help with assembly
  1999-04-22 15:28 Help with assembly Philipp Thomas
@ 1999-04-22 15:48 ` Bill Currie
  1999-04-30 23:15   ` Bill Currie
  1999-04-22 22:21 ` Jeffrey A Law
  1999-04-30 23:15 ` Philipp Thomas
  2 siblings, 1 reply; 6+ messages in thread
From: Bill Currie @ 1999-04-22 15:48 UTC (permalink / raw)
  To: Philipp Thomas; +Cc: egcs

Philipp Thomas wrote:
> 
> Yes, I know this possibly isn't the right place to ask. But could somebody
> with more knowledge of x86 assembly tell me what's wrong with this asm
> (besides the message that egcs spits out) and how to possibly fix it ?
> 
> time.c: In function `calibrate_tsc':
> time.c:611: Invalid `asm' statement:
> time.c:611: fixed or forbidden register 1 (dx) was spilled for class DREG.
> 
>         __asm__("mull %1\n\t"
>                 "divl %4"
>                 : "=a" (calibrate_time)
>                 : "r" (calibrate_latch), "0" (1000000), "d" (0),
							  ^^^^^
Drop the "d" register, you don't need it (mull only *sets* edx, it
doesn't read it, only div does) and the conflict between it and your
clobber below is what's causing your problem.


>                   "r" (CLOCK_TICK_RATE)
>                 : "edx");
> 
> Philipp Thomas
> 
> --
> caffeine low .... brain halted

-- 
Leave others their otherness

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Help with assembly
  1999-04-22 15:28 Help with assembly Philipp Thomas
  1999-04-22 15:48 ` Bill Currie
@ 1999-04-22 22:21 ` Jeffrey A Law
  1999-04-30 23:15   ` Jeffrey A Law
  1999-04-30 23:15 ` Philipp Thomas
  2 siblings, 1 reply; 6+ messages in thread
From: Jeffrey A Law @ 1999-04-22 22:21 UTC (permalink / raw)
  To: Philipp Thomas; +Cc: egcs

  In message < 3720a164.2460070@mailer.gwdg.de >you write:
  > Yes, I know this possibly isn't the right place to ask. But could somebody
  > with more knowledge of x86 assembly tell me what's wrong with this asm
  > (besides the message that egcs spits out) and how to possibly fix it ?
You might want to read the faq entry on asms :

http://egcs.cygnus.com/faq.html#asmclobber

Jeff

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Help with assembly
  1999-04-22 15:48 ` Bill Currie
@ 1999-04-30 23:15   ` Bill Currie
  0 siblings, 0 replies; 6+ messages in thread
From: Bill Currie @ 1999-04-30 23:15 UTC (permalink / raw)
  To: Philipp Thomas; +Cc: egcs

Philipp Thomas wrote:
> 
> Yes, I know this possibly isn't the right place to ask. But could somebody
> with more knowledge of x86 assembly tell me what's wrong with this asm
> (besides the message that egcs spits out) and how to possibly fix it ?
> 
> time.c: In function `calibrate_tsc':
> time.c:611: Invalid `asm' statement:
> time.c:611: fixed or forbidden register 1 (dx) was spilled for class DREG.
> 
>         __asm__("mull %1\n\t"
>                 "divl %4"
>                 : "=a" (calibrate_time)
>                 : "r" (calibrate_latch), "0" (1000000), "d" (0),
							  ^^^^^
Drop the "d" register, you don't need it (mull only *sets* edx, it
doesn't read it, only div does) and the conflict between it and your
clobber below is what's causing your problem.


>                   "r" (CLOCK_TICK_RATE)
>                 : "edx");
> 
> Philipp Thomas
> 
> --
> caffeine low .... brain halted

-- 
Leave others their otherness

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Help with assembly
  1999-04-22 15:28 Help with assembly Philipp Thomas
  1999-04-22 15:48 ` Bill Currie
  1999-04-22 22:21 ` Jeffrey A Law
@ 1999-04-30 23:15 ` Philipp Thomas
  2 siblings, 0 replies; 6+ messages in thread
From: Philipp Thomas @ 1999-04-30 23:15 UTC (permalink / raw)
  To: egcs

Yes, I know this possibly isn't the right place to ask. But could somebody
with more knowledge of x86 assembly tell me what's wrong with this asm
(besides the message that egcs spits out) and how to possibly fix it ?

time.c: In function `calibrate_tsc':
time.c:611: Invalid `asm' statement:
time.c:611: fixed or forbidden register 1 (dx) was spilled for class DREG.



	__asm__("mull %1\n\t"
		"divl %4"
		: "=a" (calibrate_time)
		: "r" (calibrate_latch), "0" (1000000), "d" (0),
		  "r" (CLOCK_TICK_RATE)
		: "edx");



Philipp Thomas

-- 
caffeine low .... brain halted

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Help with assembly
  1999-04-22 22:21 ` Jeffrey A Law
@ 1999-04-30 23:15   ` Jeffrey A Law
  0 siblings, 0 replies; 6+ messages in thread
From: Jeffrey A Law @ 1999-04-30 23:15 UTC (permalink / raw)
  To: Philipp Thomas; +Cc: egcs

  In message < 3720a164.2460070@mailer.gwdg.de >you write:
  > Yes, I know this possibly isn't the right place to ask. But could somebody
  > with more knowledge of x86 assembly tell me what's wrong with this asm
  > (besides the message that egcs spits out) and how to possibly fix it ?
You might want to read the faq entry on asms :

http://egcs.cygnus.com/faq.html#asmclobber

Jeff

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1999-04-30 23:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-22 15:28 Help with assembly Philipp Thomas
1999-04-22 15:48 ` Bill Currie
1999-04-30 23:15   ` Bill Currie
1999-04-22 22:21 ` Jeffrey A Law
1999-04-30 23:15   ` Jeffrey A Law
1999-04-30 23:15 ` Philipp Thomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).