Displaying 4 results from an estimated 4 matches for "is_bigendian".
2011 Oct 03
0
[LLVMdev] [RFC] Proposal to make LLVM-IR endian agnostic
...t;(<type> data, <type>* ptr,
>
> i32 alignment, i1 host, i1 littleEndian, i1 atomic, i1 volatile,
>
> i1 nontemporal, i1 singlethread)
FWIW here is another way to do it (which is approximately what ClamAV does currently) by introducing just one intrinsic:
declare i1 @llvm.is_bigendian()
The advantage is that you can implement htonl() and ntohl() like functionality without using a temporary memory location.
Actually I think having the 2 intrinsics you suggest and the is_bigendian() intrinsic would be optimal:
you can use your 2 intrinsics for initial codegen, and mem2reg can tra...
2011 Oct 03
6
[LLVMdev] [RFC] Proposal to make LLVM-IR endian agnostic
One of the projects I am working on with others is to make LLVM-IR endian agnostic.
So, I am sending out this proposal for feedback to the LLVM community. I've attached
pretty version of the proposal in PDF format and pasted a 80-column safe text version
below.
I'm looking forward to comments and feedback.
Thanks,
Micah Villmow
Text of Proposal:
2009 Sep 03
1
Running an expression 1MN times using embedded R
...O_REMAP
#include <Rversion.h>
#include <R.h>
#include <Rdefines.h>
#include <Rinternals.h>
#include <Rinterface.h>
#include <Rembedded.h>
#include <R_ext/Boolean.h>
#include <R_ext/Parse.h>
#include <R_ext/Rdynload.h>
const int i___ = 1;
#define is_bigendian() ( (*(char*)&i___) == 0 )
extern void (*ptr_R_ShowMessage)(const char *);
extern void (*ptr_R_WriteConsole)(const char *, int);
extern int (*ptr_R_ReadConsole)(char *, unsigned char *, int, int);
extern void (*ptr_R_WriteConsoleEx)(const char *, int , int );
SEXP rh_status(SEXP);
static uint...
2011 Oct 04
1
[LLVMdev] [RFC] Proposal to make LLVM-IR endian agnostic
Hi Edwin,
> FWIW here is another way to do it (which is approximately what ClamAV does currently) by introducing just one intrinsic:
> declare i1 @llvm.is_bigendian()
why is an intrinsic needed? It is easy to write a small LLVM IR function
that computes this. For example:
define i1 @is_big_endian() {
%ip = alloca i16
store i16 1, i16* %ip
%cp = bitcast i16* %ip to i8*
%c = load i8* %cp
%r = icmp eq i8 %c, 0
ret i1 %r
}
Ciao, Duncan.