Giter Club home page Giter Club logo

Comments (3)

ukasz avatar ukasz commented on August 14, 2024

Slightly different test case, which is also failing only on 2 byte data size:


#include <stdio.h>
#define u16 unsigned short
#define u8 unsigned char
#define assert(x) if (!(x)) { asm(".byte 0x00"); asm(".byte 0x00"); asm(".byte 0x00"); asm(".byte 0x00"); }

/* Memory to test */
#define SIZE 10000
u8 mem[SIZE];

#define fill_stride_f(type) void fill_stride_by_##type(type *addr, size_t size, type pattern, size_t idx, size_t stride) \
{ \
        for (size_t i = idx; i < size; i += stride) \
                addr[i] = pattern; \
}

fill_stride_f(u16);

#define check_stride_f(type) int check_stride_by_##type(type *addr, size_t size, size_t idx, type pattern, size_t stride) \
{ \
        int ret  = 0; \
        for (size_t i = idx; i < size; i += stride) \
                ret |= (addr[i] != pattern); \
        return ret;\
}

check_stride_f(u16);

int main(){
        u16 *addr =(u16*) mem;
        size_t size = SIZE/sizeof(u16);
        int ret = 0;
        const size_t stride = 16;

        for (size_t idx = 0; idx < stride; idx++) {
                fill_stride_by_u16((u16*)addr, size / 2, idx, idx, stride);
                ret |= check_stride_by_u16((u16*)addr, size / 2, idx, idx, stride);
        }
        assert(!ret);
        return 0;
}

from rev.

donofrio avatar donofrio commented on August 14, 2024

Both of these tests should now work correctly in the latest devel branch

from rev.

ukasz avatar ukasz commented on August 14, 2024

Tested on (4414659), problem no longer exists. Issue can be closed.

from rev.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.