Port-amd64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [PATCH] mutliboot2 second round



    Date:        Thu, 30 Jan 2020 02:09:40 +0000
    From:        Emmanuel Dreyfus <manu%netbsd.org@localhost>
    Message-ID:  <20200130020940.GD24728%homeworld.netbsd.org@localhost>

  | calling memmove() which requires setting up a stack in the text segment,
  | or just do a rep movsq that assumes aligned non overlapping copy.

Or, the x86 assembly version of

	if (d < s)
		while (--n)
			*d++ = *s++;
	else
		while (--n)
			d[n] = s[n];

(everything being char * or a byte counter).

Just because fancy instructions, or optimised code, exist, doesn't
mean that it is always necessary to use them.   Make it work, simply,
first, and then if this part is noticeably slow, it can be improved.

kre



Home | Main Index | Thread Index | Old Index