From 73457fb37203a562f27f45630377dba287a55512 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Sat, 3 Jan 2009 04:48:59 +0000 Subject: [PATCH] - add intrinsic lowerer for strcpy(), mempcpy(), memmove(), strncmp() - add missing strlen() intrinsic lowerer [r25073] --- ast2firm.c | 9 +++++++-- driver/firm_opt.c | 10 +++++++--- driver/firm_opt.h | 8 ++++++-- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/ast2firm.c b/ast2firm.c index 7f17d0a..d84e447 100644 --- a/ast2firm.c +++ b/ast2firm.c @@ -973,10 +973,15 @@ static const struct { { rts_coshl, 1, "coshl", 1, _C99 }, { rts_tanhl, 1, "tanhl", 1, _C99 }, + { rts_strcmp, 1, "strcmp", 2, _C89 }, + { rts_strncmp, 1, "strncmp", 3, _C89 }, + { rts_strcpy, 1, "strcpy", 2, _C89 }, + { rts_strlen, 1, "strlen", 1, _C89 }, { rts_memcpy, 1, "memcpy", 3, _C89 }, /* HMM, man say its C99 */ + { rts_mempcpy, 1, "mempcpy", 3, _GNUC }, + { rts_memmove, 1, "memmove", 3, _C89 }, /* HMM, man say its C99 */ { rts_memset, 1, "memset", 3, _C89 }, /* HMM, man say its C99 */ - { rts_strcmp, 1, "strcmp", 2, _C89 }, - { rts_strncmp, 1, "strncmp", 3, _C89 } + { rts_memcmp, 1, "memcmp", 3, _C89 }, /* HMM, man say its C99 */ }; static ident *rts_idents[lengthof(rts_data)]; diff --git a/driver/firm_opt.c b/driver/firm_opt.c index b4ee53c..2a85403 100644 --- a/driver/firm_opt.c +++ b/driver/firm_opt.c @@ -212,11 +212,15 @@ static void rts_map(void) { { &rts_entities[rts_tanhl], i_mapper_tanh }, /* string */ - { &rts_entities[rts_memcpy], i_mapper_memcpy }, - { &rts_entities[rts_memset], i_mapper_memset }, { &rts_entities[rts_strcmp], i_mapper_strcmp }, { &rts_entities[rts_strncmp], i_mapper_strncmp }, - { &rts_entities[rts_strlen], i_mapper_strlen } + { &rts_entities[rts_strcpy], i_mapper_strcpy }, + { &rts_entities[rts_strlen], i_mapper_strlen }, + { &rts_entities[rts_memcpy], i_mapper_memcpy }, + { &rts_entities[rts_mempcpy], i_mapper_mempcpy }, + { &rts_entities[rts_memmove], i_mapper_memmove }, + { &rts_entities[rts_memset], i_mapper_memset }, + { &rts_entities[rts_memcmp], i_mapper_memcmp } }; i_record rec[sizeof(mapper)/sizeof(mapper[0])]; unsigned i, n_map; diff --git a/driver/firm_opt.h b/driver/firm_opt.h index 202db4f..a381fa7 100644 --- a/driver/firm_opt.h +++ b/driver/firm_opt.h @@ -77,11 +77,15 @@ enum rts_names { rts_tanhl, /**< the name of the tanhl() function */ /* string functions */ - rts_memcpy, /**< the name of the memcpy() function */ - rts_memset, /**< the name of the memset() function */ rts_strcmp, /**< the name of the strcmp() function */ rts_strncmp, /**< the name of the strncmp() function */ + rts_strcpy, /**< the name of the strcpy() function */ rts_strlen, /**< the name of the strlen() function */ + rts_memcpy, /**< the name of the memcpy() function */ + rts_mempcpy, /**< the name of the mempcpy() function */ + rts_memmove, /**< the name of the memmove() function */ + rts_memset, /**< the name of the memset() function */ + rts_memcmp, /**< the name of the memcmp() function */ rts_max }; -- 2.20.1