Code: Select all
#include <stdint.h>
__attribute__ ((noinline)) uint32_t callee(uint32_t x, uint16_t y){
return x + y;
}
__attribute__ ((noinline)) uint32_t caller(uint32_t x, uint32_t y){
return callee(x, y);
}
Code: Select all
#include <stdint.h>
__attribute__ ((noinline)) uint32_t callee(uint32_t x, uint16_t y){
return x + y;
}
__attribute__ ((noinline)) uint32_t caller(uint32_t x, uint32_t y){
return callee(x, y);
}
Given the above, my interpretation is that the argument to be passed must be extended. So a variable passed to a function should be extended before calling the function, while a return value should be extended inside the function, before returning to the caller. Thus no further extension should be necessary when such a parameter is received.All arguments consist of an integral number of 4-byte words. Thus, the minimum argument size is one word. Integer values smaller than a word (that is, char and short) are stored in the least significant portion of the argument word, with the upper bits set to zero for unsigned values or sign-extended for signed values.
Users browsing this forum: No registered users and 339 guests