f5348cedd702124c90fc75e75d0195e2e485c620 |
|
22-Sep-2016 |
Pierre Langlois <pierre.langlois@arm.com> |
Remove implicit 64 to 32 bit narrowing This patch fixes cases of implicit 64 to 32 bit narrowing. The issue is that `CodeBuffer` represents code offsets with `ptrdiff_t`, which will be 64 bit on a 64 bit system. However, we want to support generating 32 bit code from a 64 bit program, therefore the 32 bit part of VIXL works with `int32_t` for code offsets. We had implicit conversions happening due to this. We solve this by explicitely casting to `int32_t` in the AArch32 assembler when calling `GetCursorOffset`. If you are working with the `CodeBuffer` directly, you are dealing with a code buffer on the host and so will work with offsets as `ptrdiff_t`. But, when working with the AArch32 assembler itself you will get offsets as `int32_t`. The assembler is in charge of checking that the offsets it gets from the code buffer fit into `int32_t`. Additionally, we had narrowing cases when generally wrapping host pointers into an Operand. This can only work if the pointer fits into 32 bits. This patch introduces a Operand::From() factory method that can be used for converting any integral or pointer type to an immediate operand. Change-Id: Icc15711b34c2477ed997eef238e25496d86ea9aa
/external/vixl/tools/test_generator/data_types.py
|