Comments (5)
line 380 is here /* Original C code replaced with hand tuned assembly code /
/
for (; p <= pe; p++) {
*p = rand_32bits(me);
}
*/
line 386 is here asm volatile (
"jmp L200\n\t"
".p2align 4,,7\n\t"
"L201:\n\t"
"addl $4,%%edi\n\t"
"L200:\n\t"
"pushl %%ecx\n\t"
"call rand_32bits\n\t"
"popl %%ecx\n\t"
"movl %%eax,(%%edi)\n\t"
"cmpl %%ebx,%%edi\n\t"
"jb L201\n\t"
: : "D" (p), "b" (pe), "c" (me)
: "eax"
);
from memtest86.
Original code was written for very old GCC version (and not by me), and you compiling on the modern version of GCC, which may optimize code and can give incorrect results.
You can compile test.c with assembler output: in makefile add "-S" option:
$(CC) -S -c -Wall -march=i486 -m32 -O0 -fomit-frame-pointer -fno-builtin -ffreestanding -fno-pie -fno-stack-protector -std=gnu99 test.c
Compile will fail, but will produce test.s file with assembler source. You can compare then assembler results of original C code optimized by GCC and hand-tuned code.
Second, if you remove all assembly code from test.c, you can compile it without "-fno-pie -fno-stack-protector" options (as they added to support modern GCC versions) and see if it works.
from memtest86.
thanks a lot.
I have fix the problem.
the replaced c code should be as below:
/* Original C code replaced with hand tuned assembly code */
*p = rand_32bits(me);
for (; p < pe; ) {
p++;
*p = rand_32bits(me);
}
from memtest86.
the above c code could replace the assembly code
my GCC version is 5.4.0 on ubuntu 16.04
from memtest86.
Yes, it makes sense.
This code is unused, but if you will make commit fixing it, I will merge it. Or I can make it by myself, as you wish.
from memtest86.
Related Issues (20)
- the problem of realizing the test13[Random number sequence, 64-bit] HOT 2
- the problem on change_timing_xxx HOT 6
- question about "static void poll_fsb_nhm(void){xxxxxxxxx}" HOT 13
- 0104 loop using USB stick HOT 2
- AMD 15h freezes while "Testing: 4096M - 6144M of 15GB RAM (= 16GB - iGPU_shared)" HOT 5
- Memtest86+ 5.31b released HOT 1
- the problem of booting from U-Disk HOT 6
- add file system into the memtest86 HOT 1
- smp, reliability, non-existent memory, heat, duration, test list HOT 1
- the problem on reading bytes of ddr4 SPD HOT 1
- Merge patch from debian HOT 1
- 5.31b from upstream is said to fix some system HOT 1
- balenaEtcher HOT 3
- How about ECC support and hammer test? HOT 1
- add failed info. about failed error-chip into memtest86 plus
- Other patches HOT 4
- Missing proper official history HOT 1
- History, Roadmap and Contribution HOT 1
- an inssue found by HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from memtest86.